Home | Hierarchy | Members | Alphabetical | Related Pages |
00001 #ifndef XDKWRL_MATERIAL_H 00002 #define XDKWRL_MATERIAL_H 00003 00004 #include <xdkwrl/config.h> 00005 #include <xdkwrl/node.h> 00006 #include <xdkwrl/fieldtypes/sfcolor.h> 00007 #include <xdkwrl/fieldtypes/sffloat.h> 00008 00009 namespace wrl 00010 { 00011 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00012 // Interface of Material 00013 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00014 class XDKWRL_EXPORT Material : public Node 00015 { 00016 public: 00017 Material(const char* name=""); 00018 virtual ~Material(); 00019 virtual inline unsigned int nbFields() const; 00020 virtual FieldHandle field(const std::string& n); 00021 virtual FieldHandle field(unsigned int i); 00022 virtual bool isSetToDefaultValue(unsigned int i) const; 00023 virtual inline unsigned int nbEventsIn() const; 00024 virtual EventInHandle eventIn(const std::string& n); 00025 virtual EventInHandle eventIn(unsigned int i); 00026 virtual inline unsigned int nbEventsOut() const; 00027 virtual EventOutHandle eventOut(const std::string& n); 00028 virtual EventOutHandle eventOut(unsigned int i); 00029 inline const char* typeName() const; 00030 virtual Node* duplicate() const; 00031 virtual Node* duplicate(std::map<const Node*,Node*>&) const; 00032 /*!@name Exposed Fields 00033 * A field that is capable of receiving events via an eventIn to 00034 * change its value(s), and generating events via an eventOut 00035 * when its value(s) change. 00036 */ 00037 //!@{ 00038 /*! 00039 * See <a href="#_details" class="md">Detailed Description</a> 00040 * for meaning of this field. 00041 * Default value is set to 00042 \code 00043 ambientIntensity = 0.2f; 00044 \endcode 00045 */ 00046 SFFloat ambientIntensity; 00047 /*! 00048 * See <a href="#_details" class="md">Detailed Description</a> 00049 * for meaning of this field. 00050 * Default value is set to 00051 \code 00052 diffuseColor.setRGB(0.8,0.8,0.8); 00053 \endcode 00054 */ 00055 SFColor diffuseColor; 00056 /*! 00057 * See <a href="#_details" class="md">Detailed Description</a> 00058 * for meaning of this field. 00059 * Default value is set to 00060 \code 00061 emissiveColor.setRGB(0,0,0); 00062 \endcode 00063 */ 00064 SFColor emissiveColor; 00065 /*! 00066 * See <a href="#_details" class="md">Detailed Description</a> 00067 * for meaning of this field. 00068 * Default value is set to 00069 \code 00070 shininess = 0.2f; 00071 \endcode 00072 */ 00073 SFFloat shininess; 00074 /*! 00075 * See <a href="#_details" class="md">Detailed Description</a> 00076 * for meaning of this field. 00077 * Default value is set to 00078 \code 00079 specularColor.setRGB(0,0,0); 00080 \endcode 00081 */ 00082 SFColor specularColor; 00083 /*! 00084 * See <a href="#_details" class="md">Detailed Description</a> 00085 * for meaning of this field. 00086 * Default value is set to 00087 \code 00088 transparency = 0.0f; 00089 \endcode 00090 */ 00091 SFFloat transparency; 00092 //!@} 00093 /*!@name Fields 00094 * A property or attribute of a node. Each node type has a fixed set 00095 * of fields. Fields may contain various kinds of data and one or many 00096 * values. Each field has a default value. 00097 */ 00098 //!@{ 00099 //!@} 00100 /*!@name Events In 00101 * 00102 */ 00103 //!@{ 00104 /*! 00105 * Set event associated to exposedField ambientIntensity 00106 */ 00107 EventIn<SFFloat> set_ambientIntensity; 00108 /*! 00109 * Set event associated to exposedField diffuseColor 00110 */ 00111 EventIn<SFColor> set_diffuseColor; 00112 /*! 00113 * Set event associated to exposedField emissiveColor 00114 */ 00115 EventIn<SFColor> set_emissiveColor; 00116 /*! 00117 * Set event associated to exposedField shininess 00118 */ 00119 EventIn<SFFloat> set_shininess; 00120 /*! 00121 * Set event associated to exposedField specularColor 00122 */ 00123 EventIn<SFColor> set_specularColor; 00124 /*! 00125 * Set event associated to exposedField transparency 00126 */ 00127 EventIn<SFFloat> set_transparency; 00128 //!@} 00129 /*!@name Events Out 00130 * 00131 */ 00132 //!@{ 00133 /*! 00134 * Changed event associated to exposedField ambientIntensity 00135 */ 00136 EventOut<SFFloat> ambientIntensity_changed; 00137 /*! 00138 * Changed event associated to exposedField diffuseColor 00139 */ 00140 EventOut<SFColor> diffuseColor_changed; 00141 /*! 00142 * Changed event associated to exposedField emissiveColor 00143 */ 00144 EventOut<SFColor> emissiveColor_changed; 00145 /*! 00146 * Changed event associated to exposedField shininess 00147 */ 00148 EventOut<SFFloat> shininess_changed; 00149 /*! 00150 * Changed event associated to exposedField specularColor 00151 */ 00152 EventOut<SFColor> specularColor_changed; 00153 /*! 00154 * Changed event associated to exposedField transparency 00155 */ 00156 EventOut<SFFloat> transparency_changed; 00157 //!@} 00158 }; 00159 }; 00160 //************************************************************ 00161 // Implementation of Material 00162 //************************************************************ 00163 /*! 00164 * Returns <code>"Material"</code>. Useful for printing. 00165 */ 00166 inline const char* 00167 wrl::Material::typeName() const 00168 { 00169 return "Material"; 00170 } 00171 /*! 00172 * Returns the number of fields (exposed or not) for this node type. 00173 */ 00174 inline unsigned int 00175 wrl::Material::nbFields() const 00176 { 00177 return 6; 00178 } 00179 /*! 00180 * Returns the number of events in for this node type. 00181 */ 00182 inline unsigned int 00183 wrl::Material::nbEventsIn() const 00184 { 00185 return 0; 00186 } 00187 /*! 00188 * Returns the number of events out for this node type. 00189 */ 00190 inline unsigned int 00191 wrl::Material::nbEventsOut() const 00192 { 00193 return 0; 00194 } 00195 #endif // XDKWRL_MATERIAL_H 00196 00197 // Local variables section. 00198 // This is only used by emacs! 00199 // Local Variables: 00200 // ff-search-directories: ("../../" "../../../src/xdkwrl/nodes") 00201 // End:
Generated on 5 Jan 2007 with
![]() |
|