@font-face { font-family: "Times New Roman" }
@font-face { font-family: "宋体" }
@font-face { font-family: "Wingdings" }
@font-face { font-family: "楷体" }
p.MsoNormal { mso-style-name: 正文; mso-style-parent: ""; margin: 0 0 0.0001pt; mso-pagination: none; text-align: justify; text-justify: inter-ideograph; font-family: "Times New Roman"; mso-fareast-font-family: 宋体; color: rgba(0, 0, 0, 1); font-size: 10.5pt; mso-font-kerning: 1.0000pt }
{ font-family: "Times New Roman" }
span.msoIns { mso-style-type: export-only; mso-style-name: ""; text-decoration: underline; text-underline: single; color: rgba(0, 0, 255, 1) }
span.msoDel { mso-style-type: export-only; mso-style-name: ""; text-decoration: line-through; color: rgba(255, 0, 0, 1) }
table.MsoNormalTable { mso-style-name: 普通表格; mso-style-parent: ""; mso-style-noshow: yes; mso-tstyle-rowband-size: 0; mso-tstyle-colband-size: 0; mso-padding-alt: 0.0000pt 5.4000pt 0.0000pt 5.4000pt; mso-para-margin: 0pt; mso-para-margin-bottom: .0001pt; mso-pagination: widow-orphan; font-family: "Times New Roman"; font-size: 10pt; mso-ansi-language: #0400; mso-fareast-language: #0400; mso-bidi-language: #0400 }
@page { mso-page-border-surround-header: no mso-page-border-surround-footer: no }
@page Section0 { margin-top: 72pt margin-bottom: 72pt margin-left: 90pt margin-right: 90pt size: 595.3000pt 841.9000pt layout-grid: 15.6000pt }
div.Section0 { page: Section0 }
OpenCascade的拓扑对象的方向,存在继承关系。通常来说,下层拓扑对象的最终方向,依赖上层对象的方向。例如:一个Edge的方向,依赖所在Face方向最终确定。
在OCCT中,当一个拓扑对象反向时,仅仅需要将方向属性反向,如下面代码所示:
inline void TopoDS_Shape::Reverse()
{
myOrient = TopAbs::Reverse(myOrient);
}
子对象的方向将根据父对象的方向属性而进行调整。
例如:如果一个Face反向了,通常裁剪环Wire也需要反向,Wire中的Edge也需要反向,这样才能保证拓扑结构的正确性。而实际上,仅仅需要调用Face的Reverse()方法,反向Face的方向即可。
OCCT中拓扑子对象遍历,有两个工具类:TopoDS_Iterator和TopExp_Explorer,其中TopExp_Explorer是基于TopoDS_Iterator类实现的。我们看看TopoDS_Iterator类:
//! Creates an Iterator on sub-shapes.
//! Note:
//! - If cumOri is true, the function composes all
//! sub-shapes with the orientation of S.
//! - If cumLoc is true, the function multiplies all
//! sub-shapes by the location of S, i.e. it applies to
//! each sub-shape the transformation that is associated with S.
TopoDS\_Iterator(const TopoDS\_Shape& S, const Standard\_Boolean cumOri = Standard\_True, const Standard\_Boolean cumLoc = Standard\_True);
注意:cumOri参数,就是遍历是,是否需要考虑父对象的方向。如果要获取最终子对象正确的方向,通常需要设定该参数为true,这里默认也是true。
在一些情况下,可以使用false。例如:Face中当要基于surface进行参数域或裁剪环操作时,通常不考虑Face的方向,基于surface来进行裁剪环的处理,可以省去很多的麻烦。
在TopExp_Explorer类的实现总,创建TopExp_Iterator类对象时,传递的cumOri值为默认值,即为true,因此默认是考虑上了父对象的方向的,也因此组合了父对象的方向。
手机扫一扫
移动阅读更方便
你可能感兴趣的文章