changed: gcc8 base update
[opensg.git] / Source / System / State / ARBProgram / OSGVertexProgramChunkBase.cpp
blobdb85637aca0c1d9b471626e4f62482cfa84801cc
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 VertexProgramChunk!
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 "OSGVertexProgramChunkBase.h"
67 #include "OSGVertexProgramChunk.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::VertexProgramChunk
78 The ProgramChunk is the base class for generic ASCII-based programs inside
79 OpenGL. For actual use see the derived VertexProgramChunk and
80 FragmentProgramChunk.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
88 /***************************************************************************\
89 * FieldType/FieldTrait Instantiation *
90 \***************************************************************************/
92 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
93 PointerType FieldTraits<VertexProgramChunk *, nsOSG>::_type(
94 "VertexProgramChunkPtr",
95 "ProgramChunkPtr",
96 VertexProgramChunk::getClassType(),
97 nsOSG);
98 #endif
100 OSG_FIELDTRAITS_GETTYPE_NS(VertexProgramChunk *, nsOSG)
102 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
103 VertexProgramChunk *,
104 nsOSG)
106 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
107 VertexProgramChunk *,
108 nsOSG)
110 /***************************************************************************\
111 * Field Description *
112 \***************************************************************************/
114 void VertexProgramChunkBase::classDescInserter(TypeObject &oType)
119 VertexProgramChunkBase::TypeObject VertexProgramChunkBase::_type(
120 VertexProgramChunkBase::getClassname(),
121 Inherited::getClassname(),
122 "NULL",
123 nsOSG, //Namespace
124 reinterpret_cast<PrototypeCreateF>(&VertexProgramChunkBase::createEmptyLocal),
125 reinterpret_cast<InitContainerF>(&VertexProgramChunk::initMethod),
126 reinterpret_cast<ExitContainerF>(&VertexProgramChunk::exitMethod),
127 reinterpret_cast<InitalInsertDescFunc>(
128 reinterpret_cast<void *>(&VertexProgramChunk::classDescInserter)),
129 false,
131 "<?xml version=\"1.0\"?>\n"
132 "\n"
133 "<FieldContainer\n"
134 " name=\"VertexProgramChunk\"\n"
135 " parent=\"ProgramChunk\"\n"
136 " library=\"State\"\n"
137 " pointerfieldtypes=\"both\"\n"
138 " structure=\"concrete\"\n"
139 " systemcomponent=\"true\"\n"
140 " parentsystemcomponent=\"true\"\n"
141 " decoratable=\"false\"\n"
142 " docGroupBase=\"GrpStateARBProgram\"\n"
143 " >\n"
144 " The ProgramChunk is the base class for generic ASCII-based programs inside\n"
145 " OpenGL. For actual use see the derived VertexProgramChunk and\n"
146 " FragmentProgramChunk.\n"
147 "\n"
148 " See \\ref PageSystemVertexProgramChunk for a description. The\n"
149 " VertexProgramChunk implements Vertex Programs as specified in the\n"
150 " GL_ARB_vertex_program extension. It is just a special version of the\n"
151 " OSG::ProgramChunk, which contains the whole public interface.\n"
152 "</FieldContainer>\n",
153 "The ProgramChunk is the base class for generic ASCII-based programs inside\n"
154 "OpenGL. For actual use see the derived VertexProgramChunk and\n"
155 "FragmentProgramChunk.\n"
156 "\n"
157 "See \\ref PageSystemVertexProgramChunk for a description. The\n"
158 "VertexProgramChunk implements Vertex Programs as specified in the\n"
159 "GL_ARB_vertex_program extension. It is just a special version of the\n"
160 "OSG::ProgramChunk, which contains the whole public interface.\n"
163 /*------------------------------ get -----------------------------------*/
165 FieldContainerType &VertexProgramChunkBase::getType(void)
167 return _type;
170 const FieldContainerType &VertexProgramChunkBase::getType(void) const
172 return _type;
175 UInt32 VertexProgramChunkBase::getContainerSize(void) const
177 return sizeof(VertexProgramChunk);
180 /*------------------------- decorator get ------------------------------*/
187 /*------------------------------ access -----------------------------------*/
189 SizeT VertexProgramChunkBase::getBinSize(ConstFieldMaskArg whichField)
191 SizeT returnValue = Inherited::getBinSize(whichField);
194 return returnValue;
197 void VertexProgramChunkBase::copyToBin(BinaryDataHandler &pMem,
198 ConstFieldMaskArg whichField)
200 Inherited::copyToBin(pMem, whichField);
204 void VertexProgramChunkBase::copyFromBin(BinaryDataHandler &pMem,
205 ConstFieldMaskArg whichField)
207 Inherited::copyFromBin(pMem, whichField);
211 //! create a new instance of the class
212 VertexProgramChunkTransitPtr VertexProgramChunkBase::createLocal(BitVector bFlags)
214 VertexProgramChunkTransitPtr fc;
216 if(getClassType().getPrototype() != NULL)
218 FieldContainerTransitPtr tmpPtr =
219 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
221 fc = dynamic_pointer_cast<VertexProgramChunk>(tmpPtr);
224 return fc;
227 //! create a new instance of the class, copy the container flags
228 VertexProgramChunkTransitPtr VertexProgramChunkBase::createDependent(BitVector bFlags)
230 VertexProgramChunkTransitPtr fc;
232 if(getClassType().getPrototype() != NULL)
234 FieldContainerTransitPtr tmpPtr =
235 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
237 fc = dynamic_pointer_cast<VertexProgramChunk>(tmpPtr);
240 return fc;
243 //! create a new instance of the class
244 VertexProgramChunkTransitPtr VertexProgramChunkBase::create(void)
246 VertexProgramChunkTransitPtr fc;
248 if(getClassType().getPrototype() != NULL)
250 FieldContainerTransitPtr tmpPtr =
251 getClassType().getPrototype()-> shallowCopy();
253 fc = dynamic_pointer_cast<VertexProgramChunk>(tmpPtr);
256 return fc;
259 VertexProgramChunk *VertexProgramChunkBase::createEmptyLocal(BitVector bFlags)
261 VertexProgramChunk *returnValue;
263 newPtr<VertexProgramChunk>(returnValue, bFlags);
265 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
267 return returnValue;
270 //! create an empty new instance of the class, do not copy the prototype
271 VertexProgramChunk *VertexProgramChunkBase::createEmpty(void)
273 VertexProgramChunk *returnValue;
275 newPtr<VertexProgramChunk>(returnValue, Thread::getCurrentLocalFlags());
277 returnValue->_pFieldFlags->_bNamespaceMask &=
278 ~Thread::getCurrentLocalFlags();
280 return returnValue;
284 FieldContainerTransitPtr VertexProgramChunkBase::shallowCopyLocal(
285 BitVector bFlags) const
287 VertexProgramChunk *tmpPtr;
289 newPtr(tmpPtr, dynamic_cast<const VertexProgramChunk *>(this), bFlags);
291 FieldContainerTransitPtr returnValue(tmpPtr);
293 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
295 return returnValue;
298 FieldContainerTransitPtr VertexProgramChunkBase::shallowCopyDependent(
299 BitVector bFlags) const
301 VertexProgramChunk *tmpPtr;
303 newPtr(tmpPtr, dynamic_cast<const VertexProgramChunk *>(this), ~bFlags);
305 FieldContainerTransitPtr returnValue(tmpPtr);
307 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
309 return returnValue;
312 FieldContainerTransitPtr VertexProgramChunkBase::shallowCopy(void) const
314 VertexProgramChunk *tmpPtr;
316 newPtr(tmpPtr,
317 dynamic_cast<const VertexProgramChunk *>(this),
318 Thread::getCurrentLocalFlags());
320 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
322 FieldContainerTransitPtr returnValue(tmpPtr);
324 return returnValue;
330 /*------------------------- constructors ----------------------------------*/
332 VertexProgramChunkBase::VertexProgramChunkBase(void) :
333 Inherited()
337 VertexProgramChunkBase::VertexProgramChunkBase(const VertexProgramChunkBase &source) :
338 Inherited(source)
343 /*-------------------------- destructors ----------------------------------*/
345 VertexProgramChunkBase::~VertexProgramChunkBase(void)
351 #ifdef OSG_MT_CPTR_ASPECT
352 void VertexProgramChunkBase::execSyncV( FieldContainer &oFrom,
353 ConstFieldMaskArg whichField,
354 AspectOffsetStore &oOffsets,
355 ConstFieldMaskArg syncMode,
356 const UInt32 uiSyncInfo)
358 VertexProgramChunk *pThis = static_cast<VertexProgramChunk *>(this);
360 pThis->execSync(static_cast<VertexProgramChunk *>(&oFrom),
361 whichField,
362 oOffsets,
363 syncMode,
364 uiSyncInfo);
366 #endif
369 #ifdef OSG_MT_CPTR_ASPECT
370 FieldContainer *VertexProgramChunkBase::createAspectCopy(
371 const FieldContainer *pRefAspect) const
373 VertexProgramChunk *returnValue;
375 newAspectCopy(returnValue,
376 dynamic_cast<const VertexProgramChunk *>(pRefAspect),
377 dynamic_cast<const VertexProgramChunk *>(this));
379 return returnValue;
381 #endif
383 void VertexProgramChunkBase::resolveLinks(void)
385 Inherited::resolveLinks();
391 OSG_END_NAMESPACE