version 3.3

VRS::ColorLinearEffect Class Reference

Provides a straight forward way to get smooth color or alpha transitions for any shape affected by the ColorAttribute passed to this class. More...

#include <vrs/sg/colorlineareffect.h>

Inheritance diagram for VRS::ColorLinearEffect:

VRS::LeafBehavior VRS::BehaviorNode VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  Mode { AUTO_REVERSE_EFFECT = 0x0001, MANUAL_REVERSE_EFFECT = 0x0002 }
 Constructor to fade back and forth between two colors. More...

Public Member Functions

 ColorLinearEffect ()
 ColorLinearEffect (SO< ColorAttribute > fxAttribute, const Color &fxEndColor, Mode mode=AUTO_REVERSE_EFFECT)
 ColorLinearEffect (SO< ColorAttribute > fxAttribute, double alpha, Mode mode=AUTO_REVERSE_EFFECT)
 Constructor to only change the alpha value.
 ColorLinearEffect (SO< ColorAttribute > fxAttribute, Mode mode=AUTO_REVERSE_EFFECT)
 Minimum constructor.
virtual void activate (int hint=BehaviorNode::NoHint)
virtual void deactivate (int)
virtual
BehaviorNode::InvalidationHint 
handle (Event *)
void reverseEffect ()
 Will switch start and end color / alpha values, so the next call to the effect will actually reverse it. Call only when mode is set to MANUAL_REVERSE_EFFECT.
Color getEndColor () const
void setEndColor (const Color &fxEndColor)
double getEndAlpha () const
void setEndAlpha (double endAlpha)
Color getStartColor () const
void setStartColor (const Color &fxStartColor)
double getStartAlpha () const
void setStartAlpha (double alpha)
SO< ColorAttributegetColorAttribute () const
void setColorAttribute (SO< ColorAttribute > val)
 VRS_TYPEINFO (ColorLinearEffect, LeafBehavior)
 VRS_SERIALIZABLE (ColorLinearEffect)


Detailed Description

Provides a straight forward way to get smooth color or alpha transitions for any shape affected by the ColorAttribute passed to this class.


Member Enumeration Documentation

Constructor to fade back and forth between two colors.

Parameters:
fxAttribute The ColorAttribute affected by the effect. All shapes belonging to this attribute will be changed accordingly
fxEndColor The color the transition will end with. The start color is taken from the fxAttribute
mode AUTO_REVERSE_EFFECT means that after the transition is finished start and end color are switched, so the next call of the effect will reverse it
Enumerator:
AUTO_REVERSE_EFFECT 
MANUAL_REVERSE_EFFECT 


Constructor & Destructor Documentation

VRS::ColorLinearEffect::ColorLinearEffect (  ) 

VRS::ColorLinearEffect::ColorLinearEffect ( SO< ColorAttribute fxAttribute,
const Color fxEndColor,
Mode  mode = AUTO_REVERSE_EFFECT 
)

VRS::ColorLinearEffect::ColorLinearEffect ( SO< ColorAttribute fxAttribute,
double  alpha,
Mode  mode = AUTO_REVERSE_EFFECT 
)

Constructor to only change the alpha value.

Parameters:
fxAttribute The ColorAttribute affected by the effect. All shapes belonging to this attribute will be changed accordingly
alpha The alpha value the transition will end with. The start alpha value is taken from the fxAttribute
mode AUTO_REVERSE_EFFECT means that after the transition is finished start and end color are switched, so the next call of the effect will reverse it

VRS::ColorLinearEffect::ColorLinearEffect ( SO< ColorAttribute fxAttribute,
Mode  mode = AUTO_REVERSE_EFFECT 
)

Minimum constructor.

Easy for fading in/out the shapes affected by the fxAttribute:
Depending on the alpha value of the fxAttribute 0 (1 respectively) the transition will change
the alpha value to 1 (0 respectively)

Parameters:
fxAttribute The ColorAttribute affected by the effect. All shapes belonging to this attribute will be changed accordingly
mode AUTO_REVERSE_EFFECT means that after the transition is finished start and end color are switched, so the next call of the effect will reverse it


Member Function Documentation

virtual void VRS::ColorLinearEffect::activate ( int  hint = BehaviorNode::NoHint  )  [virtual]

Reimplemented from VRS::BehaviorNode.

virtual void VRS::ColorLinearEffect::deactivate ( int   )  [virtual]

Reimplemented from VRS::BehaviorNode.

virtual BehaviorNode::InvalidationHint VRS::ColorLinearEffect::handle ( Event event  )  [virtual]

'handle' receives and possibly propagates events. A behavior node returns an invalidation hint, indicating whether the associated canvas (if any) or the whole world (that is, all canvases) needs to be redrawn.

Implements VRS::BehaviorNode.

void VRS::ColorLinearEffect::reverseEffect (  ) 

Will switch start and end color / alpha values, so the next call to the effect will actually reverse it. Call only when mode is set to MANUAL_REVERSE_EFFECT.

Color VRS::ColorLinearEffect::getEndColor (  )  const

void VRS::ColorLinearEffect::setEndColor ( const Color fxEndColor  ) 

double VRS::ColorLinearEffect::getEndAlpha (  )  const

void VRS::ColorLinearEffect::setEndAlpha ( double  endAlpha  ) 

Color VRS::ColorLinearEffect::getStartColor (  )  const

void VRS::ColorLinearEffect::setStartColor ( const Color fxStartColor  ) 

double VRS::ColorLinearEffect::getStartAlpha (  )  const

void VRS::ColorLinearEffect::setStartAlpha ( double  alpha  ) 

SO<ColorAttribute> VRS::ColorLinearEffect::getColorAttribute (  )  const [inline]

void VRS::ColorLinearEffect::setColorAttribute ( SO< ColorAttribute val  )  [inline]

VRS::ColorLinearEffect::VRS_TYPEINFO ( ColorLinearEffect  ,
LeafBehavior   
)

VRS::ColorLinearEffect::VRS_SERIALIZABLE ( ColorLinearEffect   ) 


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

Generated on Mon May 21 06:00:25 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact