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

Generated on 5 Jan 2007 with version 1.5.1. |