fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / Collada / OSGColladaInstanceGeometry.h
blob4d1c905615a69fdade00151c7bb93531a78d06b1
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2009 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 _OSGCOLLADAINSTANCEGEOMETRY_H_
40 #define _OSGCOLLADAINSTANCEGEOMETRY_H_
42 #include "OSGConfig.h"
44 #if defined(OSG_WITH_COLLADA) || defined(OSG_DO_DOC)
46 #include "OSGColladaInstanceElement.h"
47 #include "OSGColladaGeometry.h"
48 #include "OSGColladaInstanceMaterial.h"
49 #include "OSGColladaElementFactoryHelper.h"
51 #include <dom/domGeometry.h>
53 OSG_BEGIN_NAMESPACE
55 /*! \ingroup GrpFileIOCollada
56 \nohierarchy
59 class OSG_FILEIO_DLLMAPPING ColladaInstanceGeometry
60 : public ColladaInstanceElement
62 /*========================== PUBLIC =================================*/
63 public:
64 /*---------------------------------------------------------------------*/
65 /*! \name Types */
66 /*! \{ */
68 typedef ColladaInstanceElement Inherited;
69 typedef ColladaInstanceGeometry Self;
71 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaInstanceGeometry);
73 // map material symbol to material instance
74 typedef std::map<std::string,
75 ColladaInstanceMaterialRefPtr> MaterialMap;
76 typedef MaterialMap::iterator MaterialMapIt;
77 typedef MaterialMap::const_iterator MaterialMapConstIt;
79 /*! \} */
80 /*---------------------------------------------------------------------*/
81 /*! \name Create */
82 /*! \{ */
84 static ColladaElementTransitPtr
85 create(daeElement *elem, ColladaGlobal *global);
87 /*! \} */
88 /*---------------------------------------------------------------------*/
89 /*! \name Reading */
90 /*! \{ */
92 virtual void read(ColladaElement *colElemParent);
94 /*! \} */
95 /*---------------------------------------------------------------------*/
96 /*! \name Access */
97 /*! \{ */
99 virtual ColladaGeometry *getTargetElem (void) const;
100 virtual daeElement *getTargetDOMElem(void) const;
102 const MaterialMap &getMaterialMap (void) const;
104 /*! \} */
105 /*========================= PROTECTED ===============================*/
106 protected:
107 /*---------------------------------------------------------------------*/
108 /*! \name Constructors/Destructor */
109 /*! \{ */
111 ColladaInstanceGeometry(daeElement *elem, ColladaGlobal *global);
112 virtual ~ColladaInstanceGeometry(void );
114 /*! \} */
115 /*---------------------------------------------------------------------*/
116 /*! \name Helper functions */
117 /*! \{ */
119 void readBindMaterial(domBind_material *bindMat);
121 /*! \} */
122 /*---------------------------------------------------------------------*/
124 static ColladaElementRegistrationHelper _regHelper;
126 MaterialMap _matMap;
129 OSG_GEN_MEMOBJPTR(ColladaInstanceGeometry);
131 OSG_END_NAMESPACE
133 // #include "OSGColladaInstanceGeometry.inl"
135 #endif // OSG_WITH_COLLADA
137 #endif // _OSGCOLLADAINSTANCEGEOMETRY_H_