fixed: stay with old cmake qt link setup (policy CMP0020)
[opensg.git] / Source / System / State / Base / OSGTextureBaseChunkBase.cpp
blob06fbb29ae4355cb26c1dfaf91571d117a4e51ee5
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class TextureBaseChunk!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #include "OSGConfig.h"
59 #include "OSGGL.h" // Target default header
62 #include "OSGTextureBaseChunkBase.h"
63 #include "OSGTextureBaseChunk.h"
65 #include <boost/bind.hpp>
67 #ifdef WIN32 // turn off 'this' : used in base member initializer list warning
68 #pragma warning(disable:4355)
69 #endif
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::TextureBaseChunk
78 See \ref PageSystemTextureBaseChunk for a description.
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var GLenum TextureBaseChunkBase::_sfTarget
86 Texture target. Overwrite automatically determined texture target
87 based on the parameters of the assigned image if set to anything
88 else than GL_NONE. Used for nVidia's rectangle textures. Be careful
89 when using it!
93 /***************************************************************************\
94 * FieldType/FieldTrait Instantiation *
95 \***************************************************************************/
97 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
98 PointerType FieldTraits<TextureBaseChunk *, nsOSG>::_type(
99 "TextureBaseChunkPtr",
100 "StateChunkPtr",
101 TextureBaseChunk::getClassType(),
102 nsOSG);
103 #endif
105 OSG_FIELDTRAITS_GETTYPE_NS(TextureBaseChunk *, nsOSG)
107 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
108 TextureBaseChunk *,
109 nsOSG);
111 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
112 TextureBaseChunk *,
113 nsOSG);
115 /***************************************************************************\
116 * Field Description *
117 \***************************************************************************/
119 void TextureBaseChunkBase::classDescInserter(TypeObject &oType)
121 FieldDescriptionBase *pDesc = NULL;
124 pDesc = new SFGLenum::Description(
125 SFGLenum::getClassType(),
126 "target",
127 "Texture target. Overwrite automatically determined texture target\n"
128 "based on the parameters of the assigned image if set to anything \n"
129 "else than GL_NONE. Used for nVidia's rectangle textures. Be careful\n"
130 "when using it!\n",
131 TargetFieldId, TargetFieldMask,
132 false,
133 (Field::SFDefaultFlags | Field::FStdAccess),
134 static_cast<FieldEditMethodSig>(&TextureBaseChunk::editHandleTarget),
135 static_cast<FieldGetMethodSig >(&TextureBaseChunk::getHandleTarget));
137 oType.addInitialDesc(pDesc);
141 TextureBaseChunkBase::TypeObject TextureBaseChunkBase::_type(
142 TextureBaseChunkBase::getClassname(),
143 Inherited::getClassname(),
144 "NULL",
145 nsOSG, //Namespace
146 NULL,
147 TextureBaseChunk::initMethod,
148 TextureBaseChunk::exitMethod,
149 reinterpret_cast<InitalInsertDescFunc>(&TextureBaseChunk::classDescInserter),
150 false,
152 "<?xml version=\"1.0\"?>\n"
153 "\n"
154 "<FieldContainer\n"
155 " name=\"TextureBaseChunk\"\n"
156 " parent=\"StateChunk\"\n"
157 " library=\"System\"\n"
158 " pointerfieldtypes=\"both\"\n"
159 " structure=\"abstract\"\n"
160 " systemcomponent=\"true\"\n"
161 " parentsystemcomponent=\"true\"\n"
162 " decoratable=\"false\"\n"
163 " useLocalIncludes=\"false\"\n"
164 " docGroupBase=\"GrpSystemState\"\n"
165 " >\n"
166 " \n"
167 " See \\ref PageSystemTextureBaseChunk for a description.\n"
168 " <Field\n"
169 " name=\"target\"\n"
170 " type=\"GLenum\"\n"
171 " cardinality=\"single\"\n"
172 " visibility=\"external\"\n"
173 " defaultValue=\"GL_NONE\"\n"
174 " defaultHeader=\"&quot;OSGGL.h&quot;\"\n"
175 " access=\"public\"\n"
176 " >\n"
177 " Texture target. Overwrite automatically determined texture target\n"
178 " based on the parameters of the assigned image if set to anything \n"
179 " else than GL_NONE. Used for nVidia's rectangle textures. Be careful\n"
180 " when using it!\n"
181 " </Field>\n"
182 "</FieldContainer>\n",
183 "See \\ref PageSystemTextureBaseChunk for a description.\n"
186 /*------------------------------ get -----------------------------------*/
188 FieldContainerType &TextureBaseChunkBase::getType(void)
190 return _type;
193 const FieldContainerType &TextureBaseChunkBase::getType(void) const
195 return _type;
198 UInt32 TextureBaseChunkBase::getContainerSize(void) const
200 return sizeof(TextureBaseChunk);
203 /*------------------------- decorator get ------------------------------*/
206 SFGLenum *TextureBaseChunkBase::editSFTarget(void)
208 editSField(TargetFieldMask);
210 return &_sfTarget;
213 const SFGLenum *TextureBaseChunkBase::getSFTarget(void) const
215 return &_sfTarget;
223 /*------------------------------ access -----------------------------------*/
225 SizeT TextureBaseChunkBase::getBinSize(ConstFieldMaskArg whichField)
227 SizeT returnValue = Inherited::getBinSize(whichField);
229 if(FieldBits::NoField != (TargetFieldMask & whichField))
231 returnValue += _sfTarget.getBinSize();
234 return returnValue;
237 void TextureBaseChunkBase::copyToBin(BinaryDataHandler &pMem,
238 ConstFieldMaskArg whichField)
240 Inherited::copyToBin(pMem, whichField);
242 if(FieldBits::NoField != (TargetFieldMask & whichField))
244 _sfTarget.copyToBin(pMem);
248 void TextureBaseChunkBase::copyFromBin(BinaryDataHandler &pMem,
249 ConstFieldMaskArg whichField)
251 Inherited::copyFromBin(pMem, whichField);
253 if(FieldBits::NoField != (TargetFieldMask & whichField))
255 editSField(TargetFieldMask);
256 _sfTarget.copyFromBin(pMem);
263 /*------------------------- constructors ----------------------------------*/
265 TextureBaseChunkBase::TextureBaseChunkBase(void) :
266 Inherited(),
267 _sfTarget (GLenum(GL_NONE))
271 TextureBaseChunkBase::TextureBaseChunkBase(const TextureBaseChunkBase &source) :
272 Inherited(source),
273 _sfTarget (source._sfTarget )
278 /*-------------------------- destructors ----------------------------------*/
280 TextureBaseChunkBase::~TextureBaseChunkBase(void)
285 GetFieldHandlePtr TextureBaseChunkBase::getHandleTarget (void) const
287 SFGLenum::GetHandlePtr returnValue(
288 new SFGLenum::GetHandle(
289 &_sfTarget,
290 this->getType().getFieldDesc(TargetFieldId),
291 const_cast<TextureBaseChunkBase *>(this)));
293 return returnValue;
296 EditFieldHandlePtr TextureBaseChunkBase::editHandleTarget (void)
298 SFGLenum::EditHandlePtr returnValue(
299 new SFGLenum::EditHandle(
300 &_sfTarget,
301 this->getType().getFieldDesc(TargetFieldId),
302 this));
305 editSField(TargetFieldMask);
307 return returnValue;
311 #ifdef OSG_MT_CPTR_ASPECT
312 void TextureBaseChunkBase::execSyncV( FieldContainer &oFrom,
313 ConstFieldMaskArg whichField,
314 AspectOffsetStore &oOffsets,
315 ConstFieldMaskArg syncMode,
316 const UInt32 uiSyncInfo)
318 TextureBaseChunk *pThis = static_cast<TextureBaseChunk *>(this);
320 pThis->execSync(static_cast<TextureBaseChunk *>(&oFrom),
321 whichField,
322 oOffsets,
323 syncMode,
324 uiSyncInfo);
326 #endif
330 void TextureBaseChunkBase::resolveLinks(void)
332 Inherited::resolveLinks();
338 OSG_END_NAMESPACE