cee::geo::PartSettings Class Reference

Part settings represents how to draw a part and it's associated part data. More...

Public Member Functions

 PartSettings ()
 Constructs an empty part settings. More...
 
void setVisible (bool visible)
 Shows or hides the whole part. More...
 
bool visible () const
 Returns true if the part is drawn. More...
 
void setIntersectable (bool intersectable)
 Sets if the part should be "selectable" or not when doing rayIntersect/regionIntersect. More...
 
bool intersectable () const
 Returns true if the part is "selectable" (default), i.e. considered in rayIntersect() or regionIntersect(). More...
 
size_t effectCount () const
 Returns the number of associated effects. More...
 
size_t effectIndex (const Effect *effect) const
 Returns index of the given effect. More...
 
Effecteffect (size_t index)
 Returns the effect at the given index. More...
 
const Effecteffect (size_t index) const
 Returns the effect at the given index. More...
 
void addEffect (Effect *effect)
 Adds an effect. More...
 
void removeEffect (Effect *effect)
 Removes effect from part. More...
 
void removeAllEffects ()
 Removes all associated effects. More...
 
template<typename T >
const T * activeEffectOfType () const
 Returns the active (last inserted/top of stack) effect of the given type T, or NULL if no effect of that type was found. More...
 
template<typename T >
T * activeEffectOfType ()
 Returns the active (last inserted/top of stack) effect of the given type T, or NULL if no effect of that type was found. More...
 
template<typename T >
void removeAllEffectsOfType ()
 Removes all effects of the given type. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 
Inheritance diagram for cee::geo::PartSettings:
cee::RefCountedObject

Detailed Description

Part settings represents how to draw a part and it's associated part data.

Each part can have any number of effects. Add effects for manipulating how the part data should be drawn. These effect are added, queried and retrieved from the parts part settings.

  • It is not allowed to enter an effect not applicable for the associated part data.
  • Default effects are used if not provided, where needed.
  • Effects are organized in a stack and the system will use the first applicable unused effect type found, ignoring any other effects in the same group further down the stack.
See also
Part
Effect
EffectColor
EffectEyeLift
EffectFrontAndBackColor
EffectFrontAndBackOpacity
EffectHalo
EffectLighting
EffectLineWidth
EffectOpacity
EffectPointSize
EffectPolygonOffset
EffectTexture

Constructor & Destructor Documentation

cee::geo::PartSettings::PartSettings ( )

Constructs an empty part settings.

Member Function Documentation

template<typename T >
const T * cee::geo::PartSettings::activeEffectOfType ( ) const

Returns the active (last inserted/top of stack) effect of the given type T, or NULL if no effect of that type was found.

template<typename T >
T * cee::geo::PartSettings::activeEffectOfType ( )

Returns the active (last inserted/top of stack) effect of the given type T, or NULL if no effect of that type was found.

void cee::geo::PartSettings::addEffect ( Effect effect)

Adds an effect.

Effect * cee::geo::PartSettings::effect ( size_t  index)

Returns the effect at the given index.

const Effect * cee::geo::PartSettings::effect ( size_t  index) const

Returns the effect at the given index.

size_t cee::geo::PartSettings::effectCount ( ) const

Returns the number of associated effects.

size_t cee::geo::PartSettings::effectIndex ( const Effect effect) const

Returns index of the given effect.

bool cee::geo::PartSettings::intersectable ( ) const

Returns true if the part is "selectable" (default), i.e. considered in rayIntersect() or regionIntersect().

If this method returns false, the part will not be hit in GeometryModel::rayIntersect() or GeometryModel::regionIntersect().

See also
setIntersectable
void cee::geo::PartSettings::removeAllEffects ( )

Removes all associated effects.

template<typename T >
void cee::geo::PartSettings::removeAllEffectsOfType ( )

Removes all effects of the given type.

void cee::geo::PartSettings::removeEffect ( Effect effect)

Removes effect from part.

Warning
Effect must already be present in the part settings
void cee::geo::PartSettings::setIntersectable ( bool  intersectable)

Sets if the part should be "selectable" or not when doing rayIntersect/regionIntersect.

The default is true. If this is set to false, this part will not be hit by the GeometryModel::rayIntersect() or GeometryModel::regionIntersect() methods.

This is useful if you only want the user to be able to pick/select parts of the model.

void cee::geo::PartSettings::setVisible ( bool  visible)

Shows or hides the whole part.

bool cee::geo::PartSettings::visible ( ) const

Returns true if the part is drawn.