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 **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGTIMESENSORBASE_H_
55 #define _OSGTIMESENSORBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGDynamicsDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGNodeCore.h" // Parent
68 #include "OSGSysFields.h" // Enabled type
69 #include "OSGBaseFields.h" // StartTime type
71 #include "OSGTimeSensorFields.h"
73 #include "OSGNodeCoreSensorParent.h"
80 //! \brief TimeSensor Base Class.
82 class OSG_DYNAMICS_DLLMAPPING TimeSensorBase
: public NodeCoreSensorParent
86 typedef NodeCoreSensorParent Inherited
;
87 typedef NodeCore ParentContainer
;
89 typedef Inherited::TypeObject TypeObject
;
90 typedef TypeObject::InitPhase InitPhase
;
92 OSG_GEN_INTERNALPTR(TimeSensor
);
94 /*========================== PUBLIC =================================*/
100 EnabledFieldId
= Inherited::NextFieldId
,
101 IsActiveFieldId
= EnabledFieldId
+ 1,
102 LoopFieldId
= IsActiveFieldId
+ 1,
103 FractionFieldId
= LoopFieldId
+ 1,
104 StartTimeFieldId
= FractionFieldId
+ 1,
105 StopTimeFieldId
= StartTimeFieldId
+ 1,
106 CycleTimeFieldId
= StopTimeFieldId
+ 1,
107 TimeFieldId
= CycleTimeFieldId
+ 1,
108 CycleIntervalFieldId
= TimeFieldId
+ 1,
109 ChangeFractionByFieldId
= CycleIntervalFieldId
+ 1,
110 NextFieldId
= ChangeFractionByFieldId
+ 1
113 static const OSG::BitVector EnabledFieldMask
=
114 (TypeTraits
<BitVector
>::One
<< EnabledFieldId
);
115 static const OSG::BitVector IsActiveFieldMask
=
116 (TypeTraits
<BitVector
>::One
<< IsActiveFieldId
);
117 static const OSG::BitVector LoopFieldMask
=
118 (TypeTraits
<BitVector
>::One
<< LoopFieldId
);
119 static const OSG::BitVector FractionFieldMask
=
120 (TypeTraits
<BitVector
>::One
<< FractionFieldId
);
121 static const OSG::BitVector StartTimeFieldMask
=
122 (TypeTraits
<BitVector
>::One
<< StartTimeFieldId
);
123 static const OSG::BitVector StopTimeFieldMask
=
124 (TypeTraits
<BitVector
>::One
<< StopTimeFieldId
);
125 static const OSG::BitVector CycleTimeFieldMask
=
126 (TypeTraits
<BitVector
>::One
<< CycleTimeFieldId
);
127 static const OSG::BitVector TimeFieldMask
=
128 (TypeTraits
<BitVector
>::One
<< TimeFieldId
);
129 static const OSG::BitVector CycleIntervalFieldMask
=
130 (TypeTraits
<BitVector
>::One
<< CycleIntervalFieldId
);
131 static const OSG::BitVector ChangeFractionByFieldMask
=
132 (TypeTraits
<BitVector
>::One
<< ChangeFractionByFieldId
);
133 static const OSG::BitVector NextFieldMask
=
134 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
136 typedef SFBool SFEnabledType
;
137 typedef SFBool SFIsActiveType
;
138 typedef SFBool SFLoopType
;
139 typedef SFReal32 SFFractionType
;
140 typedef SFTime SFStartTimeType
;
141 typedef SFTime SFStopTimeType
;
142 typedef SFTime SFCycleTimeType
;
143 typedef SFTime SFTimeType
;
144 typedef SFTime SFCycleIntervalType
;
145 typedef SFTime SFChangeFractionByType
;
147 /*---------------------------------------------------------------------*/
148 /*! \name Class Get */
151 static FieldContainerType
&getClassType (void);
152 static UInt32
getClassTypeId (void);
153 static UInt16
getClassGroupId(void);
156 /*---------------------------------------------------------------------*/
157 /*! \name FieldContainer Get */
160 virtual FieldContainerType
&getType (void);
161 virtual const FieldContainerType
&getType (void) const;
163 virtual UInt32
getContainerSize(void) const;
166 /*---------------------------------------------------------------------*/
167 /*! \name Field Get */
171 SFBool
*editSFEnabled (void);
172 const SFBool
*getSFEnabled (void) const;
174 SFBool
*editSFIsActive (void);
175 const SFBool
*getSFIsActive (void) const;
177 SFBool
*editSFLoop (void);
178 const SFBool
*getSFLoop (void) const;
180 SFReal32
*editSFFraction (void);
181 const SFReal32
*getSFFraction (void) const;
183 SFTime
*editSFStartTime (void);
184 const SFTime
*getSFStartTime (void) const;
186 SFTime
*editSFStopTime (void);
187 const SFTime
*getSFStopTime (void) const;
189 SFTime
*editSFCycleTime (void);
190 const SFTime
*getSFCycleTime (void) const;
192 SFTime
*editSFTime (void);
193 const SFTime
*getSFTime (void) const;
195 SFTime
*editSFCycleInterval (void);
196 const SFTime
*getSFCycleInterval (void) const;
198 SFTime
*editSFChangeFractionBy(void);
199 const SFTime
*getSFChangeFractionBy (void) const;
202 bool &editEnabled (void);
203 bool getEnabled (void) const;
205 bool &editIsActive (void);
206 bool getIsActive (void) const;
208 bool &editLoop (void);
209 bool getLoop (void) const;
211 Real32
&editFraction (void);
212 Real32
getFraction (void) const;
214 Time
&editStartTime (void);
215 const Time
&getStartTime (void) const;
217 Time
&editStopTime (void);
218 const Time
&getStopTime (void) const;
220 Time
&editCycleTime (void);
221 const Time
&getCycleTime (void) const;
223 Time
&editTime (void);
224 const Time
&getTime (void) const;
226 Time
&editCycleInterval (void);
227 const Time
&getCycleInterval (void) const;
229 Time
&editChangeFractionBy(void);
230 const Time
&getChangeFractionBy (void) const;
233 /*---------------------------------------------------------------------*/
234 /*! \name Field Set */
237 void setEnabled (const bool value
);
238 void setIsActive (const bool value
);
239 void setLoop (const bool value
);
240 void setFraction (const Real32 value
);
241 void setStartTime (const Time
&value
);
242 void setStopTime (const Time
&value
);
243 void setCycleTime (const Time
&value
);
244 void setTime (const Time
&value
);
245 void setCycleInterval (const Time
&value
);
246 void setChangeFractionBy(const Time
&value
);
249 /*---------------------------------------------------------------------*/
250 /*! \name Ptr MField Set */
254 /*---------------------------------------------------------------------*/
255 /*! \name Binary Access */
258 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
259 virtual void copyToBin (BinaryDataHandler
&pMem
,
260 ConstFieldMaskArg whichField
);
261 virtual void copyFromBin(BinaryDataHandler
&pMem
,
262 ConstFieldMaskArg whichField
);
266 /*---------------------------------------------------------------------*/
267 /*! \name Construction */
270 static TimeSensorTransitPtr
create (void);
271 static TimeSensor
*createEmpty (void);
273 static TimeSensorTransitPtr
createLocal (
274 BitVector bFlags
= FCLocal::All
);
276 static TimeSensor
*createEmptyLocal(
277 BitVector bFlags
= FCLocal::All
);
279 static TimeSensorTransitPtr
createDependent (BitVector bFlags
);
282 /*---------------------------------------------------------------------*/
286 virtual FieldContainerTransitPtr
shallowCopy (void) const;
287 virtual FieldContainerTransitPtr
shallowCopyLocal(
288 BitVector bFlags
= FCLocal::All
) const;
289 virtual FieldContainerTransitPtr
shallowCopyDependent(
290 BitVector bFlags
) const;
293 /*========================= PROTECTED ===============================*/
297 static TypeObject _type
;
299 static void classDescInserter(TypeObject
&oType
);
300 static const Char8
*getClassname (void );
302 /*---------------------------------------------------------------------*/
309 SFReal32 _sfFraction
;
314 SFTime _sfCycleInterval
;
315 SFTime _sfChangeFractionBy
;
318 /*---------------------------------------------------------------------*/
319 /*! \name Constructors */
322 TimeSensorBase(void);
323 TimeSensorBase(const TimeSensorBase
&source
);
326 /*---------------------------------------------------------------------*/
327 /*! \name Destructors */
330 virtual ~TimeSensorBase(void);
333 /*---------------------------------------------------------------------*/
334 /*! \name onCreate */
339 /*---------------------------------------------------------------------*/
340 /*! \name Generic Field Access */
343 GetFieldHandlePtr
getHandleEnabled (void) const;
344 EditFieldHandlePtr
editHandleEnabled (void);
345 GetFieldHandlePtr
getHandleIsActive (void) const;
346 EditFieldHandlePtr
editHandleIsActive (void);
347 GetFieldHandlePtr
getHandleLoop (void) const;
348 EditFieldHandlePtr
editHandleLoop (void);
349 GetFieldHandlePtr
getHandleFraction (void) const;
350 EditFieldHandlePtr
editHandleFraction (void);
351 GetFieldHandlePtr
getHandleStartTime (void) const;
352 EditFieldHandlePtr
editHandleStartTime (void);
353 GetFieldHandlePtr
getHandleStopTime (void) const;
354 EditFieldHandlePtr
editHandleStopTime (void);
355 GetFieldHandlePtr
getHandleCycleTime (void) const;
356 EditFieldHandlePtr
editHandleCycleTime (void);
357 GetFieldHandlePtr
getHandleTime (void) const;
358 EditFieldHandlePtr
editHandleTime (void);
359 GetFieldHandlePtr
getHandleCycleInterval (void) const;
360 EditFieldHandlePtr
editHandleCycleInterval (void);
361 GetFieldHandlePtr
getHandleChangeFractionBy (void) const;
362 EditFieldHandlePtr
editHandleChangeFractionBy(void);
365 /*---------------------------------------------------------------------*/
369 #ifdef OSG_MT_CPTR_ASPECT
370 virtual void execSyncV( FieldContainer
&oFrom
,
371 ConstFieldMaskArg whichField
,
372 AspectOffsetStore
&oOffsets
,
373 ConstFieldMaskArg syncMode
,
374 const UInt32 uiSyncInfo
);
376 void execSync ( TimeSensorBase
*pFrom
,
377 ConstFieldMaskArg whichField
,
378 AspectOffsetStore
&oOffsets
,
379 ConstFieldMaskArg syncMode
,
380 const UInt32 uiSyncInfo
);
384 /*---------------------------------------------------------------------*/
389 /*---------------------------------------------------------------------*/
390 /*! \name Aspect Create */
393 #ifdef OSG_MT_CPTR_ASPECT
394 virtual FieldContainer
*createAspectCopy(
395 const FieldContainer
*pRefAspect
) const;
399 /*---------------------------------------------------------------------*/
403 /*---------------------------------------------------------------------*/
407 virtual void resolveLinks(void);
410 /*========================== PRIVATE ================================*/
413 /*---------------------------------------------------------------------*/
415 // prohibit default functions (move to 'public' if you need one)
416 void operator =(const TimeSensorBase
&source
);
419 typedef TimeSensorBase
*TimeSensorBaseP
;
421 typedef CoredNodeRefPtr
<TimeSensor
> TimeSensorNodeRefPtr
;
422 typedef CoredNodeMTRefPtr
<TimeSensor
> TimeSensorNodeMTRefPtr
;
426 #endif /* _OSGTIMESENSORBASE_H_ */