5.3.1 元素在视图中的可见性
视图中记录了所有可见的元素。平台提供了隐藏视图中构件的接口,主要在BPViewController
及BPViewShowUtil
类中。
表5-1 元素可见性接口列表
方法 | 描述 |
---|---|
BPViewController | p3d::pset getHiddenEntities(BPViewportCR) |
clearHiddenEntities(BPViewportCP) | |
setHiddenEntities(p3d::pset, bool , BPViewportCP) | |
BPViewShowUtil | showOrHideEntities |
showOrHideEntities | |
showAll | |
hideEntities |
通过提供的这些接口,可在指定视口批量显示或隐藏某些构件,并且实时获取被隐藏的构件。
5.3.2 视图显示
在三维视图中,通过三维导航工具可以任意旋转该视图,对于打开的视图可以设置背景色呈现不同的视图效果,根据视图显示的不同可以设置视图原点及比例等。在API中,可以通过以下接口来实现视图显示控制。
表5-2 视图显示控制接口列表
方法 | 描述 |
---|---|
BPViewport | UInt32 getBackgroundColor() |
setBackgroundColor(UInt32) | |
UInt32 getContrastToBKGColor() | |
p3d::GeRotMatrix getRotMatrix() | |
p3d::GeRotMatrix getRotMatrix() | |
p3d::GePoint3dCR getOrigin() | |
p3d::GePoint3dCR getDelta() | |
p3d::GePoint3dCR getDelta() | |
setRotMatrix(p3d::GeRotMatrixCR) | |
setOrigin(p3d::GePoint3dCR) | |
p3d::GePoint3dCP getScale() | |
BPViewShowUtil | BPStandardView isStandardViewRotation(p3d::GeRotMatrixCR , bool) |
::p3d::P3DStatus setAllow3DManipulations(int , const BPRotateAxisOption) | |
::p3d::P3DStatus getAllow3DManipulations(int , OUT BPRotateAxisOption) |
其中在BPViewManager
对3D视图进行控制的接口中,BPRotateAxisOption
中对应的操作为enRotateNone->
不可以做任何3D旋转,enRotateAxisX->
仅可以围绕X轴进行3D旋转,enRotateAxisY->
仅可以围绕Y轴进行3D旋转,enRotateAxisZ->
仅可以围绕Z轴进行3D旋转,enRotateAny->
可以围绕任意轴做3D旋转。