osgFX::Effect Class Reference

Inheritance diagram for osgFX::Effect:

osg::Group osg::Node osg::Object osg::Referenced osgFX::AnisotropicLighting osgFX::BumpMapping osgFX::Cartoon osgFX::Scribe osgFX::SpecularHighlights List of all members.

Public Types

 AUTO_DETECT = -1
enum  TechniqueSelection { AUTO_DETECT = -1 }

Public Member Functions

 Effect ()
 Effect (const Effect &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual bool isSameKindAs (const osg::Object *obj) const
virtual const char * libraryName () const
virtual const char * className () const
virtual const char * effectName () const =0
virtual const char * effectDescription () const =0
virtual const char * effectAuthor () const =0
bool getEnabled () const
void setEnabled (bool v)
virtual void setUpDemo ()
int getNumTechniques () const
TechniquegetTechnique (int i)
const TechniquegetTechnique (int i) const
int getSelectedTechnique () const
void selectTechnique (int i=AUTO_DETECT)
virtual void traverse (osg::NodeVisitor &nv)
void inherited_traverse (osg::NodeVisitor &nv)

Protected Member Functions

virtual ~Effect ()
Effectoperator= (const Effect &)
void dirtyTechniques ()
void addTechnique (Technique *tech)
virtual bool define_techniques ()=0

Friends

class Validator

Detailed Description

The base class for special effects. An effect is basically a collection of state attributes and an interface for configuring them in a predefined fashion. The Effect class does more however, as it handles multipass rendering transparently and it allows more than one "technique" to be defined. Each technique tries to implement the effect in a different way, often using different OpenGL extensions. The active technique can be selected either manually, with selectTechnique(), or automatically, in which case the first technique that is supported by all active rendering contexts is chosen. If you are an Effect user, then simply use it as a node group. Create an instance of your desired effect, add it to your scene graph and call its addChild() method to add a child node as you would do with a Group. If you are an Effect developer, you will have to implement the method define_techniques() to define the different techniques that can be used for obtaining the desired effect. In define_techniques() you will usually create one or more instances of custom classes derived from Technique and you will add them to the effect with addTechnique(). The order is important: techniques added first will have higher priority and will be used first as soon as all rendering contexts support it.


Member Enumeration Documentation

enum osgFX::Effect::TechniqueSelection

Enumerator:
AUTO_DETECT 


Constructor & Destructor Documentation

osgFX::Effect::Effect (  ) 

osgFX::Effect::Effect ( const Effect copy,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)

virtual osgFX::Effect::~Effect (  )  [protected, virtual]


Member Function Documentation

void osgFX::Effect::addTechnique ( Technique tech  )  [inline, protected]

add a technique to the Effect

virtual const char* osgFX::Effect::className (  )  const [inline, virtual]

return the name of the node's class type.

Reimplemented from osg::Node.

virtual bool osgFX::Effect::define_techniques (  )  [protected, pure virtual]

abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect. You will usually call addTechnique() inside this method.

Implemented in osgFX::AnisotropicLighting, osgFX::BumpMapping, osgFX::Cartoon, osgFX::Scribe, and osgFX::SpecularHighlights.

void osgFX::Effect::dirtyTechniques (  )  [inline, protected]

force rebuilding of techniques on next traversal

virtual const char* osgFX::Effect::effectAuthor (  )  const [pure virtual]

get the effect author's name

virtual const char* osgFX::Effect::effectDescription (  )  const [pure virtual]

get a brief description of this Effect

virtual const char* osgFX::Effect::effectName (  )  const [pure virtual]

get the name of this Effect

bool osgFX::Effect::getEnabled (  )  const [inline]

get whether the effect is enabled or not

int osgFX::Effect::getNumTechniques (  )  const [inline]

get the number of techniques defined for this Effect

int osgFX::Effect::getSelectedTechnique (  )  const [inline]

get the index of the currently selected Technique

const Technique * osgFX::Effect::getTechnique ( int  i  )  const [inline]

get the i-th const Technique

Technique * osgFX::Effect::getTechnique ( int  i  )  [inline]

get the i-th Technique

void osgFX::Effect::inherited_traverse ( osg::NodeVisitor nv  )  [inline]

default traversal

virtual bool osgFX::Effect::isSameKindAs ( const osg::Object obj  )  const [inline, virtual]

return true if this and obj are of the same kind of object.

Reimplemented from osg::Node.

virtual const char* osgFX::Effect::libraryName (  )  const [inline, virtual]

return the name of the node's library.

Reimplemented from osg::Node.

Effect& osgFX::Effect::operator= ( const Effect  )  [inline, protected]

void osgFX::Effect::selectTechnique ( int  i = AUTO_DETECT  )  [inline]

select a technique or enable automatic detection

void osgFX::Effect::setEnabled ( bool  v  )  [inline]

set whether the effect is enabled or not

virtual void osgFX::Effect::setUpDemo (  )  [inline, virtual]

optional: set effect parameters to produce a visually significant result to be used in demo applications like osgfxbrowser. Default is to do nothing.

Reimplemented in osgFX::BumpMapping.

virtual void osgFX::Effect::traverse ( osg::NodeVisitor nv  )  [virtual]

custom traversal

Reimplemented from osg::Group.


Friends And Related Function Documentation

friend class Validator [friend]


The documentation for this class was generated from the following file:
Generated on Sun Oct 1 13:17:09 2006 for openscenegraph by  doxygen 1.4.7