Home Hierarchy Members Alphabetical Related Pages

timesensor.h

Go to the documentation of this file.
00001 #ifndef XDKWRL_TIMESENSOR_H
00002 #define XDKWRL_TIMESENSOR_H
00003 
00004 #include <xdkwrl/node.h>
00005 #include <xdkwrl/fieldtypes/sfbool.h>
00006 #include <xdkwrl/fieldtypes/sffloat.h>
00007 #include <xdkwrl/fieldtypes/sftime.h>
00008 
00009 namespace wrl
00010 {
00011   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00012   // Interface of TimeSensor
00013   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00014   class TimeSensor : public Node
00015   {
00016    public:
00017      TimeSensor(const char* name="");
00018      virtual ~TimeSensor();
00019      virtual inline unsigned int nbFields() const;
00020      virtual FieldHandle field(const std::string& n);
00021      virtual FieldHandle field(const unsigned int i);
00022      virtual bool isSetToDefaultValue(const unsigned int i) const;
00023      virtual inline unsigned int nbEventsIn() const;
00024      virtual EventInHandle eventIn(const std::string& n);
00025      virtual EventInHandle eventIn(const unsigned int i);
00026      virtual inline unsigned int nbEventsOut() const;
00027      virtual EventOutHandle eventOut(const std::string& n);
00028      virtual EventOutHandle eventOut(const 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        cycleInterval.setNbSeconds(1);
00044        \endcode
00045        */
00046        SFTime     cycleInterval;
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        enabled = true;
00053        \endcode
00054        */
00055        SFBool     enabled;
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        loop = false;
00062        \endcode
00063        */
00064        SFBool     loop;
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        startTime.setNbSeconds(0);
00071        \endcode
00072        */
00073        SFTime     startTime;
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        stopTime.setNbSeconds(0);
00080        \endcode
00081        */
00082        SFTime     stopTime;
00083      //!@}
00084      /*!@name Fields
00085       * A property or attribute of a node. Each node type has a fixed set
00086       * of fields. Fields may contain various kinds of data and one or many
00087       * values. Each field has a default value.
00088       */
00089       //!@{
00090      //!@}
00091      /*!@name Events In
00092       * 
00093       */
00094       //!@{
00095       /*!
00096        * Set event associated to exposedField cycleInterval
00097        */
00098        EventIn<SFTime>     set_cycleInterval;
00099       /*!
00100        * Set event associated to exposedField enabled
00101        */
00102        EventIn<SFBool>     set_enabled;
00103       /*!
00104        * Set event associated to exposedField loop
00105        */
00106        EventIn<SFBool>     set_loop;
00107       /*!
00108        * Set event associated to exposedField startTime
00109        */
00110        EventIn<SFTime>     set_startTime;
00111       /*!
00112        * Set event associated to exposedField stopTime
00113        */
00114        EventIn<SFTime>     set_stopTime;
00115   //!@}
00116      /*!@name Events Out
00117       * 
00118       */
00119       //!@{
00120       /*!
00121        * See <a href="#_details" class="md">Detailed Description</a>
00122        * for meaning of this event.
00123        */
00124        EventOut<SFTime>     cycleTime;
00125       /*!
00126        * See <a href="#_details" class="md">Detailed Description</a>
00127        * for meaning of this event.
00128        */
00129        EventOut<SFFloat>    fraction_changed;
00130       /*!
00131        * See <a href="#_details" class="md">Detailed Description</a>
00132        * for meaning of this event.
00133        */
00134        EventOut<SFBool>     isActive;
00135       /*!
00136        * See <a href="#_details" class="md">Detailed Description</a>
00137        * for meaning of this event.
00138        */
00139        EventOut<SFTime>     time;
00140       /*!
00141        * Changed event associated to exposedField cycleInterval
00142        */
00143        EventOut<SFTime>     cycleInterval_changed;
00144       /*!
00145        * Changed event associated to exposedField enabled
00146        */
00147        EventOut<SFBool>     enabled_changed;
00148       /*!
00149        * Changed event associated to exposedField loop
00150        */
00151        EventOut<SFBool>     loop_changed;
00152       /*!
00153        * Changed event associated to exposedField startTime
00154        */
00155        EventOut<SFTime>     startTime_changed;
00156       /*!
00157        * Changed event associated to exposedField stopTime
00158        */
00159        EventOut<SFTime>     stopTime_changed;
00160   //!@}
00161   };
00162 };
00163 //************************************************************
00164 // Implementation of TimeSensor
00165 //************************************************************
00166 /*!
00167  * Returns <code>"TimeSensor"</code>. Useful for printing.
00168  */
00169 inline const char*
00170 wrl::TimeSensor::typeName() const
00171 {
00172   return "TimeSensor";
00173 }
00174 /*!
00175  * Returns the number of fields (exposed or not) for this node type.
00176  */
00177 inline unsigned int
00178 wrl::TimeSensor::nbFields() const
00179 {
00180    return 5;
00181 }
00182 /*!
00183  * Returns the number of events in for this node type.
00184  */
00185 inline unsigned int
00186 wrl::TimeSensor::nbEventsIn() const
00187 {
00188    return 0;
00189 }
00190 /*!
00191  * Returns the number of events out for this node type.
00192  */
00193 inline unsigned int
00194 wrl::TimeSensor::nbEventsOut() const
00195 {
00196    return 4;
00197 }
00198 #endif // XDKWRL_TIMESENSOR_H
00199 
00200 // Local variables section.
00201 // This is only used by emacs!
00202 // Local Variables:
00203 // ff-search-directories: ("../../" "../../../src/xdkwrl/nodes")
00204 // End:

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