XdkWrl: collision.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# collision.h

Go to the documentation of this file.

    00001 #ifndef XDKWRL_COLLISION_H
    00002 #define XDKWRL_COLLISION_H
    00003
    00004 #include <xdkwrl/config.h>
    00005 #include <xdkwrl/node.h>
    00006 #include <xdkwrl/fieldtypes/mfnode.h>
    00007 #include <xdkwrl/fieldtypes/sfbool.h>
    00008 #include <xdkwrl/fieldtypes/sfnode.h>
    00009 #include <xdkwrl/fieldtypes/sftime.h>
    00010 #include <xdkwrl/fieldtypes/sfvec3f.h>
    00011
    00012 namespace wrl
    00013 {
    00014   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00015   // Interface of Collision
    00016   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00017   class XDKWRL_EXPORT Collision : public Node
    00018   {
    00019    public:
    00020      Collision(const char* name="");
    00021      virtual ~Collision();
    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 MFNode default value
    00045        */
    00046        MFNode     children;
    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        collide = true;
    00053        \endcode
    00054        */
    00055        SFBool     collide;
    00056      //!@}
    00057      /*!@name Fields
    00058       * A property or attribute of a node. Each node type has a fixed set
    00059       * of fields. Fields may contain various kinds of data and one or many
    00060       * values. Each field has a default value.
    00061       */
    00062       //!@{
    00063       /*!
    00064        * See <a href="#_details" class="md">Detailed Description</a>
    00065        * for meaning of this field.
    00066        * Default value is set to
    00067        \code
    00068        bboxCenter.setXYZ(0,0,0);
    00069         \endcode
    00070        */
    00071        SFVec3f    bboxCenter;
    00072       /*!
    00073        * See <a href="#_details" class="md">Detailed Description</a>
    00074        * for meaning of this field.
    00075        * Default value is set to
    00076        \code
    00077        bboxSize.setXYZ(-1,-1,-1);
    00078         \endcode
    00079        */
    00080        SFVec3f    bboxSize;
    00081       /*!
    00082        * See <a href="#_details" class="md">Detailed Description</a>
    00083        * for meaning of this field.
    00084        * Default value is set to SFNode default value
    00085        */
    00086        SFNode     proxy;
    00087      //!@}
    00088      /*!@name Events In
    00089       *
    00090       */
    00091       //!@{
    00092       /*!
    00093        * See <a href="#_details" class="md">Detailed Description</a>
    00094        * for meaning of this event.
    00095        */
    00096        EventIn<MFNode>     addChildren;
    00097       /*!
    00098        * See <a href="#_details" class="md">Detailed Description</a>
    00099        * for meaning of this event.
    00100        */
    00101        EventIn<MFNode>     removeChildren;
    00102       /*!
    00103        * Set event associated to exposedField children
    00104        */
    00105        EventIn<MFNode>     set_children;
    00106       /*!
    00107        * Set event associated to exposedField collide
    00108        */
    00109        EventIn<SFBool>     set_collide;
    00110   //!@}
    00111      /*!@name Events Out
    00112       *
    00113       */
    00114       //!@{
    00115       /*!
    00116        * See <a href="#_details" class="md">Detailed Description</a>
    00117        * for meaning of this event.
    00118        */
    00119        EventOut<SFTime>     collideTime;
    00120       /*!
    00121        * Changed event associated to exposedField children
    00122        */
    00123        EventOut<MFNode>     children_changed;
    00124       /*!
    00125        * Changed event associated to exposedField collide
    00126        */
    00127        EventOut<SFBool>     collide_changed;
    00128   //!@}
    00129   };
    00130 };
    00131 //************************************************************
    00132 // Implementation of Collision
    00133 //************************************************************
    00134 /*!
    00135  * Returns <code>"Collision"</code>. Useful for printing.
    00136  */
    00137 inline const char*
    00138 wrl::Collision::typeName() const
    00139 {
    00140   return "Collision";
    00141 }
    00142 /*!
    00143  * Returns the number of fields (exposed or not) for this node type.
    00144  */
    00145 inline unsigned int
    00146 wrl::Collision::nbFields() const
    00147 {
    00148    return 5;
    00149 }
    00150 /*!
    00151  * Returns the number of events in for this node type.
    00152  */
    00153 inline unsigned int
    00154 wrl::Collision::nbEventsIn() const
    00155 {
    00156    return 2;
    00157 }
    00158 /*!
    00159  * Returns the number of events out for this node type.
    00160  */
    00161 inline unsigned int
    00162 wrl::Collision::nbEventsOut() const
    00163 {
    00164    return 1;
    00165 }
    00166 #endif // XDKWRL_COLLISION_H
    00167
    00168 // Local variables section.
    00169 // This is only used by emacs!
    00170 // Local Variables:
    00171 // ff-search-directories: ("../../" "../../../src/xdkwrl/nodes")
    00172 // End:

Generated on 5 Jan 2007 with version 1.5.1. |