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 CgFXVariableTexObj!
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 "OSGCgFXVariableTexObjBase.h"
67 #include "OSGCgFXVariableTexObj.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::CgFXVariableTexObj
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var Int32 CgFXVariableTexObjBase::_sfValue
89 /*! \var std::string CgFXVariableTexObjBase::_sfFilePath
90 filepath of this texture
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<CgFXVariableTexObj
*, nsOSG
>::_type(
100 "CgFXVariableTexObjPtr",
101 "ShaderValueVariablePtr",
102 CgFXVariableTexObj::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(CgFXVariableTexObj
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
109 CgFXVariableTexObj
*,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
113 CgFXVariableTexObj
*,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void CgFXVariableTexObjBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new SFInt32::Description(
126 SFInt32::getClassType(),
129 ValueFieldId
, ValueFieldMask
,
131 (Field::SFDefaultFlags
| Field::FStdAccess
),
132 static_cast<FieldEditMethodSig
>(&CgFXVariableTexObj::editHandleValue
),
133 static_cast<FieldGetMethodSig
>(&CgFXVariableTexObj::getHandleValue
));
135 oType
.addInitialDesc(pDesc
);
137 pDesc
= new SFString::Description(
138 SFString::getClassType(),
140 "filepath of this texture\n",
141 FilePathFieldId
, FilePathFieldMask
,
143 (Field::SFDefaultFlags
| Field::FStdAccess
),
144 static_cast<FieldEditMethodSig
>(&CgFXVariableTexObj::editHandleFilePath
),
145 static_cast<FieldGetMethodSig
>(&CgFXVariableTexObj::getHandleFilePath
));
147 oType
.addInitialDesc(pDesc
);
151 CgFXVariableTexObjBase::TypeObject
CgFXVariableTexObjBase::_type(
152 CgFXVariableTexObjBase::getClassname(),
153 Inherited::getClassname(),
156 reinterpret_cast<PrototypeCreateF
>(&CgFXVariableTexObjBase::createEmptyLocal
),
157 reinterpret_cast<InitContainerF
>(&CgFXVariableTexObj::initMethod
),
158 reinterpret_cast<ExitContainerF
>(&CgFXVariableTexObj::exitMethod
),
159 reinterpret_cast<InitalInsertDescFunc
>(
160 reinterpret_cast<void *>(&CgFXVariableTexObj::classDescInserter
)),
163 "<?xml version=\"1.0\"?>\n"
166 " name=\"CgFXVariableTexObj\"\n"
167 " parent=\"ShaderValueVariable\"\n"
168 " library=\"ContribCgFX\"\n"
169 " pointerfieldtypes=\"both\"\n"
170 " structure=\"concrete\"\n"
171 " systemcomponent=\"true\"\n"
172 " parentsystemcomponent=\"true\"\n"
173 " decoratable=\"false\"\n"
174 " useLocalIncludes=\"false\"\n"
175 " docGroupBase=\"GrpSystemShader\"\n"
180 " cardinality=\"single\"\n"
181 " visibility=\"internal\"\n"
182 " access=\"public\"\n"
183 " defaultValue=\"-1\"\n"
188 " name=\"filePath\"\n"
189 " type=\"std::string\"\n"
190 " cardinality=\"single\"\n"
191 " visibility=\"external\"\n"
192 " access=\"public\"\n"
194 " filepath of this texture\n"
196 "</FieldContainer>\n",
200 /*------------------------------ get -----------------------------------*/
202 FieldContainerType
&CgFXVariableTexObjBase::getType(void)
207 const FieldContainerType
&CgFXVariableTexObjBase::getType(void) const
212 UInt32
CgFXVariableTexObjBase::getContainerSize(void) const
214 return sizeof(CgFXVariableTexObj
);
217 /*------------------------- decorator get ------------------------------*/
220 SFInt32
*CgFXVariableTexObjBase::editSFValue(void)
222 editSField(ValueFieldMask
);
227 const SFInt32
*CgFXVariableTexObjBase::getSFValue(void) const
233 SFString
*CgFXVariableTexObjBase::editSFFilePath(void)
235 editSField(FilePathFieldMask
);
240 const SFString
*CgFXVariableTexObjBase::getSFFilePath(void) const
250 /*------------------------------ access -----------------------------------*/
252 SizeT
CgFXVariableTexObjBase::getBinSize(ConstFieldMaskArg whichField
)
254 SizeT returnValue
= Inherited::getBinSize(whichField
);
256 if(FieldBits::NoField
!= (ValueFieldMask
& whichField
))
258 returnValue
+= _sfValue
.getBinSize();
260 if(FieldBits::NoField
!= (FilePathFieldMask
& whichField
))
262 returnValue
+= _sfFilePath
.getBinSize();
268 void CgFXVariableTexObjBase::copyToBin(BinaryDataHandler
&pMem
,
269 ConstFieldMaskArg whichField
)
271 Inherited::copyToBin(pMem
, whichField
);
273 if(FieldBits::NoField
!= (ValueFieldMask
& whichField
))
275 _sfValue
.copyToBin(pMem
);
277 if(FieldBits::NoField
!= (FilePathFieldMask
& whichField
))
279 _sfFilePath
.copyToBin(pMem
);
283 void CgFXVariableTexObjBase::copyFromBin(BinaryDataHandler
&pMem
,
284 ConstFieldMaskArg whichField
)
286 Inherited::copyFromBin(pMem
, whichField
);
288 if(FieldBits::NoField
!= (ValueFieldMask
& whichField
))
290 editSField(ValueFieldMask
);
291 _sfValue
.copyFromBin(pMem
);
293 if(FieldBits::NoField
!= (FilePathFieldMask
& whichField
))
295 editSField(FilePathFieldMask
);
296 _sfFilePath
.copyFromBin(pMem
);
300 //! create a new instance of the class
301 CgFXVariableTexObjTransitPtr
CgFXVariableTexObjBase::createLocal(BitVector bFlags
)
303 CgFXVariableTexObjTransitPtr fc
;
305 if(getClassType().getPrototype() != NULL
)
307 FieldContainerTransitPtr tmpPtr
=
308 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
310 fc
= dynamic_pointer_cast
<CgFXVariableTexObj
>(tmpPtr
);
316 //! create a new instance of the class, copy the container flags
317 CgFXVariableTexObjTransitPtr
CgFXVariableTexObjBase::createDependent(BitVector bFlags
)
319 CgFXVariableTexObjTransitPtr fc
;
321 if(getClassType().getPrototype() != NULL
)
323 FieldContainerTransitPtr tmpPtr
=
324 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
326 fc
= dynamic_pointer_cast
<CgFXVariableTexObj
>(tmpPtr
);
332 //! create a new instance of the class
333 CgFXVariableTexObjTransitPtr
CgFXVariableTexObjBase::create(void)
335 CgFXVariableTexObjTransitPtr fc
;
337 if(getClassType().getPrototype() != NULL
)
339 FieldContainerTransitPtr tmpPtr
=
340 getClassType().getPrototype()-> shallowCopy();
342 fc
= dynamic_pointer_cast
<CgFXVariableTexObj
>(tmpPtr
);
348 CgFXVariableTexObj
*CgFXVariableTexObjBase::createEmptyLocal(BitVector bFlags
)
350 CgFXVariableTexObj
*returnValue
;
352 newPtr
<CgFXVariableTexObj
>(returnValue
, bFlags
);
354 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
359 //! create an empty new instance of the class, do not copy the prototype
360 CgFXVariableTexObj
*CgFXVariableTexObjBase::createEmpty(void)
362 CgFXVariableTexObj
*returnValue
;
364 newPtr
<CgFXVariableTexObj
>(returnValue
, Thread::getCurrentLocalFlags());
366 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
367 ~Thread::getCurrentLocalFlags();
373 FieldContainerTransitPtr
CgFXVariableTexObjBase::shallowCopyLocal(
374 BitVector bFlags
) const
376 CgFXVariableTexObj
*tmpPtr
;
378 newPtr(tmpPtr
, dynamic_cast<const CgFXVariableTexObj
*>(this), bFlags
);
380 FieldContainerTransitPtr
returnValue(tmpPtr
);
382 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
387 FieldContainerTransitPtr
CgFXVariableTexObjBase::shallowCopyDependent(
388 BitVector bFlags
) const
390 CgFXVariableTexObj
*tmpPtr
;
392 newPtr(tmpPtr
, dynamic_cast<const CgFXVariableTexObj
*>(this), ~bFlags
);
394 FieldContainerTransitPtr
returnValue(tmpPtr
);
396 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
401 FieldContainerTransitPtr
CgFXVariableTexObjBase::shallowCopy(void) const
403 CgFXVariableTexObj
*tmpPtr
;
406 dynamic_cast<const CgFXVariableTexObj
*>(this),
407 Thread::getCurrentLocalFlags());
409 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
411 FieldContainerTransitPtr
returnValue(tmpPtr
);
419 /*------------------------- constructors ----------------------------------*/
421 CgFXVariableTexObjBase::CgFXVariableTexObjBase(void) :
423 _sfValue (Int32(-1)),
428 CgFXVariableTexObjBase::CgFXVariableTexObjBase(const CgFXVariableTexObjBase
&source
) :
430 _sfValue (source
._sfValue
),
431 _sfFilePath (source
._sfFilePath
)
436 /*-------------------------- destructors ----------------------------------*/
438 CgFXVariableTexObjBase::~CgFXVariableTexObjBase(void)
443 GetFieldHandlePtr
CgFXVariableTexObjBase::getHandleValue (void) const
445 SFInt32::GetHandlePtr
returnValue(
446 new SFInt32::GetHandle(
448 this->getType().getFieldDesc(ValueFieldId
),
449 const_cast<CgFXVariableTexObjBase
*>(this)));
454 EditFieldHandlePtr
CgFXVariableTexObjBase::editHandleValue (void)
456 SFInt32::EditHandlePtr
returnValue(
457 new SFInt32::EditHandle(
459 this->getType().getFieldDesc(ValueFieldId
),
463 editSField(ValueFieldMask
);
468 GetFieldHandlePtr
CgFXVariableTexObjBase::getHandleFilePath (void) const
470 SFString::GetHandlePtr
returnValue(
471 new SFString::GetHandle(
473 this->getType().getFieldDesc(FilePathFieldId
),
474 const_cast<CgFXVariableTexObjBase
*>(this)));
479 EditFieldHandlePtr
CgFXVariableTexObjBase::editHandleFilePath (void)
481 SFString::EditHandlePtr
returnValue(
482 new SFString::EditHandle(
484 this->getType().getFieldDesc(FilePathFieldId
),
488 editSField(FilePathFieldMask
);
494 #ifdef OSG_MT_CPTR_ASPECT
495 void CgFXVariableTexObjBase::execSyncV( FieldContainer
&oFrom
,
496 ConstFieldMaskArg whichField
,
497 AspectOffsetStore
&oOffsets
,
498 ConstFieldMaskArg syncMode
,
499 const UInt32 uiSyncInfo
)
501 CgFXVariableTexObj
*pThis
= static_cast<CgFXVariableTexObj
*>(this);
503 pThis
->execSync(static_cast<CgFXVariableTexObj
*>(&oFrom
),
512 #ifdef OSG_MT_CPTR_ASPECT
513 FieldContainer
*CgFXVariableTexObjBase::createAspectCopy(
514 const FieldContainer
*pRefAspect
) const
516 CgFXVariableTexObj
*returnValue
;
518 newAspectCopy(returnValue
,
519 dynamic_cast<const CgFXVariableTexObj
*>(pRefAspect
),
520 dynamic_cast<const CgFXVariableTexObj
*>(this));
526 void CgFXVariableTexObjBase::resolveLinks(void)
528 Inherited::resolveLinks();