XModelComponent

Inherited from NOrderItem,

Inherited by XPart, XAssembly

Friend class XManager,ModelComponentManager,PartSnapshotManager,XModel,

Description

XModelComponent封装了模型中的部件数据以及其相关的方法。部件的基本属性包括名字、颜色和变换矩阵,可分为零件(仅包含几何数据)和装配件(仅包含其他装配件或零件)。零件包含若干具有相同物理属性的几何对象(在某些特殊情况下也可能不相同),原则上零件与零件之间不共享节点(如果共享节点,则该两零件应该合并成一个零件),零件内的几何对象使用以一种颜色构建视图数据。装配件定义了零件与零件之间的装配关系,并且支持嵌套。

部件是模型的内部数据之一,它必须通过XModel提供的接口访问,不能直接访问和修改。

部件拥有自己的角色设定(role), 相同角色的部件必须放在同一根装配树下。

Members

Public interface

Private interface


OrderContainer m_Geoms

部件内几何对象数组

OrderContainer m_Subs

部件内子对象数组(对于装配体,是子部件对象;对于部件,是部件快照对象的引用)

RGBAColor m_Color

部件颜色

TypeID m_iRefMode

部件参考模式

TMatrix44<double> m_dTMatrix

部件坐标变换矩阵

bool m_bVisible

部件可见性

bool m_bAuxiliary

是否为辅助部件


XPart(ulong id)

~XPart()

const XModel * getModel() const

virtual void clear()

virtual void write(XBinaryIO * io)const

virtual ErrorCode read(PartManager * pMgr,XBinaryIO * io)

bool isVisible() const

void setVisible(bool b)

bool isAuxiliary() const

void setAuxiliary(bool b)

RGBAColor getColor() const

void setColor(RGBAColor c)

ulong getReferencePartID() const

void setReferencePartID(ulong p)

XAssembly * toAssembly()

const XAssembly * toAssembly() const

ulong getGeometryCount() const

void bindGeometryIterator(OrderItemIterator<XGeometry> * pIter)const

const XGeometry * getFirstGeometry() const

ulong getPartSnapshotCount() const

void bindPartSnapshotIterator(OrderItemIterator<XPartSnapshot> * pIter)const

const XPartSnapshot * getFirstPartSnapshot() const

const XPartSnapshot * getLastSnapshot() const

const XAssembly * getParentAssembly() const

void setParentAssembly(const XAssembly * a)

TMatrix44<double> & getTrMatrix()

const TMatrix44<double> & getTrMatrix() const


void detach(XGeometry * g, GeometryManager * geomMgr)

void attach(XGeometry * g, GeometryManager * geomMgr)

void detach(XPartSnapshot * pss, PartSnapshotManager * pssMgr)

void attach(XPartSnapshot * pss, PartSnapshotManager * pssMgr)