1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: David Kabala (djkabala@gmail.com) *
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 SimpleTextForeground
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSIMPLETEXTFOREGROUNDBASE_H_
55 #define _OSGSIMPLETEXTFOREGROUNDBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGWindowDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGForeground.h" // Parent
68 #include "OSGBaseFields.h" // Lines type
69 #include "OSGSysFields.h" // Size type
70 #include "OSGVecFields.h" // ShadowOffset type
72 #include "OSGSimpleTextForegroundFields.h"
77 class SimpleTextForeground
;
79 //! \brief SimpleTextForeground Base Class.
81 class OSG_WINDOW_DLLMAPPING SimpleTextForegroundBase
: public Foreground
85 typedef Foreground Inherited
;
86 typedef Foreground ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(SimpleTextForeground
);
93 /*========================== PUBLIC =================================*/
99 LinesFieldId
= Inherited::NextFieldId
,
100 SizeFieldId
= LinesFieldId
+ 1,
101 ColorFieldId
= SizeFieldId
+ 1,
102 ShadowColorFieldId
= ColorFieldId
+ 1,
103 BgColorFieldId
= ShadowColorFieldId
+ 1,
104 FamilyFieldId
= BgColorFieldId
+ 1,
105 ShadowOffsetFieldId
= FamilyFieldId
+ 1,
106 HorizontalAlignFieldId
= ShadowOffsetFieldId
+ 1,
107 VerticalAlignFieldId
= HorizontalAlignFieldId
+ 1,
108 BorderColorFieldId
= VerticalAlignFieldId
+ 1,
109 BorderOffsetFieldId
= BorderColorFieldId
+ 1,
110 TextMarginFieldId
= BorderOffsetFieldId
+ 1,
111 TileFieldId
= TextMarginFieldId
+ 1,
112 NextFieldId
= TileFieldId
+ 1
115 static const OSG::BitVector LinesFieldMask
=
116 (TypeTraits
<BitVector
>::One
<< LinesFieldId
);
117 static const OSG::BitVector SizeFieldMask
=
118 (TypeTraits
<BitVector
>::One
<< SizeFieldId
);
119 static const OSG::BitVector ColorFieldMask
=
120 (TypeTraits
<BitVector
>::One
<< ColorFieldId
);
121 static const OSG::BitVector ShadowColorFieldMask
=
122 (TypeTraits
<BitVector
>::One
<< ShadowColorFieldId
);
123 static const OSG::BitVector BgColorFieldMask
=
124 (TypeTraits
<BitVector
>::One
<< BgColorFieldId
);
125 static const OSG::BitVector FamilyFieldMask
=
126 (TypeTraits
<BitVector
>::One
<< FamilyFieldId
);
127 static const OSG::BitVector ShadowOffsetFieldMask
=
128 (TypeTraits
<BitVector
>::One
<< ShadowOffsetFieldId
);
129 static const OSG::BitVector HorizontalAlignFieldMask
=
130 (TypeTraits
<BitVector
>::One
<< HorizontalAlignFieldId
);
131 static const OSG::BitVector VerticalAlignFieldMask
=
132 (TypeTraits
<BitVector
>::One
<< VerticalAlignFieldId
);
133 static const OSG::BitVector BorderColorFieldMask
=
134 (TypeTraits
<BitVector
>::One
<< BorderColorFieldId
);
135 static const OSG::BitVector BorderOffsetFieldMask
=
136 (TypeTraits
<BitVector
>::One
<< BorderOffsetFieldId
);
137 static const OSG::BitVector TextMarginFieldMask
=
138 (TypeTraits
<BitVector
>::One
<< TextMarginFieldId
);
139 static const OSG::BitVector TileFieldMask
=
140 (TypeTraits
<BitVector
>::One
<< TileFieldId
);
141 static const OSG::BitVector NextFieldMask
=
142 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
144 typedef MFString MFLinesType
;
145 typedef SFReal32 SFSizeType
;
146 typedef SFColor4f SFColorType
;
147 typedef SFColor4f SFShadowColorType
;
148 typedef SFColor4f SFBgColorType
;
149 typedef SFString SFFamilyType
;
150 typedef SFVec2f SFShadowOffsetType
;
151 typedef SFUInt8 SFHorizontalAlignType
;
152 typedef SFUInt8 SFVerticalAlignType
;
153 typedef SFColor4f SFBorderColorType
;
154 typedef SFVec2f SFBorderOffsetType
;
155 typedef SFVec2f SFTextMarginType
;
156 typedef SFBool SFTileType
;
158 /*---------------------------------------------------------------------*/
159 /*! \name Class Get */
162 static FieldContainerType
&getClassType (void);
163 static UInt32
getClassTypeId (void);
164 static UInt16
getClassGroupId(void);
167 /*---------------------------------------------------------------------*/
168 /*! \name FieldContainer Get */
171 virtual FieldContainerType
&getType (void);
172 virtual const FieldContainerType
&getType (void) const;
174 virtual UInt32
getContainerSize(void) const;
177 /*---------------------------------------------------------------------*/
178 /*! \name Field Get */
182 MFString
*editMFLines (void);
183 const MFString
*getMFLines (void) const;
185 SFReal32
*editSFSize (void);
186 const SFReal32
*getSFSize (void) const;
188 SFColor4f
*editSFColor (void);
189 const SFColor4f
*getSFColor (void) const;
191 SFColor4f
*editSFShadowColor (void);
192 const SFColor4f
*getSFShadowColor (void) const;
194 SFColor4f
*editSFBgColor (void);
195 const SFColor4f
*getSFBgColor (void) const;
197 SFString
*editSFFamily (void);
198 const SFString
*getSFFamily (void) const;
200 SFVec2f
*editSFShadowOffset (void);
201 const SFVec2f
*getSFShadowOffset (void) const;
203 SFUInt8
*editSFHorizontalAlign(void);
204 const SFUInt8
*getSFHorizontalAlign (void) const;
206 SFUInt8
*editSFVerticalAlign (void);
207 const SFUInt8
*getSFVerticalAlign (void) const;
209 SFColor4f
*editSFBorderColor (void);
210 const SFColor4f
*getSFBorderColor (void) const;
212 SFVec2f
*editSFBorderOffset (void);
213 const SFVec2f
*getSFBorderOffset (void) const;
215 SFVec2f
*editSFTextMargin (void);
216 const SFVec2f
*getSFTextMargin (void) const;
218 SFBool
*editSFTile (void);
219 const SFBool
*getSFTile (void) const;
222 MFString ::reference
editLines (const UInt32 index
);
223 const std::string
&getLines (const UInt32 index
) const;
225 Real32
&editSize (void);
226 Real32
getSize (void) const;
228 Color4f
&editColor (void);
229 const Color4f
&getColor (void) const;
231 Color4f
&editShadowColor (void);
232 const Color4f
&getShadowColor (void) const;
234 Color4f
&editBgColor (void);
235 const Color4f
&getBgColor (void) const;
237 std::string
&editFamily (void);
238 const std::string
&getFamily (void) const;
240 Vec2f
&editShadowOffset (void);
241 const Vec2f
&getShadowOffset (void) const;
243 UInt8
&editHorizontalAlign(void);
244 UInt8
getHorizontalAlign (void) const;
246 UInt8
&editVerticalAlign (void);
247 UInt8
getVerticalAlign (void) const;
249 Color4f
&editBorderColor (void);
250 const Color4f
&getBorderColor (void) const;
252 Vec2f
&editBorderOffset (void);
253 const Vec2f
&getBorderOffset (void) const;
255 Vec2f
&editTextMargin (void);
256 const Vec2f
&getTextMargin (void) const;
258 bool &editTile (void);
259 bool getTile (void) const;
262 /*---------------------------------------------------------------------*/
263 /*! \name Field Set */
266 void setSize (const Real32 value
);
267 void setColor (const Color4f
&value
);
268 void setShadowColor (const Color4f
&value
);
269 void setBgColor (const Color4f
&value
);
270 void setFamily (const std::string
&value
);
271 void setShadowOffset (const Vec2f
&value
);
272 void setHorizontalAlign(const UInt8 value
);
273 void setVerticalAlign (const UInt8 value
);
274 void setBorderColor (const Color4f
&value
);
275 void setBorderOffset (const Vec2f
&value
);
276 void setTextMargin (const Vec2f
&value
);
277 void setTile (const bool value
);
280 /*---------------------------------------------------------------------*/
281 /*! \name Ptr MField Set */
285 /*---------------------------------------------------------------------*/
286 /*! \name Binary Access */
289 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
290 virtual void copyToBin (BinaryDataHandler
&pMem
,
291 ConstFieldMaskArg whichField
);
292 virtual void copyFromBin(BinaryDataHandler
&pMem
,
293 ConstFieldMaskArg whichField
);
297 /*---------------------------------------------------------------------*/
298 /*! \name Construction */
301 static SimpleTextForegroundTransitPtr
create (void);
302 static SimpleTextForeground
*createEmpty (void);
304 static SimpleTextForegroundTransitPtr
createLocal (
305 BitVector bFlags
= FCLocal::All
);
307 static SimpleTextForeground
*createEmptyLocal(
308 BitVector bFlags
= FCLocal::All
);
310 static SimpleTextForegroundTransitPtr
createDependent (BitVector bFlags
);
313 /*---------------------------------------------------------------------*/
317 virtual FieldContainerTransitPtr
shallowCopy (void) const;
318 virtual FieldContainerTransitPtr
shallowCopyLocal(
319 BitVector bFlags
= FCLocal::All
) const;
320 virtual FieldContainerTransitPtr
shallowCopyDependent(
321 BitVector bFlags
) const;
324 /*========================= PROTECTED ===============================*/
328 static TypeObject _type
;
330 static void classDescInserter(TypeObject
&oType
);
331 static const Char8
*getClassname (void );
333 /*---------------------------------------------------------------------*/
340 SFColor4f _sfShadowColor
;
341 SFColor4f _sfBgColor
;
343 SFVec2f _sfShadowOffset
;
344 SFUInt8 _sfHorizontalAlign
;
345 SFUInt8 _sfVerticalAlign
;
346 SFColor4f _sfBorderColor
;
347 SFVec2f _sfBorderOffset
;
348 SFVec2f _sfTextMargin
;
352 /*---------------------------------------------------------------------*/
353 /*! \name Constructors */
356 SimpleTextForegroundBase(void);
357 SimpleTextForegroundBase(const SimpleTextForegroundBase
&source
);
360 /*---------------------------------------------------------------------*/
361 /*! \name Destructors */
364 virtual ~SimpleTextForegroundBase(void);
367 /*---------------------------------------------------------------------*/
368 /*! \name onCreate */
373 /*---------------------------------------------------------------------*/
374 /*! \name Generic Field Access */
377 GetFieldHandlePtr
getHandleLines (void) const;
378 EditFieldHandlePtr
editHandleLines (void);
379 GetFieldHandlePtr
getHandleSize (void) const;
380 EditFieldHandlePtr
editHandleSize (void);
381 GetFieldHandlePtr
getHandleColor (void) const;
382 EditFieldHandlePtr
editHandleColor (void);
383 GetFieldHandlePtr
getHandleShadowColor (void) const;
384 EditFieldHandlePtr
editHandleShadowColor (void);
385 GetFieldHandlePtr
getHandleBgColor (void) const;
386 EditFieldHandlePtr
editHandleBgColor (void);
387 GetFieldHandlePtr
getHandleFamily (void) const;
388 EditFieldHandlePtr
editHandleFamily (void);
389 GetFieldHandlePtr
getHandleShadowOffset (void) const;
390 EditFieldHandlePtr
editHandleShadowOffset (void);
391 GetFieldHandlePtr
getHandleHorizontalAlign (void) const;
392 EditFieldHandlePtr
editHandleHorizontalAlign(void);
393 GetFieldHandlePtr
getHandleVerticalAlign (void) const;
394 EditFieldHandlePtr
editHandleVerticalAlign (void);
395 GetFieldHandlePtr
getHandleBorderColor (void) const;
396 EditFieldHandlePtr
editHandleBorderColor (void);
397 GetFieldHandlePtr
getHandleBorderOffset (void) const;
398 EditFieldHandlePtr
editHandleBorderOffset (void);
399 GetFieldHandlePtr
getHandleTextMargin (void) const;
400 EditFieldHandlePtr
editHandleTextMargin (void);
401 GetFieldHandlePtr
getHandleTile (void) const;
402 EditFieldHandlePtr
editHandleTile (void);
405 /*---------------------------------------------------------------------*/
409 #ifdef OSG_MT_CPTR_ASPECT
410 virtual void execSyncV( FieldContainer
&oFrom
,
411 ConstFieldMaskArg whichField
,
412 AspectOffsetStore
&oOffsets
,
413 ConstFieldMaskArg syncMode
,
414 const UInt32 uiSyncInfo
);
416 void execSync ( SimpleTextForegroundBase
*pFrom
,
417 ConstFieldMaskArg whichField
,
418 AspectOffsetStore
&oOffsets
,
419 ConstFieldMaskArg syncMode
,
420 const UInt32 uiSyncInfo
);
424 /*---------------------------------------------------------------------*/
429 /*---------------------------------------------------------------------*/
430 /*! \name Aspect Create */
433 #ifdef OSG_MT_CPTR_ASPECT
434 virtual FieldContainer
*createAspectCopy(
435 const FieldContainer
*pRefAspect
) const;
439 /*---------------------------------------------------------------------*/
443 /*---------------------------------------------------------------------*/
447 virtual void resolveLinks(void);
450 /*========================== PRIVATE ================================*/
453 /*---------------------------------------------------------------------*/
455 // prohibit default functions (move to 'public' if you need one)
456 void operator =(const SimpleTextForegroundBase
&source
);
459 typedef SimpleTextForegroundBase
*SimpleTextForegroundBaseP
;
463 #endif /* _OSGSIMPLETEXTFOREGROUNDBASE_H_ */