fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / Collada / OSGColladaTexture.h
blob9e8106dc9691f682a8d0675a519a8554322e65a6
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 _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"
52 OSG_BEGIN_NAMESPACE
54 // forward decl
55 class ColladaEffect;
56 class ColladaSampler2D;
58 /*! \ingroup GrpFileIOCollada
59 \nohierarchy
62 class OSG_FILEIO_DLLMAPPING ColladaTexture : public ColladaElement
64 /*========================== PUBLIC =================================*/
66 public:
68 /*---------------------------------------------------------------------*/
69 /*! \name Types */
70 /*! \{ */
72 typedef ColladaElement Inherited;
73 typedef ColladaTexture Self;
75 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaTexture);
77 /*! \} */
78 /*---------------------------------------------------------------------*/
79 /*! \name Create */
80 /*! \{ */
81 static ColladaElementTransitPtr create(daeElement *elem,
82 ColladaGlobal *global);
84 /*! \} */
85 /*---------------------------------------------------------------------*/
86 /*! \name Reading */
87 /*! \{ */
89 virtual void read(ColladaElement *colElemParent);
91 /*! \} */
92 /*---------------------------------------------------------------------*/
93 /*! \name Access */
94 /*! \{ */
96 ColladaEffect *getEffect (void ) const;
97 void setEffect (ColladaEffect *colEffect);
99 /*! \} */
100 /*---------------------------------------------------------------------*/
101 /*! \name Access */
102 /*! \{ */
104 TextureObjChunk *getTexture (void) const;
105 TextureEnvChunk *getTexEnv (void) const;
106 TextureEnvChunk *editTexEnv (void);
107 TextureTransformChunk *getTexTransform (void) const;
108 TextureTransformChunk *editTexTransform(void);
110 /*! \} */
111 /*---------------------------------------------------------------------*/
112 /*! \name Access */
113 /*! \{ */
115 bool hasAlpha (void) const;
116 bool hasBinaryAlpha(void) const;
118 virtual const std::string getSemantic (void) const;
120 /*! \} */
121 /*========================= PROTECTED ===============================*/
123 protected:
125 /*---------------------------------------------------------------------*/
126 /*! \name Constructors/Destructor */
127 /*! \{ */
129 ColladaTexture(daeElement *elem, ColladaGlobal *global);
130 virtual ~ColladaTexture(void );
132 /*! \} */
133 /*---------------------------------------------------------------------*/
134 /*! \name Access */
135 /*! \{ */
137 void readSampler( ColladaSampler2D *colSampler);
138 void readImage (const Char8 *texId );
140 /*! \} */
141 /*---------------------------------------------------------------------*/
143 static ColladaElementRegistrationHelper _regHelper;
145 ColladaEffect *_colEffect;
146 TextureObjChunkUnrecPtr _texObj;
147 TextureEnvChunkUnrecPtr _texEnv;
148 TextureTransformChunkUnrecPtr _texTransform;
149 ExtraHandlerStore _extraHandlers;
151 private:
153 ColladaTexture(const ColladaTexture &other);
154 void operator=(const ColladaTexture &rhs);
158 OSG_GEN_MEMOBJPTR(ColladaTexture);
160 OSG_END_NAMESPACE
162 // #include "OSGColladaTexture.inl"
164 #endif // OSG_WITH_COLLADA
166 #endif // _OSGCOLLADATEXTURE_H_