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 _OSGCOLLADAINSTANCEMATERIAL_H_
40 #define _OSGCOLLADAINSTANCEMATERIAL_H_
42 #include "OSGConfig.h"
44 #if defined(OSG_WITH_COLLADA) || defined(OSG_DO_DOC)
46 #include "OSGColladaInstanceElement.h"
47 #include "OSGColladaMaterial.h"
48 #include "OSGColladaElementFactoryHelper.h"
50 #include <dom/domMaterial.h>
55 class ColladaInstanceEffect
;
57 /*! \ingroup GrpFileIOCollada
61 class OSG_FILEIO_DLLMAPPING ColladaInstanceMaterial
62 : public ColladaInstanceElement
64 /*========================== PUBLIC =================================*/
66 /*---------------------------------------------------------------------*/
70 typedef ColladaInstanceElement Inherited
;
71 typedef ColladaInstanceMaterial Self
;
73 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaInstanceMaterial
);
82 BindInfo(void) : semantic(), target() {}
85 typedef std::vector
<BindInfo
> BindStore
;
86 typedef BindStore::iterator BindStoreIt
;
87 typedef BindStore::const_iterator BindStoreConstIt
;
94 std::string inSemantic
;
97 BindVertexInfo(void): semantic(), inSemantic(), inSet() {}
100 typedef std::vector
<BindVertexInfo
> BindVertexStore
;
101 typedef BindVertexStore::iterator BindVertexStoreIt
;
102 typedef BindVertexStore::const_iterator BindVertexStoreConstIt
;
105 /*---------------------------------------------------------------------*/
109 static ColladaElementTransitPtr
110 create(daeElement
*elem
, ColladaGlobal
*global
);
113 /*---------------------------------------------------------------------*/
117 virtual void read(ColladaElement
*colElemParent
);
120 /*---------------------------------------------------------------------*/
124 virtual ColladaMaterial
*getTargetElem (void) const;
125 virtual domMaterial
*getTargetDOMElem (void) const;
127 const std::string
&getSymbol (void) const;
128 const std::string
&getTarget (void) const;
130 const BindStore
&getBindStore (void ) const;
131 const BindInfo
*findBindInfo (
132 const std::string
&semantic
) const;
134 const BindVertexStore
&getBindVertexStore(void ) const;
135 const BindVertexInfo
*findBindVertexInfo(
136 const std::string
&inSemantic
,
137 UInt32 inSet
) const;
139 ColladaInstanceEffect
*getInstanceEffect(void ) const;
142 /*========================= PROTECTED ===============================*/
144 /*---------------------------------------------------------------------*/
145 /*! \name Constructors/Destructor */
148 ColladaInstanceMaterial(daeElement
*elem
, ColladaGlobal
*global
);
149 virtual ~ColladaInstanceMaterial(void );
152 /*---------------------------------------------------------------------*/
154 static ColladaElementRegistrationHelper _regHelper
;
158 BindStore _bindStore
;
159 BindVertexStore _bindVertexStore
;
162 OSG_GEN_MEMOBJPTR(ColladaInstanceMaterial
);
166 // #include "OSGColladaInstanceMaterial.inl"
168 #endif // OSG_WITH_COLLADA
170 #endif // _OSGCOLLADAINSTANCEMATERIAL_H_