2014-10-05 08:25:37 +00:00
|
|
|
#ifndef OPENCS_VIEW_TEXTOVERLAY_H
|
|
|
|
#define OPENCS_VIEW_TEXTOVERLAY_H
|
|
|
|
|
2014-10-05 21:20:09 +00:00
|
|
|
#include <QRect>
|
|
|
|
|
2014-10-05 08:25:37 +00:00
|
|
|
#include <OgreString.h>
|
2014-10-12 10:15:50 +00:00
|
|
|
#include <OgreFont.h>
|
2014-10-05 08:25:37 +00:00
|
|
|
|
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class MovableObject;
|
|
|
|
class Camera;
|
|
|
|
class Font;
|
|
|
|
class Overlay;
|
|
|
|
class OverlayContainer;
|
|
|
|
class TextAreaOverlayElement;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSVRender
|
|
|
|
{
|
|
|
|
|
|
|
|
class TextOverlay
|
|
|
|
{
|
|
|
|
Ogre::Overlay* mOverlay;
|
|
|
|
Ogre::OverlayContainer* mContainer;
|
|
|
|
Ogre::TextAreaOverlayElement* mElement;
|
|
|
|
Ogre::String mCaption;
|
2014-10-07 08:35:28 +00:00
|
|
|
Ogre::String mDesc;
|
2014-10-05 08:25:37 +00:00
|
|
|
|
|
|
|
const Ogre::MovableObject* mObj;
|
|
|
|
const Ogre::Camera* mCamera;
|
|
|
|
Ogre::FontPtr mFont;
|
|
|
|
int mFontHeight; // in pixels
|
|
|
|
Ogre::String mId;
|
2014-10-05 21:20:09 +00:00
|
|
|
QRect mPos;
|
2014-10-05 08:25:37 +00:00
|
|
|
|
|
|
|
bool mEnabled;
|
2014-10-13 09:58:07 +00:00
|
|
|
bool mOnScreen;
|
2014-10-12 10:15:50 +00:00
|
|
|
int mInstance;
|
2014-10-05 08:25:37 +00:00
|
|
|
|
|
|
|
Ogre::FontPtr getFont();
|
|
|
|
int textWidth();
|
|
|
|
int fontHeight();
|
|
|
|
void getScreenCoordinates(const Ogre::Vector3& position, Ogre::Real& x, Ogre::Real& y);
|
2014-10-14 06:34:10 +00:00
|
|
|
void getMinMaxEdgesOfAABBIn2D(float& MinX, float& MinY, float& MaxX, float& MaxY,
|
|
|
|
bool top = true);
|
2014-10-05 08:25:37 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
TextOverlay(const Ogre::MovableObject* obj, const Ogre::Camera* camera, const Ogre::String &id);
|
|
|
|
virtual ~TextOverlay();
|
|
|
|
|
2014-10-13 04:57:01 +00:00
|
|
|
void enable(bool enable); // controlled from scene widget toolbar visibility mask
|
|
|
|
void show(bool show); // for updating from render target listener
|
2014-10-05 21:20:09 +00:00
|
|
|
bool isEnabled();
|
2014-10-05 08:25:37 +00:00
|
|
|
void setCaption(const Ogre::String& text);
|
2014-10-07 08:35:28 +00:00
|
|
|
void setDesc(const Ogre::String& text);
|
2014-10-06 02:55:36 +00:00
|
|
|
void update();
|
2014-10-13 04:57:01 +00:00
|
|
|
QRect container(); // for detection of mouse click on the overlay
|
2014-10-07 20:54:22 +00:00
|
|
|
Ogre::String getCaption() { return mCaption; } // FIXME: debug
|
|
|
|
Ogre::String getDesc() { return mDesc; }
|
2014-10-05 08:25:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // OPENCS_VIEW_TEXTOVERLAY_H
|