1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class TextureBaseChunk!
50 *****************************************************************************
51 \*****************************************************************************/
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)
73 /***************************************************************************\
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
93 /***************************************************************************\
94 * FieldType/FieldTrait Instantiation *
95 \***************************************************************************/
97 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
98 PointerType FieldTraits
<TextureBaseChunk
*, nsOSG
>::_type(
99 "TextureBaseChunkPtr",
101 TextureBaseChunk::getClassType(),
105 OSG_FIELDTRAITS_GETTYPE_NS(TextureBaseChunk
*, nsOSG
)
107 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
111 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
115 /***************************************************************************\
116 * Field Description *
117 \***************************************************************************/
119 void TextureBaseChunkBase::classDescInserter(TypeObject
&oType
)
121 FieldDescriptionBase
*pDesc
= NULL
;
124 pDesc
= new SFGLenum::Description(
125 SFGLenum::getClassType(),
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"
131 TargetFieldId
, TargetFieldMask
,
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(),
147 TextureBaseChunk::initMethod
,
148 TextureBaseChunk::exitMethod
,
149 reinterpret_cast<InitalInsertDescFunc
>(&TextureBaseChunk::classDescInserter
),
152 "<?xml version=\"1.0\"?>\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"
167 " See \\ref PageSystemTextureBaseChunk for a description.\n"
171 " cardinality=\"single\"\n"
172 " visibility=\"external\"\n"
173 " defaultValue=\"GL_NONE\"\n"
174 " defaultHeader=\""OSGGL.h"\"\n"
175 " access=\"public\"\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"
182 "</FieldContainer>\n",
183 "See \\ref PageSystemTextureBaseChunk for a description.\n"
186 /*------------------------------ get -----------------------------------*/
188 FieldContainerType
&TextureBaseChunkBase::getType(void)
193 const FieldContainerType
&TextureBaseChunkBase::getType(void) const
198 UInt32
TextureBaseChunkBase::getContainerSize(void) const
200 return sizeof(TextureBaseChunk
);
203 /*------------------------- decorator get ------------------------------*/
206 SFGLenum
*TextureBaseChunkBase::editSFTarget(void)
208 editSField(TargetFieldMask
);
213 const SFGLenum
*TextureBaseChunkBase::getSFTarget(void) const
223 /*------------------------------ access -----------------------------------*/
225 SizeT
TextureBaseChunkBase::getBinSize(ConstFieldMaskArg whichField
)
227 SizeT returnValue
= Inherited::getBinSize(whichField
);
229 if(FieldBits::NoField
!= (TargetFieldMask
& whichField
))
231 returnValue
+= _sfTarget
.getBinSize();
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) :
267 _sfTarget (GLenum(GL_NONE
))
271 TextureBaseChunkBase::TextureBaseChunkBase(const TextureBaseChunkBase
&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(
290 this->getType().getFieldDesc(TargetFieldId
),
291 const_cast<TextureBaseChunkBase
*>(this)));
296 EditFieldHandlePtr
TextureBaseChunkBase::editHandleTarget (void)
298 SFGLenum::EditHandlePtr
returnValue(
299 new SFGLenum::EditHandle(
301 this->getType().getFieldDesc(TargetFieldId
),
305 editSField(TargetFieldMask
);
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
),
330 void TextureBaseChunkBase::resolveLinks(void)
332 Inherited::resolveLinks();