Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGVRMLNodeFactory.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGVRMLNODEFACTORY_H_
00040 #define _OSGVRMLNODEFACTORY_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include <OSGBaseTypes.h>
00046 #include <OSGBaseFunctions.h>
00047 
00048 #ifdef OSG_STL_HAS_HASH_MAP
00049 #ifdef OSG_HASH_MAP_AS_EXT
00050 #else
00051 #include <hash_map>
00052 #endif
00053 #else
00054 #include <map>
00055 #endif
00056 
00057 #include <stack>
00058 
00059 #include <OSGNode.h>
00060 #include <OSGNodeCore.h>
00061 #include <OSGAttachment.h>
00062 #include <OSGGroup.h>
00063 #include <OSGGeometry.h>
00064 
00065 #include <OSGVRMLNodeDescs.h>
00066 
00067 OSG_BEGIN_NAMESPACE
00068 
00071 
00072 template <class BaseT>
00073 class VRMLNodeFactory : public BaseT
00074 {
00075     /*==========================  PRIVATE  ================================*/
00076   private:
00077 
00078 #ifdef OSG_STL_HAS_HASH_MAP
00079 #ifdef OSG_USE_HASH_COMPARE
00080     typedef 
00081         OSG_STDEXTENSION_NAMESPACE::hash_map<
00082             const Char8  *,  
00083             VRMLNodeDesc *,
00084             HashCmpString> NodeNameDescHash;
00085 #else
00086     typedef 
00087         OSG_STDEXTENSION_NAMESPACE::hash_map<
00088             const Char8  *,  
00089             VRMLNodeDesc *, 
00090             OSG_STDEXTENSION_NAMESPACE::hash<const Char8 *>, 
00091             EQString                                      > NodeNameDescHash;  
00092 #endif
00093 #else
00094     typedef 
00095         std::map<     const Char8 *,  VRMLNodeDesc  *, 
00096                                       LTString       > NodeNameDescHash;
00097 #endif
00098 
00099     typedef VRMLNodeFactory<BaseT> Self;
00100     
00101     /*==========================  PUBLIC  =================================*/
00102   public :
00103 
00104     /*---------------------------------------------------------------------*/
00108     VRMLNodeFactory(void);
00109 
00111     /*---------------------------------------------------------------------*/
00115     virtual ~VRMLNodeFactory(void); 
00116 
00118     /*---------------------------------------------------------------------*/
00122     virtual void beginProto            (const Char8 *szProtoname);
00123     virtual void endProto              (      void);
00124 
00125     virtual void beginEventInDecl      (const Char8 *szEventType,
00126                                         const UInt32  uiFieldTypeId,
00127                                         const Char8 *szEventName); 
00128 
00129     virtual void beginEventOutDecl     (const Char8 *szEventType,
00130                                         const UInt32  uiFieldTypeId,
00131                                         const Char8 *szEventName); 
00132 
00133     virtual void beginFieldDecl        (const Char8  *szFieldType,
00134                                         const UInt32  uiFieldTypeId,
00135                                         const Char8  *szFieldName); 
00136 
00137     virtual void endFieldDecl          (      void);
00138 
00139     virtual void beginExposedFieldDecl (const Char8  *szFieldType,
00140                                         const UInt32  uiFieldTypeId,
00141                                         const Char8  *szFieldName); 
00142 
00143     virtual void endExposedFieldDecl   (      void);
00144 
00145     virtual void addFieldValue         (const Char8 *szFieldVal);
00146 
00148     /*---------------------------------------------------------------------*/
00152     void dumpTable(void);
00153 
00155     /*=========================  PROTECTED  ===============================*/
00156   protected:
00157 
00158     typedef BaseT Inherited;
00159 
00160     /*---------------------------------------------------------------------*/
00164     VRMLNodeDesc     *_pCurrentNodeDesc;
00165     NodeNameDescHash  _mNodeDescHash;
00166 
00167     bool              _bInFieldProto;
00168     bool              _bIgnoreProto;
00169 
00170 
00171     VRMLNodeDesc *findNodeDesc     (const Char8        *szNodeTypename);
00172     void          addNodeDesc      (const Char8        *szNodeTypename,
00173                                           VRMLNodeDesc *pDesc);
00174 
00175     virtual void preStandardProtos (      void);
00176     virtual void postStandardProtos(      void);
00177 
00179     /*==========================  PRIVATE  ================================*/
00180   private:
00181 
00183     VRMLNodeFactory(const VRMLNodeFactory &source);
00185     void operator =(const VRMLNodeFactory &source);
00186 };
00187 
00188 OSG_END_NAMESPACE
00189 
00190 #include <OSGVRMLNodeFactory.inl>
00191 
00192 #define OSGVRMLNODEFACTORY_HEADER_CVSID "@(#)$Id: $"
00193 
00194 #endif /* _OSGVRMLNODEFACTORY_H_ */

Generated on Thu Aug 25 04:12:07 2005 for OpenSG by  doxygen 1.4.3