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 _OSGCOLLADATEXTURE_H_
40 #define _OSGCOLLADATEXTURE_H_
42 #include "OSGConfig.h"
44 #if defined(OSG_WITH_COLLADA) || defined(OSG_DO_DOC)
46 #include "OSGColladaElement.h"
47 #include "OSGColladaElementFactoryHelper.h"
48 #include "OSGTextureObjChunk.h"
49 #include "OSGTextureEnvChunk.h"
50 #include "OSGTextureTransformChunk.h"
56 class ColladaSampler2D
;
58 /*! \ingroup GrpFileIOCollada
62 class OSG_FILEIO_DLLMAPPING ColladaTexture
: public ColladaElement
64 /*========================== PUBLIC =================================*/
68 /*---------------------------------------------------------------------*/
72 typedef ColladaElement Inherited
;
73 typedef ColladaTexture Self
;
75 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaTexture
);
78 /*---------------------------------------------------------------------*/
81 static ColladaElementTransitPtr
create(daeElement
*elem
,
82 ColladaGlobal
*global
);
85 /*---------------------------------------------------------------------*/
89 virtual void read(ColladaElement
*colElemParent
);
92 /*---------------------------------------------------------------------*/
96 ColladaEffect
*getEffect (void ) const;
97 void setEffect (ColladaEffect
*colEffect
);
100 /*---------------------------------------------------------------------*/
104 TextureObjChunk
*getTexture (void) const;
105 TextureEnvChunk
*getTexEnv (void) const;
106 TextureEnvChunk
*editTexEnv (void);
107 TextureTransformChunk
*getTexTransform (void) const;
108 TextureTransformChunk
*editTexTransform(void);
111 /*---------------------------------------------------------------------*/
115 bool hasAlpha (void) const;
116 bool hasBinaryAlpha(void) const;
118 virtual const std::string
getSemantic (void) const;
121 /*========================= PROTECTED ===============================*/
125 /*---------------------------------------------------------------------*/
126 /*! \name Constructors/Destructor */
129 ColladaTexture(daeElement
*elem
, ColladaGlobal
*global
);
130 virtual ~ColladaTexture(void );
133 /*---------------------------------------------------------------------*/
137 void readSampler( ColladaSampler2D
*colSampler
);
138 void readImage (const Char8
*texId
);
141 /*---------------------------------------------------------------------*/
143 static ColladaElementRegistrationHelper _regHelper
;
145 ColladaEffect
*_colEffect
;
146 TextureObjChunkUnrecPtr _texObj
;
147 TextureEnvChunkUnrecPtr _texEnv
;
148 TextureTransformChunkUnrecPtr _texTransform
;
149 ExtraHandlerStore _extraHandlers
;
153 ColladaTexture(const ColladaTexture
&other
);
154 void operator=(const ColladaTexture
&rhs
);
158 OSG_GEN_MEMOBJPTR(ColladaTexture
);
162 // #include "OSGColladaTexture.inl"
164 #endif // OSG_WITH_COLLADA
166 #endif // _OSGCOLLADATEXTURE_H_