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