changed: gcc8 base update
[opensg.git] / Source / System / State / ARBProgram / OSGFragmentProgramChunkBase.cpp
blob901b51699b3eb37739b5c610cd07299a63438f24
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 FragmentProgramChunk!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGFragmentProgramChunkBase.h"
67 #include "OSGFragmentProgramChunk.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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",
93 "ProgramChunkPtr",
94 FragmentProgramChunk::getClassType(),
95 nsOSG);
96 #endif
98 OSG_FIELDTRAITS_GETTYPE_NS(FragmentProgramChunk *, nsOSG)
100 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
101 FragmentProgramChunk *,
102 nsOSG)
104 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
105 FragmentProgramChunk *,
106 nsOSG)
108 /***************************************************************************\
109 * Field Description *
110 \***************************************************************************/
112 void FragmentProgramChunkBase::classDescInserter(TypeObject &oType)
117 FragmentProgramChunkBase::TypeObject FragmentProgramChunkBase::_type(
118 FragmentProgramChunkBase::getClassname(),
119 Inherited::getClassname(),
120 "NULL",
121 nsOSG, //Namespace
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)),
127 false,
129 "<?xml version=\"1.0\"?>\n"
130 "\n"
131 "<FieldContainer\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"
141 " >\n"
142 " See \\ref PageSystemFragmentProgramChunk for a description.\n"
143 "\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"
149 "\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)
159 return _type;
162 const FieldContainerType &FragmentProgramChunkBase::getType(void) const
164 return _type;
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);
186 return returnValue;
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);
216 return fc;
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);
232 return fc;
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);
248 return fc;
251 FragmentProgramChunk *FragmentProgramChunkBase::createEmptyLocal(BitVector bFlags)
253 FragmentProgramChunk *returnValue;
255 newPtr<FragmentProgramChunk>(returnValue, bFlags);
257 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
259 return returnValue;
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();
272 return returnValue;
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;
287 return returnValue;
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;
301 return returnValue;
304 FieldContainerTransitPtr FragmentProgramChunkBase::shallowCopy(void) const
306 FragmentProgramChunk *tmpPtr;
308 newPtr(tmpPtr,
309 dynamic_cast<const FragmentProgramChunk *>(this),
310 Thread::getCurrentLocalFlags());
312 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
314 FieldContainerTransitPtr returnValue(tmpPtr);
316 return returnValue;
322 /*------------------------- constructors ----------------------------------*/
324 FragmentProgramChunkBase::FragmentProgramChunkBase(void) :
325 Inherited()
329 FragmentProgramChunkBase::FragmentProgramChunkBase(const FragmentProgramChunkBase &source) :
330 Inherited(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),
353 whichField,
354 oOffsets,
355 syncMode,
356 uiSyncInfo);
358 #endif
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));
371 return returnValue;
373 #endif
375 void FragmentProgramChunkBase::resolveLinks(void)
377 Inherited::resolveLinks();
383 OSG_END_NAMESPACE