QElectroTech 0.100.0-dev
|
The CustomElementPart class This abstract class represents a primitive of the visual representation of an electrical element. The Element, FixedElement and CustomElement classes do not embed its attributes and methods in order to remain lightweight; indeed, there is no point for those classes to store their visual representation with anything more complex than a QImage. More...
#include <customelementpart.h>
Public Member Functions | |
CustomElementPart (QETElementEditor *editor) | |
CustomElementPart Constructor. | |
virtual | ~CustomElementPart () |
~CustomElementPart Destructor | |
virtual void | fromXml (const QDomElement &)=0 |
virtual const QDomElement | toXml (QDomDocument &) const =0 |
virtual void | setProperty (const char *name, const QVariant &value)=0 |
virtual QVariant | property (const char *name) const =0 |
virtual bool | isUseless () const =0 |
virtual QRectF | sceneGeometricRect () const =0 |
virtual void | startUserTransformation (const QRectF &)=0 |
virtual void | handleUserTransformation (const QRectF &, const QRectF &)=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 Member Functions | |
QList< QPointF > | mapPoints (const QRectF &, const QRectF &, const QList< QPointF > &) |
Private Member Functions | |
CustomElementPart (const CustomElementPart &) | |
Private Attributes | |
QETElementEditor * | element_editor |
The CustomElementPart class This abstract class represents a primitive of the visual representation of an electrical element. The Element, FixedElement and CustomElement classes do not embed its attributes and methods in order to remain lightweight; indeed, there is no point for those classes to store their visual representation with anything more complex than a QImage.
|
inline |
CustomElementPart Constructor.
editor | Element editor this primitive is attached to |
|
inlinevirtual |
~CustomElementPart Destructor
|
private |
|
virtual |
|
virtual |
|
pure virtual |
Load the primitive from an XML element that describes it
Implemented in PartArc, PartEllipse, PartLine, PartPolygon, PartRectangle, PartTerminal, PartText, and PartDynamicTextField.
|
pure virtual |
Make this part fit into the provided rectangle.
Implemented in AbstractPartEllipse, PartLine, PartPolygon, PartRectangle, PartTerminal, PartText, and PartDynamicTextField.
|
pure virtual |
Implemented in AbstractPartEllipse, PartDynamicTextField, PartLine, PartPolygon, PartRectangle, PartTerminal, and PartText.
|
protected |
Helper method to map points in CustomElementPart::handleUserTransformation()
initial_selection_rect | Selection rectangle when the movement started, in scene coordinates |
new_selection_rect | New selection rectangle, in scene coordinates |
points | List of points when the movement started, in scene coordinates. |
|
pure virtual |
Implemented in PartArc, PartDynamicTextField, PartEllipse, PartLine, PartPolygon, PartRectangle, PartTerminal, and PartText.
|
virtual |
This method is called by the decorator when it needs to determine the best way to interactively scale a primitive. It is typically called when only a single primitive is being scaled. The default implementation systematically returns QET::SnapScalingPointToGrid
Reimplemented in PartPolygon.
|
pure virtual |
Get the current value of a specific primitive property
Implemented in CustomElementGraphicPart, PartDynamicTextField, and PartText.
|
pure virtual |
Implemented in AbstractPartEllipse, PartArc, PartDynamicTextField, PartLine, PartPolygon, PartRectangle, PartTerminal, and PartText.
|
pure virtual |
Set a specific property of the primitive
Implemented in CustomElementGraphicPart, PartDynamicTextField, and PartText.
|
pure virtual |
Inform this part a user-induced transformation is about to begin. This method can be used to save data required by handleUserTransformation().
Implemented in AbstractPartEllipse, PartLine, PartPolygon, PartRectangle, PartTerminal, PartText, and PartDynamicTextField.
|
virtual |
|
pure virtual |
Export the primitive as an XML element
Implemented in PartArc, PartEllipse, PartLine, PartPolygon, PartRectangle, PartTerminal, PartText, and PartDynamicTextField.
|
virtual |
|
virtual |
Call the updateCurrentPartEditor() slot of the editor
Appelle le slot updateCurrentPartEditor de l'editeur
|
pure virtual |
Implemented in PartArc, PartDynamicTextField, PartEllipse, PartLine, PartPolygon, PartRectangle, PartTerminal, and PartText.
|
private |