QElectroTech
0.70
|
The AbstractPartEllipse class This is the base class for all ellipse based item like ellipse, circle, arc. This class only provide common method for edit the ellipse like rect that contain the ellipse. All coordinates is in item coordinate, except pos(), center(), centerX() and centerY() which are in parent coordinate (or scene if no parent). More...
#include <abstractpartellipse.h>
Signals | |
void | rectChanged () |
void | startAngleChanged () |
void | spanAngleChanged () |
Public Member Functions | |
AbstractPartEllipse (QETElementEditor *editor, QGraphicsItem *parent=nullptr) | |
AbstractPartEllipse::AbstractPartEllipse Constructor. More... | |
~AbstractPartEllipse () override | |
AbstractPartEllipse::~AbstractPartEllipse Destructor. More... | |
void | startUserTransformation (const QRectF &) override |
AbstractPartEllipse::startUserTransformation Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle. More... | |
void | handleUserTransformation (const QRectF &, const QRectF &) override |
AbstractPartEllipse::handleUserTransformation Handle the user-induced transformation from initial_selection_rect to new_selection_rect. More... | |
QRectF | boundingRect () const override |
AbstractPartEllipse::boundingRect Bounding rectangle this part can fit into. More... | |
QRectF | sceneGeometricRect () const override |
AbstractPartEllipse::sceneGeometricRect. More... | |
virtual QPointF | sceneTopLeft () const |
AbstractPartEllipse::sceneTopLeft. More... | |
QRectF | rect () const |
virtual void | setRect (const QRectF &rect) |
AbstractPartEllipse::setRect Sets the item's ellipse geometry to rect. The rectangle's left edge defines the left edge of the ellipse, and the rectangle's top edge describes the top of the ellipse The height and width of the rectangle describe the height and width of the ellipse. More... | |
bool | isUseless () const override |
AbstractPartEllipse::isUseless. More... | |
int | startAngle () const |
virtual void | setStartAngle (const int &start_angle) |
AbstractPartEllipse::setStartAngle Sets the start angle for an ellipse segment to angle, which is in 16ths of a degree. This angle is used together with spanAngle() for representing an ellipse segment (a pie). By default, the start angle is 0. More... | |
int | spanAngle () const |
virtual void | setSpanAngle (const int &span_angle) |
AbstractPartEllipse::setSpanAngle Returns the span angle of an ellipse segment in 16ths of a degree. This angle is used together with startAngle() for representing an ellipse segment (a pie). By default, this function returns 5760 (360 * 16, a full ellipse). More... | |
Public Member Functions inherited from CustomElementGraphicPart | |
CustomElementGraphicPart (QETElementEditor *editor, QGraphicsItem *parent=nullptr) | |
CustomElementGraphicPart::CustomElementGraphicPart Default constructor. By default, item is selectable, send geometry change (Qt > 4.6), accept mouse left button and accept hover event. More... | |
~CustomElementGraphicPart () override | |
CustomElementGraphicPart::~CustomElementGraphicPart Destructor. More... | |
LineStyle | lineStyle () const |
void | setLineStyle (const LineStyle ls) |
CustomElementGraphicPart::setLineStyle Set line style to ls. More... | |
LineWeight | lineWeight () const |
void | setLineWeight (const LineWeight lw) |
CustomElementGraphicPart::setLineWeight Set line weight to lw. More... | |
qreal | penWeight () const |
CustomElementGraphicPart::penWeight. More... | |
Filling | filling () const |
void | setFilling (const Filling f) |
CustomElementGraphicPart::setFilling Set filling to f. More... | |
Color | color () const |
void | setColor (const Color c) |
CustomElementGraphicPart::setColor Set color to c. More... | |
bool | antialiased () const |
void | setAntialiased (const bool b) |
CustomElementGraphicPart::setAntialiased Set antialias to b. More... | |
void | setProperty (const char *name, const QVariant &value) override |
QVariant | property (const char *name) const override |
virtual QPainterPath | shadowShape () const =0 |
Public Member Functions inherited from CustomElementPart | |
CustomElementPart (QETElementEditor *editor) | |
virtual | ~CustomElementPart () |
Destructor. More... | |
virtual void | fromXml (const QDomElement &)=0 |
virtual const QDomElement | toXml (QDomDocument &) const =0 |
virtual QETElementEditor * | elementEditor () const |
virtual void | updateCurrentPartEditor () const |
virtual ElementScene * | elementScene () const |
virtual QUndoStack & | undoStack () const |
virtual QString | name () const =0 |
virtual QString | xmlName () const =0 |
virtual QGraphicsItem * | toItem () |
virtual QET::ScalingMethod | preferredScalingMethod () const |
Protected Attributes | |
QList< QPointF > | saved_points_ |
QRectF | m_rect |
qreal | m_start_angle |
qreal | m_span_angle |
QVector< QetGraphicsHandlerItem * > | m_handler_vector |
Protected Attributes inherited from CustomElementGraphicPart | |
bool | m_hovered |
Properties | |
int | startAngle |
int | spanAngle |
QRectF | rect |
AbstractPartEllipse::rect Returns the item's ellipse geometry as a QRectF. More... | |
Properties inherited from CustomElementGraphicPart | |
LineStyle | line_style |
LineWeight | line_weight |
Filling | filling |
Color | color |
bool | antialias |
Private Member Functions | |
AbstractPartEllipse (const AbstractPartEllipse &) | |
Additional Inherited Members | |
Public Types inherited from CustomElementGraphicPart | |
enum | LineStyle { NormalStyle, DashedStyle, DottedStyle, DashdottedStyle } |
enum | LineWeight { NoneWeight, ThinWeight, NormalWeight, UltraWeight, BigWeight } |
enum | Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling, BrunFilling, YellowFilling, CyanFilling, MagentaFilling, LightgrayFilling, OrangeFilling, PurpleFilling, HorFilling, VerFilling, BdiagFilling, FdiagFilling } |
enum | Color { BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor, NoneColor } |
Static Public Member Functions inherited from CustomElementGraphicPart | |
static void | drawCross (const QPointF ¢er, QPainter *painter) |
CustomElementGraphicPart::drawCross Draw a cross at pos center. More... | |
Protected Member Functions inherited from CustomElementGraphicPart | |
void | stylesToXml (QDomElement &) const |
CustomElementGraphicPart::stylesToXml Write the curent style to xml element. The style are stored like this: name-of-style:value;name-of-style:value Each style separate by ; and name-style/value are separate by : More... | |
void | stylesFromXml (const QDomElement &) |
CustomElementGraphicPart::stylesFromXml Read the style used by this, from a xml element. More... | |
void | resetStyles () |
CustomElementGraphicPart::resetStyles Reset the curent style to default, same style of default constructor. More... | |
void | applyStylesToQPainter (QPainter &) const |
CustomElementGraphicPart::applyStylesToQPainter Apply the current style to the QPainter. More... | |
void | drawShadowShape (QPainter *painter) |
CustomElementGraphicPart::drawShadowShape Draw a transparent blue shadow arround the shape of this item. The QPainterPathStroker used to draw shadows have a width of SHADOWS_HEIGHT Be carefull if penWeight of this item is to 0 the outline of strock is bigger of 0.5. More... | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
CustomElementGraphicPart::itemChange Reimplemented from QGraphicsObject. If the item position change call updateCurrentPartEditor() the change is always send to QGraphicsObject. More... | |
void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) override |
CustomElementGraphicPart::hoverEnterEvent Reimplemented from QGraphicsObject. Set m_hovered to true. More... | |
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override |
CustomElementGraphicPart::hoverLeaveEvent Reimplemented from QGraphicsObject. Set m_hovered to false. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
Protected Member Functions inherited from CustomElementPart | |
QList< QPointF > | mapPoints (const QRectF &, const QRectF &, const QList< QPointF > &) |
The AbstractPartEllipse class This is the base class for all ellipse based item like ellipse, circle, arc. This class only provide common method for edit the ellipse like rect that contain the ellipse. All coordinates is in item coordinate, except pos(), center(), centerX() and centerY() which are in parent coordinate (or scene if no parent).
In several points, this class is a copy of QGraphicsEllipseItem with some change, (the use of Q_PROPERTY) to be easily used with Element editor.
Definition at line 35 of file abstractpartellipse.h.
AbstractPartEllipse::AbstractPartEllipse | ( | QETElementEditor * | editor, |
QGraphicsItem * | parent = nullptr |
||
) |
AbstractPartEllipse::AbstractPartEllipse Constructor.
editor | : QETElementEditor of this part |
parent | : parent item |
Definition at line 26 of file abstractpartellipse.cpp.
|
override |
AbstractPartEllipse::~AbstractPartEllipse Destructor.
Definition at line 37 of file abstractpartellipse.cpp.
|
private |
|
override |
AbstractPartEllipse::boundingRect Bounding rectangle this part can fit into.
Definition at line 70 of file abstractpartellipse.cpp.
References m_rect, CustomElementGraphicPart::penWeight(), and SHADOWS_HEIGHT.
Referenced by sceneGeometricRect().
|
overridevirtual |
AbstractPartEllipse::handleUserTransformation Handle the user-induced transformation from initial_selection_rect to new_selection_rect.
initial_selection_rect | |
new_selection_rect |
Implements CustomElementPart.
Definition at line 59 of file abstractpartellipse.cpp.
References CustomElementPart::mapPoints(), saved_points_, and setRect().
|
overridevirtual |
AbstractPartEllipse::isUseless.
Implements CustomElementPart.
Definition at line 130 of file abstractpartellipse.cpp.
References rect().
QRectF AbstractPartEllipse::rect | ( | ) | const |
|
signal |
Referenced by EllipseEditor::setPart(), ArcEditor::setPart(), and setRect().
|
overridevirtual |
AbstractPartEllipse::sceneGeometricRect.
Implements CustomElementPart.
Definition at line 88 of file abstractpartellipse.cpp.
References boundingRect(), and rect().
|
virtual |
AbstractPartEllipse::sceneTopLeft.
Definition at line 96 of file abstractpartellipse.cpp.
References rect().
Referenced by PartArc::toXml(), and PartEllipse::toXml().
|
virtual |
AbstractPartEllipse::setRect Sets the item's ellipse geometry to rect. The rectangle's left edge defines the left edge of the ellipse, and the rectangle's top edge describes the top of the ellipse The height and width of the rectangle describe the height and width of the ellipse.
rect |
Reimplemented in PartArc, and PartEllipse.
Definition at line 116 of file abstractpartellipse.cpp.
References m_rect, rect(), and rectChanged().
Referenced by handleUserTransformation(), PartEllipse::setRect(), and PartArc::setRect().
|
virtual |
AbstractPartEllipse::setSpanAngle Returns the span angle of an ellipse segment in 16ths of a degree. This angle is used together with startAngle() for representing an ellipse segment (a pie). By default, this function returns 5760 (360 * 16, a full ellipse).
span_angle |
Reimplemented in PartArc.
Definition at line 156 of file abstractpartellipse.cpp.
References m_span_angle, and spanAngleChanged().
Referenced by PartArc::setSpanAngle().
|
virtual |
AbstractPartEllipse::setStartAngle Sets the start angle for an ellipse segment to angle, which is in 16ths of a degree. This angle is used together with spanAngle() for representing an ellipse segment (a pie). By default, the start angle is 0.
start_angle |
Reimplemented in PartArc.
Definition at line 141 of file abstractpartellipse.cpp.
References m_start_angle, and startAngleChanged().
Referenced by PartArc::setStartAngle().
|
inline |
Definition at line 72 of file abstractpartellipse.h.
References m_span_angle.
|
signal |
Referenced by ArcEditor::setPart(), and setSpanAngle().
|
inline |
Definition at line 69 of file abstractpartellipse.h.
References m_start_angle.
|
signal |
Referenced by ArcEditor::setPart(), and setStartAngle().
|
overridevirtual |
AbstractPartEllipse::startUserTransformation Start the user-induced transformation, provided this primitive is contained within the initial_selection_rect bounding rectangle.
initial_selection_rect |
Implements CustomElementPart.
Definition at line 45 of file abstractpartellipse.cpp.
References rect(), and saved_points_.
|
protected |
Definition at line 80 of file abstractpartellipse.h.
Referenced by PartEllipse::addHandler(), PartEllipse::adjusteHandlerPos(), PartEllipse::removeHandler(), PartEllipse::sceneEventFilter(), and PartEllipse::switchResizeMode().
|
protected |
Definition at line 77 of file abstractpartellipse.h.
Referenced by PartEllipse::addHandler(), PartArc::addHandler(), PartEllipse::adjusteHandlerPos(), PartArc::adjusteHandlerPos(), boundingRect(), PartArc::fromXml(), PartEllipse::fromXml(), PartEllipse::handlerMouseMoveEvent(), PartArc::handlerMouseMoveEvent(), PartEllipse::handlerMousePressEvent(), PartArc::handlerMousePressEvent(), PartEllipse::handlerMouseReleaseEvent(), PartArc::handlerMouseReleaseEvent(), PartArc::paint(), PartEllipse::paint(), setRect(), PartEllipse::shadowShape(), PartArc::shadowShape(), PartEllipse::shape(), and PartArc::shape().
|
protected |
Definition at line 79 of file abstractpartellipse.h.
Referenced by PartArc::addHandler(), PartArc::adjusteHandlerPos(), PartArc::fromXml(), PartArc::handlerMouseMoveEvent(), PartArc::handlerMousePressEvent(), PartArc::handlerMouseReleaseEvent(), PartArc::paint(), PartArc::PartArc(), setSpanAngle(), PartArc::shadowShape(), PartArc::shape(), spanAngle(), and PartArc::toXml().
|
protected |
Definition at line 78 of file abstractpartellipse.h.
Referenced by PartArc::addHandler(), PartArc::adjusteHandlerPos(), PartArc::fromXml(), PartArc::handlerMouseMoveEvent(), PartArc::handlerMousePressEvent(), PartArc::handlerMouseReleaseEvent(), PartArc::paint(), PartArc::PartArc(), setStartAngle(), PartArc::shadowShape(), PartArc::shape(), startAngle(), and PartArc::toXml().
|
protected |
Definition at line 76 of file abstractpartellipse.h.
Referenced by handleUserTransformation(), and startUserTransformation().
|
readwrite |
AbstractPartEllipse::rect Returns the item's ellipse geometry as a QRectF.
Definition at line 40 of file abstractpartellipse.h.
Referenced by ESEventAddArc::mousePressEvent().
|
readwrite |
Definition at line 39 of file abstractpartellipse.h.
|
readwrite |
Definition at line 38 of file abstractpartellipse.h.