Home Hierarchy Members Alphabetical Related Pages

viewpoint.h

Go to the documentation of this file.
00001 #ifndef XDKWRL_VIEWPOINT_H
00002 #define XDKWRL_VIEWPOINT_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/sfrotation.h>
00009 #include <xdkwrl/fieldtypes/sfstring.h>
00010 #include <xdkwrl/fieldtypes/sftime.h>
00011 #include <xdkwrl/fieldtypes/sfvec3f.h>
00012 
00013 namespace wrl
00014 {
00015   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00016   // Interface of Viewpoint
00017   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00018   class XDKWRL_EXPORT Viewpoint : public Node
00019   {
00020    public:
00021      Viewpoint(const char* name="");
00022      virtual ~Viewpoint();
00023      virtual inline unsigned int nbFields() const;
00024      virtual FieldHandle field(const std::string& n);
00025      virtual FieldHandle field(unsigned int i);
00026      virtual bool isSetToDefaultValue(unsigned int i) const;
00027      virtual inline unsigned int nbEventsIn() const;
00028      virtual EventInHandle eventIn(const std::string& n);
00029      virtual EventInHandle eventIn(unsigned int i);
00030      virtual inline unsigned int nbEventsOut() const;
00031      virtual EventOutHandle eventOut(const std::string& n);
00032      virtual EventOutHandle eventOut(unsigned int i);
00033      inline const char* typeName() const;
00034      virtual Node* duplicate() const;
00035      virtual Node* duplicate(std::map<const Node*,Node*>&) const;
00036      /*!@name Exposed Fields
00037       * A field that is capable of receiving events via an eventIn to 
00038       * change its value(s), and generating events via an eventOut 
00039       * when its value(s) change.
00040       */
00041       //!@{
00042       /*!
00043        * See <a href="#_details" class="md">Detailed Description</a>
00044        * for meaning of this field.
00045        * Default value is set to 
00046        \code
00047        fieldOfView = 0.785398f;
00048        \endcode
00049        */
00050        SFFloat    fieldOfView;
00051       /*!
00052        * See <a href="#_details" class="md">Detailed Description</a>
00053        * for meaning of this field.
00054        * Default value is set to 
00055        \code
00056        jump = true;
00057        \endcode
00058        */
00059        SFBool     jump;
00060       /*!
00061        * See <a href="#_details" class="md">Detailed Description</a>
00062        * for meaning of this field.
00063        * Default value is set to 
00064        \code
00065        orientation.setAxisAndAngle(0,0,1,0);
00066        \endcode
00067        */
00068        SFRotation orientation;
00069       /*!
00070        * See <a href="#_details" class="md">Detailed Description</a>
00071        * for meaning of this field.
00072        * Default value is set to 
00073        \code
00074        position.setXYZ(0,0,10);
00075        \endcode
00076        */
00077        SFVec3f    position;
00078      //!@}
00079      /*!@name Fields
00080       * A property or attribute of a node. Each node type has a fixed set
00081       * of fields. Fields may contain various kinds of data and one or many
00082       * values. Each field has a default value.
00083       */
00084       //!@{
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        description = string("");
00091         \endcode
00092        */
00093        SFString   description;
00094      //!@}
00095      /*!@name Events In
00096       * 
00097       */
00098       //!@{
00099       /*!
00100        * See <a href="#_details" class="md">Detailed Description</a>
00101        * for meaning of this event.
00102        */
00103        EventIn<SFBool>     set_bind;
00104       /*!
00105        * Set event associated to exposedField fieldOfView
00106        */
00107        EventIn<SFFloat>    set_fieldOfView;
00108       /*!
00109        * Set event associated to exposedField jump
00110        */
00111        EventIn<SFBool>     set_jump;
00112       /*!
00113        * Set event associated to exposedField orientation
00114        */
00115        EventIn<SFRotation> set_orientation;
00116       /*!
00117        * Set event associated to exposedField position
00118        */
00119        EventIn<SFVec3f>    set_position;
00120   //!@}
00121      /*!@name Events Out
00122       * 
00123       */
00124       //!@{
00125       /*!
00126        * See <a href="#_details" class="md">Detailed Description</a>
00127        * for meaning of this event.
00128        */
00129        EventOut<SFTime>     bindTime;
00130       /*!
00131        * See <a href="#_details" class="md">Detailed Description</a>
00132        * for meaning of this event.
00133        */
00134        EventOut<SFBool>     isBound;
00135       /*!
00136        * Changed event associated to exposedField fieldOfView
00137        */
00138        EventOut<SFFloat>    fieldOfView_changed;
00139       /*!
00140        * Changed event associated to exposedField jump
00141        */
00142        EventOut<SFBool>     jump_changed;
00143       /*!
00144        * Changed event associated to exposedField orientation
00145        */
00146        EventOut<SFRotation> orientation_changed;
00147       /*!
00148        * Changed event associated to exposedField position
00149        */
00150        EventOut<SFVec3f>    position_changed;
00151   //!@}
00152   };
00153 };
00154 //************************************************************
00155 // Implementation of Viewpoint
00156 //************************************************************
00157 /*!
00158  * Returns <code>"Viewpoint"</code>. Useful for printing.
00159  */
00160 inline const char*
00161 wrl::Viewpoint::typeName() const
00162 {
00163   return "Viewpoint";
00164 }
00165 /*!
00166  * Returns the number of fields (exposed or not) for this node type.
00167  */
00168 inline unsigned int
00169 wrl::Viewpoint::nbFields() const
00170 {
00171    return 5;
00172 }
00173 /*!
00174  * Returns the number of events in for this node type.
00175  */
00176 inline unsigned int
00177 wrl::Viewpoint::nbEventsIn() const
00178 {
00179    return 1;
00180 }
00181 /*!
00182  * Returns the number of events out for this node type.
00183  */
00184 inline unsigned int
00185 wrl::Viewpoint::nbEventsOut() const
00186 {
00187    return 2;
00188 }
00189 #endif // XDKWRL_VIEWPOINT_H
00190 
00191 // Local variables section.
00192 // This is only used by emacs!
00193 // Local Variables:
00194 // ff-search-directories: ("../../" "../../../src/xdkwrl/nodes")
00195 // End:

Generated on 5 Jan 2007 with doxygen version 1.5.1. Valid HTML 4.0! Valid CSS!