fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / Collada / OSGColladaInstanceMaterial.h
blob1581ab1dc3916dcf0909a5c19bbce97651a489b7
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 _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>
52 OSG_BEGIN_NAMESPACE
54 // forward decl
55 class ColladaInstanceEffect;
57 /*! \ingroup GrpFileIOCollada
58 \nohierarchy
61 class OSG_FILEIO_DLLMAPPING ColladaInstanceMaterial
62 : public ColladaInstanceElement
64 /*========================== PUBLIC =================================*/
65 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Types */
68 /*! \{ */
70 typedef ColladaInstanceElement Inherited;
71 typedef ColladaInstanceMaterial Self;
73 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaInstanceMaterial);
75 /*! \nohierarchy
77 struct BindInfo
79 std::string semantic;
80 std::string target;
82 BindInfo(void) : semantic(), target() {}
85 typedef std::vector<BindInfo> BindStore;
86 typedef BindStore::iterator BindStoreIt;
87 typedef BindStore::const_iterator BindStoreConstIt;
89 /*! \nohierarchy
91 struct BindVertexInfo
93 std::string semantic;
94 std::string inSemantic;
95 UInt32 inSet;
97 BindVertexInfo(void): semantic(), inSemantic(), inSet() {}
100 typedef std::vector<BindVertexInfo> BindVertexStore;
101 typedef BindVertexStore::iterator BindVertexStoreIt;
102 typedef BindVertexStore::const_iterator BindVertexStoreConstIt;
104 /*! \} */
105 /*---------------------------------------------------------------------*/
106 /*! \name Create */
107 /*! \{ */
109 static ColladaElementTransitPtr
110 create(daeElement *elem, ColladaGlobal *global);
112 /*! \} */
113 /*---------------------------------------------------------------------*/
114 /*! \name Reading */
115 /*! \{ */
117 virtual void read(ColladaElement *colElemParent);
119 /*! \} */
120 /*---------------------------------------------------------------------*/
121 /*! \name Access */
122 /*! \{ */
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;
141 /*! \} */
142 /*========================= PROTECTED ===============================*/
143 protected:
144 /*---------------------------------------------------------------------*/
145 /*! \name Constructors/Destructor */
146 /*! \{ */
148 ColladaInstanceMaterial(daeElement *elem, ColladaGlobal *global);
149 virtual ~ColladaInstanceMaterial(void );
151 /*! \} */
152 /*---------------------------------------------------------------------*/
154 static ColladaElementRegistrationHelper _regHelper;
156 std::string _symbol;
157 std::string _target;
158 BindStore _bindStore;
159 BindVertexStore _bindVertexStore;
162 OSG_GEN_MEMOBJPTR(ColladaInstanceMaterial);
164 OSG_END_NAMESPACE
166 // #include "OSGColladaInstanceMaterial.inl"
168 #endif // OSG_WITH_COLLADA
170 #endif // _OSGCOLLADAINSTANCEMATERIAL_H_