Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Attributes
jafar::qdisplay::Shape Class Reference

Creates a shape (rectangle, cross or ellipse) to disaplay in a view. More...


Detailed Description

Creates a shape (rectangle, cross or ellipse) to disaplay in a view.

Definition at line 15 of file Shape.hpp.

#include <Shape.hpp>

Inheritance diagram for jafar::qdisplay::Shape:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ShapeType {
  ShapeRectangle, ShapeCross, ShapeCrossX, ShapeEllipse,
  ShapeRectangleFilled, ShapeEllipseFilled, ShapeLine
}

Public Member Functions

 Shape (ShapeType shapeType, double x, double y, double w, double h, double angle=0)
 Create an Shape to use with a Viewer to display a basic shape.
virtual QRectF boundingRect () const
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
void setColor (int r, int g, int b)
 Set the color of the line of the shape.
void setPos (double x, double y)
 Set the position of the shape.
void setRotation (double a)
 Set the rotation of the shape.
void setScale (double s)
 Set the scale of the shape.
void setLabel (const char *text, double relX=0, double relY=0)
void setFontSize (int s)
void setFontColor (int r, int g, int b)
void setBoundingBox (double x, double y, double w, double h)
bool hasItem (QGraphicsItem *item) const

Private Attributes

ShapeType m_shapeType
QRectF m_boundingRect
QColor m_color
QColor m_fontColor
QGraphicsTextItem * m_label
int m_fontSize

Constructor & Destructor Documentation

jafar::qdisplay::Shape::Shape ( ShapeType  shapeType,
double  x,
double  y,
double  w,
double  h,
double  angle = 0 
)

Create an Shape to use with a Viewer to display a basic shape.

Parameters:
shapeTypethe type of the shape to display
xx-coordinate of the center of the shape
yy-coordinate of the center of the shape
wwidth of the shape
hheight of the shape
angleangle of the shape (degrees)

Member Function Documentation

void jafar::qdisplay::Shape::setColor ( int  r,
int  g,
int  b 
) [inline]

Set the color of the line of the shape.

Parameters:
rred [0 to 255]
ggreen [0 to 255]
bblue [0 to 255]

Definition at line 45 of file Shape.hpp.

void jafar::qdisplay::Shape::setPos ( double  x,
double  y 
) [inline]

Set the position of the shape.

Parameters:
x
y

Definition at line 51 of file Shape.hpp.

void jafar::qdisplay::Shape::setRotation ( double  a) [inline]

Set the rotation of the shape.

Parameters:
a

Definition at line 56 of file Shape.hpp.

void jafar::qdisplay::Shape::setScale ( double  s) [inline]

Set the scale of the shape.

Parameters:
s

Definition at line 61 of file Shape.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:43 for Jafar by doxygen 1.7.6.1
LAAS-CNRS