00001 /* -*- C++ -*- */ 00002 00003 /* COPYRIGHT 00004 * 00005 * This file is part of the Visual Effects Engine - VEE 00006 * 00007 * Read the "VEE-LICENSE" file for the license. 00008 * 00009 * Authors & Copyright: 00010 * 00011 * Tommi Ilmonen, Tuukka Heikura, Marko Myllymaa and 00012 * Janne Kontkanen 2001-2004 00013 * 00014 * Additional copyrights: Tekes 2003-2004 00015 * 00016 * firstname.lastname@hut.fi 00017 * 00018 */ 00019 00020 #ifndef VEE_VALUES_H 00021 #define VEE_VALUES_H 00022 00023 #include <vee_looks.h> 00024 #include <vee_value_ptr.h> 00025 00026 #include <vee_matrix3.h> 00027 00028 class VEE_Looks; 00029 class VEE_Volume; 00030 00032 class VEE_ValueFloat : public VEE_Value 00033 { 00034 public: 00035 VEE_ValueFloat(float v = 0) : m_val(v) {} 00036 virtual ~VEE_ValueFloat() {} 00037 00038 virtual VEE_Value * clone() const; 00039 virtual bool setValue(const char *, VEE_Value *); 00040 00041 virtual bool getFloat(float *); 00042 virtual bool getInt(int *); 00043 00044 virtual void setValue2(float v) { m_val = v; } 00045 float getValue() const { return m_val; } 00046 protected: 00047 float m_val; 00048 }; 00049 00052 00054 class VEE_ValueInt : public VEE_Value 00055 { 00056 public: 00057 VEE_ValueInt(int v = 0) : m_val(v) {} 00058 virtual ~VEE_ValueInt() {} 00059 00060 virtual VEE_Value * clone() const; 00061 virtual bool setValue(const char *, VEE_Value *); 00062 00063 virtual bool getFloat(float *); 00064 virtual bool getInt(int *); 00065 00066 virtual void setValue2(int v) { m_val = v; } 00067 int getValue() const { return m_val; } 00068 protected: 00069 int m_val; 00070 }; 00071 00074 00075 class VEE_ValueVector3 : public VEE_Value 00076 { 00077 public: 00078 VEE_ValueVector3(float x, float y, float z) { m_val.make(x, y, z); } 00079 VEE_ValueVector3(const VEE_Vector3 &v = VEE_Vector3ZERO) : m_val(v) {} 00080 virtual ~VEE_ValueVector3() {} 00081 00082 virtual VEE_Value * clone() const; 00083 virtual bool setValue(const char *, VEE_Value *); 00084 00085 virtual bool getVector3(VEE_Vector3 *); 00086 00087 void setValue2(const VEE_Vector3 &v) { m_val = v; } 00088 const VEE_Vector3 & getValue() const { return m_val; } 00089 protected: 00090 VEE_Vector3 m_val; 00091 }; 00092 00095 00096 class VEE_ValueMatrix3 : public VEE_Value 00097 { 00098 public: 00099 VEE_ValueMatrix3(const VEE_Matrix3 &v = VEE_Matrix3IDENTITY) 00100 : m_val(v) {} 00101 virtual ~VEE_ValueMatrix3() {} 00102 00103 virtual VEE_Value * clone() const; 00104 virtual bool setValue(const char *, VEE_Value *); 00105 00106 virtual bool getMatrix3(VEE_Matrix3 *); 00107 00108 void setValue2(const VEE_Matrix3 &v) { m_val = v; } 00109 const VEE_Matrix3 & getValue() const { return m_val; } 00110 00111 protected: 00112 VEE_Matrix3 m_val; 00113 }; 00114 00117 00118 class VEE_ValueRgba : public VEE_Value 00119 { 00120 public: 00121 VEE_ValueRgba() : m_color(VEE_Rgba::White) {} 00122 VEE_ValueRgba(const VEE_Rgba &color) : m_color(color) {} 00123 virtual ~VEE_ValueRgba() {} 00124 00125 virtual VEE_Value * clone() const; 00126 virtual bool getVector3(VEE_Vector3 *); 00127 00128 void setValue2(const VEE_Rgba &color) { m_color = color; } 00129 const VEE_Rgba & getValue() const { return m_color; } 00130 00131 protected: 00132 VEE_Rgba m_color; 00133 }; 00134 00137 00138 class VEE_ValueLooks : public VEE_Value 00139 { 00140 public: 00141 VEE_ValueLooks() : m_looks(0) {} 00142 virtual ~VEE_ValueLooks(); 00143 00144 virtual VEE_Value * clone() const; 00145 00146 VEE_Looks *looks() { return m_looks.ptr(); } 00147 00148 void setLooks(VEE_Looks *); 00149 00150 protected: 00151 VEE_ClonablePointer<VEE_Looks> m_looks; 00152 }; 00153 00156 00157 typedef VEE_ValuePtr<VEE_Volume> VEE_ValueVolume; 00158 00159 00160 #endif