fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Base / OSGShaderStorageBufferObjChunkBase.cpp
blob534bf98a32cb03ff2d6709090fa5468cb66240a7
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 ShaderStorageBufferObjChunk!
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 "OSGShaderStorageBufferObjChunkBase.h"
67 #include "OSGShaderStorageBufferObjChunk.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::ShaderStorageBufferObjChunk
78 See \ref PageSystemShaderStorageBufferObjChunk for a description.
80 This chunk wraps the OpenGL shader storage buffer object extension (ARB_shader_storage_buffer_object).
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var GLenum ShaderStorageBufferObjChunkBase::_sfGLId
88 The OpenGL object id for this shader storage buffer object.
91 /*! \var GLenum ShaderStorageBufferObjChunkBase::_sfUsage
92 Specifies the expected usage pattern of the data store. The symbolic constant must be
93 GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY,
94 GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY,
95 GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY.
98 /*! \var std::string ShaderStorageBufferObjChunkBase::_sfBlockName
99 The name of the shader storage block.
102 /*! \var UInt8 ShaderStorageBufferObjChunkBase::_mfFundamentalTypes
103 Stores the fundamental type of a block entry. This can be any of the set {NONE_T, FLOAT_T, DOUBLE_T, INT_T, UINT_T, BOOL_T}.
106 /*! \var UInt8 ShaderStorageBufferObjChunkBase::_mfMainTypes
107 Stores the main type of a block entry. This can be any of the set {SIMPLE_T, VEC2_T, VEC3_T, VEC4_T, MAT2_T, MAT3_T, MAT4_T,
108 MAT2X3_T, MAT2X4_T, MAT3X4_T, MAT3X2_T, MAT4X2_T, MAT4X3_T, STRUCT_BEGIN_T, STRUCT_END_T}.
111 /*! \var UInt32 ShaderStorageBufferObjChunkBase::_mfCardinality
112 Stores the cardinality of array structure elements.
115 /*! \var UInt32 ShaderStorageBufferObjChunkBase::_mfIndex
116 Stores the index pointer into the value containers.
119 /*! \var std::string ShaderStorageBufferObjChunkBase::_mfNames
120 Stores the index pointer into the value containers.
123 /*! \var StringToUInt32Map ShaderStorageBufferObjChunkBase::_sfNameToIndex
124 Stores the mapping from names into the index container.
127 /*! \var Real32 ShaderStorageBufferObjChunkBase::_mfFloatValues
128 The float values.
131 /*! \var Real64 ShaderStorageBufferObjChunkBase::_mfDoubleValues
132 The double values.
135 /*! \var Int32 ShaderStorageBufferObjChunkBase::_mfIntValues
136 The int values.
139 /*! \var UInt32 ShaderStorageBufferObjChunkBase::_mfUIntValues
140 The unsigned int values.
143 /*! \var UInt8 ShaderStorageBufferObjChunkBase::_mfBoolValues
144 The bool values.
148 /***************************************************************************\
149 * FieldType/FieldTrait Instantiation *
150 \***************************************************************************/
152 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
153 PointerType FieldTraits<ShaderStorageBufferObjChunk *, nsOSG>::_type(
154 "ShaderStorageBufferObjChunkPtr",
155 "ShaderStorageBufferObjBaseChunkPtr",
156 ShaderStorageBufferObjChunk::getClassType(),
157 nsOSG);
158 #endif
160 OSG_FIELDTRAITS_GETTYPE_NS(ShaderStorageBufferObjChunk *, nsOSG)
162 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
163 ShaderStorageBufferObjChunk *,
164 nsOSG)
166 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
167 ShaderStorageBufferObjChunk *,
168 nsOSG)
170 /***************************************************************************\
171 * Field Description *
172 \***************************************************************************/
174 void ShaderStorageBufferObjChunkBase::classDescInserter(TypeObject &oType)
176 FieldDescriptionBase *pDesc = NULL;
179 pDesc = new SFGLenum::Description(
180 SFGLenum::getClassType(),
181 "GLId",
182 "The OpenGL object id for this shader storage buffer object.\n",
183 GLIdFieldId, GLIdFieldMask,
184 true,
185 (Field::FClusterLocal),
186 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleGLId),
187 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleGLId));
189 oType.addInitialDesc(pDesc);
191 pDesc = new SFGLenum::Description(
192 SFGLenum::getClassType(),
193 "usage",
194 "Specifies the expected usage pattern of the data store. The symbolic constant must be \n"
195 "GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, \n"
196 "GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, \n"
197 "GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY.\n",
198 UsageFieldId, UsageFieldMask,
199 false,
200 (Field::SFDefaultFlags | Field::FStdAccess),
201 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleUsage),
202 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleUsage));
204 oType.addInitialDesc(pDesc);
206 pDesc = new SFString::Description(
207 SFString::getClassType(),
208 "blockName",
209 "The name of the shader storage block.\n",
210 BlockNameFieldId, BlockNameFieldMask,
211 false,
212 (Field::SFDefaultFlags | Field::FStdAccess),
213 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleBlockName),
214 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleBlockName));
216 oType.addInitialDesc(pDesc);
218 pDesc = new MFUInt8::Description(
219 MFUInt8::getClassType(),
220 "fundamentalTypes",
221 "Stores the fundamental type of a block entry. This can be any of the set {NONE_T, FLOAT_T, DOUBLE_T, INT_T, UINT_T, BOOL_T}.\n",
222 FundamentalTypesFieldId, FundamentalTypesFieldMask,
223 false,
224 (Field::MFDefaultFlags | Field::FStdAccess),
225 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleFundamentalTypes),
226 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleFundamentalTypes));
228 oType.addInitialDesc(pDesc);
230 pDesc = new MFUInt8::Description(
231 MFUInt8::getClassType(),
232 "mainTypes",
233 "Stores the main type of a block entry. This can be any of the set {SIMPLE_T, VEC2_T, VEC3_T, VEC4_T, MAT2_T, MAT3_T, MAT4_T, \n"
234 "MAT2X3_T, MAT2X4_T, MAT3X4_T, MAT3X2_T, MAT4X2_T, MAT4X3_T, STRUCT_BEGIN_T, STRUCT_END_T}.\n",
235 MainTypesFieldId, MainTypesFieldMask,
236 false,
237 (Field::MFDefaultFlags | Field::FStdAccess),
238 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleMainTypes),
239 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleMainTypes));
241 oType.addInitialDesc(pDesc);
243 pDesc = new MFUInt32::Description(
244 MFUInt32::getClassType(),
245 "cardinality",
246 "Stores the cardinality of array structure elements.\n",
247 CardinalityFieldId, CardinalityFieldMask,
248 false,
249 (Field::MFDefaultFlags | Field::FStdAccess),
250 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleCardinality),
251 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleCardinality));
253 oType.addInitialDesc(pDesc);
255 pDesc = new MFUInt32::Description(
256 MFUInt32::getClassType(),
257 "index",
258 "Stores the index pointer into the value containers.\n",
259 IndexFieldId, IndexFieldMask,
260 false,
261 (Field::MFDefaultFlags | Field::FStdAccess),
262 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleIndex),
263 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleIndex));
265 oType.addInitialDesc(pDesc);
267 pDesc = new MFString::Description(
268 MFString::getClassType(),
269 "names",
270 "Stores the index pointer into the value containers.\n",
271 NamesFieldId, NamesFieldMask,
272 false,
273 (Field::MFDefaultFlags | Field::FStdAccess),
274 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleNames),
275 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleNames));
277 oType.addInitialDesc(pDesc);
279 pDesc = new SFStringToUInt32Map::Description(
280 SFStringToUInt32Map::getClassType(),
281 "nameToIndex",
282 "Stores the mapping from names into the index container.\n",
283 NameToIndexFieldId, NameToIndexFieldMask,
284 false,
285 (Field::SFDefaultFlags | Field::FStdAccess),
286 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleNameToIndex),
287 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleNameToIndex));
289 oType.addInitialDesc(pDesc);
291 pDesc = new MFReal32::Description(
292 MFReal32::getClassType(),
293 "floatValues",
294 "The float values.\n",
295 FloatValuesFieldId, FloatValuesFieldMask,
296 false,
297 (Field::MFDefaultFlags | Field::FStdAccess),
298 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleFloatValues),
299 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleFloatValues));
301 oType.addInitialDesc(pDesc);
303 pDesc = new MFReal64::Description(
304 MFReal64::getClassType(),
305 "doubleValues",
306 "The double values.\n",
307 DoubleValuesFieldId, DoubleValuesFieldMask,
308 false,
309 (Field::MFDefaultFlags | Field::FStdAccess),
310 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleDoubleValues),
311 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleDoubleValues));
313 oType.addInitialDesc(pDesc);
315 pDesc = new MFInt32::Description(
316 MFInt32::getClassType(),
317 "intValues",
318 "The int values.\n",
319 IntValuesFieldId, IntValuesFieldMask,
320 false,
321 (Field::MFDefaultFlags | Field::FStdAccess),
322 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleIntValues),
323 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleIntValues));
325 oType.addInitialDesc(pDesc);
327 pDesc = new MFUInt32::Description(
328 MFUInt32::getClassType(),
329 "uIntValues",
330 "The unsigned int values.\n",
331 UIntValuesFieldId, UIntValuesFieldMask,
332 false,
333 (Field::MFDefaultFlags | Field::FStdAccess),
334 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleUIntValues),
335 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleUIntValues));
337 oType.addInitialDesc(pDesc);
339 pDesc = new MFUInt8::Description(
340 MFUInt8::getClassType(),
341 "boolValues",
342 "The bool values.\n",
343 BoolValuesFieldId, BoolValuesFieldMask,
344 false,
345 (Field::MFDefaultFlags | Field::FStdAccess),
346 static_cast<FieldEditMethodSig>(&ShaderStorageBufferObjChunk::editHandleBoolValues),
347 static_cast<FieldGetMethodSig >(&ShaderStorageBufferObjChunk::getHandleBoolValues));
349 oType.addInitialDesc(pDesc);
353 ShaderStorageBufferObjChunkBase::TypeObject ShaderStorageBufferObjChunkBase::_type(
354 ShaderStorageBufferObjChunkBase::getClassname(),
355 Inherited::getClassname(),
356 "NULL",
357 nsOSG, //Namespace
358 reinterpret_cast<PrototypeCreateF>(&ShaderStorageBufferObjChunkBase::createEmptyLocal),
359 reinterpret_cast<InitContainerF>(&ShaderStorageBufferObjChunk::initMethod),
360 reinterpret_cast<ExitContainerF>(&ShaderStorageBufferObjChunk::exitMethod),
361 reinterpret_cast<InitalInsertDescFunc>(
362 reinterpret_cast<void *>(&ShaderStorageBufferObjChunk::classDescInserter)),
363 false,
365 "<?xml version=\"1.0\"?>\n"
366 "\n"
367 "<FieldContainer\n"
368 " name=\"ShaderStorageBufferObjChunk\"\n"
369 " parent=\"ShaderStorageBufferObjBaseChunk\"\n"
370 " library=\"System\"\n"
371 " pointerfieldtypes=\"both\"\n"
372 " structure=\"concrete\"\n"
373 " systemcomponent=\"true\"\n"
374 " parentsystemcomponent=\"true\"\n"
375 " decoratable=\"false\"\n"
376 " useLocalIncludes=\"false\"\n"
377 " docGroupBase=\"GrpSystemState\"\n"
378 " >\n"
379 " See \\ref PageSystemShaderStorageBufferObjChunk for a description.\n"
380 "\n"
381 " This chunk wraps the OpenGL shader storage buffer object extension (ARB_shader_storage_buffer_object). \n"
382 "\n"
383 " <Field\n"
384 " name=\"GLId\"\n"
385 " type=\"GLenum\"\n"
386 " cardinality=\"single\"\n"
387 " visibility=\"internal\"\n"
388 " access=\"public\"\n"
389 " defaultValue=\"0\"\n"
390 " fieldFlags=\"FClusterLocal\"\n"
391 "\t>\n"
392 " The OpenGL object id for this shader storage buffer object.\n"
393 " </Field>\n"
394 " <Field\n"
395 " name=\"usage\"\n"
396 " type=\"GLenum\"\n"
397 " cardinality=\"single\"\n"
398 " visibility=\"external\"\n"
399 " access=\"public\"\n"
400 " defaultValue=\"GL_STATIC_DRAW\"\n"
401 " potential_values=\"GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, GL_DYNAMIC_COPY\"\n"
402 "\t>\n"
403 " Specifies the expected usage pattern of the data store. The symbolic constant must be \n"
404 " GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, \n"
405 " GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, \n"
406 " GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY.\n"
407 " </Field>\n"
408 " <Field\n"
409 " name=\"blockName\"\n"
410 " type=\"std::string\"\n"
411 " cardinality=\"single\"\n"
412 " visibility=\"external\"\n"
413 " access=\"public\"\n"
414 "\t>\n"
415 " The name of the shader storage block.\n"
416 " </Field>\n"
417 " <Field\n"
418 " name=\"fundamentalTypes\"\n"
419 " type=\"UInt8\"\n"
420 " cardinality=\"multi\"\n"
421 " visibility=\"external\"\n"
422 " access=\"protected\"\n"
423 "\t>\n"
424 " Stores the fundamental type of a block entry. This can be any of the set {NONE_T, FLOAT_T, DOUBLE_T, INT_T, UINT_T, BOOL_T}.\n"
425 " </Field>\n"
426 " <Field\n"
427 " name=\"mainTypes\"\n"
428 " type=\"UInt8\"\n"
429 " cardinality=\"multi\"\n"
430 " visibility=\"external\"\n"
431 " access=\"protected\"\n"
432 "\t>\n"
433 " Stores the main type of a block entry. This can be any of the set {SIMPLE_T, VEC2_T, VEC3_T, VEC4_T, MAT2_T, MAT3_T, MAT4_T, \n"
434 " MAT2X3_T, MAT2X4_T, MAT3X4_T, MAT3X2_T, MAT4X2_T, MAT4X3_T, STRUCT_BEGIN_T, STRUCT_END_T}.\n"
435 " </Field>\n"
436 " <Field\n"
437 " name=\"cardinality\"\n"
438 " type=\"UInt32\"\n"
439 " cardinality=\"multi\"\n"
440 " visibility=\"external\"\n"
441 " access=\"protected\"\n"
442 "\t>\n"
443 " Stores the cardinality of array structure elements.\n"
444 " </Field>\n"
445 " <Field\n"
446 " name=\"index\"\n"
447 " type=\"UInt32\"\n"
448 " cardinality=\"multi\"\n"
449 " visibility=\"external\"\n"
450 " access=\"protected\"\n"
451 "\t>\n"
452 " Stores the index pointer into the value containers.\n"
453 " </Field>\n"
454 " <Field\n"
455 " name=\"names\"\n"
456 " type=\"std::string\"\n"
457 " cardinality=\"multi\"\n"
458 " visibility=\"external\"\n"
459 " access=\"protected\"\n"
460 "\t>\n"
461 " Stores the index pointer into the value containers.\n"
462 " </Field>\n"
463 " <Field\n"
464 " name=\"nameToIndex\"\n"
465 " type=\"StringToUInt32Map\"\n"
466 " cardinality=\"single\"\n"
467 " visibility=\"external\"\n"
468 " access=\"protected\"\n"
469 "\t>\n"
470 " Stores the mapping from names into the index container.\n"
471 " </Field>\n"
472 " <Field\n"
473 " name=\"floatValues\"\n"
474 " type=\"Real32\"\n"
475 " cardinality=\"multi\"\n"
476 " visibility=\"external\"\n"
477 " access=\"protected\"\n"
478 "\t>\n"
479 " The float values.\n"
480 " </Field>\n"
481 " <Field\n"
482 " name=\"doubleValues\"\n"
483 " type=\"Real64\"\n"
484 " cardinality=\"multi\"\n"
485 " visibility=\"external\"\n"
486 " access=\"protected\"\n"
487 "\t>\n"
488 " The double values.\n"
489 " </Field>\n"
490 " <Field\n"
491 " name=\"intValues\"\n"
492 " type=\"Int32\"\n"
493 " cardinality=\"multi\"\n"
494 " visibility=\"external\"\n"
495 " access=\"protected\"\n"
496 "\t>\n"
497 " The int values.\n"
498 " </Field>\n"
499 " <Field\n"
500 " name=\"uIntValues\"\n"
501 " type=\"UInt32\"\n"
502 " cardinality=\"multi\"\n"
503 " visibility=\"external\"\n"
504 " access=\"protected\"\n"
505 "\t>\n"
506 " The unsigned int values.\n"
507 " </Field>\n"
508 " <Field\n"
509 " name=\"boolValues\"\n"
510 " type=\"UInt8\"\n"
511 " cardinality=\"multi\"\n"
512 " visibility=\"external\"\n"
513 " access=\"protected\"\n"
514 "\t>\n"
515 " The bool values.\n"
516 " </Field>\n"
517 "</FieldContainer>\n",
518 "See \\ref PageSystemShaderStorageBufferObjChunk for a description.\n"
519 "\n"
520 "This chunk wraps the OpenGL shader storage buffer object extension (ARB_shader_storage_buffer_object). \n"
523 /*------------------------------ get -----------------------------------*/
525 FieldContainerType &ShaderStorageBufferObjChunkBase::getType(void)
527 return _type;
530 const FieldContainerType &ShaderStorageBufferObjChunkBase::getType(void) const
532 return _type;
535 UInt32 ShaderStorageBufferObjChunkBase::getContainerSize(void) const
537 return sizeof(ShaderStorageBufferObjChunk);
540 /*------------------------- decorator get ------------------------------*/
543 SFGLenum *ShaderStorageBufferObjChunkBase::editSFGLId(void)
545 editSField(GLIdFieldMask);
547 return &_sfGLId;
550 const SFGLenum *ShaderStorageBufferObjChunkBase::getSFGLId(void) const
552 return &_sfGLId;
556 SFGLenum *ShaderStorageBufferObjChunkBase::editSFUsage(void)
558 editSField(UsageFieldMask);
560 return &_sfUsage;
563 const SFGLenum *ShaderStorageBufferObjChunkBase::getSFUsage(void) const
565 return &_sfUsage;
569 SFString *ShaderStorageBufferObjChunkBase::editSFBlockName(void)
571 editSField(BlockNameFieldMask);
573 return &_sfBlockName;
576 const SFString *ShaderStorageBufferObjChunkBase::getSFBlockName(void) const
578 return &_sfBlockName;
582 MFUInt8 *ShaderStorageBufferObjChunkBase::editMFFundamentalTypes(void)
584 editMField(FundamentalTypesFieldMask, _mfFundamentalTypes);
586 return &_mfFundamentalTypes;
589 const MFUInt8 *ShaderStorageBufferObjChunkBase::getMFFundamentalTypes(void) const
591 return &_mfFundamentalTypes;
595 MFUInt8 *ShaderStorageBufferObjChunkBase::editMFMainTypes(void)
597 editMField(MainTypesFieldMask, _mfMainTypes);
599 return &_mfMainTypes;
602 const MFUInt8 *ShaderStorageBufferObjChunkBase::getMFMainTypes(void) const
604 return &_mfMainTypes;
608 MFUInt32 *ShaderStorageBufferObjChunkBase::editMFCardinality(void)
610 editMField(CardinalityFieldMask, _mfCardinality);
612 return &_mfCardinality;
615 const MFUInt32 *ShaderStorageBufferObjChunkBase::getMFCardinality(void) const
617 return &_mfCardinality;
621 MFUInt32 *ShaderStorageBufferObjChunkBase::editMFIndex(void)
623 editMField(IndexFieldMask, _mfIndex);
625 return &_mfIndex;
628 const MFUInt32 *ShaderStorageBufferObjChunkBase::getMFIndex(void) const
630 return &_mfIndex;
634 MFString *ShaderStorageBufferObjChunkBase::editMFNames(void)
636 editMField(NamesFieldMask, _mfNames);
638 return &_mfNames;
641 const MFString *ShaderStorageBufferObjChunkBase::getMFNames(void) const
643 return &_mfNames;
647 SFStringToUInt32Map *ShaderStorageBufferObjChunkBase::editSFNameToIndex(void)
649 editSField(NameToIndexFieldMask);
651 return &_sfNameToIndex;
654 const SFStringToUInt32Map *ShaderStorageBufferObjChunkBase::getSFNameToIndex(void) const
656 return &_sfNameToIndex;
660 MFReal32 *ShaderStorageBufferObjChunkBase::editMFFloatValues(void)
662 editMField(FloatValuesFieldMask, _mfFloatValues);
664 return &_mfFloatValues;
667 const MFReal32 *ShaderStorageBufferObjChunkBase::getMFFloatValues(void) const
669 return &_mfFloatValues;
673 MFReal64 *ShaderStorageBufferObjChunkBase::editMFDoubleValues(void)
675 editMField(DoubleValuesFieldMask, _mfDoubleValues);
677 return &_mfDoubleValues;
680 const MFReal64 *ShaderStorageBufferObjChunkBase::getMFDoubleValues(void) const
682 return &_mfDoubleValues;
686 MFInt32 *ShaderStorageBufferObjChunkBase::editMFIntValues(void)
688 editMField(IntValuesFieldMask, _mfIntValues);
690 return &_mfIntValues;
693 const MFInt32 *ShaderStorageBufferObjChunkBase::getMFIntValues(void) const
695 return &_mfIntValues;
699 MFUInt32 *ShaderStorageBufferObjChunkBase::editMFUIntValues(void)
701 editMField(UIntValuesFieldMask, _mfUIntValues);
703 return &_mfUIntValues;
706 const MFUInt32 *ShaderStorageBufferObjChunkBase::getMFUIntValues(void) const
708 return &_mfUIntValues;
712 MFUInt8 *ShaderStorageBufferObjChunkBase::editMFBoolValues(void)
714 editMField(BoolValuesFieldMask, _mfBoolValues);
716 return &_mfBoolValues;
719 const MFUInt8 *ShaderStorageBufferObjChunkBase::getMFBoolValues(void) const
721 return &_mfBoolValues;
729 /*------------------------------ access -----------------------------------*/
731 SizeT ShaderStorageBufferObjChunkBase::getBinSize(ConstFieldMaskArg whichField)
733 SizeT returnValue = Inherited::getBinSize(whichField);
735 if(FieldBits::NoField != (GLIdFieldMask & whichField))
737 returnValue += _sfGLId.getBinSize();
739 if(FieldBits::NoField != (UsageFieldMask & whichField))
741 returnValue += _sfUsage.getBinSize();
743 if(FieldBits::NoField != (BlockNameFieldMask & whichField))
745 returnValue += _sfBlockName.getBinSize();
747 if(FieldBits::NoField != (FundamentalTypesFieldMask & whichField))
749 returnValue += _mfFundamentalTypes.getBinSize();
751 if(FieldBits::NoField != (MainTypesFieldMask & whichField))
753 returnValue += _mfMainTypes.getBinSize();
755 if(FieldBits::NoField != (CardinalityFieldMask & whichField))
757 returnValue += _mfCardinality.getBinSize();
759 if(FieldBits::NoField != (IndexFieldMask & whichField))
761 returnValue += _mfIndex.getBinSize();
763 if(FieldBits::NoField != (NamesFieldMask & whichField))
765 returnValue += _mfNames.getBinSize();
767 if(FieldBits::NoField != (NameToIndexFieldMask & whichField))
769 returnValue += _sfNameToIndex.getBinSize();
771 if(FieldBits::NoField != (FloatValuesFieldMask & whichField))
773 returnValue += _mfFloatValues.getBinSize();
775 if(FieldBits::NoField != (DoubleValuesFieldMask & whichField))
777 returnValue += _mfDoubleValues.getBinSize();
779 if(FieldBits::NoField != (IntValuesFieldMask & whichField))
781 returnValue += _mfIntValues.getBinSize();
783 if(FieldBits::NoField != (UIntValuesFieldMask & whichField))
785 returnValue += _mfUIntValues.getBinSize();
787 if(FieldBits::NoField != (BoolValuesFieldMask & whichField))
789 returnValue += _mfBoolValues.getBinSize();
792 return returnValue;
795 void ShaderStorageBufferObjChunkBase::copyToBin(BinaryDataHandler &pMem,
796 ConstFieldMaskArg whichField)
798 Inherited::copyToBin(pMem, whichField);
800 if(FieldBits::NoField != (GLIdFieldMask & whichField))
802 _sfGLId.copyToBin(pMem);
804 if(FieldBits::NoField != (UsageFieldMask & whichField))
806 _sfUsage.copyToBin(pMem);
808 if(FieldBits::NoField != (BlockNameFieldMask & whichField))
810 _sfBlockName.copyToBin(pMem);
812 if(FieldBits::NoField != (FundamentalTypesFieldMask & whichField))
814 _mfFundamentalTypes.copyToBin(pMem);
816 if(FieldBits::NoField != (MainTypesFieldMask & whichField))
818 _mfMainTypes.copyToBin(pMem);
820 if(FieldBits::NoField != (CardinalityFieldMask & whichField))
822 _mfCardinality.copyToBin(pMem);
824 if(FieldBits::NoField != (IndexFieldMask & whichField))
826 _mfIndex.copyToBin(pMem);
828 if(FieldBits::NoField != (NamesFieldMask & whichField))
830 _mfNames.copyToBin(pMem);
832 if(FieldBits::NoField != (NameToIndexFieldMask & whichField))
834 _sfNameToIndex.copyToBin(pMem);
836 if(FieldBits::NoField != (FloatValuesFieldMask & whichField))
838 _mfFloatValues.copyToBin(pMem);
840 if(FieldBits::NoField != (DoubleValuesFieldMask & whichField))
842 _mfDoubleValues.copyToBin(pMem);
844 if(FieldBits::NoField != (IntValuesFieldMask & whichField))
846 _mfIntValues.copyToBin(pMem);
848 if(FieldBits::NoField != (UIntValuesFieldMask & whichField))
850 _mfUIntValues.copyToBin(pMem);
852 if(FieldBits::NoField != (BoolValuesFieldMask & whichField))
854 _mfBoolValues.copyToBin(pMem);
858 void ShaderStorageBufferObjChunkBase::copyFromBin(BinaryDataHandler &pMem,
859 ConstFieldMaskArg whichField)
861 Inherited::copyFromBin(pMem, whichField);
863 if(FieldBits::NoField != (GLIdFieldMask & whichField))
865 editSField(GLIdFieldMask);
866 _sfGLId.copyFromBin(pMem);
868 if(FieldBits::NoField != (UsageFieldMask & whichField))
870 editSField(UsageFieldMask);
871 _sfUsage.copyFromBin(pMem);
873 if(FieldBits::NoField != (BlockNameFieldMask & whichField))
875 editSField(BlockNameFieldMask);
876 _sfBlockName.copyFromBin(pMem);
878 if(FieldBits::NoField != (FundamentalTypesFieldMask & whichField))
880 editMField(FundamentalTypesFieldMask, _mfFundamentalTypes);
881 _mfFundamentalTypes.copyFromBin(pMem);
883 if(FieldBits::NoField != (MainTypesFieldMask & whichField))
885 editMField(MainTypesFieldMask, _mfMainTypes);
886 _mfMainTypes.copyFromBin(pMem);
888 if(FieldBits::NoField != (CardinalityFieldMask & whichField))
890 editMField(CardinalityFieldMask, _mfCardinality);
891 _mfCardinality.copyFromBin(pMem);
893 if(FieldBits::NoField != (IndexFieldMask & whichField))
895 editMField(IndexFieldMask, _mfIndex);
896 _mfIndex.copyFromBin(pMem);
898 if(FieldBits::NoField != (NamesFieldMask & whichField))
900 editMField(NamesFieldMask, _mfNames);
901 _mfNames.copyFromBin(pMem);
903 if(FieldBits::NoField != (NameToIndexFieldMask & whichField))
905 editSField(NameToIndexFieldMask);
906 _sfNameToIndex.copyFromBin(pMem);
908 if(FieldBits::NoField != (FloatValuesFieldMask & whichField))
910 editMField(FloatValuesFieldMask, _mfFloatValues);
911 _mfFloatValues.copyFromBin(pMem);
913 if(FieldBits::NoField != (DoubleValuesFieldMask & whichField))
915 editMField(DoubleValuesFieldMask, _mfDoubleValues);
916 _mfDoubleValues.copyFromBin(pMem);
918 if(FieldBits::NoField != (IntValuesFieldMask & whichField))
920 editMField(IntValuesFieldMask, _mfIntValues);
921 _mfIntValues.copyFromBin(pMem);
923 if(FieldBits::NoField != (UIntValuesFieldMask & whichField))
925 editMField(UIntValuesFieldMask, _mfUIntValues);
926 _mfUIntValues.copyFromBin(pMem);
928 if(FieldBits::NoField != (BoolValuesFieldMask & whichField))
930 editMField(BoolValuesFieldMask, _mfBoolValues);
931 _mfBoolValues.copyFromBin(pMem);
935 //! create a new instance of the class
936 ShaderStorageBufferObjChunkTransitPtr ShaderStorageBufferObjChunkBase::createLocal(BitVector bFlags)
938 ShaderStorageBufferObjChunkTransitPtr fc;
940 if(getClassType().getPrototype() != NULL)
942 FieldContainerTransitPtr tmpPtr =
943 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
945 fc = dynamic_pointer_cast<ShaderStorageBufferObjChunk>(tmpPtr);
948 return fc;
951 //! create a new instance of the class, copy the container flags
952 ShaderStorageBufferObjChunkTransitPtr ShaderStorageBufferObjChunkBase::createDependent(BitVector bFlags)
954 ShaderStorageBufferObjChunkTransitPtr fc;
956 if(getClassType().getPrototype() != NULL)
958 FieldContainerTransitPtr tmpPtr =
959 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
961 fc = dynamic_pointer_cast<ShaderStorageBufferObjChunk>(tmpPtr);
964 return fc;
967 //! create a new instance of the class
968 ShaderStorageBufferObjChunkTransitPtr ShaderStorageBufferObjChunkBase::create(void)
970 ShaderStorageBufferObjChunkTransitPtr fc;
972 if(getClassType().getPrototype() != NULL)
974 FieldContainerTransitPtr tmpPtr =
975 getClassType().getPrototype()-> shallowCopy();
977 fc = dynamic_pointer_cast<ShaderStorageBufferObjChunk>(tmpPtr);
980 return fc;
983 ShaderStorageBufferObjChunk *ShaderStorageBufferObjChunkBase::createEmptyLocal(BitVector bFlags)
985 ShaderStorageBufferObjChunk *returnValue;
987 newPtr<ShaderStorageBufferObjChunk>(returnValue, bFlags);
989 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
991 return returnValue;
994 //! create an empty new instance of the class, do not copy the prototype
995 ShaderStorageBufferObjChunk *ShaderStorageBufferObjChunkBase::createEmpty(void)
997 ShaderStorageBufferObjChunk *returnValue;
999 newPtr<ShaderStorageBufferObjChunk>(returnValue, Thread::getCurrentLocalFlags());
1001 returnValue->_pFieldFlags->_bNamespaceMask &=
1002 ~Thread::getCurrentLocalFlags();
1004 return returnValue;
1008 FieldContainerTransitPtr ShaderStorageBufferObjChunkBase::shallowCopyLocal(
1009 BitVector bFlags) const
1011 ShaderStorageBufferObjChunk *tmpPtr;
1013 newPtr(tmpPtr, dynamic_cast<const ShaderStorageBufferObjChunk *>(this), bFlags);
1015 FieldContainerTransitPtr returnValue(tmpPtr);
1017 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1019 return returnValue;
1022 FieldContainerTransitPtr ShaderStorageBufferObjChunkBase::shallowCopyDependent(
1023 BitVector bFlags) const
1025 ShaderStorageBufferObjChunk *tmpPtr;
1027 newPtr(tmpPtr, dynamic_cast<const ShaderStorageBufferObjChunk *>(this), ~bFlags);
1029 FieldContainerTransitPtr returnValue(tmpPtr);
1031 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
1033 return returnValue;
1036 FieldContainerTransitPtr ShaderStorageBufferObjChunkBase::shallowCopy(void) const
1038 ShaderStorageBufferObjChunk *tmpPtr;
1040 newPtr(tmpPtr,
1041 dynamic_cast<const ShaderStorageBufferObjChunk *>(this),
1042 Thread::getCurrentLocalFlags());
1044 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
1046 FieldContainerTransitPtr returnValue(tmpPtr);
1048 return returnValue;
1054 /*------------------------- constructors ----------------------------------*/
1056 ShaderStorageBufferObjChunkBase::ShaderStorageBufferObjChunkBase(void) :
1057 Inherited(),
1058 _sfGLId (GLenum(0)),
1059 _sfUsage (GLenum(GL_STATIC_DRAW)),
1060 _sfBlockName (),
1061 _mfFundamentalTypes (),
1062 _mfMainTypes (),
1063 _mfCardinality (),
1064 _mfIndex (),
1065 _mfNames (),
1066 _sfNameToIndex (),
1067 _mfFloatValues (),
1068 _mfDoubleValues (),
1069 _mfIntValues (),
1070 _mfUIntValues (),
1071 _mfBoolValues ()
1075 ShaderStorageBufferObjChunkBase::ShaderStorageBufferObjChunkBase(const ShaderStorageBufferObjChunkBase &source) :
1076 Inherited(source),
1077 _sfGLId (source._sfGLId ),
1078 _sfUsage (source._sfUsage ),
1079 _sfBlockName (source._sfBlockName ),
1080 _mfFundamentalTypes (source._mfFundamentalTypes ),
1081 _mfMainTypes (source._mfMainTypes ),
1082 _mfCardinality (source._mfCardinality ),
1083 _mfIndex (source._mfIndex ),
1084 _mfNames (source._mfNames ),
1085 _sfNameToIndex (source._sfNameToIndex ),
1086 _mfFloatValues (source._mfFloatValues ),
1087 _mfDoubleValues (source._mfDoubleValues ),
1088 _mfIntValues (source._mfIntValues ),
1089 _mfUIntValues (source._mfUIntValues ),
1090 _mfBoolValues (source._mfBoolValues )
1095 /*-------------------------- destructors ----------------------------------*/
1097 ShaderStorageBufferObjChunkBase::~ShaderStorageBufferObjChunkBase(void)
1102 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleGLId (void) const
1104 SFGLenum::GetHandlePtr returnValue(
1105 new SFGLenum::GetHandle(
1106 &_sfGLId,
1107 this->getType().getFieldDesc(GLIdFieldId),
1108 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1110 return returnValue;
1113 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleGLId (void)
1115 SFGLenum::EditHandlePtr returnValue(
1116 new SFGLenum::EditHandle(
1117 &_sfGLId,
1118 this->getType().getFieldDesc(GLIdFieldId),
1119 this));
1122 editSField(GLIdFieldMask);
1124 return returnValue;
1127 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleUsage (void) const
1129 SFGLenum::GetHandlePtr returnValue(
1130 new SFGLenum::GetHandle(
1131 &_sfUsage,
1132 this->getType().getFieldDesc(UsageFieldId),
1133 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1135 return returnValue;
1138 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleUsage (void)
1140 SFGLenum::EditHandlePtr returnValue(
1141 new SFGLenum::EditHandle(
1142 &_sfUsage,
1143 this->getType().getFieldDesc(UsageFieldId),
1144 this));
1147 editSField(UsageFieldMask);
1149 return returnValue;
1152 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleBlockName (void) const
1154 SFString::GetHandlePtr returnValue(
1155 new SFString::GetHandle(
1156 &_sfBlockName,
1157 this->getType().getFieldDesc(BlockNameFieldId),
1158 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1160 return returnValue;
1163 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleBlockName (void)
1165 SFString::EditHandlePtr returnValue(
1166 new SFString::EditHandle(
1167 &_sfBlockName,
1168 this->getType().getFieldDesc(BlockNameFieldId),
1169 this));
1172 editSField(BlockNameFieldMask);
1174 return returnValue;
1177 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleFundamentalTypes (void) const
1179 MFUInt8::GetHandlePtr returnValue(
1180 new MFUInt8::GetHandle(
1181 &_mfFundamentalTypes,
1182 this->getType().getFieldDesc(FundamentalTypesFieldId),
1183 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1185 return returnValue;
1188 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleFundamentalTypes(void)
1190 MFUInt8::EditHandlePtr returnValue(
1191 new MFUInt8::EditHandle(
1192 &_mfFundamentalTypes,
1193 this->getType().getFieldDesc(FundamentalTypesFieldId),
1194 this));
1197 editMField(FundamentalTypesFieldMask, _mfFundamentalTypes);
1199 return returnValue;
1202 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleMainTypes (void) const
1204 MFUInt8::GetHandlePtr returnValue(
1205 new MFUInt8::GetHandle(
1206 &_mfMainTypes,
1207 this->getType().getFieldDesc(MainTypesFieldId),
1208 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1210 return returnValue;
1213 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleMainTypes (void)
1215 MFUInt8::EditHandlePtr returnValue(
1216 new MFUInt8::EditHandle(
1217 &_mfMainTypes,
1218 this->getType().getFieldDesc(MainTypesFieldId),
1219 this));
1222 editMField(MainTypesFieldMask, _mfMainTypes);
1224 return returnValue;
1227 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleCardinality (void) const
1229 MFUInt32::GetHandlePtr returnValue(
1230 new MFUInt32::GetHandle(
1231 &_mfCardinality,
1232 this->getType().getFieldDesc(CardinalityFieldId),
1233 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1235 return returnValue;
1238 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleCardinality (void)
1240 MFUInt32::EditHandlePtr returnValue(
1241 new MFUInt32::EditHandle(
1242 &_mfCardinality,
1243 this->getType().getFieldDesc(CardinalityFieldId),
1244 this));
1247 editMField(CardinalityFieldMask, _mfCardinality);
1249 return returnValue;
1252 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleIndex (void) const
1254 MFUInt32::GetHandlePtr returnValue(
1255 new MFUInt32::GetHandle(
1256 &_mfIndex,
1257 this->getType().getFieldDesc(IndexFieldId),
1258 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1260 return returnValue;
1263 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleIndex (void)
1265 MFUInt32::EditHandlePtr returnValue(
1266 new MFUInt32::EditHandle(
1267 &_mfIndex,
1268 this->getType().getFieldDesc(IndexFieldId),
1269 this));
1272 editMField(IndexFieldMask, _mfIndex);
1274 return returnValue;
1277 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleNames (void) const
1279 MFString::GetHandlePtr returnValue(
1280 new MFString::GetHandle(
1281 &_mfNames,
1282 this->getType().getFieldDesc(NamesFieldId),
1283 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1285 return returnValue;
1288 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleNames (void)
1290 MFString::EditHandlePtr returnValue(
1291 new MFString::EditHandle(
1292 &_mfNames,
1293 this->getType().getFieldDesc(NamesFieldId),
1294 this));
1297 editMField(NamesFieldMask, _mfNames);
1299 return returnValue;
1302 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleNameToIndex (void) const
1304 SFStringToUInt32Map::GetHandlePtr returnValue(
1305 new SFStringToUInt32Map::GetHandle(
1306 &_sfNameToIndex,
1307 this->getType().getFieldDesc(NameToIndexFieldId),
1308 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1310 return returnValue;
1313 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleNameToIndex (void)
1315 SFStringToUInt32Map::EditHandlePtr returnValue(
1316 new SFStringToUInt32Map::EditHandle(
1317 &_sfNameToIndex,
1318 this->getType().getFieldDesc(NameToIndexFieldId),
1319 this));
1322 editSField(NameToIndexFieldMask);
1324 return returnValue;
1327 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleFloatValues (void) const
1329 MFReal32::GetHandlePtr returnValue(
1330 new MFReal32::GetHandle(
1331 &_mfFloatValues,
1332 this->getType().getFieldDesc(FloatValuesFieldId),
1333 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1335 return returnValue;
1338 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleFloatValues (void)
1340 MFReal32::EditHandlePtr returnValue(
1341 new MFReal32::EditHandle(
1342 &_mfFloatValues,
1343 this->getType().getFieldDesc(FloatValuesFieldId),
1344 this));
1347 editMField(FloatValuesFieldMask, _mfFloatValues);
1349 return returnValue;
1352 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleDoubleValues (void) const
1354 MFReal64::GetHandlePtr returnValue(
1355 new MFReal64::GetHandle(
1356 &_mfDoubleValues,
1357 this->getType().getFieldDesc(DoubleValuesFieldId),
1358 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1360 return returnValue;
1363 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleDoubleValues (void)
1365 MFReal64::EditHandlePtr returnValue(
1366 new MFReal64::EditHandle(
1367 &_mfDoubleValues,
1368 this->getType().getFieldDesc(DoubleValuesFieldId),
1369 this));
1372 editMField(DoubleValuesFieldMask, _mfDoubleValues);
1374 return returnValue;
1377 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleIntValues (void) const
1379 MFInt32::GetHandlePtr returnValue(
1380 new MFInt32::GetHandle(
1381 &_mfIntValues,
1382 this->getType().getFieldDesc(IntValuesFieldId),
1383 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1385 return returnValue;
1388 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleIntValues (void)
1390 MFInt32::EditHandlePtr returnValue(
1391 new MFInt32::EditHandle(
1392 &_mfIntValues,
1393 this->getType().getFieldDesc(IntValuesFieldId),
1394 this));
1397 editMField(IntValuesFieldMask, _mfIntValues);
1399 return returnValue;
1402 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleUIntValues (void) const
1404 MFUInt32::GetHandlePtr returnValue(
1405 new MFUInt32::GetHandle(
1406 &_mfUIntValues,
1407 this->getType().getFieldDesc(UIntValuesFieldId),
1408 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1410 return returnValue;
1413 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleUIntValues (void)
1415 MFUInt32::EditHandlePtr returnValue(
1416 new MFUInt32::EditHandle(
1417 &_mfUIntValues,
1418 this->getType().getFieldDesc(UIntValuesFieldId),
1419 this));
1422 editMField(UIntValuesFieldMask, _mfUIntValues);
1424 return returnValue;
1427 GetFieldHandlePtr ShaderStorageBufferObjChunkBase::getHandleBoolValues (void) const
1429 MFUInt8::GetHandlePtr returnValue(
1430 new MFUInt8::GetHandle(
1431 &_mfBoolValues,
1432 this->getType().getFieldDesc(BoolValuesFieldId),
1433 const_cast<ShaderStorageBufferObjChunkBase *>(this)));
1435 return returnValue;
1438 EditFieldHandlePtr ShaderStorageBufferObjChunkBase::editHandleBoolValues (void)
1440 MFUInt8::EditHandlePtr returnValue(
1441 new MFUInt8::EditHandle(
1442 &_mfBoolValues,
1443 this->getType().getFieldDesc(BoolValuesFieldId),
1444 this));
1447 editMField(BoolValuesFieldMask, _mfBoolValues);
1449 return returnValue;
1453 #ifdef OSG_MT_CPTR_ASPECT
1454 void ShaderStorageBufferObjChunkBase::execSyncV( FieldContainer &oFrom,
1455 ConstFieldMaskArg whichField,
1456 AspectOffsetStore &oOffsets,
1457 ConstFieldMaskArg syncMode,
1458 const UInt32 uiSyncInfo)
1460 ShaderStorageBufferObjChunk *pThis = static_cast<ShaderStorageBufferObjChunk *>(this);
1462 pThis->execSync(static_cast<ShaderStorageBufferObjChunk *>(&oFrom),
1463 whichField,
1464 oOffsets,
1465 syncMode,
1466 uiSyncInfo);
1468 #endif
1471 #ifdef OSG_MT_CPTR_ASPECT
1472 FieldContainer *ShaderStorageBufferObjChunkBase::createAspectCopy(
1473 const FieldContainer *pRefAspect) const
1475 ShaderStorageBufferObjChunk *returnValue;
1477 newAspectCopy(returnValue,
1478 dynamic_cast<const ShaderStorageBufferObjChunk *>(pRefAspect),
1479 dynamic_cast<const ShaderStorageBufferObjChunk *>(this));
1481 return returnValue;
1483 #endif
1485 void ShaderStorageBufferObjChunkBase::resolveLinks(void)
1487 Inherited::resolveLinks();
1489 #ifdef OSG_MT_CPTR_ASPECT
1490 AspectOffsetStore oOffsets;
1492 _pAspectStore->fillOffsetArray(oOffsets, this);
1493 #endif
1495 #ifdef OSG_MT_CPTR_ASPECT
1496 _mfFundamentalTypes.terminateShare(Thread::getCurrentAspect(),
1497 oOffsets);
1498 #endif
1499 #ifdef OSG_MT_CPTR_ASPECT
1500 _mfMainTypes.terminateShare(Thread::getCurrentAspect(),
1501 oOffsets);
1502 #endif
1503 #ifdef OSG_MT_CPTR_ASPECT
1504 _mfCardinality.terminateShare(Thread::getCurrentAspect(),
1505 oOffsets);
1506 #endif
1507 #ifdef OSG_MT_CPTR_ASPECT
1508 _mfIndex.terminateShare(Thread::getCurrentAspect(),
1509 oOffsets);
1510 #endif
1511 #ifdef OSG_MT_CPTR_ASPECT
1512 _mfNames.terminateShare(Thread::getCurrentAspect(),
1513 oOffsets);
1514 #endif
1515 #ifdef OSG_MT_CPTR_ASPECT
1516 _mfFloatValues.terminateShare(Thread::getCurrentAspect(),
1517 oOffsets);
1518 #endif
1519 #ifdef OSG_MT_CPTR_ASPECT
1520 _mfDoubleValues.terminateShare(Thread::getCurrentAspect(),
1521 oOffsets);
1522 #endif
1523 #ifdef OSG_MT_CPTR_ASPECT
1524 _mfIntValues.terminateShare(Thread::getCurrentAspect(),
1525 oOffsets);
1526 #endif
1527 #ifdef OSG_MT_CPTR_ASPECT
1528 _mfUIntValues.terminateShare(Thread::getCurrentAspect(),
1529 oOffsets);
1530 #endif
1531 #ifdef OSG_MT_CPTR_ASPECT
1532 _mfBoolValues.terminateShare(Thread::getCurrentAspect(),
1533 oOffsets);
1534 #endif
1538 OSG_END_NAMESPACE