Home Hierarchy Members Alphabetical Related Pages

material.h

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

Generated on 24 Feb 2005 with doxygen version 1.3.9.1. Valid HTML 4.0! Valid CSS!