1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2009 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
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>
55 /*! \ingroup GrpFileIOCollada
59 class OSG_FILEIO_DLLMAPPING ColladaInstanceGeometry
60 : public ColladaInstanceElement
62 /*========================== PUBLIC =================================*/
64 /*---------------------------------------------------------------------*/
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
;
80 /*---------------------------------------------------------------------*/
84 static ColladaElementTransitPtr
85 create(daeElement
*elem
, ColladaGlobal
*global
);
88 /*---------------------------------------------------------------------*/
92 virtual void read(ColladaElement
*colElemParent
);
95 /*---------------------------------------------------------------------*/
99 virtual ColladaGeometry
*getTargetElem (void) const;
100 virtual daeElement
*getTargetDOMElem(void) const;
102 const MaterialMap
&getMaterialMap (void) const;
105 /*========================= PROTECTED ===============================*/
107 /*---------------------------------------------------------------------*/
108 /*! \name Constructors/Destructor */
111 ColladaInstanceGeometry(daeElement
*elem
, ColladaGlobal
*global
);
112 virtual ~ColladaInstanceGeometry(void );
115 /*---------------------------------------------------------------------*/
116 /*! \name Helper functions */
119 void readBindMaterial(domBind_material
*bindMat
);
122 /*---------------------------------------------------------------------*/
124 static ColladaElementRegistrationHelper _regHelper
;
129 OSG_GEN_MEMOBJPTR(ColladaInstanceGeometry
);
133 // #include "OSGColladaInstanceGeometry.inl"
135 #endif // OSG_WITH_COLLADA
137 #endif // _OSGCOLLADAINSTANCEGEOMETRY_H_