GLC_3DViewInstance Class Reference

GLC_3DViewInstance : GLC_3DRep + bounding box. More...

#include <glc_3dviewinstance.h>

Inheritance diagram for GLC_3DViewInstance:
GLC_Object

List of all members.

Public Types

enum  Viewable { FullViewable = 120, PartialViewable = 121, NoViewable = 122 }
 

Viewable instance property.

More...

Public Member Functions

Constructor / Destructor

 GLC_3DViewInstance ()
 Default constructor.
 GLC_3DViewInstance (GLC_Geometry *pGeom)
 Contruct instance with a geometry.
 GLC_3DViewInstance (const GLC_3DRep &)
 Contruct instance with a 3DRep.
 GLC_3DViewInstance (const GLC_3DViewInstance &)
 Copy constructor.
GLC_3DViewInstanceoperator= (const GLC_3DViewInstance &)
 Assignement operator.
 ~GLC_3DViewInstance ()
 Destructor.

Private Member Functions

void computeBoundingBox (void)
 compute the instance bounding box
void clear ()
 Clear current instance.
int choseLod (const GLC_BoundingBox &, GLC_Viewport *, bool)
 Compute LOD.

Private Attributes

GLC_3DRep m_3DRep
 The 3D rep of the instance.
GLC_BoundingBoxm_pBoundingBox
 BoundingBox of the instance.
GLC_Matrix4x4 m_AbsoluteMatrix
 Geometry matrix.
bool m_IsBoundingBoxValid
 Bounding box validity.
GLC_RenderProperties m_RenderProperties
 The 3DViewInstance rendering properties.
bool m_IsVisible
 Visibility.
GLubyte m_colorId [4]
 The instance color ID.
int m_DefaultLOD
 The Default LOD.
Viewable m_ViewableFlag
 Flag to know if the instance is viewable.
QVector< bool > m_ViewableGeomFlag
 vector of Flag to know if geometies of this instance are viewable

Static Private Attributes

static QMutex m_Mutex
 A Mutex.
static int m_GlobalDefaultLOD = 10
 The global default LOD.

Get Functions



bool isTransparent () const
 Return true if the all instance's mesh are transparent.
bool hasTransparentMaterials () const
 Return true if the instance contains mesh which contains transparent material.
bool isEmpty () const
 Return true if the instance as no geometry.
bool isSelected (void) const
 Return true if the instance is selected.
int numberOfGeometry () const
 Return the number of geometry.
GLC_GeometrygeomAt (int index) const
 Return the geometry at the specified position.
GLC_BoundingBox boundingBox ()
 Get the bounding box.
bool boundingBoxValidity () const
 Get the validity of the Bounding Box.
const GLC_Matrix4x4matrix () const
 Return transfomation 4x4Matrix.
GLC_3DViewInstance deepCopy () const
 Make a deep copy of the instance.
GLC_3DViewInstance instanciate ()
 Instanciate the instance.
GLenum polygonMode () const
 Get the Polygon mode off the instance.
GLC_RenderPropertiesrenderPropertiesHandle ()
 Return an handle to the renderProperties.
bool isVisible () const
 Get the visibility state of instance.
GLC_3DViewInstance::Viewable viewableFlag () const
 Return true if the instance is viewable.
bool isGeomViewable (int index) const
 Return true if the geom at the index is viewable.
unsigned int numberOfFaces () const
 Get number of faces.
unsigned int numberOfVertex () const
 Get number of vertex.
unsigned int numberOfMaterials () const
 Get number of materials.
QSet< GLC_Material * > materialSet () const
 Get materials List.
int defaultLodValue () const
 Return the default LOD Value.
GLC_3DRep representation () const
 Return the instance representation.
int numberOfBody () const
 Return the number of body contains in the 3DRep.
static int globalDefaultLod ()
 Return the global default LOD value.

Set Functions



bool setGeometry (GLC_Geometry *pGeom)
 Set the instance Geometry.
void removeEmptyGeometry ()
 Remove empty geometries.
void reverseGeometriesNormals ()
 Reverse geometry normals.
GLC_3DViewInstancetranslate (double Tx, double Ty, double Tz)
 Translate Instance.
GLC_3DViewInstancetranslate (const GLC_Vector3d &v)
 Translate Instance.
GLC_3DViewInstancemultMatrix (const GLC_Matrix4x4 &MultMat)
 Move instance with a 4x4Matrix.
GLC_3DViewInstancesetMatrix (const GLC_Matrix4x4 &SetMat)
 Replace the instance Matrix.
GLC_3DViewInstanceresetMatrix (void)
 Reset the instance Matrix.
void setPolygonMode (GLenum Face, GLenum Mode)
 Polygon's display style.
void select (bool primitive)
 Select the instance.
void unselect (void)
 Unselect the instance.
void setVisibility (bool visibility)
 Set instance visibility.
void setId (const GLC_uint id)
 Set Instance Id.
void setDefaultLodValue (int lod)
 Set the default LOD value.
bool setViewable (GLC_3DViewInstance::Viewable flag)
 Set the viewable flag.
void setGeomViewable (int index, bool flag)
 Set the viewable flag of a geometry.
void setRenderProperties (const GLC_RenderProperties &renderProperties)
 Set the renderProperties of this 3DView instance.
static void setGlobalDefaultLod (int)
 Set the global default LOD value.

OpenGL Functions



void render (glc::RenderFlag renderFlag=glc::ShadingFlag, bool useLoad=false, GLC_Viewport *pView=NULL)
 Display the instance.
void renderForBodySelection ()
 Display the instance in Body selection mode.
int renderForPrimitiveSelection (GLC_uint)
 Display the instance in Primitive selection mode of the specified body id and return the body index.
void OpenglVisProperties ()
 Set instance visualisation properties.

Detailed Description

GLC_3DViewInstance : GLC_3DRep + bounding box.

An GLC_3DViewInstance contain :

Definition at line 53 of file glc_3dviewinstance.h.


Member Enumeration Documentation

Viewable instance property.

Enumerator:
FullViewable 
PartialViewable 
NoViewable 

Definition at line 57 of file glc_3dviewinstance.h.


Constructor & Destructor Documentation

GLC_3DViewInstance::GLC_3DViewInstance (  ) 

Default constructor.

Definition at line 43 of file glc_3dviewinstance.cpp.

References glc::encodeRgbId(), m_colorId, and GLC_Object::m_Uid.

GLC_3DViewInstance::GLC_3DViewInstance ( GLC_Geometry pGeom  ) 

Contruct instance with a geometry.

Definition at line 63 of file glc_3dviewinstance.cpp.

References glc::encodeRgbId(), m_3DRep, m_colorId, GLC_Object::m_Uid, GLC_Rep::name(), and GLC_Object::setName().

GLC_3DViewInstance::GLC_3DViewInstance ( const GLC_3DRep rep  ) 

Contruct instance with a 3DRep.

Definition at line 85 of file glc_3dviewinstance.cpp.

References glc::encodeRgbId(), m_3DRep, m_colorId, GLC_Object::m_Uid, GLC_Rep::name(), and GLC_Object::setName().

GLC_3DViewInstance::GLC_3DViewInstance ( const GLC_3DViewInstance inputNode  ) 

Copy constructor.

Definition at line 107 of file glc_3dviewinstance.cpp.

References glc::encodeRgbId(), m_colorId, m_pBoundingBox, and GLC_Object::m_Uid.

GLC_3DViewInstance::~GLC_3DViewInstance (  ) 

Destructor.

Definition at line 161 of file glc_3dviewinstance.cpp.

References clear().


Member Function Documentation

GLC_BoundingBox GLC_3DViewInstance::boundingBox ( void   ) 
bool GLC_3DViewInstance::boundingBoxValidity (  )  const [inline]

Get the validity of the Bounding Box.

Definition at line 123 of file glc_3dviewinstance.h.

Referenced by boundingBox().

int GLC_3DViewInstance::choseLod ( const GLC_BoundingBox boundingBox,
GLC_Viewport pView,
bool  useLod 
) [private]
void GLC_3DViewInstance::clear ( void   )  [private]

Clear current instance.

Definition at line 460 of file glc_3dviewinstance.cpp.

References m_IsBoundingBoxValid, and m_pBoundingBox.

Referenced by operator=(), and ~GLC_3DViewInstance().

void GLC_3DViewInstance::computeBoundingBox ( void   )  [private]
GLC_3DViewInstance GLC_3DViewInstance::deepCopy (  )  const
int GLC_3DViewInstance::defaultLodValue (  )  const [inline]

Return the default LOD Value.

Definition at line 174 of file glc_3dviewinstance.h.

GLC_Geometry* GLC_3DViewInstance::geomAt ( int  index  )  const [inline]
static int GLC_3DViewInstance::globalDefaultLod (  )  [inline, static]

Return the global default LOD value.

Definition at line 186 of file glc_3dviewinstance.h.

bool GLC_3DViewInstance::hasTransparentMaterials (  )  const [inline]
GLC_3DViewInstance GLC_3DViewInstance::instanciate (  ) 

Instanciate the instance.

Definition at line 218 of file glc_3dviewinstance.cpp.

References glc::encodeRgbId(), glc::GLC_GenID(), m_colorId, and GLC_Object::m_Uid.

bool GLC_3DViewInstance::isEmpty ( void   )  const [inline]

Return true if the instance as no geometry.

Definition at line 100 of file glc_3dviewinstance.h.

bool GLC_3DViewInstance::isGeomViewable ( int  index  )  const [inline]

Return true if the geom at the index is viewable.

Definition at line 154 of file glc_3dviewinstance.h.

bool GLC_3DViewInstance::isSelected ( void   )  const [inline]
bool GLC_3DViewInstance::isTransparent (  )  const [inline]
bool GLC_3DViewInstance::isVisible (  )  const [inline]
QSet<GLC_Material*> GLC_3DViewInstance::materialSet (  )  const [inline]

Get materials List.

Definition at line 170 of file glc_3dviewinstance.h.

const GLC_Matrix4x4& GLC_3DViewInstance::matrix (  )  const [inline]

Return transfomation 4x4Matrix.

Definition at line 127 of file glc_3dviewinstance.h.

Referenced by GLC_OctreeNode::updateViewableInstances().

GLC_3DViewInstance & GLC_3DViewInstance::multMatrix ( const GLC_Matrix4x4 MultMat  ) 
int GLC_3DViewInstance::numberOfBody (  )  const [inline]

Return the number of body contains in the 3DRep.

Definition at line 182 of file glc_3dviewinstance.h.

Referenced by GLC_OctreeNode::updateViewableInstances().

unsigned int GLC_3DViewInstance::numberOfFaces (  )  const [inline]

Get number of faces.

Definition at line 158 of file glc_3dviewinstance.h.

int GLC_3DViewInstance::numberOfGeometry (  )  const [inline]

Return the number of geometry.

Definition at line 108 of file glc_3dviewinstance.h.

unsigned int GLC_3DViewInstance::numberOfMaterials (  )  const [inline]

Get number of materials.

Definition at line 166 of file glc_3dviewinstance.h.

unsigned int GLC_3DViewInstance::numberOfVertex (  )  const [inline]

Get number of vertex.

Definition at line 162 of file glc_3dviewinstance.h.

void GLC_3DViewInstance::OpenglVisProperties (  )  [inline, private]

Set instance visualisation properties.

Definition at line 296 of file glc_3dviewinstance.h.

Referenced by render(), renderForBodySelection(), and renderForPrimitiveSelection().

GLC_3DViewInstance & GLC_3DViewInstance::operator= ( const GLC_3DViewInstance inputNode  ) 
GLenum GLC_3DViewInstance::polygonMode (  )  const [inline]

Get the Polygon mode off the instance.

Polygon Mode can Be : GL_POINT, GL_LINE, or GL_FILL

Definition at line 138 of file glc_3dviewinstance.h.

void GLC_3DViewInstance::removeEmptyGeometry (  )  [inline]

Remove empty geometries.

Definition at line 206 of file glc_3dviewinstance.h.

void GLC_3DViewInstance::render ( glc::RenderFlag  renderFlag = glc::ShadingFlag,
bool  useLoad = false,
GLC_Viewport pView = NULL 
)
void GLC_3DViewInstance::renderForBodySelection (  ) 
int GLC_3DViewInstance::renderForPrimitiveSelection ( GLC_uint  bodyId  ) 
GLC_RenderProperties* GLC_3DViewInstance::renderPropertiesHandle (  )  [inline]
GLC_3DRep GLC_3DViewInstance::representation (  )  const [inline]

Return the instance representation.

Definition at line 178 of file glc_3dviewinstance.h.

Referenced by GLC_Axis::create3DviewInstance().

GLC_3DViewInstance & GLC_3DViewInstance::resetMatrix ( void   ) 

Reset the instance Matrix.

Definition at line 275 of file glc_3dviewinstance.cpp.

References m_AbsoluteMatrix, m_IsBoundingBoxValid, and GLC_Matrix4x4::setToIdentity().

void GLC_3DViewInstance::reverseGeometriesNormals (  )  [inline]

Reverse geometry normals.

Definition at line 210 of file glc_3dviewinstance.h.

Referenced by GLC_StructOccurence::reverseNormals().

void GLC_3DViewInstance::select ( bool  primitive  )  [inline]

Select the instance.

Definition at line 238 of file glc_3dviewinstance.h.

Referenced by GLC_3DViewCollection::select(), and GLC_3DViewCollection::selectAll().

void GLC_3DViewInstance::setDefaultLodValue ( int  lod  )  [inline]

Set the default LOD value.

Definition at line 257 of file glc_3dviewinstance.h.

bool GLC_3DViewInstance::setGeometry ( GLC_Geometry pGeom  ) 

Set the instance Geometry.

instance must be null

Definition at line 234 of file glc_3dviewinstance.cpp.

References GLC_3DRep::addGeom(), GLC_3DRep::contains(), and m_3DRep.

Referenced by GLC_RepFlyMover::createRepresentation().

void GLC_3DViewInstance::setGeomViewable ( int  index,
bool  flag 
) [inline]

Set the viewable flag of a geometry.

Definition at line 266 of file glc_3dviewinstance.h.

Referenced by GLC_OctreeNode::updateViewableInstances().

void GLC_3DViewInstance::setGlobalDefaultLod ( int  lod  )  [static]

Set the global default LOD value.

Definition at line 189 of file glc_3dviewinstance.cpp.

References m_GlobalDefaultLOD, and m_Mutex.

void GLC_3DViewInstance::setId ( const GLC_uint  id  )  [inline]

Set Instance Id.

Reimplemented from GLC_Object.

Definition at line 250 of file glc_3dviewinstance.h.

References glc::encodeRgbId(), and GLC_Object::setId().

Referenced by GLC_WorldHandle::addOccurence(), and GLC_StructOccurence::create3DViewInstance().

GLC_3DViewInstance & GLC_3DViewInstance::setMatrix ( const GLC_Matrix4x4 SetMat  ) 
void GLC_3DViewInstance::setPolygonMode ( GLenum  Face,
GLenum  Mode 
) [inline]

Polygon's display style.

Face Polygon Mode can be : GL_FRONT_AND_BACK, GL_FRONT, or GL_BACK mode can be : GL_POINT, GL_LINE, or GL_FILL

Definition at line 234 of file glc_3dviewinstance.h.

void GLC_3DViewInstance::setRenderProperties ( const GLC_RenderProperties renderProperties  )  [inline]

Set the renderProperties of this 3DView instance.

Definition at line 274 of file glc_3dviewinstance.h.

Referenced by GLC_StructOccurence::GLC_StructOccurence(), and GLC_StructOccurence::setRenderProperties().

bool GLC_3DViewInstance::setViewable ( GLC_3DViewInstance::Viewable  flag  )  [inline]
void GLC_3DViewInstance::setVisibility ( bool  visibility  )  [inline]
GLC_3DViewInstance& GLC_3DViewInstance::translate ( const GLC_Vector3d v  )  [inline]

Translate Instance.

Definition at line 217 of file glc_3dviewinstance.h.

References GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().

GLC_3DViewInstance & GLC_3DViewInstance::translate ( double  Tx,
double  Ty,
double  Tz 
)

Translate Instance.

Definition at line 248 of file glc_3dviewinstance.cpp.

References multMatrix().

Referenced by GLC_Axis::create3DviewInstance(), and GLC_Factory::createBox().

void GLC_3DViewInstance::unselect ( void   )  [inline]

Unselect the instance.

Definition at line 242 of file glc_3dviewinstance.h.

Referenced by GLC_3DViewCollection::unselectAll().

GLC_3DViewInstance::Viewable GLC_3DViewInstance::viewableFlag (  )  const [inline]

Return true if the instance is viewable.

Definition at line 150 of file glc_3dviewinstance.h.

Referenced by GLC_3DViewCollection::glDrawInstancesOf().


Member Data Documentation

Geometry matrix.

Definition at line 332 of file glc_3dviewinstance.h.

Referenced by choseLod(), computeBoundingBox(), deepCopy(), multMatrix(), operator=(), render(), resetMatrix(), and setMatrix().

GLubyte GLC_3DViewInstance::m_colorId[4] [private]

The instance color ID.

Definition at line 344 of file glc_3dviewinstance.h.

Referenced by GLC_3DViewInstance(), instanciate(), operator=(), and render().

The Default LOD.

Definition at line 347 of file glc_3dviewinstance.h.

Referenced by choseLod(), operator=(), render(), and renderForBodySelection().

int GLC_3DViewInstance::m_GlobalDefaultLOD = 10 [static, private]

The global default LOD.

Definition at line 359 of file glc_3dviewinstance.h.

Referenced by setGlobalDefaultLod().

Bounding box validity.

Definition at line 335 of file glc_3dviewinstance.h.

Referenced by boundingBox(), clear(), deepCopy(), multMatrix(), operator=(), resetMatrix(), and setMatrix().

Visibility.

Definition at line 341 of file glc_3dviewinstance.h.

Referenced by deepCopy(), and operator=().

QMutex GLC_3DViewInstance::m_Mutex [static, private]

A Mutex.

Reimplemented from GLC_Object.

Definition at line 356 of file glc_3dviewinstance.h.

Referenced by setGlobalDefaultLod().

BoundingBox of the instance.

Definition at line 329 of file glc_3dviewinstance.h.

Referenced by boundingBox(), clear(), computeBoundingBox(), deepCopy(), GLC_3DViewInstance(), and operator=().

The 3DViewInstance rendering properties.

Definition at line 338 of file glc_3dviewinstance.h.

Referenced by deepCopy(), hasTransparentMaterials(), isTransparent(), operator=(), render(), renderForBodySelection(), and renderForPrimitiveSelection().

Flag to know if the instance is viewable.

Definition at line 350 of file glc_3dviewinstance.h.

Referenced by deepCopy(), operator=(), and setViewable().

QVector<bool> GLC_3DViewInstance::m_ViewableGeomFlag [private]

vector of Flag to know if geometies of this instance are viewable

Definition at line 353 of file glc_3dviewinstance.h.

Referenced by operator=(), render(), and setViewable().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon