fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / WRL / OSGVRMLNodeHelper.h
blob6e5777ebde46b49ba20b787f139003ac1ba5ab4d
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGVRMLNODEHELPER_H_
40 #define _OSGVRMLNODEHELPER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #define OSG_VRML_IMAGETEXTURE_MAP
47 #include "OSGFileIODef.h"
48 #include "OSGAttachment.h"
49 #include "OSGDynamicAttachmentMixin.h"
50 #include "OSGSingletonHolder.h"
52 #include "OSGVecSFields.h"
53 #include "OSGVecMFields.h"
55 #include "OSGChunkMaterial.h"
56 #include "OSGMaterialChunk.h"
57 #include "OSGVRMLAttachment.h"
58 #include "OSGImage.h"
60 #include "OSGDeprecatedCPP.h"
62 OSG_BEGIN_NAMESPACE
64 class VRMLNodeHelper;
65 class Image;
67 //---------------------------------------------------------------------------
68 // Class
69 //---------------------------------------------------------------------------
71 /*! \ingroup GrpFileIOWRLObj
72 \nohierarchy
75 struct VRMLGenericAttDesc
77 typedef VRMLAttachment Parent;
78 typedef VRMLAttachment *ParentPtr;
80 static const Char8 *getTypeName (void) { return "VRMLGenericAtt"; }
81 static const Char8 *getParentTypeName(void)
83 return "VRMLAttachment";
85 static const Char8 *getGroupName (void) { return "VRMLGenAtt"; }
88 static InitContainerF getInitMethod(void) { return NULL; }
90 static FieldDescriptionBase **getDesc (void) { return NULL; }
93 /*! \ingroup GrpFileIOWRLObj
96 typedef DynFieldAttachment<VRMLGenericAttDesc> VRMLGenericAtt;
98 /*! \ingroup GrpFileIOWRLObj
100 typedef VRMLGenericAtt::ObjUnrecPtr VRMLGenericAttUnrecPtr;
104 //---------------------------------------------------------------------------
105 // Class
106 //---------------------------------------------------------------------------
108 /*! \brief General VRML Node Desc
109 \ingroup GrpFileIOWRLObj
110 \nohierarchy
113 class OSG_FILEIO_DLLMAPPING VRMLNodeHelperFactoryBase
115 /*========================== PUBLIC =================================*/
117 public :
119 typedef boost::function<VRMLNodeHelper *(void)> CreateHelper;
121 /*! \nohierarchy
123 class OSG_FILEIO_DLLMAPPING RegisterHelper
125 public:
127 RegisterHelper( CreateHelper fCreate,
128 const Char8 *szNodeName,
129 InitFuncF fStaticInit);
132 /*---------------------------------------------------------------------*/
133 /*! \name Class Get */
134 /*! \{ */
136 /*! \} */
137 /*---------------------------------------------------------------------*/
138 /*! \name Helper */
139 /*! \{ */
142 /*! \} */
143 /*---------------------------------------------------------------------*/
144 /*! \name Field */
145 /*! \{ */
147 void registerNodeHelper( CreateHelper fHelper,
148 const Char8 *szNodeName);
150 /*! \} */
151 /*---------------------------------------------------------------------*/
152 /*! \name Prototypes */
153 /*! \{ */
155 VRMLNodeHelper *createHelper(const Char8 *szNodeName);
157 /*! \} */
158 /*---------------------------------------------------------------------*/
159 /*! \name Node */
160 /*! \{ */
162 /*! \} */
163 /*---------------------------------------------------------------------*/
164 /*! \name FieldValue */
165 /*! \{ */
168 /*! \} */
169 /*---------------------------------------------------------------------*/
170 /*! \name Dump */
171 /*! \{ */
173 /*! \} */
174 /*========================= PROTECTED ===============================*/
176 protected:
178 template <class SingletonT>
179 friend class SingletonHolder;
181 #ifdef OSG_STL_HAS_HASH_MAP
182 #ifdef OSG_USE_HASH_COMPARE
183 typedef
184 OSG_STDEXTENSION_NAMESPACE::hash_map<
185 const Char8 *,
186 CreateHelper,
187 HashCmpString > NameHelperCreateMap;
189 #else
190 typedef
191 OSG_STDEXTENSION_NAMESPACE::hash_map<
192 const Char8 *,
193 CreateHelper,
194 OSG_STDEXTENSION_NAMESPACE::hash<
195 const Char8 *>,
196 EQString > NameHelperCreateMap;
197 #endif
198 #else
199 typedef
200 std::map<const Char8 *,
201 CreateHelper,
202 LTString > NameHelperCreateMap;
203 #endif
207 /*---------------------------------------------------------------------*/
208 /*! \name Constructors */
209 /*! \{ */
211 VRMLNodeHelperFactoryBase(void);
213 /*! \} */
214 /*---------------------------------------------------------------------*/
215 /*! \name Destructor */
216 /*! \{ */
218 virtual ~VRMLNodeHelperFactoryBase(void);
220 /*! \} */
221 /*---------------------------------------------------------------------*/
222 /*! \name Member */
223 /*! \{ */
225 /*! \} */
226 /*---------------------------------------------------------------------*/
227 /*! \name Member */
228 /*! \{ */
231 NameHelperCreateMap _mRegisteredNodeHelperHash;
233 /*! \} */
234 /*========================== PRIVATE ================================*/
236 private:
238 /*!\brief prohibit default function (move to 'public' if needed) */
239 VRMLNodeHelperFactoryBase(const VRMLNodeHelperFactoryBase &source);
240 /*!\brief prohibit default function (move to 'public' if needed) */
241 void operator =(const VRMLNodeHelperFactoryBase &source);
244 #if defined(WIN32)
245 OSG_FILEIO_EXPIMP_TMPL
246 template class OSG_FILEIO_DLLMAPPING SingletonHolder<VRMLNodeHelperFactoryBase>;
247 #endif
249 /*! \ingroup GrpFileIOWRLObj
252 typedef SingletonHolder<VRMLNodeHelperFactoryBase> VRMLNodeHelperFactory;
254 //---------------------------------------------------------------------------
255 // Class
256 //---------------------------------------------------------------------------
258 /*! \brief General VRML Node Desc
259 \ingroup GrpFileIOWRLObj
260 \nohierarchy
262 This is a helper that knows how to load and handle construction of a single
263 VRML node type. This class will have one derived class for all node
264 types that can be handled by the loader.
267 class OSG_FILEIO_DLLMAPPING VRMLNodeHelper
269 /*========================== PUBLIC =================================*/
271 public :
273 /*---------------------------------------------------------------------*/
274 /*! \name Class Get */
275 /*! \{ */
277 static UInt32 getIndent (void);
278 static void incIndent (void);
279 static void decIndent (void);
280 static void resetIndent(void);
282 /*! \} */
283 /*---------------------------------------------------------------------*/
284 /*! \name Destructor */
285 /*! \{ */
287 virtual ~VRMLNodeHelper(void);
289 /*! \} */
290 /*---------------------------------------------------------------------*/
291 /*! \name Helper */
292 /*! \{ */
294 void reset(void);
296 /*! \} */
297 /*---------------------------------------------------------------------*/
298 /*! \name Field */
299 /*! \{ */
301 virtual
302 FieldContainerTransitPtr beginNode(const Char8 *szTypename,
303 const Char8 *szName,
304 FieldContainer *pCurrentFC);
306 virtual
307 void endNode ( FieldContainer * );
309 /*! \} */
310 /*---------------------------------------------------------------------*/
311 /*! \name Field */
312 /*! \{ */
314 virtual void mapFieldname(const std::string &szVRMLNodeName,
315 std::string &szFieldName );
317 /*! \} */
318 /*---------------------------------------------------------------------*/
319 /*! \name Prototypes */
320 /*! \{ */
322 virtual void init(const Char8 *szName);
324 /*! \} */
325 /*---------------------------------------------------------------------*/
326 /*! \name Node */
327 /*! \{ */
329 virtual bool prototypeAddField (const Char8 *szFieldType,
330 const UInt32 uiFieldTypeId,
331 const Char8 *szFieldName);
333 virtual void endProtoInterface (void);
335 /*! \} */
336 /*---------------------------------------------------------------------*/
337 /*! \name FieldValue */
338 /*! \{ */
340 virtual void getFieldAndDesc( FieldContainer *pFC,
341 const Char8 * szFieldname,
342 FieldContainer *&pFieldFC,
343 EditFieldHandlePtr &pField,
344 const FieldDescriptionBase *&pDesc);
346 /*! \} */
347 /*---------------------------------------------------------------------*/
348 /*! \name Dump */
349 /*! \{ */
351 virtual
352 void addFieldValue ( EditFieldHandlePtr pField,
353 const FieldDescriptionBase *pFieldDesc,
354 const Char8 *szFieldVal);
356 virtual
357 void addImageValue ( EditFieldHandlePtr pField,
358 const FieldDescriptionBase *pFieldDesc,
359 Image *pImage );
361 virtual
362 void setContainerFieldValue( FieldContainer *pFC,
363 const FieldDescriptionBase *pFieldDesc,
364 FieldContainer *pFieldFC );
366 /*! \} */
367 /*========================= PROTECTED ===============================*/
369 protected:
371 /*---------------------------------------------------------------------*/
372 /*! \name Constructors */
373 /*! \{ */
375 VRMLNodeHelper(void);
377 /*! \} */
378 /*---------------------------------------------------------------------*/
379 /*! \name Member */
380 /*! \{ */
382 static UInt32 _uiIndent;
384 /*! \} */
385 /*---------------------------------------------------------------------*/
386 /*! \name Member */
387 /*! \{ */
389 bool _bProtoInterfaceDone;
391 VRMLGenericAttUnrecPtr _pGenAttProto;
392 FieldContainerUnrecPtr _pNodeProto;
393 FieldContainerUnrecPtr _pNodeCoreProto;
395 /*! \} */
396 /*---------------------------------------------------------------------*/
397 /*! \name Member */
398 /*! \{ */
400 SFVec3f ::Description _sfVec3fDesc;
401 SFUnrecFieldContainerPtr::Description _sfFCPtrDesc;
402 SFUnrecImagePtr ::Description _sfImagePtrDesc;
403 SFReal32 ::Description _sfReal32Desc;
404 SFColor3f ::Description _sfColor3fDesc;
405 MFString ::Description _mfStringDesc;
406 SFBool ::Description _sfBoolDesc;
408 /*! \} */
409 /*---------------------------------------------------------------------*/
410 /*! \name Member */
411 /*! \{ */
413 GetFieldHandlePtr getField( FieldContainer *pFC1,
414 FieldContainer *pFC2,
415 VRMLGenericAtt * pGenAtt,
416 const Char8 *szFieldname);
418 void getField(const Char8 *szFieldname,
419 FieldContainer *&pFieldFC,
420 EditFieldHandlePtr &pField,
421 const FieldDescriptionBase *&pDesc );
423 FieldDescriptionBase *getFieldDescription(const Char8 *szFieldName,
424 const UInt32 uiFieldTypeId);
426 /*! \} */
427 /*========================== PRIVATE ================================*/
429 private:
431 /*!\brief prohibit default function (move to 'public' if needed) */
432 VRMLNodeHelper(const VRMLNodeHelper &source);
433 /*!\brief prohibit default function (move to 'public' if needed) */
434 void operator =(const VRMLNodeHelper &source);
441 //---------------------------------------------------------------------------
442 // Class
443 //---------------------------------------------------------------------------
445 /*! \brief VRML Group Helper
446 \ingroup GrpFileIOWRLObj
447 \nohierarchy
450 class OSG_FILEIO_DLLMAPPING VRMLDefaultHelper : public VRMLNodeHelper
452 /*========================== PUBLIC =================================*/
453 public :
455 /*---------------------------------------------------------------------*/
456 /*! \name Destructor */
457 /*! \{ */
459 static VRMLNodeHelper *create(void);
461 /*! \} */
462 /*---------------------------------------------------------------------*/
463 /*! \name Destructor */
464 /*! \{ */
466 virtual ~VRMLDefaultHelper(void);
468 /*! \} */
469 /*---------------------------------------------------------------------*/
470 /*! \name Helper */
471 /*! \{ */
473 virtual void init(const Char8 *szName);
475 /*! \} */
476 /*---------------------------------------------------------------------*/
477 /*! \name Field */
478 /*! \{ */
480 virtual
481 FieldContainerTransitPtr beginNode(const Char8 *szTypename,
482 const Char8 *szName,
483 FieldContainer *pCurrentFC);
485 /*! \} */
486 /*---------------------------------------------------------------------*/
487 /*! \name Node */
488 /*! \{ */
490 /*! \} */
491 /*---------------------------------------------------------------------*/
492 /*! \name Dump */
493 /*! \{ */
495 virtual void dump(const Char8 *szNodeName);
497 /*! \} */
498 /*========================= PROTECTED ===============================*/
500 protected:
502 /*---------------------------------------------------------------------*/
503 /*! \name Constructors */
504 /*! \{ */
506 VRMLDefaultHelper(void);
508 /*! \} */
509 /*---------------------------------------------------------------------*/
510 /*! \name Member */
511 /*! \{ */
513 /*! \} */
514 /*---------------------------------------------------------------------*/
515 /*! \name Dump */
516 /*! \{ */
518 /*! \} */
519 /*========================== PRIVATE ================================*/
521 private:
523 typedef VRMLNodeHelper Inherited;
525 /*!\brief prohibit default function (move to 'public' if needed) */
526 VRMLDefaultHelper(const VRMLDefaultHelper &source);
527 /*!\brief prohibit default function (move to 'public' if needed) */
528 void operator =(const VRMLDefaultHelper &source);
533 //---------------------------------------------------------------------------
534 // Class
535 //---------------------------------------------------------------------------
537 /*! \brief VRML Group Helper
538 \ingroup GrpFileIOWRLObj
539 \nohierarchy
542 template<class ContainerT>
543 class VRMLGenericHelper : public VRMLNodeHelper
545 /*========================== PUBLIC =================================*/
547 public :
549 /*---------------------------------------------------------------------*/
550 /*! \name Destructor */
551 /*! \{ */
553 static VRMLNodeHelper *create(void);
555 /*! \} */
556 /*---------------------------------------------------------------------*/
557 /*! \name Destructor */
558 /*! \{ */
560 virtual ~VRMLGenericHelper(void);
562 /*! \} */
563 /*---------------------------------------------------------------------*/
564 /*! \name Helper */
565 /*! \{ */
567 virtual void init(const Char8 *szName);
569 /*! \} */
570 /*---------------------------------------------------------------------*/
571 /*! \name Field */
572 /*! \{ */
574 static bool initStatic(void);
576 /*! \} */
577 /*---------------------------------------------------------------------*/
578 /*! \name Node */
579 /*! \{ */
581 virtual void mapFieldname(const std::string &szVRMLNodeName,
582 std::string &szFieldName );
584 /*! \} */
585 /*---------------------------------------------------------------------*/
586 /*! \name Dump */
587 /*! \{ */
589 virtual bool prototypeAddField(const Char8 *szFieldType,
590 const UInt32 uiFieldTypeId,
591 const Char8 *szFieldName);
593 virtual void getFieldAndDesc ( FieldContainer * pFC,
594 const Char8 * szFieldname,
595 FieldContainer *&pFieldFC,
596 EditFieldHandlePtr &pField,
597 const FieldDescriptionBase *&pDesc);
598 /*! \} */
599 /*---------------------------------------------------------------------*/
600 /*! \name Dump */
601 /*! \{ */
603 virtual void dump(const Char8 *szNodeName);
605 /*! \} */
606 /*========================= PROTECTED ===============================*/
608 protected:
611 typedef std::map<std::string,
612 std::string> FieldNameMap;
614 typedef FieldNameMap::const_iterator FieldNameMapConstIt;
616 static FieldNameMap _mFieldNameMap;
618 /*---------------------------------------------------------------------*/
619 /*! \name Constructors */
620 /*! \{ */
622 VRMLGenericHelper(void);
624 /*! \} */
625 /*---------------------------------------------------------------------*/
626 /*! \name Member */
627 /*! \{ */
629 /*! \} */
630 /*---------------------------------------------------------------------*/
631 /*! \name Dump */
632 /*! \{ */
634 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
636 /*! \} */
637 /*========================== PRIVATE ================================*/
639 private:
641 typedef VRMLNodeHelper Inherited;
643 /*!\brief prohibit default function (move to 'public' if needed) */
644 VRMLGenericHelper(const VRMLGenericHelper &source);
645 /*!\brief prohibit default function (move to 'public' if needed) */
646 void operator =(const VRMLGenericHelper &source);
649 #define OSG_INST_GENERICVRMLHELPER(OSGNODE) \
651 template<> \
652 VRMLGenericHelper< OSGNODE >::FieldNameMap \
653 VRMLGenericHelper< OSGNODE >::_mFieldNameMap = \
654 VRMLGenericHelper< OSGNODE >::FieldNameMap(); \
656 template class VRMLGenericHelper< OSGNODE >
658 //---------------------------------------------------------------------------
659 // Class
660 //---------------------------------------------------------------------------
662 /*! \brief VRML Material Desc
663 \ingroup GrpFileIOWRLObj
664 \nohierarchy
667 class OSG_FILEIO_DLLMAPPING VRMLMaterialHelper : public VRMLNodeHelper
669 /*========================== PUBLIC =================================*/
670 public :
672 /*---------------------------------------------------------------------*/
673 /*! \name Destructor */
674 /*! \{ */
676 virtual ~VRMLMaterialHelper(void);
678 /*! \} */
679 /*---------------------------------------------------------------------*/
680 /*! \name Helper */
681 /*! \{ */
683 virtual void init (const Char8 *szName);
685 virtual void reset ( void);
687 virtual Material *getDefaultMaterial( void);
689 /*! \} */
690 /*---------------------------------------------------------------------*/
691 /*! \name Field */
692 /*! \{ */
694 virtual bool prototypeAddField(const Char8 * szFieldType,
695 const UInt32 uiFieldTypeId,
696 const Char8 * szFieldName);
698 virtual void endProtoInterface( void);
700 virtual void getFieldAndDesc ( FieldContainer * pFC,
701 const Char8 * szFieldname,
702 FieldContainer *&pFieldFC,
703 EditFieldHandlePtr &pField,
704 const FieldDescriptionBase *&pDesc);
706 /*! \} */
707 /*---------------------------------------------------------------------*/
708 /*! \name Node */
709 /*! \{ */
711 virtual
712 FieldContainerTransitPtr beginNode(const Char8 *szTypename,
713 const Char8 *szName,
714 FieldContainer *pCurrentFC);
716 virtual
717 void endNode ( FieldContainer * );
719 /*! \} */
720 /*---------------------------------------------------------------------*/
721 /*! \name Type Specific */
722 /*! \{ */
724 const std::string &getName(void) const;
726 /*! \} */
727 /*---------------------------------------------------------------------*/
728 /*! \name Dump */
729 /*! \{ */
731 virtual void dump(const Char8 *szNodeName);
733 /*! \} */
734 /*========================= PROTECTED ===============================*/
736 protected:
738 /*---------------------------------------------------------------------*/
739 /*! \name Destructor */
740 /*! \{ */
742 static VRMLNodeHelper *create(void);
744 /*! \} */
745 /*---------------------------------------------------------------------*/
746 /*! \name Constructors */
747 /*! \{ */
749 VRMLMaterialHelper(void);
751 /*! \} */
752 /*---------------------------------------------------------------------*/
753 /*! \name Member */
754 /*! \{ */
756 SFReal32 _defaultAmbientIntensity;
757 SFColor3f _defaultDiffuseColor;
758 SFColor3f _defaultEmissiveColor;
759 SFReal32 _defaultShininess;
760 SFColor3f _defaultSpecularColor;
761 SFReal32 _defaultTransparency;
763 SFReal32 _ambientIntensity;
764 SFColor3f _diffuseColor;
765 SFColor3f _emissiveColor;
766 SFReal32 _shininess;
767 SFColor3f _specularColor;
768 SFReal32 _transparency;
770 ChunkMaterialUnrecPtr _pDefMat;
771 MaterialChunkUnrecPtr _pMat;
773 std::string _szName;
775 /*! \} */
776 /*---------------------------------------------------------------------*/
777 /*! \name Member */
778 /*! \{ */
780 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
782 /*! \} */
783 /*========================== PRIVATE ================================*/
785 private:
787 typedef VRMLNodeHelper Inherited;
789 /*!\brief prohibit default function (move to 'public' if needed) */
790 VRMLMaterialHelper(const VRMLMaterialHelper &source);
791 /*!\brief prohibit default function (move to 'public' if needed) */
792 void operator =(const VRMLMaterialHelper &source);
798 //---------------------------------------------------------------------------
799 // Class
800 //---------------------------------------------------------------------------
802 /*! \brief VRML Shape Helper
803 \ingroup GrpFileIOWRLObj
804 \nohierarchy
807 class OSG_FILEIO_DLLMAPPING VRMLShapeHelper : public VRMLNodeHelper
809 /*========================== PUBLIC =================================*/
811 public :
813 /*---------------------------------------------------------------------*/
814 /*! \name Destructor */
815 /*! \{ */
817 virtual ~VRMLShapeHelper(void);
819 /*! \} */
820 /*---------------------------------------------------------------------*/
821 /*! \name Helper */
822 /*! \{ */
824 virtual void init (const Char8 *szName );
826 void setMaterialHelper( VRMLMaterialHelper *pMaterialHelper);
828 /*! \} */
829 /*---------------------------------------------------------------------*/
830 /*! \name Get */
831 /*! \{ */
833 virtual bool prototypeAddField(const Char8 *szFieldType,
834 const UInt32 uiFieldTypeId,
835 const Char8 *szFieldName);
837 virtual void getFieldAndDesc ( FieldContainer * pFC,
838 const Char8 * szFieldname,
839 FieldContainer *&pFieldFC,
840 EditFieldHandlePtr &pField,
841 const FieldDescriptionBase *&pDesc);
844 /*! \} */
845 /*---------------------------------------------------------------------*/
846 /*! \name Node */
847 /*! \{ */
849 virtual void endNode(FieldContainer *pFC);
851 /*! \} */
852 /*---------------------------------------------------------------------*/
853 /*! \name Dump */
854 /*! \{ */
856 virtual void dump(const Char8 *szNodeName);
858 /*! \} */
859 /*========================= PROTECTED ===============================*/
861 protected:
863 /*---------------------------------------------------------------------*/
864 /*! \name Destructor */
865 /*! \{ */
867 static VRMLNodeHelper *create(void);
869 /*! \} */
870 /*---------------------------------------------------------------------*/
871 /*! \name Constructors */
872 /*! \{ */
874 VRMLShapeHelper(void);
876 /*! \} */
877 /*---------------------------------------------------------------------*/
878 /*! \name Member */
879 /*! \{ */
881 VRMLMaterialHelper *_pMaterialHelper;
883 /*! \} */
884 /*---------------------------------------------------------------------*/
885 /*! \name Member */
886 /*! \{ */
888 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
890 /*! \} */
891 /*========================== PRIVATE ================================*/
893 private:
895 typedef VRMLNodeHelper Inherited;
897 /*!\brief prohibit default function (move to 'public' if needed) */
898 VRMLShapeHelper(const VRMLShapeHelper &source);
899 /*!\brief prohibit default function (move to 'public' if needed) */
900 void operator =(const VRMLShapeHelper &source);
907 //---------------------------------------------------------------------------
908 // Class
909 //---------------------------------------------------------------------------
911 /*! \brief VRML Appearance Helper
912 \ingroup GrpFileIOWRLObj
913 \nohierarchy
916 class OSG_FILEIO_DLLMAPPING VRMLAppearanceHelper : public VRMLNodeHelper
918 /*========================== PUBLIC =================================*/
920 public :
922 /*---------------------------------------------------------------------*/
923 /*! \name Destructor */
924 /*! \{ */
926 virtual ~VRMLAppearanceHelper(void);
928 /*! \} */
929 /*---------------------------------------------------------------------*/
930 /*! \name Helper */
931 /*! \{ */
933 virtual void init (const Char8 *szName );
935 virtual void setMaterialHelper( VRMLMaterialHelper *pMaterialDesc);
937 /*! \} */
938 /*---------------------------------------------------------------------*/
939 /*! \name Field */
940 /*! \{ */
942 virtual bool prototypeAddField(const Char8 * szFieldType,
943 const UInt32 uiFieldTypeId,
944 const Char8 * szFieldName);
946 virtual void getFieldAndDesc ( FieldContainer * pFC,
947 const Char8 * szFieldname,
948 FieldContainer *&pFieldFC,
949 EditFieldHandlePtr &pField,
950 const FieldDescriptionBase *&pDesc);
952 /*! \} */
953 /*---------------------------------------------------------------------*/
954 /*! \name Node */
955 /*! \{ */
957 virtual void endNode(FieldContainer *);
959 /*! \} */
960 /*---------------------------------------------------------------------*/
961 /*! \name Field Value */
962 /*! \{ */
964 /*! \} */
965 /*---------------------------------------------------------------------*/
966 /*! \name Dump */
967 /*! \{ */
969 virtual void dump(const Char8 *szNodeName);
971 /*! \} */
972 /*========================= PROTECTED ===============================*/
974 protected:
976 /*---------------------------------------------------------------------*/
977 /*! \name Destructor */
978 /*! \{ */
980 static VRMLNodeHelper *create(void);
982 /*! \} */
983 /*---------------------------------------------------------------------*/
984 /*! \name Constructors */
985 /*! \{ */
987 VRMLAppearanceHelper(void);
989 /*! \} */
990 /*---------------------------------------------------------------------*/
991 /*! \name Member */
992 /*! \{ */
994 VRMLMaterialHelper *_pMaterialHelper;
996 /*! \} */
997 /*---------------------------------------------------------------------*/
998 /*! \name Member */
999 /*! \{ */
1001 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
1003 /*! \} */
1004 /*========================== PRIVATE ================================*/
1006 private:
1008 typedef VRMLNodeHelper Inherited;
1010 /*!\brief prohibit default function (move to 'public' if needed) */
1011 VRMLAppearanceHelper(const VRMLAppearanceHelper &source);
1012 /*!\brief prohibit default function (move to 'public' if needed) */
1013 void operator =(const VRMLAppearanceHelper &source);
1019 //---------------------------------------------------------------------------
1020 // Class
1021 //---------------------------------------------------------------------------
1023 /*! \brief VRML Indexed Geometry Help
1024 \ingroup GrpFileIOWRLObj
1025 \nohierarchy
1028 class OSG_FILEIO_DLLMAPPING VRMLIndexedGeometryHelper :
1029 public VRMLNodeHelper
1031 /*========================== PUBLIC =================================*/
1033 public :
1035 /*---------------------------------------------------------------------*/
1036 /*! \name Destructor */
1037 /*! \{ */
1039 virtual ~VRMLIndexedGeometryHelper(void);
1041 /*! \} */
1042 /*---------------------------------------------------------------------*/
1043 /*! \name Helper */
1044 /*! \{ */
1046 virtual void init(const Char8 *szName);
1048 /*! \} */
1049 /*---------------------------------------------------------------------*/
1050 /*! \name Get */
1051 /*! \{ */
1053 virtual bool prototypeAddField(const Char8 * szFieldType,
1054 const UInt32 uiFieldTypeId,
1055 const Char8 * szFieldName);
1057 virtual void getFieldAndDesc ( FieldContainer * pFC,
1058 const Char8 * szFieldname,
1059 FieldContainer *&pFieldFC,
1060 EditFieldHandlePtr &pField,
1061 const FieldDescriptionBase *&pDesc);
1063 /*! \} */
1064 /*---------------------------------------------------------------------*/
1065 /*! \name Node */
1066 /*! \{ */
1068 virtual void endNode(FieldContainer *pFC);
1070 /*! \} */
1071 /*---------------------------------------------------------------------*/
1072 /*! \name Field Value */
1073 /*! \{ */
1075 virtual
1076 void setContainerFieldValue( FieldContainer *pFC,
1077 const FieldDescriptionBase *pFieldDesc,
1078 FieldContainer *pFieldFC );
1080 /*! \} */
1081 /*---------------------------------------------------------------------*/
1082 /*! \name Dump */
1083 /*! \{ */
1085 virtual void dump(const Char8 *szNodeName);
1087 /*! \} */
1088 /*========================= PROTECTED ===============================*/
1090 protected:
1092 /*---------------------------------------------------------------------*/
1093 /*! \name Destructor */
1094 /*! \{ */
1096 static VRMLNodeHelper *create(void);
1098 /*! \} */
1099 /*---------------------------------------------------------------------*/
1100 /*! \name Constructors */
1101 /*! \{ */
1103 VRMLIndexedGeometryHelper(void);
1105 /*! \} */
1106 /*---------------------------------------------------------------------*/
1107 /*! \name Member */
1108 /*! \{ */
1110 bool _bIsFaceSet;
1111 UInt16 _uiPropertyIndex;
1113 /*! \} */
1114 /*---------------------------------------------------------------------*/
1115 /*! \name Member */
1116 /*! \{ */
1118 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperIFS;
1119 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperILS;
1121 /*! \} */
1122 /*========================== PRIVATE ================================*/
1124 private:
1126 typedef VRMLNodeHelper Inherited;
1128 /*!\brief prohibit default function (move to 'public' if needed) */
1129 VRMLIndexedGeometryHelper(const VRMLIndexedGeometryHelper &source);
1130 /*!\brief prohibit default function (move to 'public' if needed) */
1131 void operator =(const VRMLIndexedGeometryHelper &source);
1136 //---------------------------------------------------------------------------
1137 // Class
1138 //---------------------------------------------------------------------------
1140 /*! \brief VRML PointSet Geometry Help
1141 \ingroup GrpFileIOWRLObj
1142 \nohierarchy
1145 class OSG_FILEIO_DLLMAPPING VRMLPointSetGeometryHelper :
1146 public VRMLNodeHelper
1148 /*========================== PUBLIC =================================*/
1150 public :
1152 /*---------------------------------------------------------------------*/
1153 /*! \name Destructor */
1154 /*! \{ */
1156 virtual ~VRMLPointSetGeometryHelper(void);
1158 /*! \} */
1159 /*---------------------------------------------------------------------*/
1160 /*! \name Helper */
1161 /*! \{ */
1163 virtual void init(const Char8 *szName);
1165 /*! \} */
1166 /*---------------------------------------------------------------------*/
1167 /*! \name Get */
1168 /*! \{ */
1170 virtual bool prototypeAddField(const Char8 * szFieldType,
1171 const UInt32 uiFieldTypeId,
1172 const Char8 * szFieldName);
1174 virtual void getFieldAndDesc ( FieldContainer * pFC,
1175 const Char8 * szFieldname,
1176 FieldContainer *&pFieldFC,
1177 EditFieldHandlePtr &pField,
1178 const FieldDescriptionBase *&pDesc);
1180 /*! \} */
1181 /*---------------------------------------------------------------------*/
1182 /*! \name Node */
1183 /*! \{ */
1185 virtual void endNode(FieldContainer *pFC);
1187 /*! \} */
1188 /*---------------------------------------------------------------------*/
1189 /*! \name Field Value */
1190 /*! \{ */
1192 virtual
1193 void setContainerFieldValue( FieldContainer *pFC,
1194 const FieldDescriptionBase *pFieldDesc,
1195 FieldContainer *pFieldFC );
1197 /*! \} */
1198 /*---------------------------------------------------------------------*/
1199 /*! \name Dump */
1200 /*! \{ */
1202 virtual void dump(const Char8 *szNodeName);
1204 /*! \} */
1205 /*========================= PROTECTED ===============================*/
1207 protected:
1209 /*---------------------------------------------------------------------*/
1210 /*! \name Destructor */
1211 /*! \{ */
1213 static VRMLNodeHelper *create(void);
1215 /*! \} */
1216 /*---------------------------------------------------------------------*/
1217 /*! \name Constructors */
1218 /*! \{ */
1220 VRMLPointSetGeometryHelper(void);
1222 /*! \} */
1223 /*---------------------------------------------------------------------*/
1224 /*! \name Member */
1225 /*! \{ */
1227 UInt16 _uiPropertyIndex;
1229 /*! \} */
1230 /*---------------------------------------------------------------------*/
1231 /*! \name Member */
1232 /*! \{ */
1234 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperPS;
1236 /*! \} */
1237 /*========================== PRIVATE ================================*/
1239 private:
1241 typedef VRMLNodeHelper Inherited;
1243 /*!\brief prohibit default function (move to 'public' if needed) */
1244 VRMLPointSetGeometryHelper(const VRMLPointSetGeometryHelper &source);
1245 /*!\brief prohibit default function (move to 'public' if needed) */
1246 void operator =(const VRMLPointSetGeometryHelper &source);
1251 //---------------------------------------------------------------------------
1252 // Class
1253 //---------------------------------------------------------------------------
1255 /*! \brief VRML Gemetry Part Helper
1256 \ingroup GrpFileIOWRLObj
1257 \nohierarchy
1260 class OSG_FILEIO_DLLMAPPING VRMLGeometryPartHelper : public VRMLNodeHelper
1262 /*========================== PUBLIC =================================*/
1264 public :
1266 /*---------------------------------------------------------------------*/
1267 /*! \name Destructor */
1268 /*! \{ */
1270 virtual ~VRMLGeometryPartHelper(void);
1272 /*! \} */
1273 /*---------------------------------------------------------------------*/
1274 /*! \name Helper */
1275 /*! \{ */
1277 virtual void init(const Char8 *szName);
1279 /*! \} */
1280 /*---------------------------------------------------------------------*/
1281 /*! \name Field */
1282 /*! \{ */
1284 virtual bool prototypeAddField(const Char8 * szFieldType,
1285 const UInt32 uiFieldTypeId,
1286 const Char8 * szFieldName);
1288 virtual void getFieldAndDesc ( FieldContainer * pFC,
1289 const Char8 * szFieldname,
1290 FieldContainer *&pFieldFC,
1291 EditFieldHandlePtr &pField,
1292 const FieldDescriptionBase *&pDesc);
1294 /*! \} */
1295 /*---------------------------------------------------------------------*/
1296 /*! \name Node */
1297 /*! \{ */
1299 virtual void mapFieldname(const std::string &szVRMLNodeName,
1300 std::string &szFieldName );
1302 /*! \} */
1303 /*---------------------------------------------------------------------*/
1304 /*! \name Dump */
1305 /*! \{ */
1307 virtual void dump(const Char8 *szNodeName);
1309 /*! \} */
1310 /*========================= PROTECTED ===============================*/
1312 protected:
1314 /*---------------------------------------------------------------------*/
1315 /*! \name Destructor */
1316 /*! \{ */
1318 static VRMLNodeHelper *create(void);
1320 /*! \} */
1321 /*---------------------------------------------------------------------*/
1322 /*! \name Constructors */
1323 /*! \{ */
1325 VRMLGeometryPartHelper(void);
1327 /*! \} */
1328 /*---------------------------------------------------------------------*/
1329 /*! \name Member */
1330 /*! \{ */
1332 std::string _szVRMLPartname;
1333 std::string _szOSGPartname;
1334 std::string _szOSGProtoname;
1336 /*! \} */
1337 /*---------------------------------------------------------------------*/
1338 /*! \name Member */
1339 /*! \{ */
1341 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperCoordinate;
1342 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperNormal;
1343 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperColor;
1344 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperTexCoordinate;
1346 /*! \} */
1347 /*========================== PRIVATE ================================*/
1349 private:
1351 typedef VRMLNodeHelper Inherited;
1353 /*!\brief prohibit default function (move to 'public' if needed) */
1354 VRMLGeometryPartHelper(const VRMLGeometryPartHelper &source);
1355 /*!\brief prohibit default function (move to 'public' if needed) */
1356 void operator =(const VRMLGeometryPartHelper &source);
1360 //---------------------------------------------------------------------------
1361 // Class
1362 //---------------------------------------------------------------------------
1364 /*! \brief VRML Gemetry Object Desc
1365 \ingroup GrpFileIOWRLObj
1366 \nohierarchy
1369 class OSG_FILEIO_DLLMAPPING VRMLGeometryObjectHelper : public VRMLNodeHelper
1371 /*========================== PUBLIC =================================*/
1372 public :
1374 /*---------------------------------------------------------------------*/
1375 /*! \name Destructor */
1376 /*! \{ */
1378 virtual ~VRMLGeometryObjectHelper(void);
1380 /*! \} */
1381 /*---------------------------------------------------------------------*/
1382 /*! \name Helper */
1383 /*! \{ */
1385 virtual void init(const Char8 *szName);
1387 /*! \} */
1388 /*---------------------------------------------------------------------*/
1389 /*! \name Field */
1390 /*! \{ */
1392 /*! \} */
1393 /*---------------------------------------------------------------------*/
1394 /*! \name Node */
1395 /*! \{ */
1397 virtual void endNode(FieldContainer *);
1399 /*! \} */
1400 /*---------------------------------------------------------------------*/
1401 /*! \name Dump */
1402 /*! \{ */
1404 virtual void dump(const Char8 *szNodeName);
1406 /*! \} */
1407 /*========================= PROTECTED ===============================*/
1409 protected:
1411 enum GeoObjectType
1413 UnknownGeo = 0x0000,
1414 BoxGeo = 0x0001,
1415 SphereGeo = 0x0002,
1416 ConeGeo = 0x0003,
1417 CylinderGeo = 0x0004,
1418 TeapotGeo = 0x0005,
1419 PlaneGeo = 0x0006
1422 /*---------------------------------------------------------------------*/
1423 /*! \name Constructors */
1424 /*! \{ */
1426 VRMLGeometryObjectHelper(void);
1428 /*! \} */
1429 /*---------------------------------------------------------------------*/
1430 /*! \name Constructors */
1431 /*! \{ */
1433 static VRMLNodeHelper *create(void);
1435 /*! \} */
1436 /*---------------------------------------------------------------------*/
1437 /*! \name Member */
1438 /*! \{ */
1440 GeoObjectType _eVRMLObjectType;
1442 /*! \} */
1443 /*---------------------------------------------------------------------*/
1444 /*! \name Member */
1445 /*! \{ */
1447 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperSphere;
1448 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperBox;
1449 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperCone;
1450 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperCylinder;
1451 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperTeapot;
1452 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelperPlane;
1454 /*! \} */
1455 /*========================== PRIVATE ================================*/
1457 private:
1459 typedef VRMLNodeHelper Inherited;
1461 /*!\brief prohibit default function (move to 'public' if needed) */
1462 VRMLGeometryObjectHelper(const VRMLGeometryObjectHelper &source);
1463 /*!\brief prohibit default function (move to 'public' if needed) */
1464 void operator =(const VRMLGeometryObjectHelper &source);
1468 //---------------------------------------------------------------------------
1469 // Class
1470 //---------------------------------------------------------------------------
1472 /*! \brief VRML Texture Helper
1473 \ingroup GrpFileIOWRLObj
1474 \nohierarchy
1477 class OSG_FILEIO_DLLMAPPING VRMLTextureHelper : public VRMLNodeHelper
1479 /*========================== PUBLIC =================================*/
1480 public :
1482 /*---------------------------------------------------------------------*/
1483 /*! \name Destructor */
1484 /*! \{ */
1486 virtual ~VRMLTextureHelper(void);
1488 /*! \} */
1489 /*---------------------------------------------------------------------*/
1490 /*! \name Helper */
1491 /*! \{ */
1493 /*! \} */
1494 /*---------------------------------------------------------------------*/
1495 /*! \name Field */
1496 /*! \{ */
1498 virtual bool prototypeAddField(const Char8 * szFieldType,
1499 const UInt32 uiFieldTypeId,
1500 const Char8 * szFieldName);
1502 virtual void getFieldAndDesc ( FieldContainer * pFC,
1503 const Char8 * szFieldname,
1504 FieldContainer *&pFieldFC,
1505 EditFieldHandlePtr &pField,
1506 const FieldDescriptionBase *&pDesc);
1508 /*! \} */
1509 /*---------------------------------------------------------------------*/
1510 /*! \name Node */
1511 /*! \{ */
1513 virtual
1514 FieldContainerTransitPtr beginNode(const Char8 *szTypename,
1515 const Char8 *szName,
1516 FieldContainer *pCurrentFC);
1518 virtual
1519 void endNode ( FieldContainer * );
1521 /*! \} */
1522 /*---------------------------------------------------------------------*/
1523 /*! \name Dump */
1524 /*! \{ */
1526 virtual void dump(const Char8 *szNodeName);
1528 /*! \} */
1529 /*========================= PROTECTED ===============================*/
1531 protected:
1533 /*---------------------------------------------------------------------*/
1534 /*! \name Destructor */
1535 /*! \{ */
1537 /*! \} */
1538 /*---------------------------------------------------------------------*/
1539 /*! \name Constructors */
1540 /*! \{ */
1542 VRMLTextureHelper(void);
1544 /*! \} */
1545 /*---------------------------------------------------------------------*/
1546 /*! \name Member */
1547 /*! \{ */
1549 SFBool _defaultRepeatS;
1550 SFBool _defaultRepeatT;
1552 SFBool _repeatS;
1553 SFBool _repeatT;
1555 /*! \} */
1556 /*---------------------------------------------------------------------*/
1557 /*! \name Member */
1558 /*! \{ */
1560 /*! \} */
1561 /*========================== PRIVATE ================================*/
1562 private:
1564 typedef VRMLNodeHelper Inherited;
1566 /*!\brief prohibit default function (move to 'public' if needed) */
1567 VRMLTextureHelper(const VRMLTextureHelper &source);
1568 /*!\brief prohibit default function (move to 'public' if needed) */
1569 void operator =(const VRMLTextureHelper &source);
1573 //---------------------------------------------------------------------------
1574 // Class
1575 //---------------------------------------------------------------------------
1577 /*! \brief VRML Image Texture Helper
1578 \ingroup GrpFileIOWRLObj
1579 \nohierarchy
1582 class OSG_FILEIO_DLLMAPPING VRMLImageTextureHelper : public VRMLTextureHelper
1584 /*========================== PUBLIC =================================*/
1585 public :
1587 /*---------------------------------------------------------------------*/
1588 /*! \name Destructor */
1589 /*! \{ */
1591 virtual ~VRMLImageTextureHelper(void);
1593 /*! \} */
1594 /*---------------------------------------------------------------------*/
1595 /*! \name Helper */
1596 /*! \{ */
1598 /*! \} */
1599 /*---------------------------------------------------------------------*/
1600 /*! \name Field */
1601 /*! \{ */
1603 virtual bool prototypeAddField(const Char8 * szFieldType,
1604 const UInt32 uiFieldTypeId,
1605 const Char8 * szFieldName);
1607 virtual void getFieldAndDesc ( FieldContainer * pFC,
1608 const Char8 * szFieldname,
1609 FieldContainer *&pFieldFC,
1610 EditFieldHandlePtr &pField,
1611 const FieldDescriptionBase *&pDesc);
1613 /*! \} */
1614 /*---------------------------------------------------------------------*/
1615 /*! \name Node */
1616 /*! \{ */
1618 virtual
1619 FieldContainerTransitPtr beginNode(const Char8 *szTypename,
1620 const Char8 *szName,
1621 FieldContainer *pCurrentFC);
1623 virtual
1624 void endNode ( FieldContainer * );
1626 /*! \} */
1627 /*---------------------------------------------------------------------*/
1628 /*! \name Dump */
1629 /*! \{ */
1631 virtual void dump(const Char8 *szNodeName);
1633 /*! \} */
1634 /*========================= PROTECTED ===============================*/
1636 protected:
1638 typedef std::map<std::string, Image *> UrlImageMap;
1640 /*---------------------------------------------------------------------*/
1641 /*! \name Destructor */
1642 /*! \{ */
1644 static VRMLNodeHelper *create(void);
1646 /*! \} */
1647 /*---------------------------------------------------------------------*/
1648 /*! \name Constructors */
1649 /*! \{ */
1651 VRMLImageTextureHelper(void);
1653 /*! \} */
1654 /*---------------------------------------------------------------------*/
1655 /*! \name Member */
1656 /*! \{ */
1658 MFString _defaultURL;
1660 MFString _url;
1662 #ifdef OSG_VRML_IMAGETEXTURE_MAP
1663 UrlImageMap _urlImageMap;
1664 #endif
1666 /*! \} */
1667 /*---------------------------------------------------------------------*/
1668 /*! \name Member */
1669 /*! \{ */
1671 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
1673 /*! \} */
1674 /*========================== PRIVATE ================================*/
1675 private:
1677 typedef VRMLTextureHelper Inherited;
1679 /*!\brief prohibit default function (move to 'public' if needed) */
1680 VRMLImageTextureHelper(const VRMLImageTextureHelper &source);
1681 /*!\brief prohibit default function (move to 'public' if needed) */
1682 void operator =(const VRMLImageTextureHelper &source);
1687 //---------------------------------------------------------------------------
1688 // Class
1689 //---------------------------------------------------------------------------
1691 /*! \brief VRML Image Texture Helper
1692 \ingroup GrpFileIOWRLObj
1693 \nohierarchy
1696 class OSG_FILEIO_DLLMAPPING VRMLPixelTextureHelper : public VRMLTextureHelper
1698 /*========================== PUBLIC =================================*/
1699 public :
1701 /*---------------------------------------------------------------------*/
1702 /*! \name Destructor */
1703 /*! \{ */
1705 virtual ~VRMLPixelTextureHelper(void);
1707 /*! \} */
1708 /*---------------------------------------------------------------------*/
1709 /*! \name Helper */
1710 /*! \{ */
1712 virtual
1713 void addImageValue( EditFieldHandlePtr pField,
1714 const FieldDescriptionBase *pFieldDesc,
1715 Image *pImage );
1717 /*! \} */
1718 /*---------------------------------------------------------------------*/
1719 /*! \name Field */
1720 /*! \{ */
1722 virtual bool prototypeAddField(const Char8 * szFieldType,
1723 const UInt32 uiFieldTypeId,
1724 const Char8 * szFieldName);
1726 virtual void getFieldAndDesc ( FieldContainer * pFC,
1727 const Char8 * szFieldname,
1728 FieldContainer *&pFieldFC,
1729 EditFieldHandlePtr &pField,
1730 const FieldDescriptionBase *&pDesc);
1732 /*! \} */
1733 /*---------------------------------------------------------------------*/
1734 /*! \name Node */
1735 /*! \{ */
1737 virtual
1738 FieldContainerTransitPtr beginNode(const Char8 *szTypename,
1739 const Char8 *szName,
1740 FieldContainer *pCurrentFC);
1742 virtual
1743 void endNode ( FieldContainer * );
1745 /*! \} */
1746 /*---------------------------------------------------------------------*/
1747 /*! \name Dump */
1748 /*! \{ */
1750 virtual void dump(const Char8 *szNodeName);
1752 /*! \} */
1753 /*========================= PROTECTED ===============================*/
1755 protected:
1757 /*---------------------------------------------------------------------*/
1758 /*! \name Destructor */
1759 /*! \{ */
1761 static VRMLNodeHelper *create(void);
1763 /*! \} */
1764 /*---------------------------------------------------------------------*/
1765 /*! \name Constructors */
1766 /*! \{ */
1768 VRMLPixelTextureHelper(void);
1770 /*! \} */
1771 /*---------------------------------------------------------------------*/
1772 /*! \name Member */
1773 /*! \{ */
1775 ImageUnrecPtr _pImage;
1777 /*! \} */
1778 /*---------------------------------------------------------------------*/
1779 /*! \name Member */
1780 /*! \{ */
1782 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
1784 /*! \} */
1785 /*========================== PRIVATE ================================*/
1786 private:
1788 typedef VRMLTextureHelper Inherited;
1790 /*!\brief prohibit default function (move to 'public' if needed) */
1791 VRMLPixelTextureHelper(const VRMLPixelTextureHelper &source);
1792 /*!\brief prohibit default function (move to 'public' if needed) */
1793 void operator =(const VRMLPixelTextureHelper &source);
1797 //---------------------------------------------------------------------------
1798 // Class
1799 //---------------------------------------------------------------------------
1801 /*! \brief VRML Group Helper
1802 \ingroup GrpFileIOWRLObj
1803 \nohierarchy
1806 class OSG_FILEIO_DLLMAPPING VRMLInlineHelper : public VRMLNodeHelper
1808 /*========================== PUBLIC =================================*/
1809 public :
1811 /*---------------------------------------------------------------------*/
1812 /*! \name Destructor */
1813 /*! \{ */
1815 virtual ~VRMLInlineHelper(void);
1817 /*! \} */
1818 /*---------------------------------------------------------------------*/
1819 /*! \name Helper */
1820 /*! \{ */
1822 virtual void init(const Char8 *szName);
1824 /*! \} */
1825 /*---------------------------------------------------------------------*/
1826 /*! \name Field */
1827 /*! \{ */
1829 /*! \} */
1830 /*---------------------------------------------------------------------*/
1831 /*! \name Node */
1832 /*! \{ */
1834 virtual void endNode(FieldContainer *pFC);
1836 /*! \} */
1837 /*---------------------------------------------------------------------*/
1838 /*! \name Dump */
1839 /*! \{ */
1841 virtual void dump(const Char8 *szNodeName);
1843 /*! \} */
1844 /*========================= PROTECTED ===============================*/
1846 protected:
1848 /*---------------------------------------------------------------------*/
1849 /*! \name Destructor */
1850 /*! \{ */
1852 static VRMLNodeHelper *create(void);
1854 /*! \} */
1855 /*---------------------------------------------------------------------*/
1856 /*! \name Constructors */
1857 /*! \{ */
1859 VRMLInlineHelper(void);
1861 /*! \} */
1862 /*---------------------------------------------------------------------*/
1863 /*! \name Member */
1864 /*! \{ */
1866 /*! \} */
1867 /*---------------------------------------------------------------------*/
1868 /*! \name Dump */
1869 /*! \{ */
1871 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
1873 /*! \} */
1874 /*========================== PRIVATE ================================*/
1876 private:
1878 typedef VRMLNodeHelper Inherited;
1880 /*!\brief prohibit default function (move to 'public' if needed) */
1881 VRMLInlineHelper(const VRMLInlineHelper &source);
1882 /*!\brief prohibit default function (move to 'public' if needed) */
1883 void operator =(const VRMLInlineHelper &source);
1887 //---------------------------------------------------------------------------
1888 // Class
1889 //---------------------------------------------------------------------------
1891 /*! \brief VRML Shape Helper
1892 \ingroup GrpFileIOWRLObj
1893 \nohierarchy
1896 class OSG_FILEIO_DLLMAPPING VRMLSwitchHelper : public VRMLNodeHelper
1898 /*========================== PUBLIC =================================*/
1900 public :
1902 /*---------------------------------------------------------------------*/
1903 /*! \name Destructor */
1904 /*! \{ */
1906 virtual ~VRMLSwitchHelper(void);
1908 /*! \} */
1909 /*---------------------------------------------------------------------*/
1910 /*! \name Helper */
1911 /*! \{ */
1913 virtual void init(const Char8 *szName);
1915 /*! \} */
1916 /*---------------------------------------------------------------------*/
1917 /*! \name Get */
1918 /*! \{ */
1920 virtual bool prototypeAddField(const Char8 *szFieldType,
1921 const UInt32 uiFieldTypeId,
1922 const Char8 *szFieldName);
1924 virtual void getFieldAndDesc ( FieldContainer * pFC,
1925 const Char8 * szFieldname,
1926 FieldContainer *&pFieldFC,
1927 EditFieldHandlePtr &pField,
1928 const FieldDescriptionBase *&pDesc);
1931 /*! \} */
1932 /*---------------------------------------------------------------------*/
1933 /*! \name Dump */
1934 /*! \{ */
1936 virtual void dump(const Char8 *szNodeName);
1938 /*! \} */
1939 /*========================= PROTECTED ===============================*/
1941 protected:
1943 /*---------------------------------------------------------------------*/
1944 /*! \name Destructor */
1945 /*! \{ */
1947 static VRMLNodeHelper *create(void);
1949 /*! \} */
1950 /*---------------------------------------------------------------------*/
1951 /*! \name Constructors */
1952 /*! \{ */
1954 VRMLSwitchHelper(void);
1956 /*! \} */
1957 /*---------------------------------------------------------------------*/
1958 /*! \name Member */
1959 /*! \{ */
1961 /*! \} */
1962 /*---------------------------------------------------------------------*/
1963 /*! \name Member */
1964 /*! \{ */
1966 static VRMLNodeHelperFactoryBase::RegisterHelper _regHelper;
1968 /*! \} */
1969 /*========================== PRIVATE ================================*/
1971 private:
1973 typedef VRMLNodeHelper Inherited;
1975 /*!\brief prohibit default function (move to 'public' if needed) */
1976 VRMLSwitchHelper(const VRMLSwitchHelper &source);
1977 /*!\brief prohibit default function (move to 'public' if needed) */
1978 void operator =(const VRMLSwitchHelper &source);
1981 OSG_END_NAMESPACE
1983 #include "OSGVRMLNodeHelper.inl"
1985 #endif /* _OSGVRMLNODEHELPER_H_ */