|
CEDRIC
Revision_backup-2009-02
|
NodeVisitor for changing color or alpha of ShapeDrawables. More...
#include <ChangeColorVisitor.h>
Public Member Functions | |
| ChangeColorVisitor (osg::Vec3 color=osg::Vec3(1.0, 1.0, 1.0)) | |
| void | reset () |
| Only resets number of changed drawables (see getNumberOfChangedDrawables()) More... | |
| void | changeOnlyAlpha (bool b) |
| Only change alpha value of drawables. More... | |
| void | setColor (osg::Vec4 color) |
| Set RGBA color. More... | |
| void | setColor (osg::Vec3 color) |
| Only set RGB and keep current alpha value. More... | |
| void | setAlpha (float alpha) |
| Set alpha value. More... | |
| virtual void | apply (osg::Geode &geode) |
| Visitor implementation goes here. More... | |
| int | getNumberOfChangedDrawables () const |
| Return number of changed drawables since last reset() call. More... | |
| void | setChangeBlendState (bool b) |
| Allow/Forbid changing the blend state (by default changing blend state is forbidden) More... | |
Protected Member Functions | |
| void | setBlendState (osg::StateSet *stateSet) |
| Enables blending (and sets blendfunc) if m_color alpha component < 1 else disables blending (applies only if changing blend state is allowed, see setChangeBlendState()) More... | |
Protected Attributes | |
| osg::Vec4 | m_color |
| int | m_numberOfChangedDrawables |
| bool | m_AlphaOnly |
| bool | m_dontChangeBlendState |
NodeVisitor for changing color or alpha of ShapeDrawables.
| ChangeColorVisitor::ChangeColorVisitor | ( | osg::Vec3 | color = osg::Vec3(1.0,1.0,1.0) | ) |
|
virtual |
Visitor implementation goes here.
References m_AlphaOnly, m_color, m_numberOfChangedDrawables, and setBlendState().
| void ChangeColorVisitor::changeOnlyAlpha | ( | bool | b | ) |
| int ChangeColorVisitor::getNumberOfChangedDrawables | ( | ) | const |
Return number of changed drawables since last reset() call.
References m_numberOfChangedDrawables.
Referenced by PhastNode::setColor().
| void ChangeColorVisitor::reset | ( | ) |
Only resets number of changed drawables (see getNumberOfChangedDrawables())
References m_numberOfChangedDrawables.
| void ChangeColorVisitor::setAlpha | ( | float | alpha | ) |
|
protected |
Enables blending (and sets blendfunc) if m_color alpha component < 1 else disables blending (applies only if changing blend state is allowed, see setChangeBlendState())
References m_color, and m_dontChangeBlendState.
Referenced by apply().
|
inline |
Allow/Forbid changing the blend state (by default changing blend state is forbidden)
References m_dontChangeBlendState.
| void ChangeColorVisitor::setColor | ( | osg::Vec4 | color | ) |
Set RGBA color.
| void ChangeColorVisitor::setColor | ( | osg::Vec3 | color | ) |
Only set RGB and keep current alpha value.
|
protected |
Referenced by apply(), and changeOnlyAlpha().
|
protected |
Referenced by apply(), setAlpha(), and setBlendState().
|
protected |
Referenced by setBlendState(), and setChangeBlendState().
|
protected |
Referenced by apply(), getNumberOfChangedDrawables(), and reset().
1.8.6