SO3Engine
|
#include <SO3Widget.h>
Classes | |
class | SMatData |
Public Types | |
enum | StereoMode { MONO = 0 , SBS = 1 , TB = 2 , BT = 3 } |
Public Member Functions | |
SWidget (SScene *targetScene, const std::string &widgetName, const int &xPos, const int &yPos, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SViewPort *targetViewport, const unsigned int &widgetZOrder, const std::string &widgetType) | |
SWidget (SScene *targetScene, const std::string &widgetName, const int &xPos, const int &yPos, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SViewPort *targetViewport, const std::string &widgetType) | |
SWidget (SScene *targetScene, const std::string &widgetName, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SMaterial *targetMaterial, const unsigned short &targetTechnique, const unsigned short &targetPass, const unsigned short &targetTextureUnit, const std::string &widgetType) | |
virtual | ~SWidget () |
SScene * | GetParentScene () |
std::string | GetType () |
unsigned short | GetWidth () |
unsigned short | GetHeight () |
SPoint< unsigned short > | GetSize () |
void | SetSize (const unsigned short &newWidth, const unsigned short &newHeight) |
void | SetSize (const SPoint< unsigned short > &newSize) |
float | GetTextureRatio () |
void | SetTextureRatio (const float &newRatio) |
bool | GetIsStereo () |
void | SetStereo (StereoMode state) |
void | SetStereoEye (bool isleft=true) |
SPoint< int > | GetPosition () |
void | SetPosition (const int &xPos, const int &yPos) |
void | SetPosition (const SPoint< int > &newPosition) |
void | Move (const SPoint< int > &relativeMove) |
void | SetCurrentViewport (Ogre::Viewport *vp) |
void | SetScale (const float width, const float height) |
SPoint< float > | GetScale () |
void | SetLeftOffset (const float left) |
void | SetTopOffset (const float top) |
SPoint< int > | GetRealPixelPosition () |
SPoint< unsigned short > | GetRealPixelSize () |
virtual void | InjectMouseMove (const int &xPos, const int &yPos, const MouseButtonId &button)=0 |
virtual void | InjectMouseWheel (const int &scrollX, const int &scrollY, const int &relativeScroll)=0 |
virtual void | InjectMouseDown (const int &xPos, const int &yPos, const MouseButtonId &button)=0 |
virtual void | InjectMouseUp (const int &xPos, const int &yPos, const MouseButtonId &button)=0 |
virtual void | InjectTouchAdd (const int &xPos, const int &yPos, const int &touchid)=0 |
virtual void | InjectTouchRemove (const int &touchid)=0 |
virtual void | InjectTouchUpdate (const int &xPos, const int &yPos, const int &vx, const int &vy, const int &touchid)=0 |
virtual void | InjectKeyEvent (const UINT &msg, const ScolWindowHandle &hwnd, const WPARAM &wParam, const LPARAM &lParam)=0 |
virtual void | InjectTextEvent (const std::string &utf8)=0 |
void | Show (const bool &fade=false, const unsigned short &fadeDurationMS=300) |
void | Hide (const bool &fade=false, const unsigned short &fadeDurationMS=300) |
bool | GetVisible () |
void | SetTransparency (const bool &enableTransparency) |
bool | GetTransparency () |
void | SetOpacity (const float &widgetOpacity) |
float | GetOpacity () |
void | SetIgnoreTransparentPixels (const bool &widgetIgnoreTransparentPixels, const float &tresholdColor=0.0f) |
bool | GetIgnoreTransparentPixels () |
float | GetIgnoreTransparentPixelsTreshold () |
virtual void | LoadURL (const std::string &url)=0 |
virtual void | LoadFile (const std::string &file)=0 |
void | SetZOrder (const unsigned short &newWidgetOrder) |
unsigned short | GetZOrder () |
void | TakeFocus () |
void | ReleaseFocus () |
bool | HasFocus () |
void | SetKeyboardEnable (const bool &enableKeyboardOnWidget) |
bool | GetKeyboardEnable () |
void | SetMouseEnable (const bool &enableMouseOnWidget) |
bool | GetMouseEnable () |
bool | GetMouseOver () |
bool | GetInputOver (int id) |
void | SetInputOver (int id, bool state) |
void | SetForeground (const bool &enableWidgetForeground) |
bool | GetForeground () |
void | SetTopOnFocus (const bool &enableWidgetTopOnFocus) |
bool | GetTopOnFocus () |
virtual void | RunScriptFunction (const std::string &functionName, const std::vector< std::string > &argumentList)=0 |
virtual void | loadResource (Ogre::Resource *resource) |
virtual bool | CheckPixelAlpha (const int &posX, const int &posY)=0 |
bool | GetUpdateOnFocusOnly () |
void | SetUpdateOnFocusOnly (const bool &activate) |
bool | GetIsOverlayed () |
bool | GetIs2DRect () |
virtual HCURSOR | GetCurrentMouseCursor () |
Public Member Functions inherited from SO3::SData | |
SData (const std::string &dataName) | |
virtual | ~SData () |
std::string | GetName () const |
SUserObjectBindings & | GetUserObjectBindings () |
const SUserObjectBindings & | GetUserObjectBindings () const |
Public Attributes | |
friend | SWidgetManager |
Protected Member Functions | |
bool | IsCompensateNPOT () const |
void | CreateTexture (bool alpha=true) |
std::string | CheckUrl (const std::string &url) |
virtual void | SetFocusImpl (const bool &focusOnWidget)=0 |
virtual void | SetTransparencyImpl (const bool &enableTransparency)=0 |
virtual void | SetKeyboardEnableImpl (const bool &enableKeyboardOnWidget)=0 |
virtual void | SetMouseEnableImpl (const bool &enableMouseOnWidget)=0 |
virtual void | SetSizeImpl (const unsigned short &newWidth, const unsigned short &newHeight)=0 |
Protected Attributes | |
std::string | baseResourceName |
int | leftPos |
int | topPos |
float | leftOffset |
float | topOffset |
unsigned short | width |
unsigned short | height |
unsigned short | mTextureWidth |
The actual texture width allocated in ogre. | |
unsigned short | mTextureHeight |
The actual texture height allocated in ogre. | |
float | textureRatio |
Texture ratio compared to widget size, usually 1.0. | |
SScene * | scene |
SViewPort * | viewport |
Ogre::Viewport * | currentViewport |
Ogre::TexturePtr | renderingTexture |
bool | forceRenderingUpdate |
float | transparentTresholdColor |
bool | compensateNPOT |
Use to indicate if the texture size has be rounded to an exact pow2. | |
Ogre::Vector2 | xCoef |
Ogre::Vector2 | yCoef |
Protected Attributes inherited from SO3::SData | |
std::string | name |
Definition at line 49 of file SO3Widget.h.
Enumerator | |
---|---|
MONO | |
SBS | |
TB | |
BT |
Definition at line 53 of file SO3Widget.h.
SO3::SWidget::SWidget | ( | SScene * | targetScene, |
const std::string & | widgetName, | ||
const int & | xPos, | ||
const int & | yPos, | ||
const unsigned short & | widgetWidth, | ||
const unsigned short & | widgetHeight, | ||
SViewPort * | targetViewport, | ||
const unsigned int & | widgetZOrder, | ||
const std::string & | widgetType | ||
) |
Construct a widget on a SViewport, using an overlay.
Definition at line 63 of file SO3Widget.cpp.
SO3::SWidget::SWidget | ( | SScene * | targetScene, |
const std::string & | widgetName, | ||
const int & | xPos, | ||
const int & | yPos, | ||
const unsigned short & | widgetWidth, | ||
const unsigned short & | widgetHeight, | ||
SViewPort * | targetViewport, | ||
const std::string & | widgetType | ||
) |
Construct a widget on a SViewport, using an 2D rect.
Definition at line 73 of file SO3Widget.cpp.
SO3::SWidget::SWidget | ( | SScene * | targetScene, |
const std::string & | widgetName, | ||
const unsigned short & | widgetWidth, | ||
const unsigned short & | widgetHeight, | ||
SMaterial * | targetMaterial, | ||
const unsigned short & | targetTechnique, | ||
const unsigned short & | targetPass, | ||
const unsigned short & | targetTextureUnit, | ||
const std::string & | widgetType | ||
) |
Construct a widget on an existing SMaterial.
Definition at line 84 of file SO3Widget.cpp.
|
virtual |
Destructor.
Definition at line 167 of file SO3Widget.cpp.
|
pure virtual |
return false if no pixel is under coordonates.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
|
protected |
Helper function that add "http://" at the begining of an url, if it missing.
Definition at line 1147 of file SO3Widget.cpp.
|
protected |
Helper function to create a render texture that could be used by derivated class.
Definition at line 506 of file SO3Widget.cpp.
|
virtual |
Optionnal function for widget that support it.
Reimplemented in SO3::SWebNavigatorWidget.
Definition at line 1291 of file SO3Widget.cpp.
bool SO3::SWidget::GetForeground | ( | ) |
Retrieve if a widget is setted as foreground (always on top) or not.
Definition at line 905 of file SO3Widget.cpp.
unsigned short SO3::SWidget::GetHeight | ( | ) |
Definition at line 260 of file SO3Widget.cpp.
bool SO3::SWidget::GetIgnoreTransparentPixels | ( | ) |
TODO: doc
Definition at line 1179 of file SO3Widget.cpp.
float SO3::SWidget::GetIgnoreTransparentPixelsTreshold | ( | ) |
TODO: doc
Definition at line 1184 of file SO3Widget.cpp.
bool SO3::SWidget::GetInputOver | ( | int | id | ) |
Definition at line 934 of file SO3Widget.cpp.
bool SO3::SWidget::GetIs2DRect | ( | ) |
Definition at line 1204 of file SO3Widget.cpp.
bool SO3::SWidget::GetIsOverlayed | ( | ) |
Definition at line 1199 of file SO3Widget.cpp.
bool SO3::SWidget::GetIsStereo | ( | ) |
Definition at line 1209 of file SO3Widget.cpp.
bool SO3::SWidget::GetKeyboardEnable | ( | ) |
Retrieve if keyboard input is enabled on widget.
Definition at line 1131 of file SO3Widget.cpp.
bool SO3::SWidget::GetMouseEnable | ( | ) |
Retrieve if mouse input is enabled on widget.
Definition at line 1142 of file SO3Widget.cpp.
bool SO3::SWidget::GetMouseOver | ( | ) |
Definition at line 929 of file SO3Widget.cpp.
float SO3::SWidget::GetOpacity | ( | ) |
Retrieve the opacity coeficient on a transparent widget.
Definition at line 985 of file SO3Widget.cpp.
SScene * SO3::SWidget::GetParentScene | ( | ) |
Definition at line 240 of file SO3Widget.cpp.
SPoint< int > SO3::SWidget::GetPosition | ( | ) |
Get the actual position of the widget within the viewport
Definition at line 322 of file SO3Widget.cpp.
SPoint< int > SO3::SWidget::GetRealPixelPosition | ( | ) |
Get the widget pixel position in viewport with offset
Definition at line 349 of file SO3Widget.cpp.
SPoint< unsigned short > SO3::SWidget::GetRealPixelSize | ( | ) |
Get the widget pixel size in viewport with offset
Definition at line 365 of file SO3Widget.cpp.
SPoint< float > SO3::SWidget::GetScale | ( | ) |
Get the widget scale
Definition at line 487 of file SO3Widget.cpp.
SPoint< unsigned short > SO3::SWidget::GetSize | ( | ) |
Definition at line 265 of file SO3Widget.cpp.
float SO3::SWidget::GetTextureRatio | ( | ) |
Definition at line 451 of file SO3Widget.cpp.
bool SO3::SWidget::GetTopOnFocus | ( | ) |
Retrieve if a widget is setted as "top on focus" (on top on focus) or not.
Definition at line 894 of file SO3Widget.cpp.
bool SO3::SWidget::GetTransparency | ( | ) |
Retrieve if a widget got transparent backround.
Definition at line 1120 of file SO3Widget.cpp.
std::string SO3::SWidget::GetType | ( | ) |
Definition at line 245 of file SO3Widget.cpp.
bool SO3::SWidget::GetUpdateOnFocusOnly | ( | ) |
Definition at line 1189 of file SO3Widget.cpp.
bool SO3::SWidget::GetVisible | ( | ) |
Whether the widget is hided or showed.
Definition at line 1095 of file SO3Widget.cpp.
unsigned short SO3::SWidget::GetWidth | ( | ) |
Definition at line 255 of file SO3Widget.cpp.
unsigned short SO3::SWidget::GetZOrder | ( | ) |
Retrieve the order (like a layer) of this widget. 0 is on top.
Definition at line 501 of file SO3Widget.cpp.
bool SO3::SWidget::HasFocus | ( | ) |
Retrieves whether this widget got the focus or not
Definition at line 921 of file SO3Widget.cpp.
void SO3::SWidget::Hide | ( | const bool & | fade = false , |
const unsigned short & | fadeDurationMS = 300 |
||
) |
Hide this Widget.
fade | Whether or not to fade the Widget down. |
fadeDurationMS | If fading, the number of milliseconds to fade for. |
Definition at line 1043 of file SO3Widget.cpp.
|
pure virtual |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Injects mouse down events into this Widget. You must supply the current coordinates of the mouse in this Widget's own local coordinate space.
xPos | The absolute X-Value of the mouse, relative to this Widget's origin. |
yPos | The absolute Y-Value of the mouse, relative to this Widget's origin. |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Injects the mouse's current coordinates (in this Widget's own local coordinate space) into this Widget.
xPos | The X-coordinate of the mouse, relative to this Widget's origin. |
yPos | The Y-coordinate of the mouse, relative to this Widget's origin. |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Injects mouse up events into this Widget. You must supply the current coordinates of the mouse in this Widget's own local coordinate space.
xPos | The absolute X-Value of the mouse, relative to this Widget's origin. |
yPos | The absolute Y-Value of the mouse, relative to this Widget's origin. |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Injects mouse wheel events into this Widget.
scrollX | scroll distance on X axis |
scrollY | scroll distance on Y axis |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Injects the touch add with current coordinates (in this Widget's own local coordinate space) into this Widget.
xPos | The X-coordinate of the touch point, relative to this Widget's origin. |
yPos | The Y-coordinate of the touch point, relative to this Widget's origin. |
touchid | the touch id |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Injects touch remove down events into this Widget.
touchid | the touch id |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
pure virtual |
Injects the touch update with current coordinates (in this Widget's own local coordinate space) into this Widget.
xPos | The X-coordinate of the touch point, relative to this Widget's origin. |
yPos | The Y-coordinate of the touch point, relative to this Widget's origin. |
vx | The X last move distance of the touch point, relative to this Widget's origin. |
vy | The Y last move distance of the touch point, relative to this Widget's origin. |
touchid | the touch id |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
protected |
Definition at line 250 of file SO3Widget.cpp.
|
pure virtual |
Loads a local file.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
|
virtual |
Reimplemented in SO3::SBitmapWidget.
Definition at line 870 of file SO3Widget.cpp.
|
pure virtual |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
void SO3::SWidget::Move | ( | const SPoint< int > & | relativeMove | ) |
Move the widget relatively from is actual position.
Definition at line 467 of file SO3Widget.cpp.
void SO3::SWidget::ReleaseFocus | ( | ) |
Force unfocus on this widget
Definition at line 915 of file SO3Widget.cpp.
|
pure virtual |
Execute an action script function using the parameters passed in the list.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, SO3::SObjWindowWidget, and SO3::SWebNavigatorWidget.
void SO3::SWidget::SetCurrentViewport | ( | Ogre::Viewport * | vp | ) |
Set the widget current viewport
Definition at line 235 of file SO3Widget.cpp.
|
protectedpure virtual |
Focus or unfocus widget implementation.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
void SO3::SWidget::SetForeground | ( | const bool & | enableWidgetForeground | ) |
Set widget as foreground (always on top) or not.
Definition at line 899 of file SO3Widget.cpp.
void SO3::SWidget::SetIgnoreTransparentPixels | ( | const bool & | widgetIgnoreTransparentPixels, |
const float & | tresholdColor = 0.0f |
||
) |
TODO: doc
Definition at line 1173 of file SO3Widget.cpp.
void SO3::SWidget::SetInputOver | ( | int | id, |
bool | state | ||
) |
Definition at line 943 of file SO3Widget.cpp.
void SO3::SWidget::SetKeyboardEnable | ( | const bool & | enableKeyboardOnWidget | ) |
Enable keyboard input on widget.
Definition at line 1125 of file SO3Widget.cpp.
|
protectedpure virtual |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
void SO3::SWidget::SetLeftOffset | ( | const float | left | ) |
Set the widget left position
Definition at line 337 of file SO3Widget.cpp.
void SO3::SWidget::SetMouseEnable | ( | const bool & | enableMouseOnWidget | ) |
Enable mouse input on widget.
Definition at line 1136 of file SO3Widget.cpp.
|
protectedpure virtual |
Enable mouse input on widget.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
void SO3::SWidget::SetOpacity | ( | const float & | widgetOpacity | ) |
Set the opacity coeficient on a transparent widget (must be bound between 0.0 and 1.0).
Definition at line 963 of file SO3Widget.cpp.
void SO3::SWidget::SetPosition | ( | const int & | xPos, |
const int & | yPos | ||
) |
Set the position of the widget in the viewport
Definition at line 332 of file SO3Widget.cpp.
void SO3::SWidget::SetPosition | ( | const SPoint< int > & | newPosition | ) |
Set the position of the widget in the viewport
Definition at line 381 of file SO3Widget.cpp.
void SO3::SWidget::SetScale | ( | const float | width, |
const float | height | ||
) |
Set the widget scale
Definition at line 473 of file SO3Widget.cpp.
void SO3::SWidget::SetSize | ( | const SPoint< unsigned short > & | newSize | ) |
Definition at line 275 of file SO3Widget.cpp.
void SO3::SWidget::SetSize | ( | const unsigned short & | newWidth, |
const unsigned short & | newHeight | ||
) |
Definition at line 270 of file SO3Widget.cpp.
|
protectedpure virtual |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
void SO3::SWidget::SetStereo | ( | StereoMode | state | ) |
Definition at line 1214 of file SO3Widget.cpp.
void SO3::SWidget::SetStereoEye | ( | bool | isleft = true | ) |
Definition at line 1233 of file SO3Widget.cpp.
void SO3::SWidget::SetTextureRatio | ( | const float & | newRatio | ) |
Definition at line 456 of file SO3Widget.cpp.
void SO3::SWidget::SetTopOffset | ( | const float | top | ) |
Set the widget top position
Definition at line 343 of file SO3Widget.cpp.
void SO3::SWidget::SetTopOnFocus | ( | const bool & | enableWidgetTopOnFocus | ) |
Set widget to be show on first plan when focused (on top on focus) or not.
Definition at line 889 of file SO3Widget.cpp.
void SO3::SWidget::SetTransparency | ( | const bool & | enableTransparency | ) |
Activate or deactivate transparent backround on a widget.
Definition at line 1100 of file SO3Widget.cpp.
|
protectedpure virtual |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
void SO3::SWidget::SetUpdateOnFocusOnly | ( | const bool & | activate | ) |
Definition at line 1194 of file SO3Widget.cpp.
void SO3::SWidget::SetZOrder | ( | const unsigned short & | newWidgetOrder | ) |
Set the order (like a layer) of this widget. 0 is on top.
Definition at line 492 of file SO3Widget.cpp.
void SO3::SWidget::Show | ( | const bool & | fade = false , |
const unsigned short & | fadeDurationMS = 300 |
||
) |
Shows this Widget. @param fade Whether or not to fade the Widget up. @param fadeDurationMS If fading, the number of milliseconds to fade for.
Definition at line 990 of file SO3Widget.cpp.
void SO3::SWidget::TakeFocus | ( | ) |
Force the focus on this widget
Definition at line 910 of file SO3Widget.cpp.
|
protected |
Definition at line 75 of file SO3Widget.h.
|
protected |
Use to indicate if the texture size has be rounded to an exact pow2.
Definition at line 91 of file SO3Widget.h.
|
protected |
Definition at line 87 of file SO3Widget.h.
|
protected |
Definition at line 89 of file SO3Widget.h.
|
protected |
Definition at line 81 of file SO3Widget.h.
|
protected |
Definition at line 78 of file SO3Widget.h.
|
protected |
Definition at line 76 of file SO3Widget.h.
|
protected |
The actual texture height allocated in ogre.
Definition at line 83 of file SO3Widget.h.
|
protected |
The actual texture width allocated in ogre.
Definition at line 82 of file SO3Widget.h.
|
protected |
Definition at line 88 of file SO3Widget.h.
|
protected |
Definition at line 85 of file SO3Widget.h.
friend SO3::SWidget::SWidgetManager |
Definition at line 73 of file SO3Widget.h.
|
protected |
Texture ratio compared to widget size, usually 1.0.
Definition at line 84 of file SO3Widget.h.
|
protected |
Definition at line 79 of file SO3Widget.h.
|
protected |
Definition at line 77 of file SO3Widget.h.
|
protected |
Definition at line 90 of file SO3Widget.h.
|
protected |
Definition at line 86 of file SO3Widget.h.
|
protected |
Definition at line 80 of file SO3Widget.h.
|
protected |
Definition at line 92 of file SO3Widget.h.
|
protected |
Definition at line 93 of file SO3Widget.h.