XdkWrl: switch.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# switch.h

Go to the documentation of this file.

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

Generated on 5 Jan 2007 with version 1.5.1. |