GLC_StructOccurence Class Reference

GLC_StructOccurence : A scene graph occurence node. More...

#include <glc_structoccurence.h>

List of all members.

Public Member Functions

Constructor / Destructor

 GLC_StructOccurence ()
 Default constructor.
 GLC_StructOccurence (GLC_StructInstance *, GLC_WorldHandle *pWorldHandle=NULL, GLuint shaderId=0)
 Create Occurence of the specified instance.
 GLC_StructOccurence (GLC_3DRep *)
 Construct Occurence withe the specified GLC_3DRep.
 GLC_StructOccurence (GLC_WorldHandle *, const GLC_StructOccurence &, bool shareInstance)
 Copy constructor.
virtual ~GLC_StructOccurence ()
 Destructor.
Set Functions

void setName (const QString name)
 Set Occurence instance Name.
GLC_StructOccurenceupdateAbsoluteMatrix ()
 Update the absolute matrix.
GLC_StructOccurenceupdateChildrenAbsoluteMatrix ()
 Update children obsolute Matrix.
void addChild (GLC_StructOccurence *)
 Add Child.
GLC_StructOccurenceaddChild (GLC_StructInstance *)
 Add Child instance and returns the newly created occurence.
void makeOrphan ()
 make the occurence orphan
bool removeChild (GLC_StructOccurence *pChild)
 Remove the specified child.
void reverseNormals ()
 Reverse Normals of this Occurence and childs.
bool create3DViewInstance ()
 Create the 3DViewInstance of this occurence if there is a valid 3DRep.
bool remove3DViewInstance ()
 Remove the 3DViewInstance of this occurence.
void setWorldHandle (GLC_WorldHandle *)
 Set this occurence world Handle.
bool loadRepresentation ()
 Load the representation and return true if success.
bool unloadRepresentation ()
 UnLoad the representation and return true if success.
void setOccurenceNumber (unsigned int n)
 Set the occurence number of this occurence.
unsigned int updateOccurenceNumber (unsigned int n)
 Update the occurence number of this occurence branch.
void setVisibility (bool visibility)
 Set this occurence visibility.
void setRenderProperties (const GLC_RenderProperties &renderProperties)
 set the renderProperties of this occurence
void removeEmptyChildren ()
 Remove empty children.
void setReference (GLC_StructReference *pRef)
 Set the given reference to this occurence.
void setAutomatic3DViewInstanceCreationUsage (bool usage)
 Set the automatic creation of 3DViewInstance usage.
void makeFlexible (const GLC_Matrix4x4 &relativeMatrix)
 Make this occurence a flexible occurence.
void makeRigid ()
 Make this occurence rigid.

Private Member Functions

void detach ()
 Detach the occurence from the GLC_World.

Private Attributes

GLC_uint m_Uid
 Occurence Unique ID.
GLC_WorldHandlem_pWorldHandle
 the occurence's World Handle
int * m_pNumberOfOccurence
 Number of this Occurence.
GLC_StructInstancem_pStructInstance
 The struct instance of this occurence.
GLC_StructOccurencem_pParent
 The parent of this occurence.
QList< GLC_StructOccurence * > m_Childs
 The Child of this occurence.
GLC_Matrix4x4 m_AbsoluteMatrix
 The absolute matrix of the occurence.
unsigned int m_OccurenceNumber
 The occurence number.
bool m_IsVisible
 Flag to know if a occurence without instance is visible.
GLC_RenderPropertiesm_pRenderProperties
 The occurence rendering properties.
bool m_AutomaticCreationOf3DViewInstance
 Automatique crŽation of 3DViewInstance.
GLC_Matrix4x4m_pRelativeMatrix
 The relative matrix of this occurence if this occurence is flexible.

Get Functions



GLC_uint id () const
 Return this Occurence id.
const QString name () const
 Return the instance name of this occurence.
GLC_Matrix4x4 absoluteMatrix () const
 Return the absolute matrix of this occurence.
GLC_Matrix4x4 occurrenceRelativeMatrix () const
 Return the surcharged relative matrix.
bool isOrphan () const
 Return true if this occurence is orphan.
bool hasParent () const
 Return true if this occurence has parent.
bool hasRepresentation () const
 Return true if this occurence has a representation.
bool has3DViewInstance () const
 Return true if this occurence has 3DViewInstance.
GLC_StructInstancestructInstance () const
 Return the instance of this occurence.
GLC_StructReferencestructReference () const
 Return the reference of this occurence.
int childCount () const
 Return the number of childs.
bool hasChild () const
 Return true if the occurence has child.
bool canBeAddedToChildren (GLC_StructOccurence *pOccurence) const
 Return true if the given occurence can be added to this occurence children.
GLC_StructOccurenceparent () const
 Return The parent of this occurence.
GLC_StructOccurencechild (const int index) const
 Return a child of this occurence.
QList< GLC_StructOccurence * > children () const
 Return the list of children of this occurence.
QList< GLC_StructOccurence * > subOccurenceList () const
 Return the list of all accurence under this occurence.
unsigned int numberOfFaces () const
 Return the number of faces of the representation of this occurence.
unsigned int numberOfVertex () const
 Return the number of vertex of the representation of this occurence.
unsigned int numberOfMaterials () const
 Return the number of materials of the representation of this occurence.
QSet< GLC_Material * > materialSet () const
 Return the materials List of the representation of this occurence.
GLC_StructOccurenceclone (GLC_WorldHandle *, bool shareInstance) const
 Return a clone this occurence.
bool isVisible () const
 Return true if this occurence is visible.
GLC_BoundingBox boundingBox () const
 Return the occurence Bounding Box.
unsigned int occurenceNumber () const
 Return the occurence number of this occurence.
GLC_RenderPropertiesrenderPropertiesHandle () const
 Return an handle of the renderProperties of this occurence.
unsigned int nodeCount () const
 Return the number of node of this branch.
GLC_WorldHandleworldHandle () const
 Return the world handle of this occurence.
QSet< GLC_StructReference * > childrenReferences () const
 Return the Set of children references of this occurence.
bool useAutomatic3DViewInstanceCreation () const
 Return true if the automatic creation of 3DViewInstance is used.
bool isFlexible () const
 Return true if this occurence is flexible.
static QSet
< GLC_StructReference * > 
parentsReferences (const GLC_StructOccurence *pOccurence)
 Return the set of parents references of the given occurence.

Detailed Description

GLC_StructOccurence : A scene graph occurence node.

Definition at line 43 of file glc_structoccurence.h.


Constructor & Destructor Documentation

GLC_StructOccurence::GLC_StructOccurence (  ) 

Default constructor.

Definition at line 32 of file glc_structoccurence.cpp.

References m_pStructInstance, and GLC_StructInstance::structOccurenceCreated().

Referenced by addChild(), and clone().

GLC_StructOccurence::GLC_StructOccurence ( GLC_StructInstance pStructInstance,
GLC_WorldHandle pWorldHandle = NULL,
GLuint  shaderId = 0 
)
GLC_StructOccurence::GLC_StructOccurence ( GLC_3DRep pRep  ) 

Construct Occurence withe the specified GLC_3DRep.

Definition at line 100 of file glc_structoccurence.cpp.

References m_pStructInstance, GLC_StructInstance::name(), setName(), and GLC_StructInstance::structOccurenceCreated().

GLC_StructOccurence::GLC_StructOccurence ( GLC_WorldHandle pWorldHandle,
const GLC_StructOccurence structOccurence,
bool  shareInstance 
)
GLC_StructOccurence::~GLC_StructOccurence (  )  [virtual]

Member Function Documentation

GLC_Matrix4x4 GLC_StructOccurence::absoluteMatrix (  )  const [inline]

Return the absolute matrix of this occurence.

Definition at line 80 of file glc_structoccurence.h.

Referenced by updateAbsoluteMatrix().

GLC_StructOccurence * GLC_StructOccurence::addChild ( GLC_StructInstance pInstance  ) 

Add Child instance and returns the newly created occurence.

Definition at line 563 of file glc_structoccurence.cpp.

References addChild(), GLC_StructOccurence(), and m_pWorldHandle.

void GLC_StructOccurence::addChild ( GLC_StructOccurence pChild  ) 
GLC_BoundingBox GLC_StructOccurence::boundingBox ( void   )  const
bool GLC_StructOccurence::canBeAddedToChildren ( GLC_StructOccurence pOccurence  )  const

Return true if the given occurence can be added to this occurence children.

Definition at line 284 of file glc_structoccurence.cpp.

References childrenReferences(), GLC_StructInstance::hasStructOccurence(), m_pStructInstance, parentsReferences(), and structReference().

GLC_StructOccurence* GLC_StructOccurence::child ( const int  index  )  const [inline]

Return a child of this occurence.

The index must exist

Definition at line 128 of file glc_structoccurence.h.

Referenced by GLC_3dxmlToWorld::applyV4Attribute(), GLC_WorldTo3dxml::exportAssemblyFromOccurence(), GLC_StructOccurence(), and isVisible().

int GLC_StructOccurence::childCount (  )  const [inline]
QList<GLC_StructOccurence*> GLC_StructOccurence::children (  )  const [inline]

Return the list of children of this occurence.

Definition at line 132 of file glc_structoccurence.h.

Referenced by boundingBox(), and GLC_World::mergeWithAnotherWorld().

QSet< GLC_StructReference * > GLC_StructOccurence::childrenReferences (  )  const

Return the Set of children references of this occurence.

Definition at line 466 of file glc_structoccurence.cpp.

References childCount(), m_Childs, structInstance(), and structReference().

Referenced by canBeAddedToChildren().

GLC_StructOccurence * GLC_StructOccurence::clone ( GLC_WorldHandle pWorldHandle,
bool  shareInstance 
) const

Return a clone this occurence.

Definition at line 394 of file glc_structoccurence.cpp.

References GLC_StructOccurence().

Referenced by GLC_StructReference::addChild(), GLC_StructOccurence(), and GLC_World::mergeWithAnotherWorld().

bool GLC_StructOccurence::create3DViewInstance (  ) 
void GLC_StructOccurence::detach (  )  [private]
bool GLC_StructOccurence::has3DViewInstance (  )  const
bool GLC_StructOccurence::hasChild (  )  const [inline]
bool GLC_StructOccurence::hasParent (  )  const [inline]

Return true if this occurence has parent.

Definition at line 91 of file glc_structoccurence.h.

bool GLC_StructOccurence::hasRepresentation (  )  const
GLC_uint GLC_StructOccurence::id (  )  const [inline]
bool GLC_StructOccurence::isFlexible (  )  const [inline]

Return true if this occurence is flexible.

Definition at line 185 of file glc_structoccurence.h.

Referenced by GLC_WorldTo3dxml::exportAssemblyFromOccurence(), and GLC_WorldTo3dxml::writeOccurenceDefaultViewProperty().

bool GLC_StructOccurence::isOrphan (  )  const [inline]
bool GLC_StructOccurence::isVisible (  )  const
bool GLC_StructOccurence::loadRepresentation (  ) 
void GLC_StructOccurence::makeFlexible ( const GLC_Matrix4x4 relativeMatrix  ) 

Make this occurence a flexible occurence.

Definition at line 832 of file glc_structoccurence.cpp.

References m_pRelativeMatrix, and updateChildrenAbsoluteMatrix().

Referenced by GLC_3dxmlToWorld::applyV4Attribute().

void GLC_StructOccurence::makeOrphan (  ) 

make the occurence orphan

Definition at line 574 of file glc_structoccurence.cpp.

References isOrphan(), m_pParent, and removeChild().

void GLC_StructOccurence::makeRigid (  ) 

Make this occurence rigid.

Definition at line 840 of file glc_structoccurence.cpp.

References m_pRelativeMatrix, and updateChildrenAbsoluteMatrix().

QSet< GLC_Material * > GLC_StructOccurence::materialSet (  )  const

Return the materials List of the representation of this occurence.

Definition at line 376 of file glc_structoccurence.cpp.

References hasRepresentation(), m_Childs, GLC_StructReference::materialSet(), structInstance(), and GLC_StructInstance::structReference().

Referenced by numberOfMaterials().

const QString GLC_StructOccurence::name (  )  const [inline]
unsigned int GLC_StructOccurence::nodeCount (  )  const

Return the number of node of this branch.

Definition at line 455 of file glc_structoccurence.cpp.

References m_Childs.

unsigned int GLC_StructOccurence::numberOfFaces (  )  const

Return the number of faces of the representation of this occurence.

Definition at line 322 of file glc_structoccurence.cpp.

References hasRepresentation(), m_Childs, GLC_StructReference::numberOfFaces(), structInstance(), and GLC_StructInstance::structReference().

unsigned int GLC_StructOccurence::numberOfMaterials (  )  const

Return the number of materials of the representation of this occurence.

Definition at line 356 of file glc_structoccurence.cpp.

References hasRepresentation(), m_Childs, materialSet(), GLC_StructReference::numberOfMaterials(), structInstance(), and GLC_StructInstance::structReference().

unsigned int GLC_StructOccurence::numberOfVertex (  )  const

Return the number of vertex of the representation of this occurence.

Definition at line 339 of file glc_structoccurence.cpp.

References hasRepresentation(), m_Childs, GLC_StructReference::numberOfVertex(), structInstance(), and GLC_StructInstance::structReference().

unsigned int GLC_StructOccurence::occurenceNumber (  )  const [inline]

Return the occurence number of this occurence.

Definition at line 160 of file glc_structoccurence.h.

GLC_Matrix4x4 GLC_StructOccurence::occurrenceRelativeMatrix (  )  const

Return the surcharged relative matrix.

Definition at line 256 of file glc_structoccurence.cpp.

References m_pRelativeMatrix.

Referenced by GLC_WorldTo3dxml::writeOccurenceDefaultViewProperty().

GLC_StructOccurence* GLC_StructOccurence::parent (  )  const [inline]

Return The parent of this occurence.

Definition at line 123 of file glc_structoccurence.h.

Referenced by GLC_WorldTo3dxml::exportAssemblyFromOccurence(), GLC_WorldTo3dxml::instancePath(), and parentsReferences().

QSet< GLC_StructReference * > GLC_StructOccurence::parentsReferences ( const GLC_StructOccurence pOccurence  )  [static]

Return the set of parents references of the given occurence.

Definition at line 482 of file glc_structoccurence.cpp.

References parent(), structInstance(), and structReference().

Referenced by canBeAddedToChildren().

bool GLC_StructOccurence::remove3DViewInstance (  ) 

Remove the 3DViewInstance of this occurence.

Definition at line 637 of file glc_structoccurence.cpp.

References GLC_WorldHandle::collection(), m_pWorldHandle, m_Uid, and GLC_3DViewCollection::remove().

bool GLC_StructOccurence::removeChild ( GLC_StructOccurence pChild  ) 

Remove the specified child.

The removed child will not be deleted

Definition at line 584 of file glc_structoccurence.cpp.

References detach(), m_Childs, and m_pParent.

Referenced by makeOrphan(), and ~GLC_StructOccurence().

void GLC_StructOccurence::removeEmptyChildren (  ) 

Remove empty children.

Definition at line 774 of file glc_structoccurence.cpp.

References m_Childs.

Referenced by GLC_ColladaToWorld::createSceneGraph().

GLC_RenderProperties* GLC_StructOccurence::renderPropertiesHandle (  )  const [inline]

Return an handle of the renderProperties of this occurence.

Definition at line 164 of file glc_structoccurence.h.

void GLC_StructOccurence::reverseNormals (  ) 
void GLC_StructOccurence::setAutomatic3DViewInstanceCreationUsage ( bool  usage  )  [inline]

Set the automatic creation of 3DViewInstance usage.

Definition at line 255 of file glc_structoccurence.h.

void GLC_StructOccurence::setName ( const QString  name  )  [inline]

Set Occurence instance Name.

Definition at line 195 of file glc_structoccurence.h.

Referenced by GLC_3dsToWorld::createMeshes(), and GLC_StructOccurence().

void GLC_StructOccurence::setOccurenceNumber ( unsigned int  n  )  [inline]

Set the occurence number of this occurence.

Definition at line 236 of file glc_structoccurence.h.

void GLC_StructOccurence::setReference ( GLC_StructReference pRef  ) 
void GLC_StructOccurence::setRenderProperties ( const GLC_RenderProperties renderProperties  ) 
void GLC_StructOccurence::setVisibility ( bool  visibility  ) 
void GLC_StructOccurence::setWorldHandle ( GLC_WorldHandle pWorldHandle  ) 
GLC_StructInstance* GLC_StructOccurence::structInstance (  )  const [inline]
GLC_StructReference* GLC_StructOccurence::structReference (  )  const [inline]
QList< GLC_StructOccurence * > GLC_StructOccurence::subOccurenceList (  )  const

Return the list of all accurence under this occurence.

Definition at line 305 of file glc_structoccurence.cpp.

References childCount(), hasChild(), m_Childs, and subOccurenceList().

Referenced by GLC_WorldHandle::select(), subOccurenceList(), and GLC_WorldHandle::unselect().

bool GLC_StructOccurence::unloadRepresentation (  ) 
GLC_StructOccurence * GLC_StructOccurence::updateAbsoluteMatrix (  ) 
GLC_StructOccurence * GLC_StructOccurence::updateChildrenAbsoluteMatrix (  ) 
unsigned int GLC_StructOccurence::updateOccurenceNumber ( unsigned int  n  ) 

Update the occurence number of this occurence branch.

Definition at line 728 of file glc_structoccurence.cpp.

References childCount(), m_Childs, and m_OccurenceNumber.

Referenced by GLC_WorldTo3dxml::GLC_WorldTo3dxml(), and GLC_3dxmlToWorld::loadProductStructure().

bool GLC_StructOccurence::useAutomatic3DViewInstanceCreation (  )  const [inline]

Return true if the automatic creation of 3DViewInstance is used.

Definition at line 181 of file glc_structoccurence.h.

Referenced by GLC_WorldHandle::addOccurence(), GLC_StructReference::loadRepresentation(), and GLC_StructReference::setRepresentation().

GLC_WorldHandle* GLC_StructOccurence::worldHandle (  )  const [inline]

Return the world handle of this occurence.

Definition at line 171 of file glc_structoccurence.h.

Referenced by GLC_StructReference::addChild().


Member Data Documentation

The absolute matrix of the occurence.

Definition at line 295 of file glc_structoccurence.h.

Referenced by updateAbsoluteMatrix().

Automatique crŽation of 3DViewInstance.

Definition at line 307 of file glc_structoccurence.h.

Referenced by loadRepresentation().

Flag to know if a occurence without instance is visible.

Definition at line 301 of file glc_structoccurence.h.

Referenced by create3DViewInstance(), isVisible(), setVisibility(), and setWorldHandle().

The occurence number.

Definition at line 298 of file glc_structoccurence.h.

Referenced by updateOccurenceNumber().

Number of this Occurence.

Definition at line 283 of file glc_structoccurence.h.

Referenced by GLC_StructOccurence(), setReference(), and ~GLC_StructOccurence().

The parent of this occurence.

Definition at line 289 of file glc_structoccurence.h.

Referenced by addChild(), makeOrphan(), removeChild(), and updateAbsoluteMatrix().

The relative matrix of this occurence if this occurence is flexible.

Definition at line 310 of file glc_structoccurence.h.

Referenced by GLC_StructOccurence(), makeFlexible(), makeRigid(), occurrenceRelativeMatrix(), updateAbsoluteMatrix(), and ~GLC_StructOccurence().

The occurence rendering properties.

Definition at line 304 of file glc_structoccurence.h.

Referenced by create3DViewInstance(), detach(), GLC_StructOccurence(), setRenderProperties(), and ~GLC_StructOccurence().


The documentation for this class was generated from the following files:

SourceForge.net Logo

©2005-2011 Laurent Ribon