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 FileGrabForeground!
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 "OSGFileGrabForegroundBase.h"
67 #include "OSGFileGrabForeground.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::FileGrabForeground
78 The FileGrabForeground is used for grabbing a frame or sequence of frames to
80 PageSystemWindowForegroundGrabFile for a description.
82 The name of the file(s) grabbed to are defined by the _sfName Field, the
83 current frame number by _sfFrame. _sfIncrement can be used to automatically
84 increment the frame number after each image is written. The whole grabber can
85 be activated/deactivated using _sfActive.
88 /***************************************************************************\
89 * Field Documentation *
90 \***************************************************************************/
92 /*! \var std::string FileGrabForegroundBase::_sfName
93 The filename template. %d is replaced by the frame number.
96 /*! \var UInt32 FileGrabForegroundBase::_sfFrame
97 The frame number to use.
100 /*! \var bool FileGrabForegroundBase::_sfIncrement
101 Flag to start/stop automatic frame increments after each grab.
105 /***************************************************************************\
106 * FieldType/FieldTrait Instantiation *
107 \***************************************************************************/
109 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
110 PointerType FieldTraits
<FileGrabForeground
*, nsOSG
>::_type(
111 "FileGrabForegroundPtr",
113 FileGrabForeground::getClassType(),
117 OSG_FIELDTRAITS_GETTYPE_NS(FileGrabForeground
*, nsOSG
)
119 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
120 FileGrabForeground
*,
123 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
124 FileGrabForeground
*,
127 /***************************************************************************\
128 * Field Description *
129 \***************************************************************************/
131 void FileGrabForegroundBase::classDescInserter(TypeObject
&oType
)
133 FieldDescriptionBase
*pDesc
= NULL
;
136 pDesc
= new SFString::Description(
137 SFString::getClassType(),
139 "The filename template. %d is replaced by the frame number.\n",
140 NameFieldId
, NameFieldMask
,
142 (Field::SFDefaultFlags
| Field::FStdAccess
),
143 static_cast<FieldEditMethodSig
>(&FileGrabForeground::editHandleName
),
144 static_cast<FieldGetMethodSig
>(&FileGrabForeground::getHandleName
));
146 oType
.addInitialDesc(pDesc
);
148 pDesc
= new SFUInt32::Description(
149 SFUInt32::getClassType(),
151 "The frame number to use.\n",
152 FrameFieldId
, FrameFieldMask
,
154 (Field::SFDefaultFlags
| Field::FStdAccess
),
155 static_cast<FieldEditMethodSig
>(&FileGrabForeground::editHandleFrame
),
156 static_cast<FieldGetMethodSig
>(&FileGrabForeground::getHandleFrame
));
158 oType
.addInitialDesc(pDesc
);
160 pDesc
= new SFBool::Description(
161 SFBool::getClassType(),
163 "Flag to start/stop automatic frame increments after each grab.\n",
164 IncrementFieldId
, IncrementFieldMask
,
166 (Field::SFDefaultFlags
| Field::FStdAccess
),
167 static_cast<FieldEditMethodSig
>(&FileGrabForeground::editHandleIncrement
),
168 static_cast<FieldGetMethodSig
>(&FileGrabForeground::getHandleIncrement
));
170 oType
.addInitialDesc(pDesc
);
174 FileGrabForegroundBase::TypeObject
FileGrabForegroundBase::_type(
175 FileGrabForegroundBase::getClassname(),
176 Inherited::getClassname(),
179 reinterpret_cast<PrototypeCreateF
>(&FileGrabForegroundBase::createEmptyLocal
),
180 reinterpret_cast<InitContainerF
>(&FileGrabForeground::initMethod
),
181 reinterpret_cast<ExitContainerF
>(&FileGrabForeground::exitMethod
),
182 reinterpret_cast<InitalInsertDescFunc
>(
183 reinterpret_cast<void *>(&FileGrabForeground::classDescInserter
)),
186 "<?xml version=\"1.0\"?>\n"
189 " name=\"FileGrabForeground\"\n"
190 " parent=\"GrabForeground\"\n"
191 " library=\"Window\"\n"
192 " pointerfieldtypes=\"both\"\n"
193 " structure=\"concrete\"\n"
194 " systemcomponent=\"true\"\n"
195 " parentsystemcomponent=\"true\"\n"
196 " decoratable=\"false\"\n"
197 " useLocalIncludes=\"false\"\n"
198 " docGroupBase=\"GrpWindowForeground\"\n"
200 " The FileGrabForeground is used for grabbing a frame or sequence of frames to\n"
202 " PageSystemWindowForegroundGrabFile for a description.\n"
204 " The name of the file(s) grabbed to are defined by the _sfName Field, the\n"
205 " current frame number by _sfFrame. _sfIncrement can be used to automatically\n"
206 " increment the frame number after each image is written. The whole grabber can\n"
207 " be activated/deactivated using _sfActive.\n"
210 "\t type=\"std::string\"\n"
211 "\t cardinality=\"single\"\n"
212 "\t visibility=\"external\"\n"
213 "\t access=\"public\"\n"
215 "\tThe filename template. %d is replaced by the frame number.\n"
218 "\t name=\"frame\"\n"
219 "\t type=\"UInt32\"\n"
220 "\t cardinality=\"single\"\n"
221 "\t visibility=\"external\"\n"
222 "\t defaultValue=\"0\"\n"
223 "\t access=\"public\"\n"
225 "\tThe frame number to use.\n"
228 "\t name=\"increment\"\n"
230 "\t cardinality=\"single\"\n"
231 "\t visibility=\"external\"\n"
232 "\t defaultValue=\"true\"\n"
233 "\t access=\"public\"\n"
235 "\tFlag to start/stop automatic frame increments after each grab.\n"
237 "</FieldContainer>\n",
238 "The FileGrabForeground is used for grabbing a frame or sequence of frames to\n"
240 "PageSystemWindowForegroundGrabFile for a description.\n"
242 "The name of the file(s) grabbed to are defined by the _sfName Field, the\n"
243 "current frame number by _sfFrame. _sfIncrement can be used to automatically\n"
244 "increment the frame number after each image is written. The whole grabber can\n"
245 "be activated/deactivated using _sfActive.\n"
248 /*------------------------------ get -----------------------------------*/
250 FieldContainerType
&FileGrabForegroundBase::getType(void)
255 const FieldContainerType
&FileGrabForegroundBase::getType(void) const
260 UInt32
FileGrabForegroundBase::getContainerSize(void) const
262 return sizeof(FileGrabForeground
);
265 /*------------------------- decorator get ------------------------------*/
268 SFString
*FileGrabForegroundBase::editSFName(void)
270 editSField(NameFieldMask
);
275 const SFString
*FileGrabForegroundBase::getSFName(void) const
281 SFUInt32
*FileGrabForegroundBase::editSFFrame(void)
283 editSField(FrameFieldMask
);
288 const SFUInt32
*FileGrabForegroundBase::getSFFrame(void) const
294 SFBool
*FileGrabForegroundBase::editSFIncrement(void)
296 editSField(IncrementFieldMask
);
298 return &_sfIncrement
;
301 const SFBool
*FileGrabForegroundBase::getSFIncrement(void) const
303 return &_sfIncrement
;
311 /*------------------------------ access -----------------------------------*/
313 SizeT
FileGrabForegroundBase::getBinSize(ConstFieldMaskArg whichField
)
315 SizeT returnValue
= Inherited::getBinSize(whichField
);
317 if(FieldBits::NoField
!= (NameFieldMask
& whichField
))
319 returnValue
+= _sfName
.getBinSize();
321 if(FieldBits::NoField
!= (FrameFieldMask
& whichField
))
323 returnValue
+= _sfFrame
.getBinSize();
325 if(FieldBits::NoField
!= (IncrementFieldMask
& whichField
))
327 returnValue
+= _sfIncrement
.getBinSize();
333 void FileGrabForegroundBase::copyToBin(BinaryDataHandler
&pMem
,
334 ConstFieldMaskArg whichField
)
336 Inherited::copyToBin(pMem
, whichField
);
338 if(FieldBits::NoField
!= (NameFieldMask
& whichField
))
340 _sfName
.copyToBin(pMem
);
342 if(FieldBits::NoField
!= (FrameFieldMask
& whichField
))
344 _sfFrame
.copyToBin(pMem
);
346 if(FieldBits::NoField
!= (IncrementFieldMask
& whichField
))
348 _sfIncrement
.copyToBin(pMem
);
352 void FileGrabForegroundBase::copyFromBin(BinaryDataHandler
&pMem
,
353 ConstFieldMaskArg whichField
)
355 Inherited::copyFromBin(pMem
, whichField
);
357 if(FieldBits::NoField
!= (NameFieldMask
& whichField
))
359 editSField(NameFieldMask
);
360 _sfName
.copyFromBin(pMem
);
362 if(FieldBits::NoField
!= (FrameFieldMask
& whichField
))
364 editSField(FrameFieldMask
);
365 _sfFrame
.copyFromBin(pMem
);
367 if(FieldBits::NoField
!= (IncrementFieldMask
& whichField
))
369 editSField(IncrementFieldMask
);
370 _sfIncrement
.copyFromBin(pMem
);
374 //! create a new instance of the class
375 FileGrabForegroundTransitPtr
FileGrabForegroundBase::createLocal(BitVector bFlags
)
377 FileGrabForegroundTransitPtr fc
;
379 if(getClassType().getPrototype() != NULL
)
381 FieldContainerTransitPtr tmpPtr
=
382 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
384 fc
= dynamic_pointer_cast
<FileGrabForeground
>(tmpPtr
);
390 //! create a new instance of the class, copy the container flags
391 FileGrabForegroundTransitPtr
FileGrabForegroundBase::createDependent(BitVector bFlags
)
393 FileGrabForegroundTransitPtr fc
;
395 if(getClassType().getPrototype() != NULL
)
397 FieldContainerTransitPtr tmpPtr
=
398 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
400 fc
= dynamic_pointer_cast
<FileGrabForeground
>(tmpPtr
);
406 //! create a new instance of the class
407 FileGrabForegroundTransitPtr
FileGrabForegroundBase::create(void)
409 FileGrabForegroundTransitPtr fc
;
411 if(getClassType().getPrototype() != NULL
)
413 FieldContainerTransitPtr tmpPtr
=
414 getClassType().getPrototype()-> shallowCopy();
416 fc
= dynamic_pointer_cast
<FileGrabForeground
>(tmpPtr
);
422 FileGrabForeground
*FileGrabForegroundBase::createEmptyLocal(BitVector bFlags
)
424 FileGrabForeground
*returnValue
;
426 newPtr
<FileGrabForeground
>(returnValue
, bFlags
);
428 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
433 //! create an empty new instance of the class, do not copy the prototype
434 FileGrabForeground
*FileGrabForegroundBase::createEmpty(void)
436 FileGrabForeground
*returnValue
;
438 newPtr
<FileGrabForeground
>(returnValue
, Thread::getCurrentLocalFlags());
440 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
441 ~Thread::getCurrentLocalFlags();
447 FieldContainerTransitPtr
FileGrabForegroundBase::shallowCopyLocal(
448 BitVector bFlags
) const
450 FileGrabForeground
*tmpPtr
;
452 newPtr(tmpPtr
, dynamic_cast<const FileGrabForeground
*>(this), bFlags
);
454 FieldContainerTransitPtr
returnValue(tmpPtr
);
456 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
461 FieldContainerTransitPtr
FileGrabForegroundBase::shallowCopyDependent(
462 BitVector bFlags
) const
464 FileGrabForeground
*tmpPtr
;
466 newPtr(tmpPtr
, dynamic_cast<const FileGrabForeground
*>(this), ~bFlags
);
468 FieldContainerTransitPtr
returnValue(tmpPtr
);
470 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
475 FieldContainerTransitPtr
FileGrabForegroundBase::shallowCopy(void) const
477 FileGrabForeground
*tmpPtr
;
480 dynamic_cast<const FileGrabForeground
*>(this),
481 Thread::getCurrentLocalFlags());
483 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
485 FieldContainerTransitPtr
returnValue(tmpPtr
);
493 /*------------------------- constructors ----------------------------------*/
495 FileGrabForegroundBase::FileGrabForegroundBase(void) :
498 _sfFrame (UInt32(0)),
499 _sfIncrement (bool(true))
503 FileGrabForegroundBase::FileGrabForegroundBase(const FileGrabForegroundBase
&source
) :
505 _sfName (source
._sfName
),
506 _sfFrame (source
._sfFrame
),
507 _sfIncrement (source
._sfIncrement
)
512 /*-------------------------- destructors ----------------------------------*/
514 FileGrabForegroundBase::~FileGrabForegroundBase(void)
519 GetFieldHandlePtr
FileGrabForegroundBase::getHandleName (void) const
521 SFString::GetHandlePtr
returnValue(
522 new SFString::GetHandle(
524 this->getType().getFieldDesc(NameFieldId
),
525 const_cast<FileGrabForegroundBase
*>(this)));
530 EditFieldHandlePtr
FileGrabForegroundBase::editHandleName (void)
532 SFString::EditHandlePtr
returnValue(
533 new SFString::EditHandle(
535 this->getType().getFieldDesc(NameFieldId
),
539 editSField(NameFieldMask
);
544 GetFieldHandlePtr
FileGrabForegroundBase::getHandleFrame (void) const
546 SFUInt32::GetHandlePtr
returnValue(
547 new SFUInt32::GetHandle(
549 this->getType().getFieldDesc(FrameFieldId
),
550 const_cast<FileGrabForegroundBase
*>(this)));
555 EditFieldHandlePtr
FileGrabForegroundBase::editHandleFrame (void)
557 SFUInt32::EditHandlePtr
returnValue(
558 new SFUInt32::EditHandle(
560 this->getType().getFieldDesc(FrameFieldId
),
564 editSField(FrameFieldMask
);
569 GetFieldHandlePtr
FileGrabForegroundBase::getHandleIncrement (void) const
571 SFBool::GetHandlePtr
returnValue(
572 new SFBool::GetHandle(
574 this->getType().getFieldDesc(IncrementFieldId
),
575 const_cast<FileGrabForegroundBase
*>(this)));
580 EditFieldHandlePtr
FileGrabForegroundBase::editHandleIncrement (void)
582 SFBool::EditHandlePtr
returnValue(
583 new SFBool::EditHandle(
585 this->getType().getFieldDesc(IncrementFieldId
),
589 editSField(IncrementFieldMask
);
595 #ifdef OSG_MT_CPTR_ASPECT
596 void FileGrabForegroundBase::execSyncV( FieldContainer
&oFrom
,
597 ConstFieldMaskArg whichField
,
598 AspectOffsetStore
&oOffsets
,
599 ConstFieldMaskArg syncMode
,
600 const UInt32 uiSyncInfo
)
602 FileGrabForeground
*pThis
= static_cast<FileGrabForeground
*>(this);
604 pThis
->execSync(static_cast<FileGrabForeground
*>(&oFrom
),
613 #ifdef OSG_MT_CPTR_ASPECT
614 FieldContainer
*FileGrabForegroundBase::createAspectCopy(
615 const FieldContainer
*pRefAspect
) const
617 FileGrabForeground
*returnValue
;
619 newAspectCopy(returnValue
,
620 dynamic_cast<const FileGrabForeground
*>(pRefAspect
),
621 dynamic_cast<const FileGrabForeground
*>(this));
627 void FileGrabForegroundBase::resolveLinks(void)
629 Inherited::resolveLinks();