QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RWipeoutEntity.h
Go to the documentation of this file.
1
20#ifndef RWIPEOUTENTITY_H
21#define RWIPEOUTENTITY_H
22
23#include "entity_global.h"
24
25#include "RPolylineEntity.h"
26#include "RWipeoutData.h"
27
28class RDocument;
29class RExporter;
30
31#ifndef RDEFAULT_MIN1
32#define RDEFAULT_MIN1 -1
33#endif
34
43
44public:
58
59// static RPropertyTypeId PropertyClosed;
60// static RPropertyTypeId PropertyPolylineGen;
65// static RPropertyTypeId PropertyAngleN;
66// static RPropertyTypeId PropertyStartWidthN;
67// static RPropertyTypeId PropertyEndWidthN;
68// static RPropertyTypeId PropertyGlobalWidth;
69
70// static RPropertyTypeId PropertyOrientation;
71// static RPropertyTypeId PropertyLength;
72// static RPropertyTypeId PropertyTotalLength;
73// static RPropertyTypeId PropertyArea;
74// static RPropertyTypeId PropertyTotalArea;
75
79
81
82// static RPropertyTypeId PropertyElevation;
83
84// static QString TrClockwise;
85// static QString TrCounterclockwise;
86
87public:
88 RWipeoutEntity(RDocument* document, const RWipeoutData& data);
89 RWipeoutEntity(const RWipeoutEntity& other);
90 virtual ~RWipeoutEntity();
91
92 static void init();
93
95 return RS::EntityWipeout;
96 }
97
98 static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
100 }
101
102 virtual QSharedPointer<RObject> clone() const {
103 return QSharedPointer<RObject>(new RWipeoutEntity(*this));
104 }
105
106 QSharedPointer<RWipeoutEntity> cloneToWipeoutEntity() const {
107 return QSharedPointer<RWipeoutEntity>(new RWipeoutEntity(*this));
108 }
109
111 return data;
112 }
113
114 virtual const RWipeoutData& getData() const {
115 return data;
116 }
117
118 virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
119 RTransaction* transaction=NULL);
120 virtual QPair<QVariant, RPropertyAttributes> getProperty(
121 RPropertyTypeId& propertyTypeId,
122 bool humanReadable = false, bool noAttributes = false, bool showOnRequest = false);
123
124 virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
125
126 void setShape(const RPolyline& l);
127
128 bool getShowFrame() const {
129 return data.getShowFrame();
130 }
131
132 void setShowFrame(bool on) {
133 data.setShowFrame(on);
134 }
135
136 int countVertices() const {
137 return data.countVertices();
138 }
139
140 void appendVertex(const RVector& vertex, double bulge = 0.0, double w1 = 0.0, double w2 = 0.0) {
141 data.appendVertex(vertex, bulge, w1, w2);
142 }
143
145 return data.getEndPoint();
146 }
147
149 return data.getStartPoint();
150 }
151
152 RVector getVertexAt(int i) const {
153 return data.getVertexAt(i);
154 }
155
156 void setVertexAt(int i, const RVector& v) {
157 data.setVertexAt(i, v);
158 }
159
160 double getBulgeAt(int i) const {
161 return data.getBulgeAt(i);
162 }
163
164 void setBulgeAt(int i, double b) {
165 data.setBulgeAt(i, b);
166 }
167
169 data.removeLastVertex();
170 }
171
172protected:
174};
175
177Q_DECLARE_METATYPE(QSharedPointer<RWipeoutEntity>)
178Q_DECLARE_METATYPE(QSharedPointer<RWipeoutEntity>*)
179
180#endif
Q_DECLARE_METATYPE(RMath *)
int i
Copyright (c) 2011-2018 by Andrew Mustun.
Definition autostart.js:32
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
Base class for all entity classes.
Definition REntity.h:63
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
Definition REntity.cpp:236
static void init()
Definition REntity.cpp:89
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition REntity.cpp:338
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const =0
Exports the entity to the given exporter.
Abstract base class for exporters.
Definition RExporter.h:78
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition RPolyline.h:50
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPropertyTypeId.h:54
static QSet< RPropertyTypeId > getPropertyTypeIds(RS::EntityType type, RPropertyAttributes::Option=RPropertyAttributes::NoOptions)
Gets all property type IDs that where registered for the given class.
Definition RPropertyTypeId.cpp:283
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ EntityWipeout
Wipeout.
Definition RS.h:279
Transaction implementation.
Definition RTransaction.h:73
Represents a 3d vector (x/y/z).
Definition RVector.h:47
Stores and manages all data that defines the geometry and appearance of a wipeout entity.
Definition RWipeoutData.h:49
Polyline entity.
Definition RWipeoutEntity.h:42
bool getShowFrame() const
Definition RWipeoutEntity.h:128
static RPropertyTypeId PropertyWorkingSet
Definition RWipeoutEntity.h:48
RWipeoutData data
Definition RWipeoutEntity.h:173
static RPropertyTypeId PropertyType
Definition RWipeoutEntity.h:49
static RPropertyTypeId PropertyBlock
Definition RWipeoutEntity.h:50
static RPropertyTypeId PropertyLinetype
Definition RWipeoutEntity.h:52
RVector getVertexAt(int i) const
Definition RWipeoutEntity.h:152
static RPropertyTypeId PropertyVertexNY
Definition RWipeoutEntity.h:62
static RPropertyTypeId PropertyFrame
Definition RWipeoutEntity.h:80
static RPropertyTypeId PropertyVertexNX
Definition RWipeoutEntity.h:61
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2024 by Andrew Mustun.
Definition RWipeoutEntity.h:45
RVector getEndPoint() const
Definition RWipeoutEntity.h:144
static RPropertyTypeId PropertyLinetypeScale
Definition RWipeoutEntity.h:53
static RPropertyTypeId PropertyHandle
Definition RWipeoutEntity.h:46
void setShowFrame(bool on)
Definition RWipeoutEntity.h:132
static RPropertyTypeId PropertyLayer
Definition RWipeoutEntity.h:51
static RPropertyTypeId PropertyDrawOrder
Definition RWipeoutEntity.h:57
RVector getStartPoint() const
Definition RWipeoutEntity.h:148
void appendVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)
Definition RWipeoutEntity.h:140
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition RWipeoutEntity.h:98
void setBulgeAt(int i, double b)
Definition RWipeoutEntity.h:164
static RPropertyTypeId PropertyDisplayedColor
Definition RWipeoutEntity.h:56
virtual const RWipeoutData & getData() const
Definition RWipeoutEntity.h:114
static RPropertyTypeId PropertyProtected
Definition RWipeoutEntity.h:47
static RPropertyTypeId PropertyColor
Definition RWipeoutEntity.h:55
void setVertexAt(int i, const RVector &v)
Definition RWipeoutEntity.h:156
static RPropertyTypeId PropertyBaseAngle
Definition RWipeoutEntity.h:76
static RPropertyTypeId PropertyBulgeN
Definition RWipeoutEntity.h:64
static RPropertyTypeId PropertySize1
Definition RWipeoutEntity.h:77
static RPropertyTypeId PropertyVertexNZ
Definition RWipeoutEntity.h:63
static RS::EntityType getRtti()
Definition RWipeoutEntity.h:94
virtual RWipeoutData & getData()
Definition RWipeoutEntity.h:110
double getBulgeAt(int i) const
Definition RWipeoutEntity.h:160
static RPropertyTypeId PropertySize2
Definition RWipeoutEntity.h:78
int countVertices() const
Definition RWipeoutEntity.h:136
QSharedPointer< RWipeoutEntity > cloneToWipeoutEntity() const
Definition RWipeoutEntity.h:106
virtual QSharedPointer< RObject > clone() const
Definition RWipeoutEntity.h:102
void removeLastVertex()
Definition RWipeoutEntity.h:168
static RPropertyTypeId PropertyLineweight
Definition RWipeoutEntity.h:54
#define QCADENTITY_EXPORT
Definition entity_global.h:10
#define NULL
Definition opennurbs_system.h:256