1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
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 #ifndef _OSGSIMPLESTATISTICSFOREGROUND_H_
40 #define _OSGSIMPLESTATISTICSFOREGROUND_H_
45 #include "OSGSimpleStatisticsForegroundBase.h"
46 #include "OSGTextureObjChunk.h"
47 #include "OSGTextureEnvChunk.h"
48 #include "OSGTextTXFFace.h"
52 class TextLayoutResult
;
54 /*! \brief Simple Statistics Foreground class. See \ref
55 PageSystemWindowForegroundStatisticsSimple for a description.
56 \ingroup GrpUtilStatisticsObj
57 \ingroup GrpLibOSGUtil
61 class OSG_UTIL_DLLMAPPING SimpleStatisticsForeground
:
62 public SimpleStatisticsForegroundBase
66 typedef SimpleStatisticsForegroundBase Inherited
;
68 /*---------------------------------------------------------------------*/
72 enum { Left
=0, Middle
, Right
} HorizontalAlignE
;
73 enum { Top
=0, Center
, Bottom
} VerticalAlignE
;
76 /*---------------------------------------------------------------------*/
80 virtual void changed(ConstFieldMaskArg whichField
,
85 /*---------------------------------------------------------------------*/
89 virtual void dump( UInt32 uiIndent
= 0,
90 const BitVector bvFlags
= 0) const;
93 /*---------------------------------------------------------------------*/
97 virtual void draw(DrawEnv
*pEnv
);
100 /*---------------------------------------------------------------------*/
101 /*! \name Convenience Functions */
104 void addElement(StatElemDescBase
&desc
, const Char8
*format
= NULL
);
105 void addElement(Int32 id
, const Char8
*format
= NULL
);
106 void addText (const char *text
);
107 void clearElems(void);
110 /*========================= PROTECTED ===============================*/
114 // Variables should all be in SimpleStatisticsForegroundBase.
116 /*---------------------------------------------------------------------*/
117 /*! \name Constructors */
120 SimpleStatisticsForeground(void);
121 SimpleStatisticsForeground(const SimpleStatisticsForeground
&source
);
124 /*---------------------------------------------------------------------*/
125 /*! \name Destructors */
128 virtual ~SimpleStatisticsForeground(void);
131 /*---------------------------------------------------------------------*/
135 static void initMethod(InitPhase ePhase
);
137 /*---------------------------------------------------------------------*/
141 virtual void resolveLinks(void);
144 /*========================== PRIVATE ================================*/
148 TextTXFFaceRefPtr _face
;
150 TextureObjChunkUnrecPtr _texchunk
;
151 TextureEnvChunkUnrecPtr _texenvchunk
;
153 friend class FieldContainer
;
154 friend class SimpleStatisticsForegroundBase
;
156 void initText(const std::string
&family
, Real32 size
);
158 // prohibit default functions (move to 'public' if you need one)
159 void operator =(const SimpleStatisticsForeground
&source
);
162 typedef SimpleStatisticsForeground
*SimpleStatisticsForegroundP
;
166 #include "OSGSimpleStatisticsForegroundBase.inl"
167 #include "OSGSimpleStatisticsForeground.inl"
169 #endif /* _OSGSIMPLESTATISTICSFOREGROUND_H_ */