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 GeoVectorProperty!
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 "OSGGeoVectorPropertyBase.h"
67 #include "OSGGeoVectorProperty.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::GeoVectorProperty
78 Abstract base class for all vector-valued GeoProperties.
79 Provides a uniform interface for accessing all vector data in geometry using
80 automatic conversion methods.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var UInt32 GeoVectorPropertyBase::_sfDivisor
88 sets the vertex attrib divisor for instanced rendering
92 /***************************************************************************\
93 * FieldType/FieldTrait Instantiation *
94 \***************************************************************************/
96 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
97 PointerType FieldTraits
<GeoVectorProperty
*, nsOSG
>::_type(
98 "GeoVectorPropertyPtr",
100 GeoVectorProperty::getClassType(),
104 OSG_FIELDTRAITS_GETTYPE_NS(GeoVectorProperty
*, nsOSG
)
106 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
110 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
114 DataType
&FieldTraits
< GeoVectorProperty
*, nsOSG
+ 1 >::getType(void)
116 return FieldTraits
<GeoVectorProperty
*, nsOSG
>::getType();
120 OSG_EXPORT_PTR_SFIELD(ChildPointerSField
,
122 UnrecordedRefCountPolicy
,
126 OSG_EXPORT_PTR_MFIELD(ChildPointerMField
,
128 UnrecordedRefCountPolicy
,
132 /***************************************************************************\
133 * Field Description *
134 \***************************************************************************/
136 void GeoVectorPropertyBase::classDescInserter(TypeObject
&oType
)
138 FieldDescriptionBase
*pDesc
= NULL
;
141 pDesc
= new SFUInt32::Description(
142 SFUInt32::getClassType(),
144 "sets the vertex attrib divisor for instanced rendering\n",
145 DivisorFieldId
, DivisorFieldMask
,
147 (Field::SFDefaultFlags
| Field::FStdAccess
),
148 static_cast<FieldEditMethodSig
>(&GeoVectorProperty::editHandleDivisor
),
149 static_cast<FieldGetMethodSig
>(&GeoVectorProperty::getHandleDivisor
));
151 oType
.addInitialDesc(pDesc
);
155 GeoVectorPropertyBase::TypeObject
GeoVectorPropertyBase::_type(
156 GeoVectorPropertyBase::getClassname(),
157 Inherited::getClassname(),
161 reinterpret_cast<InitContainerF
>(&GeoVectorProperty::initMethod
),
162 reinterpret_cast<ExitContainerF
>(&GeoVectorProperty::exitMethod
),
163 reinterpret_cast<InitalInsertDescFunc
>(
164 reinterpret_cast<void *>(&GeoVectorProperty::classDescInserter
)),
167 "<?xml version=\"1.0\"?>\n"
170 " name=\"GeoVectorProperty\"\n"
171 " parent=\"GeoProperty\"\n"
172 " library=\"System\"\n"
173 " pointerfieldtypes=\"both\"\n"
174 " structure=\"abstract\"\n"
175 " systemcomponent=\"true\"\n"
176 " parentsystemcomponent=\"true\"\n"
177 " decoratable=\"false\"\n"
178 " childFields=\"both\"\n"
179 " docGroupBase=\"GrpDrawablesGeometry\"\n"
181 " Abstract base class for all vector-valued GeoProperties.\n"
182 " Provides a uniform interface for accessing all vector data in geometry using\n"
183 " automatic conversion methods.\n"
185 " name=\"divisor\"\n"
187 " cardinality=\"single\"\n"
188 " visibility=\"external\"\n"
189 " defaultValue=\"0\"\n"
190 " access=\"public\"\n"
192 " sets the vertex attrib divisor for instanced rendering\n"
194 "</FieldContainer>\n",
195 "Abstract base class for all vector-valued GeoProperties.\n"
196 "Provides a uniform interface for accessing all vector data in geometry using\n"
197 "automatic conversion methods.\n"
200 /*------------------------------ get -----------------------------------*/
202 FieldContainerType
&GeoVectorPropertyBase::getType(void)
207 const FieldContainerType
&GeoVectorPropertyBase::getType(void) const
212 UInt32
GeoVectorPropertyBase::getContainerSize(void) const
214 return sizeof(GeoVectorProperty
);
217 /*------------------------- decorator get ------------------------------*/
220 SFUInt32
*GeoVectorPropertyBase::editSFDivisor(void)
222 editSField(DivisorFieldMask
);
227 const SFUInt32
*GeoVectorPropertyBase::getSFDivisor(void) const
237 /*------------------------------ access -----------------------------------*/
239 SizeT
GeoVectorPropertyBase::getBinSize(ConstFieldMaskArg whichField
)
241 SizeT returnValue
= Inherited::getBinSize(whichField
);
243 if(FieldBits::NoField
!= (DivisorFieldMask
& whichField
))
245 returnValue
+= _sfDivisor
.getBinSize();
251 void GeoVectorPropertyBase::copyToBin(BinaryDataHandler
&pMem
,
252 ConstFieldMaskArg whichField
)
254 Inherited::copyToBin(pMem
, whichField
);
256 if(FieldBits::NoField
!= (DivisorFieldMask
& whichField
))
258 _sfDivisor
.copyToBin(pMem
);
262 void GeoVectorPropertyBase::copyFromBin(BinaryDataHandler
&pMem
,
263 ConstFieldMaskArg whichField
)
265 Inherited::copyFromBin(pMem
, whichField
);
267 if(FieldBits::NoField
!= (DivisorFieldMask
& whichField
))
269 editSField(DivisorFieldMask
);
270 _sfDivisor
.copyFromBin(pMem
);
277 /*------------------------- constructors ----------------------------------*/
279 GeoVectorPropertyBase::GeoVectorPropertyBase(void) :
281 _sfDivisor (UInt32(0))
285 GeoVectorPropertyBase::GeoVectorPropertyBase(const GeoVectorPropertyBase
&source
) :
287 _sfDivisor (source
._sfDivisor
)
292 /*-------------------------- destructors ----------------------------------*/
294 GeoVectorPropertyBase::~GeoVectorPropertyBase(void)
299 GetFieldHandlePtr
GeoVectorPropertyBase::getHandleDivisor (void) const
301 SFUInt32::GetHandlePtr
returnValue(
302 new SFUInt32::GetHandle(
304 this->getType().getFieldDesc(DivisorFieldId
),
305 const_cast<GeoVectorPropertyBase
*>(this)));
310 EditFieldHandlePtr
GeoVectorPropertyBase::editHandleDivisor (void)
312 SFUInt32::EditHandlePtr
returnValue(
313 new SFUInt32::EditHandle(
315 this->getType().getFieldDesc(DivisorFieldId
),
319 editSField(DivisorFieldMask
);
325 #ifdef OSG_MT_CPTR_ASPECT
326 void GeoVectorPropertyBase::execSyncV( FieldContainer
&oFrom
,
327 ConstFieldMaskArg whichField
,
328 AspectOffsetStore
&oOffsets
,
329 ConstFieldMaskArg syncMode
,
330 const UInt32 uiSyncInfo
)
332 GeoVectorProperty
*pThis
= static_cast<GeoVectorProperty
*>(this);
334 pThis
->execSync(static_cast<GeoVectorProperty
*>(&oFrom
),
344 void GeoVectorPropertyBase::resolveLinks(void)
346 Inherited::resolveLinks();