00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef _OSGSIMPLESTATISTICSFOREGROUNDBASE_H_
00055 #define _OSGSIMPLESTATISTICSFOREGROUNDBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059
00060
00061 #include <OSGConfig.h>
00062 #include <OSGSystemDef.h>
00063
00064 #include <OSGBaseTypes.h>
00065 #include <OSGRefPtr.h>
00066 #include <OSGCoredNodePtr.h>
00067
00068 #include <OSGStatisticsForeground.h>
00069
00070 #include <OSGStringFields.h>
00071 #include <OSGReal32Fields.h>
00072 #include <OSGColor4fFields.h>
00073 #include <OSGColor4fFields.h>
00074 #include <OSGColor4fFields.h>
00075 #include <OSGStringFields.h>
00076 #include <OSGVec2fFields.h>
00077 #include <OSGUInt8Fields.h>
00078 #include <OSGUInt8Fields.h>
00079 #include <OSGColor4fFields.h>
00080 #include <OSGVec2fFields.h>
00081 #include <OSGVec2fFields.h>
00082
00083 #include <OSGSimpleStatisticsForegroundFields.h>
00084
00085 OSG_BEGIN_NAMESPACE
00086
00087 class SimpleStatisticsForeground;
00088 class BinaryDataHandler;
00089
00091
00092 class OSG_SYSTEMLIB_DLLMAPPING SimpleStatisticsForegroundBase : public StatisticsForeground
00093 {
00094 private:
00095
00096 typedef StatisticsForeground Inherited;
00097
00098
00099 public:
00100
00101 typedef SimpleStatisticsForegroundPtr Ptr;
00102
00103 enum
00104 {
00105 FormatsFieldId = Inherited::NextFieldId,
00106 SizeFieldId = FormatsFieldId + 1,
00107 ColorFieldId = SizeFieldId + 1,
00108 ShadowColorFieldId = ColorFieldId + 1,
00109 BgColorFieldId = ShadowColorFieldId + 1,
00110 FamilyFieldId = BgColorFieldId + 1,
00111 ShadowOffsetFieldId = FamilyFieldId + 1,
00112 HorizontalAlignFieldId = ShadowOffsetFieldId + 1,
00113 VerticalAlignFieldId = HorizontalAlignFieldId + 1,
00114 BorderColorFieldId = VerticalAlignFieldId + 1,
00115 BorderOffsetFieldId = BorderColorFieldId + 1,
00116 TextMarginFieldId = BorderOffsetFieldId + 1,
00117 NextFieldId = TextMarginFieldId + 1
00118 };
00119
00120 static const OSG::BitVector FormatsFieldMask;
00121 static const OSG::BitVector SizeFieldMask;
00122 static const OSG::BitVector ColorFieldMask;
00123 static const OSG::BitVector ShadowColorFieldMask;
00124 static const OSG::BitVector BgColorFieldMask;
00125 static const OSG::BitVector FamilyFieldMask;
00126 static const OSG::BitVector ShadowOffsetFieldMask;
00127 static const OSG::BitVector HorizontalAlignFieldMask;
00128 static const OSG::BitVector VerticalAlignFieldMask;
00129 static const OSG::BitVector BorderColorFieldMask;
00130 static const OSG::BitVector BorderOffsetFieldMask;
00131 static const OSG::BitVector TextMarginFieldMask;
00132
00133
00134 static const OSG::BitVector MTInfluenceMask;
00135
00136
00140 static FieldContainerType &getClassType (void);
00141 static UInt32 getClassTypeId (void);
00142
00144
00148 virtual FieldContainerType &getType (void);
00149 virtual const FieldContainerType &getType (void) const;
00150
00151 virtual UInt32 getContainerSize(void) const;
00152
00154
00158 MFString *getMFFormats (void);
00159 SFReal32 *getSFSize (void);
00160 SFColor4f *getSFColor (void);
00161 SFColor4f *getSFShadowColor (void);
00162 SFColor4f *getSFBgColor (void);
00163 SFString *getSFFamily (void);
00164 SFVec2f *getSFShadowOffset (void);
00165 SFUInt8 *getSFHorizontalAlign(void);
00166 SFUInt8 *getSFVerticalAlign (void);
00167 SFColor4f *getSFBorderColor (void);
00168 SFVec2f *getSFBorderOffset (void);
00169 SFVec2f *getSFTextMargin (void);
00170
00171 Real32 &getSize (void);
00172 const Real32 &getSize (void) const;
00173 Color4f &getColor (void);
00174 const Color4f &getColor (void) const;
00175 Color4f &getShadowColor (void);
00176 const Color4f &getShadowColor (void) const;
00177 Color4f &getBgColor (void);
00178 const Color4f &getBgColor (void) const;
00179 std::string &getFamily (void);
00180 const std::string &getFamily (void) const;
00181 Vec2f &getShadowOffset (void);
00182 const Vec2f &getShadowOffset (void) const;
00183 UInt8 &getHorizontalAlign(void);
00184 const UInt8 &getHorizontalAlign(void) const;
00185 UInt8 &getVerticalAlign (void);
00186 const UInt8 &getVerticalAlign (void) const;
00187 Color4f &getBorderColor (void);
00188 const Color4f &getBorderColor (void) const;
00189 Vec2f &getBorderOffset (void);
00190 const Vec2f &getBorderOffset (void) const;
00191 Vec2f &getTextMargin (void);
00192 const Vec2f &getTextMargin (void) const;
00193 std::string &getFormats (const UInt32 index);
00194 MFString &getFormats (void);
00195 const MFString &getFormats (void) const;
00196
00198
00202 void setSize ( const Real32 &value );
00203 void setColor ( const Color4f &value );
00204 void setShadowColor ( const Color4f &value );
00205 void setBgColor ( const Color4f &value );
00206 void setFamily ( const std::string &value );
00207 void setShadowOffset ( const Vec2f &value );
00208 void setHorizontalAlign( const UInt8 &value );
00209 void setVerticalAlign ( const UInt8 &value );
00210 void setBorderColor ( const Color4f &value );
00211 void setBorderOffset ( const Vec2f &value );
00212 void setTextMargin ( const Vec2f &value );
00213
00215
00220
00224 virtual UInt32 getBinSize (const BitVector &whichField);
00225 virtual void copyToBin ( BinaryDataHandler &pMem,
00226 const BitVector &whichField);
00227 virtual void copyFromBin( BinaryDataHandler &pMem,
00228 const BitVector &whichField);
00229
00230
00232
00236 static SimpleStatisticsForegroundPtr create (void);
00237 static SimpleStatisticsForegroundPtr createEmpty (void);
00238
00241
00245 virtual FieldContainerPtr shallowCopy (void) const;
00246
00248
00249 protected:
00250
00251
00255 MFString _mfFormats;
00256 SFReal32 _sfSize;
00257 SFColor4f _sfColor;
00258 SFColor4f _sfShadowColor;
00259 SFColor4f _sfBgColor;
00260 SFString _sfFamily;
00261 SFVec2f _sfShadowOffset;
00262 SFUInt8 _sfHorizontalAlign;
00263 SFUInt8 _sfVerticalAlign;
00264 SFColor4f _sfBorderColor;
00265 SFVec2f _sfBorderOffset;
00266 SFVec2f _sfTextMargin;
00267
00269
00273 SimpleStatisticsForegroundBase(void);
00274 SimpleStatisticsForegroundBase(const SimpleStatisticsForegroundBase &source);
00275
00277
00281 virtual ~SimpleStatisticsForegroundBase(void);
00282
00284
00288 #if !defined(OSG_FIXED_MFIELDSYNC)
00289 void executeSyncImpl( SimpleStatisticsForegroundBase *pOther,
00290 const BitVector &whichField);
00291
00292 virtual void executeSync( FieldContainer &other,
00293 const BitVector &whichField);
00294 #else
00295 void executeSyncImpl( SimpleStatisticsForegroundBase *pOther,
00296 const BitVector &whichField,
00297 const SyncInfo &sInfo );
00298
00299 virtual void executeSync( FieldContainer &other,
00300 const BitVector &whichField,
00301 const SyncInfo &sInfo);
00302
00303 virtual void execBeginEdit (const BitVector &whichField,
00304 UInt32 uiAspect,
00305 UInt32 uiContainerSize);
00306
00307 void execBeginEditImpl (const BitVector &whichField,
00308 UInt32 uiAspect,
00309 UInt32 uiContainerSize);
00310
00311 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00312 #endif
00313
00315
00316 private:
00317
00318 friend class FieldContainer;
00319
00320 static FieldDescription *_desc[];
00321 static FieldContainerType _type;
00322
00323
00324
00325 void operator =(const SimpleStatisticsForegroundBase &source);
00326 };
00327
00328
00329
00330
00331
00332
00333 typedef SimpleStatisticsForegroundBase *SimpleStatisticsForegroundBaseP;
00334
00335 typedef osgIF<SimpleStatisticsForegroundBase::isNodeCore,
00336 CoredNodePtr<SimpleStatisticsForeground>,
00337 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00338 >::_IRet SimpleStatisticsForegroundNodePtr;
00339
00340 typedef RefPtr<SimpleStatisticsForegroundPtr> SimpleStatisticsForegroundRefPtr;
00341
00342 OSG_END_NAMESPACE
00343
00344 #define OSGSIMPLESTATISTICSFOREGROUNDBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00345
00346 #endif