qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Attributes | List of all members
ccDrawableObject Class Referenceabstract

Generic interface for (3D) drawable entities. More...

#include <ccDrawableObject.h>

Inheritance diagram for ccDrawableObject:
Inheritance graph
[legend]
Collaboration diagram for ccDrawableObject:
Collaboration graph
[legend]

Public Member Functions

 ccDrawableObject ()
 Default constructor.
 
virtual void draw (CC_DRAW_CONTEXT &context)=0
 Draws entity and its children.
 
virtual bool isVisible () const
 Returns whether entity is visible or not.
 
virtual void setVisible (bool state)
 Sets entity visibility.
 
virtual void toggleVisibility ()
 Toggles visibility.
 
virtual bool isVisiblityLocked () const
 Returns whether visibilty is locked or not.
 
virtual void lockVisibility (bool state)
 Locks/unlocks visibilty. More...
 
virtual bool isSelected () const
 Returns whether entity is selected or not.
 
virtual void setSelected (bool state)
 Selects/unselects entity.
 
virtual ccBBox getBB (bool relative=true, bool withGLfeatures=false, const ccGenericGLDisplay *window=0)=0
 Returns bounding-box. More...
 
virtual ccBBox getFitBB (ccGLMatrix &trans)
 Returns best-fit bounding-box (if available) More...
 
virtual void drawBB (const colorType col[])
 Draws absolute (axis aligned) bounding-box.
 
virtual void getDrawingParameters (glDrawParams &params) const
 Returns main OpenGL paramters for this entity. More...
 
virtual bool hasColors () const
 Returns whether colors are enabled or not.
 
virtual bool colorsShown () const
 Returns whether colors are shown or not.
 
virtual void showColors (bool state)
 Sets colors visibility.
 
virtual void toggleColors ()
 Toggles colors display state.
 
virtual bool hasNormals () const
 Returns whether normals are enabled or not.
 
virtual bool normalsShown () const
 Returns whether normals are shown or not.
 
virtual void showNormals (bool state)
 Sets normals visibility.
 
virtual void toggleNormals ()
 Toggles normals display state.
 
virtual bool hasDisplayedScalarField () const
 Returns whether an active scalar field is available or not.
 
virtual bool hasScalarFields () const
 Returns whether one or more scalar fields are instantiated. More...
 
virtual void showSF (bool state)
 Sets active scalarfield visibility.
 
virtual void toggleSF ()
 Toggles SF display state.
 
virtual bool sfShown () const
 Returns whether active scalar field is visible.
 
virtual void toggleMaterials ()
 Toggles material display state.
 
virtual void showNameIn3D (bool state)
 Sets whether name should be displayed in 3D.
 
virtual bool nameShownIn3D () const
 Returns whether name is displayed in 3D or not.
 
virtual void toggleShowName ()
 Toggles name in 3D display state.
 
virtual bool isColorOverriden () const
 Returns whether colors are currently overriden by a temporary (unique) color. More...
 
virtual const colorType * getTempColor () const
 Returns current temporary (unique) color.
 
virtual void setTempColor (const colorType *col, bool autoActivate=true)
 Sets current temporary (unique) More...
 
virtual void enableTempColor (bool state)
 Set temporary color activation state.
 
virtual void removeFromDisplay (const ccGenericGLDisplay *win)
 Unlinks entity from a GL display (only if it belongs to it of course)
 
virtual void setDisplay (ccGenericGLDisplay *win)
 Sets associated GL display.
 
virtual ccGenericGLDisplaygetDisplay () const
 Returns associated GL display.
 
virtual void redrawDisplay ()
 Redraws associated GL display.
 
virtual void prepareDisplayForRefresh ()
 Sets associated GL display 'refreshable' before global refresh. More...
 
virtual void refreshDisplay ()
 Refreshes associated GL display. More...
 
virtual void setGLTransformation (const ccGLMatrix &trans)
 Associates entity with a GL transformation (rotation + translation) More...
 
virtual void enableGLTransformation (bool state)
 Enables/disables associated GL transformation. More...
 
virtual bool isGLTransEnabled () const
 Returns whether a GL transformation is enabled or not.
 
virtual const ccGLMatrixgetGLTransformation () const
 Retuns associated GL transformation. More...
 
virtual void resetGLTransformation ()
 Resets associated GL transformation. More...
 
virtual void rotateGL (const ccGLMatrix &rotMat)
 Mutliplies (left) current GL transformation by a rotation matrix. More...
 
virtual void translateGL (const CCVector3 &trans)
 Translates current GL transformation by a rotation matrix. More...
 

Protected Attributes

bool m_visible
 Specifies whether the object is visible or not. More...
 
bool m_selected
 Specifies whether the object is selected or not.
 
bool m_lockedVisibility
 Specifies whether the visibility can be changed by user or not.
 
bool m_colorsDisplayed
 Specifies whether colors should be displayed.
 
bool m_normalsDisplayed
 Specifies whether normals should be displayed.
 
bool m_sfDisplayed
 Specifies whether scalar field should be displayed.
 
colorType m_tempColor [3]
 Temporary (unique) color.
 
bool m_colorIsOverriden
 Temporary (unique) color activation state.
 
ccGLMatrix m_glTrans
 Current GL transformation. More...
 
bool m_glTransEnabled
 Current GL transformation activation state. More...
 
bool m_showNameIn3D
 Whether name is displayed in 3D or not.
 
ccGenericGLDisplaym_currentDisplay
 Currently associated GL display.
 

Detailed Description

Generic interface for (3D) drawable entities.

Member Function Documentation

void ccDrawableObject::enableGLTransformation ( bool  state)
virtual

Enables/disables associated GL transformation.

See ccDrawableObject::setGLTransformation.

virtual ccBBox ccDrawableObject::getBB ( bool  relative = true,
bool  withGLfeatures = false,
const ccGenericGLDisplay window = 0 
)
pure virtual

Returns bounding-box.

If bbox is not relative, any active GL transformation (see setGLTransformation) will be applied to it. Moreover, one can compute a full bounding box, taking into acount every children, or only the ones displayed in a given GL window. Eventualy, one can also choose to compute bbox only with geometrical entities, or also with full GL features.

Parameters
relativespecifies whether bbox is relative or not
withGLfeaturesinclude GL features (example: octree grid display) inside BB or not
windowdisplay to compute bbox only with entities displayed in a given GL window
Returns
bounding-box

Implemented in ccHObject.

void ccDrawableObject::getDrawingParameters ( glDrawParams params) const
virtual

Returns main OpenGL paramters for this entity.

These parameters are deduced from the visiblity states of its different features (points, normals, etc.).

Parameters
paramsa glDrawParams structure

Reimplemented in ccPointCloud.

ccBBox ccDrawableObject::getFitBB ( ccGLMatrix trans)
virtual

Returns best-fit bounding-box (if available)

WARNING: This method is not supported by all entities! Should be re-implemented whenever possible (returns the axis-aligned bounding-box by default).

Parameters
[out]transassociated transformation (so that the bounding-box can be displayed in the right position!)
Returns
fit bounding-box

Reimplemented in ccQuadric, and ccPlane.

const ccGLMatrix & ccDrawableObject::getGLTransformation ( ) const
virtual

Retuns associated GL transformation.

See ccDrawableObject::setGLTransformation.

bool ccDrawableObject::hasScalarFields ( ) const
virtual

Returns whether one or more scalar fields are instantiated.

WARNING: doesn't mean a scalar field is currently displayed (see ccDrawableObject::hasDisplayedScalarField).

Reimplemented in ccPointCloud, ccMesh, and ccSubMesh.

bool ccDrawableObject::isColorOverriden ( ) const
virtual

Returns whether colors are currently overriden by a temporary (unique) color.

See ccDrawableObject::setTempColor.

void ccDrawableObject::lockVisibility ( bool  state)
virtual

Locks/unlocks visibilty.

If visibility is locked, the user won't be able to modify it (via the properties tree for instance).

void ccDrawableObject::prepareDisplayForRefresh ( )
virtual

Sets associated GL display 'refreshable' before global refresh.

Only tagged displays will be refreshed when ccGenericGLDisplay::refresh is called (see also MainWindow::RefreshAllGLWindow, MainWindow::refreshAll and ccDrawableObject::refreshDisplay).

void ccDrawableObject::refreshDisplay ( )
virtual

Refreshes associated GL display.

See ccGenericGLDisplay::refresh.

void ccDrawableObject::resetGLTransformation ( )
virtual

Resets associated GL transformation.

GL transformation is reset to identity. Note: GL transformation is automatically disabled. See ccDrawableObject::setGLTransformation.

void ccDrawableObject::rotateGL ( const ccGLMatrix rotMat)
virtual

Mutliplies (left) current GL transformation by a rotation matrix.

'GLtrans = M * GLtrans' Note: GL transformation is automatically enabled. See ccDrawableObject::setGLTransformation.

void ccDrawableObject::setGLTransformation ( const ccGLMatrix trans)
virtual

Associates entity with a GL transformation (rotation + translation)

WARNING: FOR DISPLAY PURPOSE ONLY (i.e. should only be temporary) If the associated GL transformation is enabled (see ccDrawableObject::enableGLTransformation), it will be applied before displaying this entity. It will also be taken into account during computation of a non-relative bounding-box (see ccDrawableObject::getBB). However it will not be taken into account by any CCLib algorithm (distance computation, etc.) for instance. Note: GL transformation is automatically enabled.

void ccDrawableObject::setTempColor ( const colorType *  col,
bool  autoActivate = true 
)
virtual

Sets current temporary (unique)

Parameters
colrgb color
autoActivateauto activates temporary color
void ccDrawableObject::translateGL ( const CCVector3 &  trans)
virtual

Translates current GL transformation by a rotation matrix.

'GLtrans = GLtrans + T' Note: GL transformation is automatically enabled. See ccDrawableObject::setGLTransformation.

Member Data Documentation

ccGLMatrix ccDrawableObject::m_glTrans
protected

Current GL transformation.

See ccDrawableObject::setGLTransformation.

bool ccDrawableObject::m_glTransEnabled
protected

Current GL transformation activation state.

See ccDrawableObject::setGLTransformation.

bool ccDrawableObject::m_visible
protected

Specifies whether the object is visible or not.

Note: this does not influence the children visibility


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