XdkWrl: text.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# text.h

Go to the documentation of this file.

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

Generated on 28 Jun 2006 with version 1.4.4. |