XdkWrl: shape.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# shape.h

Go to the documentation of this file.

    00001 #ifndef XDKWRL_SHAPE_H
    00002 #define XDKWRL_SHAPE_H
    00003
    00004 #include <xdkwrl/node.h>
    00005 #include <xdkwrl/fieldtypes/sfnode.h>
    00006
    00007 namespace wrl
    00008 {
    00009   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00010   // Interface of Shape
    00011   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00012   class Shape : public Node
    00013   {
    00014    public:
    00015      Shape(const char* name="");
    00016      virtual ~Shape();
    00017      virtual inline unsigned int nbFields() const;
    00018      virtual FieldHandle field(const std::string& n);
    00019      virtual FieldHandle field(unsigned int i);
    00020      virtual bool isSetToDefaultValue(unsigned int i) const;
    00021      virtual inline unsigned int nbEventsIn() const;
    00022      virtual EventInHandle eventIn(const std::string& n);
    00023      virtual EventInHandle eventIn(unsigned int i);
    00024      virtual inline unsigned int nbEventsOut() const;
    00025      virtual EventOutHandle eventOut(const std::string& n);
    00026      virtual EventOutHandle eventOut(unsigned int i);
    00027      inline const char* typeName() const;
    00028      virtual Node* duplicate() const;
    00029      virtual Node* duplicate(std::map<const Node*,Node*>&) const;
    00030      /*!@name Exposed Fields
    00031       * A field that is capable of receiving events via an eventIn to
    00032       * change its value(s), and generating events via an eventOut
    00033       * when its value(s) change.
    00034       */
    00035       //!@{
    00036       /*!
    00037        * See <a href="#_details" class="md">Detailed Description</a>
    00038        * for meaning of this field.
    00039        * Default value is set to SFNode default value
    00040        */
    00041        SFNode     appearance;
    00042       /*!
    00043        * See <a href="#_details" class="md">Detailed Description</a>
    00044        * for meaning of this field.
    00045        * Default value is set to SFNode default value
    00046        */
    00047        SFNode     geometry;
    00048      //!@}
    00049      /*!@name Fields
    00050       * A property or attribute of a node. Each node type has a fixed set
    00051       * of fields. Fields may contain various kinds of data and one or many
    00052       * values. Each field has a default value.
    00053       */
    00054       //!@{
    00055      //!@}
    00056      /*!@name Events In
    00057       *
    00058       */
    00059       //!@{
    00060       /*!
    00061        * Set event associated to exposedField appearance
    00062        */
    00063        EventIn<SFNode>     set_appearance;
    00064       /*!
    00065        * Set event associated to exposedField geometry
    00066        */
    00067        EventIn<SFNode>     set_geometry;
    00068   //!@}
    00069      /*!@name Events Out
    00070       *
    00071       */
    00072       //!@{
    00073       /*!
    00074        * Changed event associated to exposedField appearance
    00075        */
    00076        EventOut<SFNode>     appearance_changed;
    00077       /*!
    00078        * Changed event associated to exposedField geometry
    00079        */
    00080        EventOut<SFNode>     geometry_changed;
    00081   //!@}
    00082   };
    00083 };
    00084 //************************************************************
    00085 // Implementation of Shape
    00086 //************************************************************
    00087 /*!
    00088  * Returns <code>"Shape"</code>. Useful for printing.
    00089  */
    00090 inline const char*
    00091 wrl::Shape::typeName() const
    00092 {
    00093   return "Shape";
    00094 }
    00095 /*!
    00096  * Returns the number of fields (exposed or not) for this node type.
    00097  */
    00098 inline unsigned int
    00099 wrl::Shape::nbFields() const
    00100 {
    00101    return 2;
    00102 }
    00103 /*!
    00104  * Returns the number of events in for this node type.
    00105  */
    00106 inline unsigned int
    00107 wrl::Shape::nbEventsIn() const
    00108 {
    00109    return 0;
    00110 }
    00111 /*!
    00112  * Returns the number of events out for this node type.
    00113  */
    00114 inline unsigned int
    00115 wrl::Shape::nbEventsOut() const
    00116 {
    00117    return 0;
    00118 }
    00119 #endif // XDKWRL_SHAPE_H
    00120
    00121 // Local variables section.
    00122 // This is only used by emacs!
    00123 // Local Variables:
    00124 // ff-search-directories: ("../../" "../../../src/xdkwrl/nodes")
    00125 // End:

Generated on 28 Jun 2006 with version 1.4.4. |