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 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
64 #include "OSGGL.h" // Target default header
67 #include "OSGTextureBaseChunkBase.h"
68 #include "OSGTextureBaseChunk.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::TextureBaseChunk
79 See \ref PageSystemTextureBaseChunk for a description.
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var GLenum TextureBaseChunkBase::_sfTarget
87 Texture target. Overwrite automatically determined texture target
88 based on the parameters of the assigned image if set to anything
89 else than GL_NONE. Used for nVidia's rectangle textures. Be careful
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<TextureBaseChunk
*, nsOSG
>::_type(
100 "TextureBaseChunkPtr",
102 TextureBaseChunk::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(TextureBaseChunk
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void TextureBaseChunkBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new SFGLenum::Description(
126 SFGLenum::getClassType(),
128 "Texture target. Overwrite automatically determined texture target\n"
129 "based on the parameters of the assigned image if set to anything \n"
130 "else than GL_NONE. Used for nVidia's rectangle textures. Be careful\n"
132 TargetFieldId
, TargetFieldMask
,
134 (Field::SFDefaultFlags
| Field::FStdAccess
),
135 static_cast<FieldEditMethodSig
>(&TextureBaseChunk::editHandleTarget
),
136 static_cast<FieldGetMethodSig
>(&TextureBaseChunk::getHandleTarget
));
138 oType
.addInitialDesc(pDesc
);
142 TextureBaseChunkBase::TypeObject
TextureBaseChunkBase::_type(
143 TextureBaseChunkBase::getClassname(),
144 Inherited::getClassname(),
148 reinterpret_cast<InitContainerF
>(&TextureBaseChunk::initMethod
),
149 reinterpret_cast<ExitContainerF
>(&TextureBaseChunk::exitMethod
),
150 reinterpret_cast<InitalInsertDescFunc
>(
151 reinterpret_cast<void *>(&TextureBaseChunk::classDescInserter
)),
154 "<?xml version=\"1.0\"?>\n"
157 " name=\"TextureBaseChunk\"\n"
158 " parent=\"StateChunk\"\n"
159 " library=\"System\"\n"
160 " pointerfieldtypes=\"both\"\n"
161 " structure=\"abstract\"\n"
162 " systemcomponent=\"true\"\n"
163 " parentsystemcomponent=\"true\"\n"
164 " decoratable=\"false\"\n"
165 " useLocalIncludes=\"false\"\n"
166 " docGroupBase=\"GrpSystemState\"\n"
169 " See \\ref PageSystemTextureBaseChunk for a description.\n"
173 " cardinality=\"single\"\n"
174 " visibility=\"external\"\n"
175 " defaultValue=\"GL_NONE\"\n"
176 " defaultHeader=\""OSGGL.h"\"\n"
177 " access=\"public\"\n"
179 " Texture target. Overwrite automatically determined texture target\n"
180 " based on the parameters of the assigned image if set to anything \n"
181 " else than GL_NONE. Used for nVidia's rectangle textures. Be careful\n"
184 "</FieldContainer>\n",
185 "See \\ref PageSystemTextureBaseChunk for a description.\n"
188 /*------------------------------ get -----------------------------------*/
190 FieldContainerType
&TextureBaseChunkBase::getType(void)
195 const FieldContainerType
&TextureBaseChunkBase::getType(void) const
200 UInt32
TextureBaseChunkBase::getContainerSize(void) const
202 return sizeof(TextureBaseChunk
);
205 /*------------------------- decorator get ------------------------------*/
208 SFGLenum
*TextureBaseChunkBase::editSFTarget(void)
210 editSField(TargetFieldMask
);
215 const SFGLenum
*TextureBaseChunkBase::getSFTarget(void) const
225 /*------------------------------ access -----------------------------------*/
227 SizeT
TextureBaseChunkBase::getBinSize(ConstFieldMaskArg whichField
)
229 SizeT returnValue
= Inherited::getBinSize(whichField
);
231 if(FieldBits::NoField
!= (TargetFieldMask
& whichField
))
233 returnValue
+= _sfTarget
.getBinSize();
239 void TextureBaseChunkBase::copyToBin(BinaryDataHandler
&pMem
,
240 ConstFieldMaskArg whichField
)
242 Inherited::copyToBin(pMem
, whichField
);
244 if(FieldBits::NoField
!= (TargetFieldMask
& whichField
))
246 _sfTarget
.copyToBin(pMem
);
250 void TextureBaseChunkBase::copyFromBin(BinaryDataHandler
&pMem
,
251 ConstFieldMaskArg whichField
)
253 Inherited::copyFromBin(pMem
, whichField
);
255 if(FieldBits::NoField
!= (TargetFieldMask
& whichField
))
257 editSField(TargetFieldMask
);
258 _sfTarget
.copyFromBin(pMem
);
265 /*------------------------- constructors ----------------------------------*/
267 TextureBaseChunkBase::TextureBaseChunkBase(void) :
269 _sfTarget (GLenum(GL_NONE
))
273 TextureBaseChunkBase::TextureBaseChunkBase(const TextureBaseChunkBase
&source
) :
275 _sfTarget (source
._sfTarget
)
280 /*-------------------------- destructors ----------------------------------*/
282 TextureBaseChunkBase::~TextureBaseChunkBase(void)
287 GetFieldHandlePtr
TextureBaseChunkBase::getHandleTarget (void) const
289 SFGLenum::GetHandlePtr
returnValue(
290 new SFGLenum::GetHandle(
292 this->getType().getFieldDesc(TargetFieldId
),
293 const_cast<TextureBaseChunkBase
*>(this)));
298 EditFieldHandlePtr
TextureBaseChunkBase::editHandleTarget (void)
300 SFGLenum::EditHandlePtr
returnValue(
301 new SFGLenum::EditHandle(
303 this->getType().getFieldDesc(TargetFieldId
),
307 editSField(TargetFieldMask
);
313 #ifdef OSG_MT_CPTR_ASPECT
314 void TextureBaseChunkBase::execSyncV( FieldContainer
&oFrom
,
315 ConstFieldMaskArg whichField
,
316 AspectOffsetStore
&oOffsets
,
317 ConstFieldMaskArg syncMode
,
318 const UInt32 uiSyncInfo
)
320 TextureBaseChunk
*pThis
= static_cast<TextureBaseChunk
*>(this);
322 pThis
->execSync(static_cast<TextureBaseChunk
*>(&oFrom
),
332 void TextureBaseChunkBase::resolveLinks(void)
334 Inherited::resolveLinks();