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 _OSGCSMDRAWERBASE_H_
55 #define _OSGCSMDRAWERBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGContribCSMDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGAttachmentContainer.h" // Parent
68 #include "OSGCSMWindowFields.h" // Windows type
69 #include "OSGBaseFields.h" // DisplayString type
70 #include "OSGAspectIdFields.h" // Aspect type
72 #include "OSGCSMDrawerFields.h"
79 //! \brief CSMDrawer Base Class.
81 class OSG_CONTRIBCSM_DLLMAPPING CSMDrawerBase
: public AttachmentContainer
85 typedef AttachmentContainer Inherited
;
86 typedef AttachmentContainer ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(CSMDrawer
);
93 /*========================== PUBLIC =================================*/
99 WindowsFieldId
= Inherited::NextFieldId
,
100 DisplayStringFieldId
= WindowsFieldId
+ 1,
101 AspectFieldId
= DisplayStringFieldId
+ 1,
102 NextFieldId
= AspectFieldId
+ 1
105 static const OSG::BitVector WindowsFieldMask
=
106 (TypeTraits
<BitVector
>::One
<< WindowsFieldId
);
107 static const OSG::BitVector DisplayStringFieldMask
=
108 (TypeTraits
<BitVector
>::One
<< DisplayStringFieldId
);
109 static const OSG::BitVector AspectFieldMask
=
110 (TypeTraits
<BitVector
>::One
<< AspectFieldId
);
111 static const OSG::BitVector NextFieldMask
=
112 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
114 typedef MFUnrecChildCSMWindowPtr MFWindowsType
;
115 typedef SFString SFDisplayStringType
;
116 typedef SFAspectId SFAspectType
;
118 /*---------------------------------------------------------------------*/
119 /*! \name Class Get */
122 static FieldContainerType
&getClassType (void);
123 static UInt32
getClassTypeId (void);
124 static UInt16
getClassGroupId(void);
127 /*---------------------------------------------------------------------*/
128 /*! \name FieldContainer Get */
131 virtual FieldContainerType
&getType (void);
132 virtual const FieldContainerType
&getType (void) const;
134 virtual UInt32
getContainerSize(void) const;
137 /*---------------------------------------------------------------------*/
138 /*! \name Field Get */
141 const MFUnrecChildCSMWindowPtr
*getMFWindows (void) const;
142 MFUnrecChildCSMWindowPtr
*editMFWindows (void);
144 SFString
*editSFDisplayString (void);
145 const SFString
*getSFDisplayString (void) const;
147 SFAspectId
*editSFAspect (void);
148 const SFAspectId
*getSFAspect (void) const;
151 CSMWindow
* getWindows (const UInt32 index
) const;
153 std::string
&editDisplayString (void);
154 const std::string
&getDisplayString (void) const;
156 AspectId
&editAspect (void);
157 const AspectId
&getAspect (void) const;
160 /*---------------------------------------------------------------------*/
161 /*! \name Field Set */
164 void setDisplayString (const std::string
&value
);
165 void setAspect (const AspectId
&value
);
168 /*---------------------------------------------------------------------*/
169 /*! \name Ptr Field Set */
173 /*---------------------------------------------------------------------*/
174 /*! \name Ptr MField Set */
177 void pushToWindows (CSMWindow
* const value
);
178 void assignWindows (const MFUnrecChildCSMWindowPtr
&value
);
179 void removeFromWindows (UInt32 uiIndex
);
180 void removeObjFromWindows(CSMWindow
* const value
);
181 void clearWindows (void );
184 /*---------------------------------------------------------------------*/
185 /*! \name Binary Access */
188 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
189 virtual void copyToBin (BinaryDataHandler
&pMem
,
190 ConstFieldMaskArg whichField
);
191 virtual void copyFromBin(BinaryDataHandler
&pMem
,
192 ConstFieldMaskArg whichField
);
196 /*---------------------------------------------------------------------*/
197 /*! \name Construction */
200 static CSMDrawerTransitPtr
create (void);
201 static CSMDrawer
*createEmpty (void);
203 static CSMDrawerTransitPtr
createLocal (
204 BitVector bFlags
= FCLocal::All
);
206 static CSMDrawer
*createEmptyLocal(
207 BitVector bFlags
= FCLocal::All
);
209 static CSMDrawerTransitPtr
createDependent (BitVector bFlags
);
212 /*---------------------------------------------------------------------*/
216 virtual FieldContainerTransitPtr
shallowCopy (void) const;
217 virtual FieldContainerTransitPtr
shallowCopyLocal(
218 BitVector bFlags
= FCLocal::All
) const;
219 virtual FieldContainerTransitPtr
shallowCopyDependent(
220 BitVector bFlags
) const;
223 /*========================= PROTECTED ===============================*/
227 static TypeObject _type
;
229 static void classDescInserter(TypeObject
&oType
);
230 static const Char8
*getClassname (void );
232 /*---------------------------------------------------------------------*/
236 MFUnrecChildCSMWindowPtr _mfWindows
;
237 SFString _sfDisplayString
;
238 SFAspectId _sfAspect
;
241 /*---------------------------------------------------------------------*/
242 /*! \name Constructors */
246 CSMDrawerBase(const CSMDrawerBase
&source
);
249 /*---------------------------------------------------------------------*/
250 /*! \name Destructors */
253 virtual ~CSMDrawerBase(void);
256 /*---------------------------------------------------------------------*/
257 /*! \name onCreate */
260 void onCreate(const CSMDrawer
*source
= NULL
);
263 /*---------------------------------------------------------------------*/
264 /*! \name Child linking */
267 virtual bool unlinkChild(FieldContainer
* const pChild
,
268 UInt16
const childFieldId
);
271 /*---------------------------------------------------------------------*/
272 /*! \name Generic Field Access */
275 GetFieldHandlePtr
getHandleWindows (void) const;
276 EditFieldHandlePtr
editHandleWindows (void);
277 GetFieldHandlePtr
getHandleDisplayString (void) const;
278 EditFieldHandlePtr
editHandleDisplayString (void);
279 GetFieldHandlePtr
getHandleAspect (void) const;
280 EditFieldHandlePtr
editHandleAspect (void);
283 /*---------------------------------------------------------------------*/
287 #ifdef OSG_MT_CPTR_ASPECT
288 virtual void execSyncV( FieldContainer
&oFrom
,
289 ConstFieldMaskArg whichField
,
290 AspectOffsetStore
&oOffsets
,
291 ConstFieldMaskArg syncMode
,
292 const UInt32 uiSyncInfo
);
294 void execSync ( CSMDrawerBase
*pFrom
,
295 ConstFieldMaskArg whichField
,
296 AspectOffsetStore
&oOffsets
,
297 ConstFieldMaskArg syncMode
,
298 const UInt32 uiSyncInfo
);
302 /*---------------------------------------------------------------------*/
307 /*---------------------------------------------------------------------*/
308 /*! \name Aspect Create */
311 #ifdef OSG_MT_CPTR_ASPECT
312 virtual FieldContainer
*createAspectCopy(
313 const FieldContainer
*pRefAspect
) const;
317 /*---------------------------------------------------------------------*/
321 /*---------------------------------------------------------------------*/
325 virtual void resolveLinks(void);
328 /*========================== PRIVATE ================================*/
331 /*---------------------------------------------------------------------*/
333 // prohibit default functions (move to 'public' if you need one)
334 void operator =(const CSMDrawerBase
&source
);
337 typedef CSMDrawerBase
*CSMDrawerBaseP
;
341 #endif /* _OSGCSMDRAWERBASE_H_ */