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 FrameBufferAttachment!
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 "OSGFrameBufferAttachmentBase.h"
67 #include "OSGFrameBufferAttachment.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::FrameBufferAttachment
78 FramebufferAttachment base class.
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt16 FrameBufferAttachmentBase::_sfWidth
89 /*! \var UInt16 FrameBufferAttachmentBase::_sfHeight
93 /*! \var bool FrameBufferAttachmentBase::_sfReadBack
94 read back the render result into the texture image obj on
95 framebuffer object deactivate
99 /***************************************************************************\
100 * FieldType/FieldTrait Instantiation *
101 \***************************************************************************/
103 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
104 PointerType FieldTraits
<FrameBufferAttachment
*, nsOSG
>::_type(
105 "FrameBufferAttachmentPtr",
106 "AttachmentContainerPtr",
107 FrameBufferAttachment::getClassType(),
111 OSG_FIELDTRAITS_GETTYPE_NS(FrameBufferAttachment
*, nsOSG
)
113 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
114 FrameBufferAttachment
*,
117 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
118 FrameBufferAttachment
*,
121 /***************************************************************************\
122 * Field Description *
123 \***************************************************************************/
125 void FrameBufferAttachmentBase::classDescInserter(TypeObject
&oType
)
127 FieldDescriptionBase
*pDesc
= NULL
;
130 pDesc
= new SFUInt16::Description(
131 SFUInt16::getClassType(),
134 WidthFieldId
, WidthFieldMask
,
136 (Field::SFDefaultFlags
| Field::FStdAccess
),
137 static_cast<FieldEditMethodSig
>(&FrameBufferAttachment::editHandleWidth
),
138 static_cast<FieldGetMethodSig
>(&FrameBufferAttachment::getHandleWidth
));
140 oType
.addInitialDesc(pDesc
);
142 pDesc
= new SFUInt16::Description(
143 SFUInt16::getClassType(),
146 HeightFieldId
, HeightFieldMask
,
148 (Field::SFDefaultFlags
| Field::FStdAccess
),
149 static_cast<FieldEditMethodSig
>(&FrameBufferAttachment::editHandleHeight
),
150 static_cast<FieldGetMethodSig
>(&FrameBufferAttachment::getHandleHeight
));
152 oType
.addInitialDesc(pDesc
);
154 pDesc
= new SFBool::Description(
155 SFBool::getClassType(),
157 "read back the render result into the texture image obj on \n"
158 "framebuffer object deactivate\n",
159 ReadBackFieldId
, ReadBackFieldMask
,
161 (Field::SFDefaultFlags
| Field::FStdAccess
),
162 static_cast<FieldEditMethodSig
>(&FrameBufferAttachment::editHandleReadBack
),
163 static_cast<FieldGetMethodSig
>(&FrameBufferAttachment::getHandleReadBack
));
165 oType
.addInitialDesc(pDesc
);
169 FrameBufferAttachmentBase::TypeObject
FrameBufferAttachmentBase::_type(
170 FrameBufferAttachmentBase::getClassname(),
171 Inherited::getClassname(),
172 "FrameBufferAttachment",
175 reinterpret_cast<InitContainerF
>(&FrameBufferAttachment::initMethod
),
176 reinterpret_cast<ExitContainerF
>(&FrameBufferAttachment::exitMethod
),
177 reinterpret_cast<InitalInsertDescFunc
>(
178 reinterpret_cast<void *>(&FrameBufferAttachment::classDescInserter
)),
181 "<?xml version=\"1.0\"?>\n"
184 " name=\"FrameBufferAttachment\"\n"
185 " parent=\"AttachmentContainer\"\n"
186 " library=\"System\"\n"
187 " pointerfieldtypes=\"both\"\n"
188 " structure=\"abstract\"\n"
189 " systemcomponent=\"true\"\n"
190 " parentsystemcomponent=\"true\"\n"
191 " decoratable=\"false\"\n"
192 " docGroupBase=\"GrpSystemWindowFBO\"\n"
194 "FramebufferAttachment base class.\n"
196 "\t\tname=\"width\"\n"
197 "\t\ttype=\"UInt16\"\n"
198 "\t\tcardinality=\"single\"\n"
199 "\t\tvisibility=\"internal\"\n"
200 "\t\taccess=\"protected\"\n"
204 "\t\tname=\"height\"\n"
205 "\t\ttype=\"UInt16\"\n"
206 "\t\tcardinality=\"single\"\n"
207 "\t\tvisibility=\"internal\"\n"
208 "\t\taccess=\"protected\"\n"
212 " name=\"readBack\"\n"
214 " cardinality=\"single\"\n"
215 " visibility=\"external\"\n"
216 " access=\"public\"\n"
217 " defaultValue=\"false\"\n"
219 " read back the render result into the texture image obj on \n"
220 " framebuffer object deactivate\n"
222 "</FieldContainer>\n",
223 "FramebufferAttachment base class.\n"
226 /*------------------------------ get -----------------------------------*/
228 FieldContainerType
&FrameBufferAttachmentBase::getType(void)
233 const FieldContainerType
&FrameBufferAttachmentBase::getType(void) const
238 UInt32
FrameBufferAttachmentBase::getContainerSize(void) const
240 return sizeof(FrameBufferAttachment
);
243 /*------------------------- decorator get ------------------------------*/
246 SFUInt16
*FrameBufferAttachmentBase::editSFWidth(void)
248 editSField(WidthFieldMask
);
253 const SFUInt16
*FrameBufferAttachmentBase::getSFWidth(void) const
259 SFUInt16
*FrameBufferAttachmentBase::editSFHeight(void)
261 editSField(HeightFieldMask
);
266 const SFUInt16
*FrameBufferAttachmentBase::getSFHeight(void) const
272 SFBool
*FrameBufferAttachmentBase::editSFReadBack(void)
274 editSField(ReadBackFieldMask
);
279 const SFBool
*FrameBufferAttachmentBase::getSFReadBack(void) const
289 /*------------------------------ access -----------------------------------*/
291 SizeT
FrameBufferAttachmentBase::getBinSize(ConstFieldMaskArg whichField
)
293 SizeT returnValue
= Inherited::getBinSize(whichField
);
295 if(FieldBits::NoField
!= (WidthFieldMask
& whichField
))
297 returnValue
+= _sfWidth
.getBinSize();
299 if(FieldBits::NoField
!= (HeightFieldMask
& whichField
))
301 returnValue
+= _sfHeight
.getBinSize();
303 if(FieldBits::NoField
!= (ReadBackFieldMask
& whichField
))
305 returnValue
+= _sfReadBack
.getBinSize();
311 void FrameBufferAttachmentBase::copyToBin(BinaryDataHandler
&pMem
,
312 ConstFieldMaskArg whichField
)
314 Inherited::copyToBin(pMem
, whichField
);
316 if(FieldBits::NoField
!= (WidthFieldMask
& whichField
))
318 _sfWidth
.copyToBin(pMem
);
320 if(FieldBits::NoField
!= (HeightFieldMask
& whichField
))
322 _sfHeight
.copyToBin(pMem
);
324 if(FieldBits::NoField
!= (ReadBackFieldMask
& whichField
))
326 _sfReadBack
.copyToBin(pMem
);
330 void FrameBufferAttachmentBase::copyFromBin(BinaryDataHandler
&pMem
,
331 ConstFieldMaskArg whichField
)
333 Inherited::copyFromBin(pMem
, whichField
);
335 if(FieldBits::NoField
!= (WidthFieldMask
& whichField
))
337 editSField(WidthFieldMask
);
338 _sfWidth
.copyFromBin(pMem
);
340 if(FieldBits::NoField
!= (HeightFieldMask
& whichField
))
342 editSField(HeightFieldMask
);
343 _sfHeight
.copyFromBin(pMem
);
345 if(FieldBits::NoField
!= (ReadBackFieldMask
& whichField
))
347 editSField(ReadBackFieldMask
);
348 _sfReadBack
.copyFromBin(pMem
);
355 /*------------------------- constructors ----------------------------------*/
357 FrameBufferAttachmentBase::FrameBufferAttachmentBase(void) :
361 _sfReadBack (bool(false))
365 FrameBufferAttachmentBase::FrameBufferAttachmentBase(const FrameBufferAttachmentBase
&source
) :
367 _sfWidth (source
._sfWidth
),
368 _sfHeight (source
._sfHeight
),
369 _sfReadBack (source
._sfReadBack
)
374 /*-------------------------- destructors ----------------------------------*/
376 FrameBufferAttachmentBase::~FrameBufferAttachmentBase(void)
381 GetFieldHandlePtr
FrameBufferAttachmentBase::getHandleWidth (void) const
383 SFUInt16::GetHandlePtr
returnValue(
384 new SFUInt16::GetHandle(
386 this->getType().getFieldDesc(WidthFieldId
),
387 const_cast<FrameBufferAttachmentBase
*>(this)));
392 EditFieldHandlePtr
FrameBufferAttachmentBase::editHandleWidth (void)
394 SFUInt16::EditHandlePtr
returnValue(
395 new SFUInt16::EditHandle(
397 this->getType().getFieldDesc(WidthFieldId
),
401 editSField(WidthFieldMask
);
406 GetFieldHandlePtr
FrameBufferAttachmentBase::getHandleHeight (void) const
408 SFUInt16::GetHandlePtr
returnValue(
409 new SFUInt16::GetHandle(
411 this->getType().getFieldDesc(HeightFieldId
),
412 const_cast<FrameBufferAttachmentBase
*>(this)));
417 EditFieldHandlePtr
FrameBufferAttachmentBase::editHandleHeight (void)
419 SFUInt16::EditHandlePtr
returnValue(
420 new SFUInt16::EditHandle(
422 this->getType().getFieldDesc(HeightFieldId
),
426 editSField(HeightFieldMask
);
431 GetFieldHandlePtr
FrameBufferAttachmentBase::getHandleReadBack (void) const
433 SFBool::GetHandlePtr
returnValue(
434 new SFBool::GetHandle(
436 this->getType().getFieldDesc(ReadBackFieldId
),
437 const_cast<FrameBufferAttachmentBase
*>(this)));
442 EditFieldHandlePtr
FrameBufferAttachmentBase::editHandleReadBack (void)
444 SFBool::EditHandlePtr
returnValue(
445 new SFBool::EditHandle(
447 this->getType().getFieldDesc(ReadBackFieldId
),
451 editSField(ReadBackFieldMask
);
457 #ifdef OSG_MT_CPTR_ASPECT
458 void FrameBufferAttachmentBase::execSyncV( FieldContainer
&oFrom
,
459 ConstFieldMaskArg whichField
,
460 AspectOffsetStore
&oOffsets
,
461 ConstFieldMaskArg syncMode
,
462 const UInt32 uiSyncInfo
)
464 FrameBufferAttachment
*pThis
= static_cast<FrameBufferAttachment
*>(this);
466 pThis
->execSync(static_cast<FrameBufferAttachment
*>(&oFrom
),
476 void FrameBufferAttachmentBase::resolveLinks(void)
478 Inherited::resolveLinks();