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 _OSGCOLLADAINSTANCEEFFECT_H_
40 #define _OSGCOLLADAINSTANCEEFFECT_H_
42 #include "OSGConfig.h"
44 #if defined(OSG_WITH_COLLADA) || defined(OSG_DO_DOC)
46 #include "OSGColladaInstanceElement.h"
47 #include "OSGColladaEffect.h"
48 #include "OSGColladaElementFactoryHelper.h"
49 #include "OSGMaterial.h"
51 #include <dom/domEffect.h>
55 /*! \ingroup GrpFileIOCollada
59 class OSG_FILEIO_DLLMAPPING ColladaInstanceEffect
60 : public ColladaInstanceElement
62 /*========================== PUBLIC =================================*/
64 /*---------------------------------------------------------------------*/
68 typedef ColladaInstanceElement Inherited
;
69 typedef ColladaInstanceEffect Self
;
71 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaInstanceEffect
);
73 // map <texture texcoord="Symbol"> to material texture slot
74 typedef std::map
<std::string
, UInt32
> TCSymbolToSlotMap
;
75 typedef TCSymbolToSlotMap::iterator TCSymbolToSlotMapIt
;
76 typedef TCSymbolToSlotMap::const_iterator TCSymbolToSlotMapConstIt
;
79 /*---------------------------------------------------------------------*/
83 static ColladaElementTransitPtr
84 create(daeElement
*elem
, ColladaGlobal
*global
);
87 /*---------------------------------------------------------------------*/
91 virtual void read(ColladaElement
*colElemParent
);
94 /*---------------------------------------------------------------------*/
98 virtual ColladaEffect
*getTargetElem (void) const;
99 virtual domEffect
*getTargetDOMElem(void) const;
101 const TCSymbolToSlotMap
&getTCMap (void) const;
102 TCSymbolToSlotMap
&editTCMap(void);
104 bool findTC (const std::string
&tcSymbol
,
105 UInt32
&texSlot
) const;
108 /*========================= PROTECTED ===============================*/
110 /*---------------------------------------------------------------------*/
111 /*! \name Constructors/Destructor */
114 ColladaInstanceEffect(daeElement
*elem
, ColladaGlobal
*global
);
115 virtual ~ColladaInstanceEffect(void );
118 /*---------------------------------------------------------------------*/
120 static ColladaElementRegistrationHelper _regHelper
;
122 TCSymbolToSlotMap _tcMap
;
125 OSG_GEN_MEMOBJPTR(ColladaInstanceEffect
);
129 // #include "OSGColladaInstanceEffect.inl"
131 #endif // OSG_WITH_COLLADA
133 #endif // _OSGCOLLADAINSTANCEEFFECT_H_