XdkWrl: spotlight.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# spotlight.h

Go to the documentation of this file.

    00001 #ifndef XDKWRL_SPOTLIGHT_H
    00002 #define XDKWRL_SPOTLIGHT_H
    00003
    00004 #include <xdkwrl/config.h>
    00005 #include <xdkwrl/node.h>
    00006 #include <xdkwrl/fieldtypes/sfbool.h>
    00007 #include <xdkwrl/fieldtypes/sfcolor.h>
    00008 #include <xdkwrl/fieldtypes/sffloat.h>
    00009 #include <xdkwrl/fieldtypes/sfvec3f.h>
    00010
    00011 namespace wrl
    00012 {
    00013   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00014   // Interface of SpotLight
    00015   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00016   class XDKWRL_EXPORT SpotLight : public Node
    00017   {
    00018    public:
    00019      SpotLight(const char* name="");
    00020      virtual ~SpotLight();
    00021      virtual inline unsigned int nbFields() const;
    00022      virtual FieldHandle field(const std::string& n);
    00023      virtual FieldHandle field(unsigned int i);
    00024      virtual bool isSetToDefaultValue(unsigned int i) const;
    00025      virtual inline unsigned int nbEventsIn() const;
    00026      virtual EventInHandle eventIn(const std::string& n);
    00027      virtual EventInHandle eventIn(unsigned int i);
    00028      virtual inline unsigned int nbEventsOut() const;
    00029      virtual EventOutHandle eventOut(const std::string& n);
    00030      virtual EventOutHandle eventOut(unsigned int i);
    00031      inline const char* typeName() const;
    00032      virtual Node* duplicate() const;
    00033      virtual Node* duplicate(std::map<const Node*,Node*>&) const;
    00034      /*!@name Exposed Fields
    00035       * A field that is capable of receiving events via an eventIn to
    00036       * change its value(s), and generating events via an eventOut
    00037       * when its value(s) change.
    00038       */
    00039       //!@{
    00040       /*!
    00041        * See <a href="#_details" class="md">Detailed Description</a>
    00042        * for meaning of this field.
    00043        * Default value is set to
    00044        \code
    00045        ambientIntensity = 0.0f;
    00046        \endcode
    00047        */
    00048        SFFloat    ambientIntensity;
    00049       /*!
    00050        * See <a href="#_details" class="md">Detailed Description</a>
    00051        * for meaning of this field.
    00052        * Default value is set to
    00053        \code
    00054        attenuation.setXYZ(1,0,0);
    00055        \endcode
    00056        */
    00057        SFVec3f    attenuation;
    00058       /*!
    00059        * See <a href="#_details" class="md">Detailed Description</a>
    00060        * for meaning of this field.
    00061        * Default value is set to
    00062        \code
    00063        beamWidth = 1.5708f;
    00064        \endcode
    00065        */
    00066        SFFloat    beamWidth;
    00067       /*!
    00068        * See <a href="#_details" class="md">Detailed Description</a>
    00069        * for meaning of this field.
    00070        * Default value is set to
    00071        \code
    00072        color.setRGB(1,1,1);
    00073        \endcode
    00074        */
    00075        SFColor    color;
    00076       /*!
    00077        * See <a href="#_details" class="md">Detailed Description</a>
    00078        * for meaning of this field.
    00079        * Default value is set to
    00080        \code
    00081        cutOffAngle = 0.785398f;
    00082        \endcode
    00083        */
    00084        SFFloat    cutOffAngle;
    00085       /*!
    00086        * See <a href="#_details" class="md">Detailed Description</a>
    00087        * for meaning of this field.
    00088        * Default value is set to
    00089        \code
    00090        direction.setXYZ(0,0,-1);
    00091        \endcode
    00092        */
    00093        SFVec3f    direction;
    00094       /*!
    00095        * See <a href="#_details" class="md">Detailed Description</a>
    00096        * for meaning of this field.
    00097        * Default value is set to
    00098        \code
    00099        intensity = 1.0f;
    00100        \endcode
    00101        */
    00102        SFFloat    intensity;
    00103       /*!
    00104        * See <a href="#_details" class="md">Detailed Description</a>
    00105        * for meaning of this field.
    00106        * Default value is set to
    00107        \code
    00108        location.setXYZ(0,0,0);
    00109        \endcode
    00110        */
    00111        SFVec3f    location;
    00112       /*!
    00113        * See <a href="#_details" class="md">Detailed Description</a>
    00114        * for meaning of this field.
    00115        * Default value is set to
    00116        \code
    00117        on = true;
    00118        \endcode
    00119        */
    00120        SFBool     on;
    00121       /*!
    00122        * See <a href="#_details" class="md">Detailed Description</a>
    00123        * for meaning of this field.
    00124        * Default value is set to
    00125        \code
    00126        radius = 100.0f;
    00127        \endcode
    00128        */
    00129        SFFloat    radius;
    00130      //!@}
    00131      /*!@name Fields
    00132       * A property or attribute of a node. Each node type has a fixed set
    00133       * of fields. Fields may contain various kinds of data and one or many
    00134       * values. Each field has a default value.
    00135       */
    00136       //!@{
    00137      //!@}
    00138      /*!@name Events In
    00139       *
    00140       */
    00141       //!@{
    00142       /*!
    00143        * Set event associated to exposedField ambientIntensity
    00144        */
    00145        EventIn<SFFloat>    set_ambientIntensity;
    00146       /*!
    00147        * Set event associated to exposedField attenuation
    00148        */
    00149        EventIn<SFVec3f>    set_attenuation;
    00150       /*!
    00151        * Set event associated to exposedField beamWidth
    00152        */
    00153        EventIn<SFFloat>    set_beamWidth;
    00154       /*!
    00155        * Set event associated to exposedField color
    00156        */
    00157        EventIn<SFColor>    set_color;
    00158       /*!
    00159        * Set event associated to exposedField cutOffAngle
    00160        */
    00161        EventIn<SFFloat>    set_cutOffAngle;
    00162       /*!
    00163        * Set event associated to exposedField direction
    00164        */
    00165        EventIn<SFVec3f>    set_direction;
    00166       /*!
    00167        * Set event associated to exposedField intensity
    00168        */
    00169        EventIn<SFFloat>    set_intensity;
    00170       /*!
    00171        * Set event associated to exposedField location
    00172        */
    00173        EventIn<SFVec3f>    set_location;
    00174       /*!
    00175        * Set event associated to exposedField on
    00176        */
    00177        EventIn<SFBool>     set_on;
    00178       /*!
    00179        * Set event associated to exposedField radius
    00180        */
    00181        EventIn<SFFloat>    set_radius;
    00182   //!@}
    00183      /*!@name Events Out
    00184       *
    00185       */
    00186       //!@{
    00187       /*!
    00188        * Changed event associated to exposedField ambientIntensity
    00189        */
    00190        EventOut<SFFloat>    ambientIntensity_changed;
    00191       /*!
    00192        * Changed event associated to exposedField attenuation
    00193        */
    00194        EventOut<SFVec3f>    attenuation_changed;
    00195       /*!
    00196        * Changed event associated to exposedField beamWidth
    00197        */
    00198        EventOut<SFFloat>    beamWidth_changed;
    00199       /*!
    00200        * Changed event associated to exposedField color
    00201        */
    00202        EventOut<SFColor>    color_changed;
    00203       /*!
    00204        * Changed event associated to exposedField cutOffAngle
    00205        */
    00206        EventOut<SFFloat>    cutOffAngle_changed;
    00207       /*!
    00208        * Changed event associated to exposedField direction
    00209        */
    00210        EventOut<SFVec3f>    direction_changed;
    00211       /*!
    00212        * Changed event associated to exposedField intensity
    00213        */
    00214        EventOut<SFFloat>    intensity_changed;
    00215       /*!
    00216        * Changed event associated to exposedField location
    00217        */
    00218        EventOut<SFVec3f>    location_changed;
    00219       /*!
    00220        * Changed event associated to exposedField on
    00221        */
    00222        EventOut<SFBool>     on_changed;
    00223       /*!
    00224        * Changed event associated to exposedField radius
    00225        */
    00226        EventOut<SFFloat>    radius_changed;
    00227   //!@}
    00228   };
    00229 };
    00230 //************************************************************
    00231 // Implementation of SpotLight
    00232 //************************************************************
    00233 /*!
    00234  * Returns <code>"SpotLight"</code>. Useful for printing.
    00235  */
    00236 inline const char*
    00237 wrl::SpotLight::typeName() const
    00238 {
    00239   return "SpotLight";
    00240 }
    00241 /*!
    00242  * Returns the number of fields (exposed or not) for this node type.
    00243  */
    00244 inline unsigned int
    00245 wrl::SpotLight::nbFields() const
    00246 {
    00247    return 10;
    00248 }
    00249 /*!
    00250  * Returns the number of events in for this node type.
    00251  */
    00252 inline unsigned int
    00253 wrl::SpotLight::nbEventsIn() const
    00254 {
    00255    return 0;
    00256 }
    00257 /*!
    00258  * Returns the number of events out for this node type.
    00259  */
    00260 inline unsigned int
    00261 wrl::SpotLight::nbEventsOut() const
    00262 {
    00263    return 0;
    00264 }
    00265 #endif // XDKWRL_SPOTLIGHT_H
    00266
    00267 // Local variables section.
    00268 // This is only used by emacs!
    00269 // Local Variables:
    00270 // ff-search-directories: ("../../" "../../../src/xdkwrl/nodes")
    00271 // End:

Generated on 5 Jan 2007 with version 1.5.1. |