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 FragmentProgramChunk!
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"
66 #include "OSGFragmentProgramChunkBase.h"
67 #include "OSGFragmentProgramChunk.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::FragmentProgramChunk
78 See \ref PageSystemFragmentProgramChunk for a description.
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits
<FragmentProgramChunk
*, nsOSG
>::_type(
92 "FragmentProgramChunkPtr",
94 FragmentProgramChunk::getClassType(),
98 OSG_FIELDTRAITS_GETTYPE_NS(FragmentProgramChunk
*, nsOSG
)
100 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
101 FragmentProgramChunk
*,
104 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
105 FragmentProgramChunk
*,
108 /***************************************************************************\
109 * Field Description *
110 \***************************************************************************/
112 void FragmentProgramChunkBase::classDescInserter(TypeObject
&oType
)
117 FragmentProgramChunkBase::TypeObject
FragmentProgramChunkBase::_type(
118 FragmentProgramChunkBase::getClassname(),
119 Inherited::getClassname(),
122 reinterpret_cast<PrototypeCreateF
>(&FragmentProgramChunkBase::createEmptyLocal
),
123 reinterpret_cast<InitContainerF
>(&FragmentProgramChunk::initMethod
),
124 reinterpret_cast<ExitContainerF
>(&FragmentProgramChunk::exitMethod
),
125 reinterpret_cast<InitalInsertDescFunc
>(
126 reinterpret_cast<void *>(&FragmentProgramChunk::classDescInserter
)),
129 "<?xml version=\"1.0\"?>\n"
132 " name=\"FragmentProgramChunk\"\n"
133 " parent=\"ProgramChunk\"\n"
134 " library=\"State\"\n"
135 " pointerfieldtypes=\"both\"\n"
136 " structure=\"concrete\"\n"
137 " systemcomponent=\"true\"\n"
138 " parentsystemcomponent=\"true\"\n"
139 " decoratable=\"false\"\n"
140 " docGroupBase=\"GrpStateARBProgram\"\n"
142 " See \\ref PageSystemFragmentProgramChunk for a description.\n"
144 " The FragmentProgramChunk implements Fragment Programs as specified in the\n"
145 " GL_ARB_fragment_program extension. It is just a special version of the\n"
146 " OSG::ProgramChunk, which contains the whole public interface.\n"
147 "</FieldContainer>\n",
148 "See \\ref PageSystemFragmentProgramChunk for a description.\n"
150 "The FragmentProgramChunk implements Fragment Programs as specified in the\n"
151 "GL_ARB_fragment_program extension. It is just a special version of the\n"
152 "OSG::ProgramChunk, which contains the whole public interface.\n"
155 /*------------------------------ get -----------------------------------*/
157 FieldContainerType
&FragmentProgramChunkBase::getType(void)
162 const FieldContainerType
&FragmentProgramChunkBase::getType(void) const
167 UInt32
FragmentProgramChunkBase::getContainerSize(void) const
169 return sizeof(FragmentProgramChunk
);
172 /*------------------------- decorator get ------------------------------*/
179 /*------------------------------ access -----------------------------------*/
181 SizeT
FragmentProgramChunkBase::getBinSize(ConstFieldMaskArg whichField
)
183 SizeT returnValue
= Inherited::getBinSize(whichField
);
189 void FragmentProgramChunkBase::copyToBin(BinaryDataHandler
&pMem
,
190 ConstFieldMaskArg whichField
)
192 Inherited::copyToBin(pMem
, whichField
);
196 void FragmentProgramChunkBase::copyFromBin(BinaryDataHandler
&pMem
,
197 ConstFieldMaskArg whichField
)
199 Inherited::copyFromBin(pMem
, whichField
);
203 //! create a new instance of the class
204 FragmentProgramChunkTransitPtr
FragmentProgramChunkBase::createLocal(BitVector bFlags
)
206 FragmentProgramChunkTransitPtr fc
;
208 if(getClassType().getPrototype() != NULL
)
210 FieldContainerTransitPtr tmpPtr
=
211 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
213 fc
= dynamic_pointer_cast
<FragmentProgramChunk
>(tmpPtr
);
219 //! create a new instance of the class, copy the container flags
220 FragmentProgramChunkTransitPtr
FragmentProgramChunkBase::createDependent(BitVector bFlags
)
222 FragmentProgramChunkTransitPtr fc
;
224 if(getClassType().getPrototype() != NULL
)
226 FieldContainerTransitPtr tmpPtr
=
227 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
229 fc
= dynamic_pointer_cast
<FragmentProgramChunk
>(tmpPtr
);
235 //! create a new instance of the class
236 FragmentProgramChunkTransitPtr
FragmentProgramChunkBase::create(void)
238 FragmentProgramChunkTransitPtr fc
;
240 if(getClassType().getPrototype() != NULL
)
242 FieldContainerTransitPtr tmpPtr
=
243 getClassType().getPrototype()-> shallowCopy();
245 fc
= dynamic_pointer_cast
<FragmentProgramChunk
>(tmpPtr
);
251 FragmentProgramChunk
*FragmentProgramChunkBase::createEmptyLocal(BitVector bFlags
)
253 FragmentProgramChunk
*returnValue
;
255 newPtr
<FragmentProgramChunk
>(returnValue
, bFlags
);
257 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
262 //! create an empty new instance of the class, do not copy the prototype
263 FragmentProgramChunk
*FragmentProgramChunkBase::createEmpty(void)
265 FragmentProgramChunk
*returnValue
;
267 newPtr
<FragmentProgramChunk
>(returnValue
, Thread::getCurrentLocalFlags());
269 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
270 ~Thread::getCurrentLocalFlags();
276 FieldContainerTransitPtr
FragmentProgramChunkBase::shallowCopyLocal(
277 BitVector bFlags
) const
279 FragmentProgramChunk
*tmpPtr
;
281 newPtr(tmpPtr
, dynamic_cast<const FragmentProgramChunk
*>(this), bFlags
);
283 FieldContainerTransitPtr
returnValue(tmpPtr
);
285 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
290 FieldContainerTransitPtr
FragmentProgramChunkBase::shallowCopyDependent(
291 BitVector bFlags
) const
293 FragmentProgramChunk
*tmpPtr
;
295 newPtr(tmpPtr
, dynamic_cast<const FragmentProgramChunk
*>(this), ~bFlags
);
297 FieldContainerTransitPtr
returnValue(tmpPtr
);
299 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
304 FieldContainerTransitPtr
FragmentProgramChunkBase::shallowCopy(void) const
306 FragmentProgramChunk
*tmpPtr
;
309 dynamic_cast<const FragmentProgramChunk
*>(this),
310 Thread::getCurrentLocalFlags());
312 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
314 FieldContainerTransitPtr
returnValue(tmpPtr
);
322 /*------------------------- constructors ----------------------------------*/
324 FragmentProgramChunkBase::FragmentProgramChunkBase(void) :
329 FragmentProgramChunkBase::FragmentProgramChunkBase(const FragmentProgramChunkBase
&source
) :
335 /*-------------------------- destructors ----------------------------------*/
337 FragmentProgramChunkBase::~FragmentProgramChunkBase(void)
343 #ifdef OSG_MT_CPTR_ASPECT
344 void FragmentProgramChunkBase::execSyncV( FieldContainer
&oFrom
,
345 ConstFieldMaskArg whichField
,
346 AspectOffsetStore
&oOffsets
,
347 ConstFieldMaskArg syncMode
,
348 const UInt32 uiSyncInfo
)
350 FragmentProgramChunk
*pThis
= static_cast<FragmentProgramChunk
*>(this);
352 pThis
->execSync(static_cast<FragmentProgramChunk
*>(&oFrom
),
361 #ifdef OSG_MT_CPTR_ASPECT
362 FieldContainer
*FragmentProgramChunkBase::createAspectCopy(
363 const FieldContainer
*pRefAspect
) const
365 FragmentProgramChunk
*returnValue
;
367 newAspectCopy(returnValue
,
368 dynamic_cast<const FragmentProgramChunk
*>(pRefAspect
),
369 dynamic_cast<const FragmentProgramChunk
*>(this));
375 void FragmentProgramChunkBase::resolveLinks(void)
377 Inherited::resolveLinks();