XdkWrl: viewpoint.h Source File

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

Generated on 28 Jun 2006 with version 1.4.4. |