Version: 9.12.0
GLViewer_TextObject Class Reference

#include <GLViewer_BaseObjects.h>

Inheritance diagram for GLViewer_TextObject:
Inheritance graph

Public Member Functions

 GLViewer_TextObject (const QString &, float xPos=0, float yPos=0, const QColor &color=QColor(0, 255, 0), const QString &toolTip="GLText")
 
 ~GLViewer_TextObject ()
 
virtual void compute ()
 
virtual GLViewer_DrawercreateDrawer ()
 
virtual void setDrawer (GLViewer_Drawer *theDrawer)
 
virtual GLboolean highlight (GLfloat x, GLfloat y, GLfloat tol, GLboolean isCircle=GL_FALSE)
 
virtual GLboolean unhighlight ()
 
virtual GLboolean select (GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect rect, GLboolean isFull=GL_FALSE, GLboolean isCircle=GL_FALSE, GLboolean isShift=GL_FALSE)
 
virtual GLboolean unselect ()
 
virtual GLViewer_RectgetUpdateRect ()
 
virtual void moveObject (float, float, bool fromGroup=false)
 
virtual QByteArray getByteCopy ()
 
virtual bool initializeFromByteCopy (QByteArray)
 
virtual bool translateToPS (QFile &hFile, GLViewer_CoordSystem *aViewerCS, GLViewer_CoordSystem *aPSCS)
 
virtual bool translateToHPGL (QFile &hFile, GLViewer_CoordSystem *aViewerCS, GLViewer_CoordSystem *aHPGLCS)
 
int getWidth ()
 
int getHeight ()
 
void setWidth (int w)
 
void setHeight (int h)
 
- Public Member Functions inherited from GLViewer_Object
 GLViewer_Object ()
 A constructor. More...
 
virtual ~GLViewer_Object ()
 A destructor. More...
 
GLViewer_DrawergetDrawer () const
 Returns current drawer. More...
 
virtual GLboolean isInside (GLViewer_Rect theRect)
 Returns if theRect inside object. More...
 
virtual bool portContains (GLViewer_Pnt)
 
virtual bool startPulling (GLViewer_Pnt)
 
virtual void pull (GLViewer_Pnt, GLViewer_Object *)
 
virtual void finishPulling ()
 
virtual bool isPulling ()
 
virtual GLViewer_Rect getPullingRect () const
 
virtual void setRect (GLViewer_Rect *rect)
 Installs object rectangle. More...
 
virtual GLViewer_RectgetRect () const
 Returns object rectungle. More...
 
virtual void setScale (GLfloat xScale, GLfloat yScale)
 Installs scale factors. More...
 
virtual void getScale (GLfloat &xScale, GLfloat &yScale) const
 Returns scale factors. More...
 
virtual GLboolean setZoom (GLfloat zoom, bool recompute, bool fromGroup=false)
 
virtual GLfloat getZoom () const
 
virtual GLboolean updateZoom (bool zoomIn)
 
virtual GLboolean isHighlighted () const
 Returns true if object is highlighted. More...
 
virtual GLboolean isSelected () const
 Returns true if object is selected. More...
 
virtual void setSelected (GLboolean state)
 Installs select status to object. More...
 
void setGLText (GLViewer_Text *glText)
 Installs GLText to object. More...
 
GLViewer_TextgetGLText () const
 Returns object GLText. More...
 
virtual void setAspectLine (GLViewer_AspectLine *aspect)
 Installs acpect line for object presentation. More...
 
virtual GLViewer_AspectLinegetAspectLine () const
 Returns acpect line of object presentation. More...
 
QString getObjectType () const
 Returns object type. More...
 
void setName (QString name)
 Installs object name. More...
 
QString getName () const
 Returns object name. More...
 
virtual int getPriority () const
 Returns object priority. More...
 
virtual bool finishMove ()
 Finaly recomputing object after moving. More...
 
virtual bool getVisible () const
 Returns visible object status. More...
 
virtual void setVisible (bool theStatus)
 Installs visible object status. More...
 
void setToolTipText (QString str)
 Installs onject tool tip text. More...
 
virtual QString getToolTipText ()
 Returns onject tool tip text. More...
 
bool isTooTipHTML () const
 Returns true if tool tip contains HTML tags. More...
 
void setToolTipFormat (bool isHTML)
 Installs tool tip supporting of HTML tags. More...
 
SUIT_DataOwnerowner () const
 
void setOwner (SUIT_DataOwner *owner)
 
void setGroup (GLViewer_Group *theGroup)
 Adds object to group theGroup. More...
 
GLViewer_GroupgetGroup () const
 Returns object group. More...
 
virtual GLViewer_ObjectgetOwner ()
 
virtual bool isSelectable ()
 Returns true if object can be selected. More...
 
virtual bool isScalable ()
 

Protected Attributes

bool myHighFlag
 
int myWidth
 
int myHeight
 
- Protected Attributes inherited from GLViewer_Object
QString myName
 Object name. More...
 
QString myType
 Object type. More...
 
GLViewer_RectmyRect
 Object base rect. More...
 
GLViewer_RectmyUpdateRect
 Update object rect (after some viewer transformations) More...
 
GLViewer_TextmyGLText
 Object GLText. More...
 
GLfloat myXScale
 X scale factor. More...
 
GLfloat myYScale
 Y scale factor. More...
 
GLfloat myXGap
 Gap for X direction of rect. More...
 
GLfloat myYGap
 Gap for Y direction of rect. More...
 
GLfloat myZoom
 
GLboolean myIsHigh
 Highlight status. More...
 
GLboolean myIsSel
 Selectt status. More...
 
GLViewer_DrawermyDrawer
 Object drawer. More...
 
GLViewer_AspectLinemyAspectLine
 Line aspect for object presentation. More...
 
QString myToolTipText
 Objet tool tip text. More...
 
bool isToolTipHTML
 HTML object tool tip status. More...
 
bool myIsVisible
 Object visibke status. More...
 
SUIT_DataOwnermyOwner
 
GLViewer_GroupmyGroup
 Object Group. More...
 

Detailed Description

Text as Object for OpenGL

Constructor & Destructor Documentation

◆ GLViewer_TextObject()

GLViewer_TextObject::GLViewer_TextObject ( const QString &  theStr,
float  xPos = 0,
float  yPos = 0,
const QColor &  color = QColor( 0, 255, 0 ),
const QString &  toolTip = "GLText" 
)

Constructor

Parameters
theStr- text string
xPos- x position
yPos- y position
color- color of text
toolTip- tooltip of text object

References OCCViewer::color(), GLViewer_Object::myGLText, myHeight, myHighFlag, GLViewer_Object::myToolTipText, and myWidth.

◆ ~GLViewer_TextObject()

GLViewer_TextObject::~GLViewer_TextObject ( )

Destructor

References GLViewer_Object::myGLText.

Member Function Documentation

◆ compute()

◆ createDrawer()

GLViewer_Drawer * GLViewer_TextObject::createDrawer ( )
virtual

Creates corresponding drawer

Implements GLViewer_Object.

References compute(), and GLViewer_Object::myDrawer.

◆ getByteCopy()

QByteArray GLViewer_TextObject::getByteCopy ( )
virtual

Codes text object as byte copy

Returns
byte array

Reimplemented from GLViewer_Object.

References GLViewer_Object::getByteCopy().

◆ getHeight()

int GLViewer_TextObject::getHeight ( )
inline

◆ getUpdateRect()

◆ getWidth()

int GLViewer_TextObject::getWidth ( )
inline

◆ highlight()

GLboolean GLViewer_TextObject::highlight ( GLfloat  theX,
GLfloat  theY,
GLfloat  theTol,
GLboolean  isCircle = GL_FALSE 
)
virtual

Computes highlight presentation

Parameters
x- x coord
y- y coord
tol- tolerance of detecting
isCircle- true if sensitive area of detection is round
Returns
true if highlight status is changed

Implements GLViewer_Object.

References GLViewer_Text::getPosition(), GLViewer_Object::myGLText, myHeight, myHighFlag, GLViewer_Object::myIsHigh, GLViewer_Object::myIsVisible, myWidth, GLViewer_Object::myXScale, and GLViewer_Object::myYScale.

◆ initializeFromByteCopy()

bool GLViewer_TextObject::initializeFromByteCopy ( QByteArray  theArray)
virtual

Initialize text object by byte array

Parameters
theArray- byte array

Reimplemented from GLViewer_Object.

References GLViewer_Object::initializeFromByteCopy(), myHighFlag, and GLViewer_Object::myType.

◆ moveObject()

void GLViewer_TextObject::moveObject ( float  theX,
float  theY,
bool  fromGroup = false 
)
virtual

Moves object by recomputing

Parameters
dx- moving along X coord
dy- moving along Y coord
fromGroup- is true if this method called from group

Implements GLViewer_Object.

References compute(), GLViewer_Group::dragingObjects(), GLViewer_Text::getPosition(), GLViewer_Object::myGLText, GLViewer_Object::myGroup, and GLViewer_Text::setPosition().

◆ select()

GLboolean GLViewer_TextObject::select ( GLfloat  theX,
GLfloat  theY,
GLfloat  theTol,
GLViewer_Rect  rect,
GLboolean  isFull = GL_FALSE,
GLboolean  isCircle = GL_FALSE,
GLboolean  isShift = GL_FALSE 
)
virtual

Selects text object /param x, y - co-ordinates of mouse /param tol - tolerance /param rect - rectangle (in case of rectangular selection) /param isFull - if it is true, then object may selected only if it lays whole in selection zone

Parameters
isCircle- true if sensitive area of detection is round
isShift- true if selection exec with append option

Implements GLViewer_Object.

References myHighFlag, GLViewer_Object::myIsHigh, GLViewer_Object::myIsSel, GLViewer_Object::myIsVisible, GLViewer_Object::myRect, and GLViewer_Rect::toQRect().

◆ setDrawer()

void GLViewer_TextObject::setDrawer ( GLViewer_Drawer theDrawer)
virtual

Installing already exist drawer with same type

Parameters
theDrawer- new drawer

Reimplemented from GLViewer_Object.

References GLViewer_Object::myDrawer.

◆ setHeight()

void GLViewer_TextObject::setHeight ( int  h)
inline

◆ setWidth()

void GLViewer_TextObject::setWidth ( int  w)
inline

◆ translateToHPGL()

bool GLViewer_TextObject::translateToHPGL ( QFile hFile,
GLViewer_CoordSystem aViewerCS,
GLViewer_CoordSystem aHPGLCS 
)
virtual

Saves text object to file HPGL

Parameters
hFile- file instance
aViewerCS- viewer co-ordinates system
aHPGLCS- paper co-ordinates system

Implements GLViewer_Object.

References AddCoordsToHPGL(), GLViewer_Text::getPosition(), GLViewer_Text::getText(), and GLViewer_Object::myGLText.

◆ translateToPS()

bool GLViewer_TextObject::translateToPS ( QFile hFile,
GLViewer_CoordSystem aViewerCS,
GLViewer_CoordSystem aPSCS 
)
virtual

Saves text object to file PostScript

Parameters
hFile- file instance
aViewerCS- viewer co-ordinates system
aPSCS- paper co-ordinates system

Implements GLViewer_Object.

References AddCoordsToPS(), GLViewer_Text::getPosition(), GLViewer_Text::getText(), and GLViewer_Object::myGLText.

◆ unhighlight()

GLboolean GLViewer_TextObject::unhighlight ( )
virtual

Unhilights object

Implements GLViewer_Object.

References GLViewer_Object::myIsHigh.

◆ unselect()

GLboolean GLViewer_TextObject::unselect ( )
virtual

Unselects text object

Implements GLViewer_Object.

References GLViewer_Object::myIsSel.

Member Data Documentation

◆ myHeight

int GLViewer_TextObject::myHeight
protected

◆ myHighFlag

bool GLViewer_TextObject::myHighFlag
protected

◆ myWidth

int GLViewer_TextObject::myWidth
protected

The documentation for this class was generated from the following files: