ddt 1.2.1
|
#include <ddtGraphicalElement.hpp>
Public Member Functions | |
virtual void | DrawElement (QPainter *painter)=0 |
Public Attributes | |
const int | LIGHTER_FACTOR = 200 |
const int | SCALE_DIFFERENCE_FACTOR = 20 |
Protected Attributes | |
DdtGraphicalElementProperties | element_properties |
DdtOverlayType | element_type |
QPointF | location |
QPointF | drag_start |
qreal | corner_size |
bool | is_hovering |
QString | object_name |
QString | element_name |
DdtGraphicalElement (DdtGraphicalElementProperties const &element_properties, const QString obj_name="", const QString elem_name="") | |
virtual | ~DdtGraphicalElement () |
virtual QRectF | boundingRect () const override |
virtual QRectF | RotateBoundingBox (QRectF const &original_bounding_box) const |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
void | DrawBoundingBox (QPainter *painter) const |
void | EditElementProperties (const DdtGraphicalElementProperties &properties) |
virtual void | HighlightSelectedElement (QPainter *painter) const |
virtual bool | IsHidden () |
virtual float | ScaleThreshold () |
virtual void | SetShowFlag (bool show) |
virtual DdtOverlayType | GetType () |
virtual QString | GetTypeString () |
virtual QString | GetTag () |
virtual void | SetTransform (QTransform const &transform) |
void | SetIsEditable (const bool editable) |
void | SetItemIsSelected (const bool is_selected) |
void | SetIsHovering (const bool item_is_hovering) |
bool | GetIsEditable () const |
bool | GetItemIsSelected () const |
QString | GetObjectName () const |
QString | GetElementName () const |
bool | GetIsHovering () const |
const DdtGraphicalElementProperties & | GetElementProperties () |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *const event) override |
void | mousePressEvent (QGraphicsSceneMouseEvent *const event) override |
bool | HandleEvent (PointGrabber *const corner, QEvent *const event) const |
Base class for the graphical elements
|
explicit |
Constructor
element_properties | DDT graphical element properties object. |
obj_name | The name of the overlay object this element belongs to (used for file-based overlay) |
elem_name | The name of this element (used for file-based overlay) |
|
virtualdefault |
Destructor
|
overridevirtual |
Function returning the bounding box of the graphics item
Reimplemented in DdtGraphicalElementPickMarker, DdtGraphicalElementCompass, DdtGraphicalElementCross, DdtGraphicalElementEllipse, DdtGraphicalElementImage, DdtGraphicalElementLine, DdtGraphicalElementRectangle, DdtGraphicalElementRefLine, DdtGraphicalElementSlit, DdtGraphicalElementStatRectangle, and DdtGraphicalElementText.
void DdtGraphicalElement::DrawBoundingBox | ( | QPainter * | painter | ) | const |
Method to draw the surounding bounding box
|
pure virtual |
Virtual function for rendering the graphical element
Implemented in DdtGraphicalElementPickMarker, DdtGraphicalElementCompass, DdtGraphicalElementCross, DdtGraphicalElementEllipse, DdtGraphicalElementImage, DdtGraphicalElementLine, DdtGraphicalElementRectangle, DdtGraphicalElementRefLine, DdtGraphicalElementSlit, DdtGraphicalElementStatRectangle, and DdtGraphicalElementText.
void DdtGraphicalElement::EditElementProperties | ( | const DdtGraphicalElementProperties & | properties | ) |
Change selected graphical elememt properties
QString DdtGraphicalElement::GetElementName | ( | ) | const |
Returns the name of this overlay element
const DdtGraphicalElementProperties & DdtGraphicalElement::GetElementProperties | ( | ) |
Returns the Element Properties of respective graphical element
bool DdtGraphicalElement::GetIsEditable | ( | ) | const |
Returns if this element is editable
bool DdtGraphicalElement::GetIsHovering | ( | ) | const |
Return if this element is hovering
bool DdtGraphicalElement::GetItemIsSelected | ( | ) | const |
Returns if this element is selected
QString DdtGraphicalElement::GetObjectName | ( | ) | const |
Returns the name of the overlay object this element belongs to
|
virtual |
Getter for tags
|
virtual |
Getter of element type
|
virtual |
Getter of element type string representation
|
protected |
|
virtual |
Highlights a selected element
|
virtual |
Checks if the graphical element shall be hidden
|
overrideprotected |
|
overrideprotected |
|
override |
Method used to paint the graphics item
painter | Pointer to the painter painting the graphics item |
option | Pointer to the style options |
widget | Pointer to the parent widget |
|
virtual |
Rotate the bounding box for rotated elements
original_bounding_box | The un-rotated bounding box |
|
virtual |
Check the threshold scale value for this graphical element
void DdtGraphicalElement::SetIsEditable | ( | const bool | editable | ) |
Setter for is_editable
void DdtGraphicalElement::SetIsHovering | ( | const bool | item_is_hovering | ) |
Setter for item is_hovering
void DdtGraphicalElement::SetItemIsSelected | ( | const bool | is_selected | ) |
Setter for item_is_selected
|
virtual |
Set show flag
|
virtual |
This method is foreseen to get reimplemented by text items only. Text items need to consider the views shearing and scaling factors for their selection rectangle.
transform | The views transformation |
|
protected |
Size of the corners.
|
protected |
Start point when dragging the mouse.
|
protected |
Name of this element.
|
protected |
Element properties
|
protected |
Type of overlay element
|
protected |
Flag showing if the mouse is hovering over this element
const int DdtGraphicalElement::LIGHTER_FACTOR = 200 |
Factor for making the pen colour lighter.
|
protected |
Location of a moved graphical element.
|
protected |
const int DdtGraphicalElement::SCALE_DIFFERENCE_FACTOR = 20 |
Factor for calculating the scale difference between current scale and object line width. Should be the max scale defined.