| VRS - The Virtual Rendering System |
| version 3.3 |
00001 #ifndef VRS_COLORLINEAREFFECT_H 00002 #define VRS_COLORLINEAREFFECT_H 00003 00004 #include <vrs/sg/leafbehavior.h> 00005 #include <vrs/color.h> 00006 00007 namespace VRS{ 00008 00009 class ColorAttribute; 00010 00012 00016 class VRS_CORE_API ColorLinearEffect : public LeafBehavior { 00017 public: 00018 00019 ColorLinearEffect(); 00021 00026 enum Mode { AUTO_REVERSE_EFFECT = 0x0001, MANUAL_REVERSE_EFFECT = 0x0002 }; 00027 ColorLinearEffect(SO<ColorAttribute> fxAttribute, const Color& fxEndColor, Mode mode = AUTO_REVERSE_EFFECT); 00029 00034 ColorLinearEffect(SO<ColorAttribute> fxAttribute, double alpha, Mode mode = AUTO_REVERSE_EFFECT); 00036 00044 ColorLinearEffect(SO<ColorAttribute> fxAttribute, Mode mode = AUTO_REVERSE_EFFECT); 00045 virtual void activate (int hint = BehaviorNode::NoHint); 00046 virtual void deactivate (int); 00047 00048 virtual BehaviorNode::InvalidationHint handle (Event*); 00050 void reverseEffect(); 00051 Color getEndColor() const; 00052 void setEndColor(const Color& fxEndColor); 00053 double getEndAlpha() const; 00054 void setEndAlpha(double endAlpha); 00055 Color getStartColor() const; 00056 void setStartColor(const Color& fxStartColor); 00057 double getStartAlpha() const; 00058 void setStartAlpha(double alpha); 00059 00060 SO<ColorAttribute> getColorAttribute() const { return attribute_; } 00061 void setColorAttribute(SO<ColorAttribute> val) { attribute_ = val; } 00062 00063 VRS_TYPEINFO(ColorLinearEffect, LeafBehavior); 00064 VRS_SERIALIZABLE(ColorLinearEffect); 00065 00066 private: 00067 SO<ColorAttribute> attribute_; 00068 00069 Color currentColor_; 00070 Color startColor_; 00071 Color endColor_; 00072 int mode_; 00073 void init(SO<ColorAttribute> fxAttribute, Mode mode); 00074 }; 00075 00076 } 00077 00078 #endif