XdkWrl: node.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# node.h

Go to the documentation of this file.

    00001 #ifndef XDKWRL_NODE_H
    00002 #define XDKWRL_NODE_H
    00003
    00004 #include <xdkwrl/fieldtypes/sfbool.h>
    00005 #include <xdkwrl/fieldtypes/sfcolor.h>
    00006 #include <xdkwrl/fieldtypes/sffloat.h>
    00007 #include <xdkwrl/fieldtypes/sfimage.h>
    00008 #include <xdkwrl/fieldtypes/sfint32.h>
    00009 #include <xdkwrl/fieldtypes/sfnode.h>
    00010 #include <xdkwrl/fieldtypes/sfrotation.h>
    00011 #include <xdkwrl/fieldtypes/sfstring.h>
    00012 #include <xdkwrl/fieldtypes/sftime.h>
    00013 #include <xdkwrl/fieldtypes/sfvec2f.h>
    00014 #include <xdkwrl/fieldtypes/sfvec3f.h>
    00015 #include <xdkwrl/fieldtypes/mfcolor.h>
    00016 #include <xdkwrl/fieldtypes/mffloat.h>
    00017 #include <xdkwrl/fieldtypes/mfint32.h>
    00018 #include <xdkwrl/fieldtypes/mfnode.h>
    00019 #include <xdkwrl/fieldtypes/mfrotation.h>
    00020 #include <xdkwrl/fieldtypes/mfstring.h>
    00021 #include <xdkwrl/fieldtypes/mftime.h>
    00022 #include <xdkwrl/fieldtypes/mfvec2f.h>
    00023 #include <xdkwrl/fieldtypes/mfvec3f.h>
    00024 #include <xdkwrl/event.h>
    00025
    00026 #include <string>
    00027 #include <map>
    00028
    00029 namespace wrl
    00030 {
    00031   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00032   // Interface of Node
    00033   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00034   class Node
    00035   {
    00036   public:
    00037     class FieldHandle;
    00038     class EventInHandle;
    00039     class EventOutHandle;
    00040     Node(const char* name="");
    00041     virtual Node* duplicate() const = 0;
    00042     virtual Node* duplicate(std::map<const Node*,Node*>&) const = 0;
    00043     virtual inline ~Node();
    00044     /*! @name Field Access
    00045      *
    00046      */
    00047     //!@{
    00048     virtual FieldHandle field(const std::string& n) = 0;
    00049     virtual unsigned int nbFields() const = 0;
    00050     virtual FieldHandle field(unsigned int i) = 0;
    00051     virtual bool isSetToDefaultValue(unsigned int i) const = 0;
    00052     //!@}
    00053     /*! @name Field Modification
    00054      * Setting a field from a handle and a value.
    00055      */
    00056     //!@{
    00057     virtual void setField(const FieldHandle& f,const SFBool&);
    00058     virtual void setField(const FieldHandle& f,const SFColor&);
    00059     virtual void setField(const FieldHandle& f,const SFFloat&);
    00060     virtual void setField(const FieldHandle& f,const SFImage&);
    00061     virtual void setField(const FieldHandle& f,const SFInt32&);
    00062     virtual void setField(const FieldHandle& f,const SFNode&);
    00063     virtual void setField(const FieldHandle& f,const SFRotation&);
    00064     virtual void setField(const FieldHandle& f,const SFString&);
    00065     virtual void setField(const FieldHandle& f,const SFTime&);
    00066     virtual void setField(const FieldHandle& f,const SFVec2f&);
    00067     virtual void setField(const FieldHandle& f,const SFVec3f&);
    00068     virtual void setField(const FieldHandle& f,const MFColor&);
    00069     virtual void setField(const FieldHandle& f,const MFFloat&);
    00070     virtual void setField(const FieldHandle& f,const MFInt32&);
    00071     virtual void setField(const FieldHandle& f,const MFNode&);
    00072     virtual void setField(const FieldHandle& f,const MFRotation&);
    00073     virtual void setField(const FieldHandle& f,const MFString&);
    00074     virtual void setField(const FieldHandle& f,const MFTime&);
    00075     virtual void setField(const FieldHandle& f,const MFVec2f&);
    00076     virtual void setField(const FieldHandle& f,const MFVec3f&);
    00077     //!@}
    00078     /*! @name Optimized Field Modification
    00079      * Alternative to setField() functions that use swaps to be faster.
    00080      */
    00081     //!@{
    00082     void swapField(const FieldHandle& f,MFColor&);
    00083     void swapField(const FieldHandle& f,MFFloat&);
    00084     void swapField(const FieldHandle& f,MFInt32&);
    00085     void swapField(const FieldHandle& f,MFNode&);
    00086     void swapField(const FieldHandle& f,MFRotation&);
    00087     void swapField(const FieldHandle& f,MFString&);
    00088     void swapField(const FieldHandle& f,MFTime&);
    00089     void swapField(const FieldHandle& f,MFVec2f&);
    00090     void swapField(const FieldHandle& f,MFVec3f&);
    00091     //!@}
    00092     /*! @name Events Access
    00093      *
    00094      */
    00095     //!@{
    00096     virtual unsigned int nbEventsIn() const = 0;
    00097     virtual EventInHandle eventIn(const std::string& n) = 0;
    00098     virtual EventInHandle eventIn(unsigned int i) = 0;
    00099     virtual unsigned int nbEventsOut() const = 0;
    00100     virtual EventOutHandle eventOut(const std::string& n) = 0;
    00101     virtual EventOutHandle eventOut(unsigned int i) = 0;
    00102     //!@}
    00103     inline bool hasName() const;
    00104     inline const char* name() const;
    00105     void setName(const char*);
    00106
    00107     virtual const char* typeName() const = 0;
    00108   protected:
    00109     FieldHandle field(const std::string& n,
    00110                       const FieldTypeId t,void* f);
    00111     EventInHandle eventIn(const std::string& n,
    00112                           const FieldTypeId t,void* f);
    00113     EventOutHandle eventOut(const std::string& n,
    00114                             const FieldTypeId t,void* f);
    00115   private:
    00116     std::string name_;
    00117   };
    00118   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00119   // Interface of DeclaredNode
    00120   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00121   class DeclaredNode : public Node
    00122   {
    00123   public:
    00124     DeclaredNode(const char* name="");
    00125     virtual unsigned int nbFields() const;
    00126     virtual FieldHandle field(const std::string& n);
    00127     virtual FieldHandle field(unsigned int i);
    00128
    00129     virtual unsigned int nbEventsIn() const;
    00130     virtual EventInHandle eventIn(const std::string& n);
    00131     virtual EventInHandle eventIn(unsigned int i);
    00132     virtual unsigned int nbEventsOut() const;
    00133     virtual EventOutHandle eventOut(const std::string& n);
    00134     virtual EventOutHandle eventOut(unsigned int i);
    00135
    00136     /*! @name Declaration
    00137      * Function used to declare dynamically extra fields or events to the
    00138      * node type.
    00139      */
    00140     //! @{
    00141     EventInHandle  declareEventIn(const FieldTypeId t,const std::string& n);
    00142     EventOutHandle declareEventOut(const FieldTypeId t,const std::string& n);
    00143     FieldHandle declareField(const FieldTypeId t,const std::string& n);
    00144     FieldHandle declareExposedField(const FieldTypeId t,const std::string& n);
    00145     virtual bool isDeclaredField(const std::string& n) const;
    00146     virtual bool isDeclaredField(unsigned int i) const;
    00147     virtual bool isDeclaredEventIn(const std::string& n) const;
    00148     virtual bool isDeclaredEventIn(unsigned int i) const;
    00149     virtual bool isDeclaredEventOut(const std::string& n) const;
    00150     virtual bool isDeclaredEventOut(unsigned int i) const;
    00151     //! @}
    00152   protected:
    00153     std::map<std::string,std::pair<SFBool,bool> >     sfBoolMap_;
    00154     std::map<std::string,std::pair<SFColor,bool> >    sfColorMap_;
    00155     std::map<std::string,std::pair<SFFloat,bool> >    sfFloatMap_;
    00156     std::map<std::string,std::pair<SFImage,bool> >    sfImageMap_;
    00157     std::map<std::string,std::pair<SFInt32,bool> >    sfInt32Map_;
    00158     std::map<std::string,std::pair<SFNode,bool> >     sfNodeMap_;
    00159     std::map<std::string,std::pair<SFRotation,bool> > sfRotationMap_;
    00160     std::map<std::string,std::pair<SFString,bool> >   sfStringMap_;
    00161     std::map<std::string,std::pair<SFTime,bool> >     sfTimeMap_;
    00162     std::map<std::string,std::pair<SFVec2f,bool> >    sfVec2fMap_;
    00163     std::map<std::string,std::pair<SFVec3f,bool> >    sfVec3fMap_;
    00164     std::map<std::string,std::pair<MFColor,bool> >    mfColorMap_;
    00165     std::map<std::string,std::pair<MFFloat,bool> >    mfFloatMap_;
    00166     std::map<std::string,std::pair<MFInt32,bool> >    mfInt32Map_;
    00167     std::map<std::string,std::pair<MFNode,bool> >     mfNodeMap_;
    00168     std::map<std::string,std::pair<MFRotation,bool> > mfRotationMap_;
    00169     std::map<std::string,std::pair<MFString,bool> >   mfStringMap_;
    00170     std::map<std::string,std::pair<MFTime,bool> >     mfTimeMap_;
    00171     std::map<std::string,std::pair<MFVec2f,bool> >    mfVec2fMap_;
    00172     std::map<std::string,std::pair<MFVec3f,bool> >    mfVec3fMap_;
    00173
    00174     std::map<std::string,EventIn<SFBool> >     sfBoolInMap_;
    00175     std::map<std::string,EventIn<SFColor> >    sfColorInMap_;
    00176     std::map<std::string,EventIn<SFFloat> >    sfFloatInMap_;
    00177     std::map<std::string,EventIn<SFImage> >    sfImageInMap_;
    00178     std::map<std::string,EventIn<SFInt32> >    sfInt32InMap_;
    00179     std::map<std::string,EventIn<SFNode> >     sfNodeInMap_;
    00180     std::map<std::string,EventIn<SFRotation> > sfRotationInMap_;
    00181     std::map<std::string,EventIn<SFString> >   sfStringInMap_;
    00182     std::map<std::string,EventIn<SFTime> >     sfTimeInMap_;
    00183     std::map<std::string,EventIn<SFVec2f> >    sfVec2fInMap_;
    00184     std::map<std::string,EventIn<SFVec3f> >    sfVec3fInMap_;
    00185     std::map<std::string,EventIn<MFColor> >    mfColorInMap_;
    00186     std::map<std::string,EventIn<MFFloat> >    mfFloatInMap_;
    00187     std::map<std::string,EventIn<MFInt32> >    mfInt32InMap_;
    00188     std::map<std::string,EventIn<MFNode> >     mfNodeInMap_;
    00189     std::map<std::string,EventIn<MFRotation> > mfRotationInMap_;
    00190     std::map<std::string,EventIn<MFString> >   mfStringInMap_;
    00191     std::map<std::string,EventIn<MFTime> >     mfTimeInMap_;
    00192     std::map<std::string,EventIn<MFVec2f> >    mfVec2fInMap_;
    00193     std::map<std::string,EventIn<MFVec3f> >    mfVec3fInMap_;
    00194
    00195     std::map<std::string,EventOut<SFBool> >     sfBoolOutMap_;
    00196     std::map<std::string,EventOut<SFColor> >    sfColorOutMap_;
    00197     std::map<std::string,EventOut<SFFloat> >    sfFloatOutMap_;
    00198     std::map<std::string,EventOut<SFImage> >    sfImageOutMap_;
    00199     std::map<std::string,EventOut<SFInt32> >    sfInt32OutMap_;
    00200     std::map<std::string,EventOut<SFNode> >     sfNodeOutMap_;
    00201     std::map<std::string,EventOut<SFRotation> > sfRotationOutMap_;
    00202     std::map<std::string,EventOut<SFString> >   sfStringOutMap_;
    00203     std::map<std::string,EventOut<SFTime> >     sfTimeOutMap_;
    00204     std::map<std::string,EventOut<SFVec2f> >    sfVec2fOutMap_;
    00205     std::map<std::string,EventOut<SFVec3f> >    sfVec3fOutMap_;
    00206     std::map<std::string,EventOut<MFColor> >    mfColorOutMap_;
    00207     std::map<std::string,EventOut<MFFloat> >    mfFloatOutMap_;
    00208     std::map<std::string,EventOut<MFInt32> >    mfInt32OutMap_;
    00209     std::map<std::string,EventOut<MFNode> >     mfNodeOutMap_;
    00210     std::map<std::string,EventOut<MFRotation> > mfRotationOutMap_;
    00211     std::map<std::string,EventOut<MFString> >   mfStringOutMap_;
    00212     std::map<std::string,EventOut<MFTime> >     mfTimeOutMap_;
    00213     std::map<std::string,EventOut<MFVec2f> >    mfVec2fOutMap_;
    00214     std::map<std::string,EventOut<MFVec3f> >    mfVec3fOutMap_;
    00215   };
    00216   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00217   // Interface of Node::FieldHandle
    00218   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00219   class Node::FieldHandle
    00220   {
    00221   public:
    00222     inline FieldHandle();
    00223     inline FieldTypeId fieldTypeId() const;
    00224     inline Node* node() const;
    00225     inline const char* fieldName() const;
    00226     const char* fieldTypeName() const;
    00227     inline bool isExposed() const;
    00228     inline SFBool*      sfBoolValue() const;
    00229     inline SFColor*     sfColorValue() const;
    00230     inline SFFloat*     sfFloatValue() const;
    00231     inline SFImage*     sfImageValue() const;
    00232     inline SFInt32*     sfInt32Value() const;
    00233     inline SFNode*      sfNodeValue() const;
    00234     inline SFRotation*  sfRotationValue() const;
    00235     inline SFString*    sfStringValue() const;
    00236     inline SFTime*      sfTimeValue() const;
    00237     inline SFVec2f*     sfVec2fValue() const;
    00238     inline SFVec3f*     sfVec3fValue() const;
    00239     inline MFColor*     mfColorValue() const;
    00240     inline MFFloat*     mfFloatValue() const;
    00241     inline MFInt32*     mfInt32Value() const;
    00242     inline MFNode*      mfNodeValue() const;
    00243     inline MFRotation*  mfRotationValue() const;
    00244     inline MFString*    mfStringValue() const;
    00245     inline MFTime*      mfTimeValue() const;
    00246     inline MFVec2f*     mfVec2fValue() const;
    00247     inline MFVec3f*     mfVec3fValue() const;
    00248     bool operator==(const FieldHandle& h) const;
    00249     bool operator!=(const FieldHandle& h) const;
    00250     static void copy(const FieldHandle& to,const FieldHandle& from);
    00251   protected:
    00252     friend class Node;
    00253     FieldHandle(Node* node,
    00254                 const std::string& n,
    00255                 const FieldTypeId t,void* f);
    00256   private:
    00257     Node*       node_;
    00258     std::string fieldName_;
    00259     FieldTypeId fieldTypeId_;
    00260     bool        isExposed_;
    00261     SFBool*     sfBoolField_;
    00262     SFColor*    sfColorField_;
    00263     SFFloat*    sfFloatField_;
    00264     SFImage*    sfImageField_;
    00265     SFInt32*    sfInt32Field_;
    00266     SFNode*     sfNodeField_;
    00267     SFRotation* sfRotationField_;
    00268     SFString*   sfStringField_;
    00269     SFTime*     sfTimeField_;
    00270     SFVec2f*    sfVec2fField_;
    00271     SFVec3f*    sfVec3fField_;
    00272     MFColor*    mfColorField_;
    00273     MFFloat*    mfFloatField_;
    00274     MFInt32*    mfInt32Field_;
    00275     MFNode*     mfNodeField_;
    00276     MFRotation* mfRotationField_;
    00277     MFString*   mfStringField_;
    00278     MFTime*     mfTimeField_;
    00279     MFVec2f*    mfVec2fField_;
    00280     MFVec3f*    mfVec3fField_;
    00281   };
    00282   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00283   // Interface of Node::EventInHandle
    00284   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00285   class Node::EventInHandle
    00286   {
    00287   public:
    00288     inline EventInHandle();
    00289     inline FieldTypeId fieldTypeId() const;
    00290     inline Node* node() const;
    00291     inline const char* fieldName() const;
    00292     const char* fieldTypeName() const;
    00293     inline EventIn<SFBool>*     sfBoolValue() const;
    00294     inline EventIn<SFColor>*    sfColorValue() const;
    00295     inline EventIn<SFFloat>*    sfFloatValue() const;
    00296     inline EventIn<SFImage>*    sfImageValue() const;
    00297     inline EventIn<SFInt32>*    sfInt32Value() const;
    00298     inline EventIn<SFNode>*     sfNodeValue() const;
    00299     inline EventIn<SFRotation>* sfRotationValue() const;
    00300     inline EventIn<SFString>*   sfStringValue() const;
    00301     inline EventIn<SFTime>*     sfTimeValue() const;
    00302     inline EventIn<SFVec2f>*    sfVec2fValue() const;
    00303     inline EventIn<SFVec3f>*    sfVec3fValue() const;
    00304     inline EventIn<MFColor>*    mfColorValue() const;
    00305     inline EventIn<MFFloat>*    mfFloatValue() const;
    00306     inline EventIn<MFInt32>*    mfInt32Value() const;
    00307     inline EventIn<MFNode>*     mfNodeValue() const;
    00308     inline EventIn<MFRotation>* mfRotationValue() const;
    00309     inline EventIn<MFString>*   mfStringValue() const;
    00310     inline EventIn<MFTime>*     mfTimeValue() const;
    00311     inline EventIn<MFVec2f>*    mfVec2fValue() const;
    00312     inline EventIn<MFVec3f>*    mfVec3fValue() const;
    00313     bool operator==(const EventInHandle& h) const;
    00314     bool operator!=(const EventInHandle& h) const;
    00315   protected:
    00316     friend class Node;
    00317     EventInHandle(Node* node,
    00318                   const std::string& n,
    00319                   const FieldTypeId t,void* f);
    00320   private:
    00321     Node*                node_;
    00322     std::string          fieldName_;
    00323     FieldTypeId          fieldTypeId_;
    00324     EventIn<SFBool>*     sfBoolField_;
    00325     EventIn<SFColor>*    sfColorField_;
    00326     EventIn<SFFloat>*    sfFloatField_;
    00327     EventIn<SFImage>*    sfImageField_;
    00328     EventIn<SFInt32>*    sfInt32Field_;
    00329     EventIn<SFNode>*     sfNodeField_;
    00330     EventIn<SFRotation>* sfRotationField_;
    00331     EventIn<SFString>*   sfStringField_;
    00332     EventIn<SFTime>*     sfTimeField_;
    00333     EventIn<SFVec2f>*    sfVec2fField_;
    00334     EventIn<SFVec3f>*    sfVec3fField_;
    00335     EventIn<MFColor>*    mfColorField_;
    00336     EventIn<MFFloat>*    mfFloatField_;
    00337     EventIn<MFInt32>*    mfInt32Field_;
    00338     EventIn<MFNode>*     mfNodeField_;
    00339     EventIn<MFRotation>* mfRotationField_;
    00340     EventIn<MFString>*   mfStringField_;
    00341     EventIn<MFTime>*     mfTimeField_;
    00342     EventIn<MFVec2f>*    mfVec2fField_;
    00343     EventIn<MFVec3f>*    mfVec3fField_;
    00344   };
    00345   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00346   // Interface of Node::EventOutHandle
    00347   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00348   class Node::EventOutHandle
    00349   {
    00350   public:
    00351     inline EventOutHandle();
    00352     inline FieldTypeId fieldTypeId() const;
    00353     inline Node* node() const;
    00354     inline const char* fieldName() const;
    00355     const char* fieldTypeName() const;
    00356     inline EventOut<SFBool>*    sfBoolValue() const;
    00357     inline EventOut<SFColor>*   sfColorValue() const;
    00358     inline EventOut<SFFloat>*   sfFloatValue() const;
    00359     inline EventOut<SFImage>*   sfImageValue() const;
    00360     inline EventOut<SFInt32>*   sfInt32Value() const;
    00361     inline EventOut<SFNode>*    sfNodeValue() const;
    00362     inline EventOut<SFRotation>*        sfRotationValue() const;
    00363     inline EventOut<SFString>*  sfStringValue() const;
    00364     inline EventOut<SFTime>*    sfTimeValue() const;
    00365     inline EventOut<SFVec2f>*   sfVec2fValue() const;
    00366     inline EventOut<SFVec3f>*   sfVec3fValue() const;
    00367     inline EventOut<MFColor>*   mfColorValue() const;
    00368     inline EventOut<MFFloat>*   mfFloatValue() const;
    00369     inline EventOut<MFInt32>*   mfInt32Value() const;
    00370     inline EventOut<MFNode>*    mfNodeValue() const;
    00371     inline EventOut<MFRotation>*        mfRotationValue() const;
    00372     inline EventOut<MFString>*  mfStringValue() const;
    00373     inline EventOut<MFTime>*    mfTimeValue() const;
    00374     inline EventOut<MFVec2f>*   mfVec2fValue() const;
    00375     inline EventOut<MFVec3f>*   mfVec3fValue() const;
    00376     bool operator==(const EventOutHandle& h) const;
    00377     bool operator!=(const EventOutHandle& h) const;
    00378   protected:
    00379     friend class Node;
    00380     EventOutHandle(Node* node,
    00381                    const std::string& n,
    00382                    const FieldTypeId t,void* f);
    00383   private:
    00384     Node*                node_;
    00385     std::string          fieldName_;
    00386     FieldTypeId          fieldTypeId_;
    00387     EventOut<SFBool>*    sfBoolField_;
    00388     EventOut<SFColor>*   sfColorField_;
    00389     EventOut<SFFloat>*   sfFloatField_;
    00390     EventOut<SFImage>*   sfImageField_;
    00391     EventOut<SFInt32>*   sfInt32Field_;
    00392     EventOut<SFNode>*    sfNodeField_;
    00393     EventOut<SFRotation>* sfRotationField_;
    00394     EventOut<SFString>*  sfStringField_;
    00395     EventOut<SFTime>*    sfTimeField_;
    00396     EventOut<SFVec2f>*   sfVec2fField_;
    00397     EventOut<SFVec3f>*   sfVec3fField_;
    00398     EventOut<MFColor>*   mfColorField_;
    00399     EventOut<MFFloat>*   mfFloatField_;
    00400     EventOut<MFInt32>*   mfInt32Field_;
    00401     EventOut<MFNode>*    mfNodeField_;
    00402     EventOut<MFRotation>* mfRotationField_;
    00403     EventOut<MFString>*  mfStringField_;
    00404     EventOut<MFTime>*    mfTimeField_;
    00405     EventOut<MFVec2f>*   mfVec2fField_;
    00406     EventOut<MFVec3f>*   mfVec3fField_;
    00407   };
    00408   //************************************************************
    00409   // Implementation of Node
    00410   //************************************************************
    00411   inline
    00412   Node::~Node()
    00413   {
    00414   }
    00415   /*!
    00416    * Return true if the node has a name, defined thru a DEF directive in a
    00417    * VRML file of with the setName command.
    00418    */
    00419   inline bool
    00420   Node::hasName() const
    00421   {
    00422     return !name_.empty();
    00423   }
    00424   /*!
    00425    * Return the name of the node, defined thru a DEF directive in a
    00426    * VRML file of with the setName command.
    00427    */
    00428   inline const char*
    00429   Node::name() const
    00430   {
    00431     return name_.c_str();
    00432   }
    00433   //************************************************************
    00434   // Implementation of Node::FieldHandle
    00435   //************************************************************
    00436   inline
    00437   Node::FieldHandle::FieldHandle()
    00438     : node_(NULL),fieldTypeId_(unknown)
    00439   {
    00440   }
    00441   inline FieldTypeId
    00442   Node::FieldHandle::fieldTypeId() const
    00443   {
    00444     return fieldTypeId_;
    00445   }
    00446   inline Node*
    00447   Node::FieldHandle::node() const
    00448   {
    00449     return node_;
    00450   }
    00451   inline const char*
    00452   Node::FieldHandle::fieldName() const
    00453   {
    00454     return fieldName_.c_str();
    00455   }
    00456   inline bool
    00457   Node::FieldHandle::isExposed() const
    00458   {
    00459     return isExposed_;
    00460   }
    00461   inline SFBool*
    00462   Node::FieldHandle::sfBoolValue() const
    00463   {
    00464     return sfBoolField_;
    00465   }
    00466   inline SFColor*
    00467   Node::FieldHandle::sfColorValue() const
    00468   {
    00469     return sfColorField_;
    00470   }
    00471   inline SFFloat*
    00472   Node::FieldHandle::sfFloatValue() const
    00473   {
    00474     return sfFloatField_;
    00475   }
    00476   inline SFImage*
    00477   Node::FieldHandle::sfImageValue() const
    00478   {
    00479     return sfImageField_;
    00480   }
    00481   inline SFInt32*
    00482   Node::FieldHandle::sfInt32Value() const
    00483   {
    00484     return sfInt32Field_;
    00485   }
    00486   inline SFNode*
    00487   Node::FieldHandle::sfNodeValue() const
    00488   {
    00489     return sfNodeField_;
    00490   }
    00491   inline SFRotation*
    00492   Node::FieldHandle::sfRotationValue() const
    00493   {
    00494     return sfRotationField_;
    00495   }
    00496   inline SFString*
    00497   Node::FieldHandle::sfStringValue() const
    00498   {
    00499     return sfStringField_;
    00500   }
    00501   inline SFTime*
    00502   Node::FieldHandle::sfTimeValue() const
    00503   {
    00504     return sfTimeField_;
    00505   }
    00506   inline SFVec2f*
    00507   Node::FieldHandle::sfVec2fValue() const
    00508   {
    00509     return sfVec2fField_;
    00510   }
    00511   inline SFVec3f*
    00512   Node::FieldHandle::sfVec3fValue() const
    00513   {
    00514     return sfVec3fField_;
    00515   }
    00516   inline MFColor*
    00517   Node::FieldHandle::mfColorValue() const
    00518   {
    00519     return mfColorField_;
    00520   }
    00521   inline MFFloat*
    00522   Node::FieldHandle::mfFloatValue() const
    00523   {
    00524     return mfFloatField_;
    00525   }
    00526   inline MFInt32*
    00527   Node::FieldHandle::mfInt32Value() const
    00528   {
    00529     return mfInt32Field_;
    00530   }
    00531   inline MFNode*
    00532   Node::FieldHandle::mfNodeValue() const
    00533   {
    00534     return mfNodeField_;
    00535   }
    00536   inline MFRotation*
    00537   Node::FieldHandle::mfRotationValue() const
    00538   {
    00539     return mfRotationField_;
    00540   }
    00541   inline MFString*
    00542   Node::FieldHandle::mfStringValue() const
    00543   {
    00544     return mfStringField_;
    00545   }
    00546   inline MFTime*
    00547   Node::FieldHandle::mfTimeValue() const
    00548   {
    00549     return mfTimeField_;
    00550   }
    00551   inline MFVec2f*
    00552   Node::FieldHandle::mfVec2fValue() const
    00553   {
    00554     return mfVec2fField_;
    00555   }
    00556   inline MFVec3f*
    00557   Node::FieldHandle::mfVec3fValue() const
    00558   {
    00559     return mfVec3fField_;
    00560   }
    00561   //************************************************************
    00562   // Implementation of Node::EventInHandle
    00563   //************************************************************
    00564   inline
    00565   Node::EventInHandle::EventInHandle()
    00566     : node_(NULL),fieldTypeId_(unknown)
    00567   {
    00568   }
    00569   inline FieldTypeId
    00570   Node::EventInHandle::fieldTypeId() const
    00571   {
    00572     return fieldTypeId_;
    00573   }
    00574   inline Node*
    00575   Node::EventInHandle::node() const
    00576   {
    00577     return node_;
    00578   }
    00579   inline const char*
    00580   Node::EventInHandle::fieldName() const
    00581   {
    00582     return fieldName_.c_str();
    00583   }
    00584   inline EventIn<SFBool>*
    00585   Node::EventInHandle::sfBoolValue() const
    00586   {
    00587     return sfBoolField_;
    00588   }
    00589   inline EventIn<SFColor>*
    00590   Node::EventInHandle::sfColorValue() const
    00591   {
    00592     return sfColorField_;
    00593   }
    00594   inline EventIn<SFFloat>*
    00595   Node::EventInHandle::sfFloatValue() const
    00596   {
    00597     return sfFloatField_;
    00598   }
    00599   inline EventIn<SFImage>*
    00600   Node::EventInHandle::sfImageValue() const
    00601   {
    00602     return sfImageField_;
    00603   }
    00604   inline EventIn<SFInt32>*
    00605   Node::EventInHandle::sfInt32Value() const
    00606   {
    00607     return sfInt32Field_;
    00608   }
    00609   inline EventIn<SFNode>*
    00610   Node::EventInHandle::sfNodeValue() const
    00611   {
    00612     return sfNodeField_;
    00613   }
    00614   inline EventIn<SFRotation>*
    00615   Node::EventInHandle::sfRotationValue() const
    00616   {
    00617     return sfRotationField_;
    00618   }
    00619   inline EventIn<SFString>*
    00620   Node::EventInHandle::sfStringValue() const
    00621   {
    00622     return sfStringField_;
    00623   }
    00624   inline EventIn<SFTime>*
    00625   Node::EventInHandle::sfTimeValue() const
    00626   {
    00627     return sfTimeField_;
    00628   }
    00629   inline EventIn<SFVec2f>*
    00630   Node::EventInHandle::sfVec2fValue() const
    00631   {
    00632     return sfVec2fField_;
    00633   }
    00634   inline EventIn<SFVec3f>*
    00635   Node::EventInHandle::sfVec3fValue() const
    00636   {
    00637     return sfVec3fField_;
    00638   }
    00639   inline EventIn<MFColor>*
    00640   Node::EventInHandle::mfColorValue() const
    00641   {
    00642     return mfColorField_;
    00643   }
    00644   inline EventIn<MFFloat>*
    00645   Node::EventInHandle::mfFloatValue() const
    00646   {
    00647     return mfFloatField_;
    00648   }
    00649   inline EventIn<MFInt32>*
    00650   Node::EventInHandle::mfInt32Value() const
    00651   {
    00652     return mfInt32Field_;
    00653   }
    00654   inline EventIn<MFNode>*
    00655   Node::EventInHandle::mfNodeValue() const
    00656   {
    00657     return mfNodeField_;
    00658   }
    00659   inline EventIn<MFRotation>*
    00660   Node::EventInHandle::mfRotationValue() const
    00661   {
    00662     return mfRotationField_;
    00663   }
    00664   inline EventIn<MFString>*
    00665   Node::EventInHandle::mfStringValue() const
    00666   {
    00667     return mfStringField_;
    00668   }
    00669   inline EventIn<MFTime>*
    00670   Node::EventInHandle::mfTimeValue() const
    00671   {
    00672     return mfTimeField_;
    00673   }
    00674   inline EventIn<MFVec2f>*
    00675   Node::EventInHandle::mfVec2fValue() const
    00676   {
    00677     return mfVec2fField_;
    00678   }
    00679   inline EventIn<MFVec3f>*
    00680   Node::EventInHandle::mfVec3fValue() const
    00681   {
    00682     return mfVec3fField_;
    00683   }
    00684   //************************************************************
    00685   // Implementation of Node::EventOutHandle
    00686   //************************************************************
    00687   inline
    00688   Node::EventOutHandle::EventOutHandle()
    00689     : node_(NULL),fieldTypeId_(unknown)
    00690   {
    00691   }
    00692   inline FieldTypeId
    00693   Node::EventOutHandle::fieldTypeId() const
    00694   {
    00695     return fieldTypeId_;
    00696   }
    00697   inline Node*
    00698   Node::EventOutHandle::node() const
    00699   {
    00700     return node_;
    00701   }
    00702   inline const char*
    00703   Node::EventOutHandle::fieldName() const
    00704   {
    00705     return fieldName_.c_str();
    00706   }
    00707   inline EventOut<SFBool>*
    00708   Node::EventOutHandle::sfBoolValue() const
    00709   {
    00710     return sfBoolField_;
    00711   }
    00712   inline EventOut<SFColor>*
    00713   Node::EventOutHandle::sfColorValue() const
    00714   {
    00715     return sfColorField_;
    00716   }
    00717   inline EventOut<SFFloat>*
    00718   Node::EventOutHandle::sfFloatValue() const
    00719   {
    00720     return sfFloatField_;
    00721   }
    00722   inline EventOut<SFImage>*
    00723   Node::EventOutHandle::sfImageValue() const
    00724   {
    00725     return sfImageField_;
    00726   }
    00727   inline EventOut<SFInt32>*
    00728   Node::EventOutHandle::sfInt32Value() const
    00729   {
    00730     return sfInt32Field_;
    00731   }
    00732   inline EventOut<SFNode>*
    00733   Node::EventOutHandle::sfNodeValue() const
    00734   {
    00735     return sfNodeField_;
    00736   }
    00737   inline EventOut<SFRotation>*
    00738   Node::EventOutHandle::sfRotationValue() const
    00739   {
    00740     return sfRotationField_;
    00741   }
    00742   inline EventOut<SFString>*
    00743   Node::EventOutHandle::sfStringValue() const
    00744   {
    00745     return sfStringField_;
    00746   }
    00747   inline EventOut<SFTime>*
    00748   Node::EventOutHandle::sfTimeValue() const
    00749   {
    00750     return sfTimeField_;
    00751   }
    00752   inline EventOut<SFVec2f>*
    00753   Node::EventOutHandle::sfVec2fValue() const
    00754   {
    00755     return sfVec2fField_;
    00756   }
    00757   inline EventOut<SFVec3f>*
    00758   Node::EventOutHandle::sfVec3fValue() const
    00759   {
    00760     return sfVec3fField_;
    00761   }
    00762   inline EventOut<MFColor>*
    00763   Node::EventOutHandle::mfColorValue() const
    00764   {
    00765     return mfColorField_;
    00766   }
    00767   inline EventOut<MFFloat>*
    00768   Node::EventOutHandle::mfFloatValue() const
    00769   {
    00770     return mfFloatField_;
    00771   }
    00772   inline EventOut<MFInt32>*
    00773   Node::EventOutHandle::mfInt32Value() const
    00774   {
    00775     return mfInt32Field_;
    00776   }
    00777   inline EventOut<MFNode>*
    00778   Node::EventOutHandle::mfNodeValue() const
    00779   {
    00780     return mfNodeField_;
    00781   }
    00782   inline EventOut<MFRotation>*
    00783   Node::EventOutHandle::mfRotationValue() const
    00784   {
    00785     return mfRotationField_;
    00786   }
    00787   inline EventOut<MFString>*
    00788   Node::EventOutHandle::mfStringValue() const
    00789   {
    00790     return mfStringField_;
    00791   }
    00792   inline EventOut<MFTime>*
    00793   Node::EventOutHandle::mfTimeValue() const
    00794   {
    00795     return mfTimeField_;
    00796   }
    00797   inline EventOut<MFVec2f>*
    00798   Node::EventOutHandle::mfVec2fValue() const
    00799   {
    00800     return mfVec2fField_;
    00801   }
    00802   inline EventOut<MFVec3f>*
    00803   Node::EventOutHandle::mfVec3fValue() const
    00804   {
    00805     return mfVec3fField_;
    00806   }
    00807 };
    00808
    00809 #endif // XDKWRL_NODE_H
    00810
    00811 // Local variables section.
    00812 // This is only used by emacs!
    00813 // Local Variables:
    00814 // ff-search-directories: ("." "../../src/xdkwrl/")
    00815 // End:

Generated on 28 Jun 2006 with version 1.4.4. |