QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
customelementpart.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef CUSTOM_ELEMENT_PART_H
19#define CUSTOM_ELEMENT_PART_H
20
21#include "../../qet.h"
22
23class CustomElement;
25class ElementScene;
27class QUndoStack;
28class QGraphicsItem;
29class QGraphicsSceneMouseEvent;
30
41 // constructors, destructor
42 public:
53 virtual ~CustomElementPart() {}
54
55 private:
57
58 // attributes
59 private:
61
62 // methods
63 public:
67 virtual void fromXml(const QDomElement &) = 0;
71 virtual const QDomElement toXml(QDomDocument &) const = 0;
75 virtual void setProperty(const char *name, const QVariant &value) = 0;
79 virtual QVariant property(const char *name) const = 0;
84 virtual bool isUseless() const = 0;
85 virtual QRectF sceneGeometricRect() const = 0;
90 virtual void startUserTransformation(const QRectF &) = 0;
94 virtual void handleUserTransformation(const QRectF &,
95 const QRectF &) = 0;
97 virtual QETElementEditor *elementEditor() const;
102 virtual void updateCurrentPartEditor() const;
104 virtual ElementScene *elementScene() const;
106 virtual QUndoStack &undoStack() const;
108 virtual QString name() const = 0;
110 virtual QString xmlName() const = 0;
111
112 virtual QGraphicsItem *toItem();
113
115
116 protected:
117 QList<QPointF> mapPoints(
118 const QRectF &,
119 const QRectF &,
120 const QList<QPointF> &);
121};
122#endif
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition customelementpart.h:40
virtual ElementScene * elementScene() const
Definition customelementpart.cpp:41
QETElementEditor * element_editor
Definition customelementpart.h:60
virtual QUndoStack & undoStack() const
Definition customelementpart.cpp:47
virtual QRectF sceneGeometricRect() const =0
virtual bool isUseless() const =0
virtual QString name() const =0
virtual void handleUserTransformation(const QRectF &, const QRectF &)=0
CustomElementPart(QETElementEditor *editor)
CustomElementPart Constructor.
Definition customelementpart.h:48
virtual QET::ScalingMethod preferredScalingMethod() const
Definition customelementpart.cpp:65
QList< QPointF > mapPoints(const QRectF &, const QRectF &, const QList< QPointF > &)
Definition customelementpart.cpp:77
virtual void startUserTransformation(const QRectF &)=0
virtual void setProperty(const char *name, const QVariant &value)=0
virtual void updateCurrentPartEditor() const
Definition customelementpart.cpp:33
virtual ~CustomElementPart()
~CustomElementPart Destructor
Definition customelementpart.h:53
virtual QGraphicsItem * toItem()
Definition customelementpart.cpp:53
virtual QETElementEditor * elementEditor() const
Definition customelementpart.cpp:24
virtual QString xmlName() const =0
CustomElementPart(const CustomElementPart &)
virtual QVariant property(const char *name) const =0
virtual void fromXml(const QDomElement &)=0
virtual const QDomElement toXml(QDomDocument &) const =0
Definition elementprimitivedecorator.h:42
The ElementScene class This class is the canvas allowing the visual edition of an electrical element....
Definition elementscene.h:46
Definition qetelementeditor.h:39
ScalingMethod
Supported types of interactive scaling, typically for a single element primitive.
Definition qet.h:77