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>
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
Create an Shape to use with a Viewer to display a basic shape.
- Parameters:
-
| shapeType | the type of the shape to display |
| x | x-coordinate of the center of the shape |
| y | y-coordinate of the center of the shape |
| w | width of the shape |
| h | height of the shape |
| angle | angle of the shape (degrees) |
Member Function Documentation
Set the color of the line of the shape.
- Parameters:
-
| r | red [0 to 255] |
| g | green [0 to 255] |
| b | blue [0 to 255] |
Definition at line 45 of file Shape.hpp.
Set the position of the shape.
- Parameters:
-
Definition at line 51 of file Shape.hpp.
Set the rotation of the shape.
- Parameters:
-
Definition at line 56 of file Shape.hpp.
Set the scale of the shape.
- Parameters:
-
Definition at line 61 of file Shape.hpp.
The documentation for this class was generated from the following file: