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 VertexProgramChunk!
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 "OSGVertexProgramChunkBase.h"
67 #include "OSGVertexProgramChunk.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
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
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",
96 VertexProgramChunk::getClassType(),
100 OSG_FIELDTRAITS_GETTYPE_NS(VertexProgramChunk
*, nsOSG
)
102 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
103 VertexProgramChunk
*,
106 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
107 VertexProgramChunk
*,
110 /***************************************************************************\
111 * Field Description *
112 \***************************************************************************/
114 void VertexProgramChunkBase::classDescInserter(TypeObject
&oType
)
119 VertexProgramChunkBase::TypeObject
VertexProgramChunkBase::_type(
120 VertexProgramChunkBase::getClassname(),
121 Inherited::getClassname(),
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
)),
131 "<?xml version=\"1.0\"?>\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"
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"
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"
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)
170 const FieldContainerType
&VertexProgramChunkBase::getType(void) const
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
);
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
);
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
);
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
);
259 VertexProgramChunk
*VertexProgramChunkBase::createEmptyLocal(BitVector bFlags
)
261 VertexProgramChunk
*returnValue
;
263 newPtr
<VertexProgramChunk
>(returnValue
, bFlags
);
265 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
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();
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
;
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
;
312 FieldContainerTransitPtr
VertexProgramChunkBase::shallowCopy(void) const
314 VertexProgramChunk
*tmpPtr
;
317 dynamic_cast<const VertexProgramChunk
*>(this),
318 Thread::getCurrentLocalFlags());
320 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
322 FieldContainerTransitPtr
returnValue(tmpPtr
);
330 /*------------------------- constructors ----------------------------------*/
332 VertexProgramChunkBase::VertexProgramChunkBase(void) :
337 VertexProgramChunkBase::VertexProgramChunkBase(const VertexProgramChunkBase
&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
),
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));
383 void VertexProgramChunkBase::resolveLinks(void)
385 Inherited::resolveLinks();