00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __SCREENOVERLAY_H__
00020 #define __SCREENOVERLAY_H__
00021
00022 #include <vrs/sg/scenething.h>
00023 #include <vrs/sg/canvas.h>
00024 #include <vrs/container/dictionary.h>
00025 #include <vrs/shape.h>
00026
00027 #include <vrs/text/vrs_textprerequisites.h>
00028 #include <vrs/text/uniformvalue.h>
00029 #include <vrs/text/texturetext.h>
00030 #include <vrs/text/simplepanel.h>
00031 #include <vrs/camera.h>
00032
00034 namespace VRS
00035 {
00036 namespace TEXT
00037 {
00039 class VRS_CORE_API OverlayInfo
00040 {
00041 public:
00043 OverlayInfo(
00044 SO<Shape> s,
00045 int z,
00046 const UniformValue& xp,
00047 const UniformValue& yp,
00048 const UniformValue& xs,
00049 const UniformValue& ys,
00050 bool hds );
00051
00053 SO<Shape> shape;
00055 int zValue;
00057 UniformValue xPos;
00059 UniformValue yPos;
00061 UniformValue xSize;
00063 UniformValue ySize;
00065 bool hasDifferentScale;
00066 };
00067
00071 class VRS_CORE_API ScreenOverlay : public SceneThing
00072 {
00073 public:
00075 ScreenOverlay( SO<Canvas> canvas, SO<SceneThing> parent = NULL );
00077 virtual ~ScreenOverlay();
00078
00080 OverlayInfo addShape(
00081 SO<Shape> shape,
00082 int zValue = 0,
00083 const UniformValue& xPos = UniformValue::ZERO,
00084 const UniformValue& yPos = UniformValue::ZERO,
00085 const UniformValue& xSize = UniformValue::UNIT,
00086 const UniformValue& ySize = UniformValue::UNIT );
00087
00089 OverlayInfo addTextureText(
00090 SO<TextureText> tt,
00091 int zValue = 0,
00092 const UniformValue& xPos = UniformValue::ZERO,
00093 const UniformValue& yPos = UniformValue::ZERO );
00094
00096 OverlayInfo addSimplePanel(
00097 SO<SimplePanel> pan,
00098 int zValue = 0,
00099 const UniformValue& xPos = UniformValue::ZERO,
00100 const UniformValue& yPos = UniformValue::ZERO );
00101
00103 OverlayInfo getOverlayElementInfo( SO<Shape> so ) const;
00104
00106 void update();
00107
00108 VRS_TYPEINFO(ScreenOverlay, SceneThing);
00109 private:
00110 void insertShape( OverlayInfo* info );
00111
00112 SO<Canvas> m_Canvas;
00113 SO<Camera> m_OverlayCam;
00114
00115 SO< NonPersistentDictionary< SO<Shape>, OverlayInfo > > m_OverlayElements;
00116 };
00117 }
00118 }
00119
00120 #endif