vee_has_variables.h

Go to the documentation of this file.
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_HAS_VARIABLES_H
00021 #define VEE_HAS_VARIABLES_H
00022 
00023 #include <vee_variable.h>
00024 
00025 class VEE_HasVariables
00026 {
00027 public:
00028   VEE_HasVariables() {}
00029   virtual ~VEE_HasVariables() {}
00030 
00031   virtual VEE_Variable getVariable(const char *) const;
00032 
00033   inline float getVariableFloat(const char *, float def = 0.0) const;
00034   inline int   getVariableInt(const char *, int def = 0.0) const;
00035   inline VEE_Rgba getVariableRgba(const char *, const VEE_Rgba & def = VEE_Rgba::White) const;
00036   inline VEE_Vector3 getVariableVector3(const char *, const VEE_Vector3 & def = VEE_Vector3ZERO) const;
00037   inline VEE_Matrix3 getVariableMatrix3(const char *, const VEE_Matrix3 & def = VEE_Matrix3IDENTITY) const;
00038 
00039 };
00040 
00041 
00043 float VEE_HasVariables::getVariableFloat(const char *id, float def) const
00044 {
00045   VEE_Variable v = getVariable(id);
00046   return v.getFloat(def);
00047 }
00048 
00050 int VEE_HasVariables::getVariableInt(const char *id, int def) const
00051 {
00052   VEE_Variable v = getVariable(id);
00053   return v.getInt(def);
00054 }
00055 
00057 VEE_Rgba VEE_HasVariables::getVariableRgba
00058 (const char *id, const VEE_Rgba & def) const
00059 {
00060   VEE_Variable v = getVariable(id);
00061   return v.getRgba(def);
00062 }
00063 
00065 VEE_Vector3 VEE_HasVariables::getVariableVector3
00066 (const char *id, const VEE_Vector3 & def) const
00067 {
00068   VEE_Variable v = getVariable(id);
00069   return v.getVector3(def);
00070 }
00071 
00073 VEE_Matrix3 VEE_HasVariables::getVariableMatrix3
00074 (const char *id, const VEE_Matrix3 & def) const
00075 {
00076   VEE_Variable v = getVariable(id);
00077   return v.getMatrix3(def);
00078 }
00079 
00080 #endif

Generated on Mon Mar 12 21:09:00 2007 for VEE - The Visual Effects Engine by  doxygen 1.4.6