QCAD Application Framework
CAD Application Development and Automation.
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
RPolylineEntity.h
Go to the documentation of this file.
1
#ifndef RPOLYLINEENTITY_H
2
#define RPOLYLINEENTITY_H
3
4
#include "
REntity.h
"
5
#include "
RPolylineData.h
"
6
7
class
RDocument
;
8
class
RExporter
;
9
class
RArc
;
10
class
RLine
;
11
19
class
RPolylineEntity
:
public
REntity
{
20
21
public
:
22
static
RPropertyTypeId
PropertyCustom
;
23
static
RPropertyTypeId
PropertyHandle
;
24
static
RPropertyTypeId
PropertyType
;
25
static
RPropertyTypeId
PropertyBlock
;
26
static
RPropertyTypeId
PropertyLayer
;
27
static
RPropertyTypeId
PropertyLinetype
;
28
static
RPropertyTypeId
PropertyLineweight
;
29
static
RPropertyTypeId
PropertyColor
;
30
static
RPropertyTypeId
PropertyDrawOrder
;
31
32
static
RPropertyTypeId
PropertyClosed
;
33
static
RPropertyTypeId
PropertyVertexNX
;
34
static
RPropertyTypeId
PropertyVertexNY
;
35
static
RPropertyTypeId
PropertyVertexNZ
;
36
static
RPropertyTypeId
PropertyBulgeN
;
37
38
public
:
39
RPolylineEntity
(
RDocument
*
document
,
const
RPolylineData
&
data
,
40
RObject::Id
objectId
=
RObject::INVALID_ID
);
41
virtual
~RPolylineEntity
();
42
43
static
void
init
();
44
45
virtual
RPolylineEntity
*
clone
()
const
{
46
return
new
RPolylineEntity
(*
this
);
47
}
48
49
virtual
RS::EntityType
getType
()
const
{
50
return
RS::EntityPolyline
;
51
}
52
53
void
setShape
(
const
RPolyline
& l);
54
55
bool
setProperty
(
RPropertyTypeId
propertyTypeId,
const
QVariant& value);
56
QPair<QVariant, RPropertyAttributes>
getProperty
(
57
RPropertyTypeId
propertyTypeId,
58
bool
humanReadable =
false
,
bool
noAttributes =
false
);
59
60
virtual
void
exportEntity
(
RExporter
& e,
bool
preview=
false
)
const
;
61
62
virtual
RPolylineData
&
getData
() {
63
return
data
;
64
}
65
66
virtual
const
RPolylineData
&
getData
()
const
{
67
return
data
;
68
}
69
70
void
clear
() {
71
data
.
clear
();
72
}
73
74
void
normalize
() {
75
data
.
normalize
();
76
}
77
78
int
countVertices
()
const
{
79
return
data
.
countVertices
();
80
}
81
82
void
appendVertex
(
const
RVector
& vertex,
double
bulge = 0.0) {
83
data
.
appendVertex
(vertex, bulge);
84
}
85
86
void
prependVertex
(
const
RVector
& vertex,
double
bulge = 0.0) {
87
data
.
prependVertex
(vertex, bulge);
88
}
89
90
void
insertVertex
(
int
index,
const
RVector
& vertex) {
91
data
.
insertVertex
(index, vertex);
92
}
93
94
RVector
getVertexAt
(
int
i)
const
{
95
return
data
.
getVertexAt
(i);
96
}
97
98
void
removeLastVertex
() {
99
data
.
removeLastVertex
();
100
}
101
102
void
removeVertex
(
int
index) {
103
data
.
removeVertex
(index);
104
}
105
106
int
countSegments
()
const
{
107
return
data
.
countSegments
();
108
}
109
110
QSharedPointer<RShape>
getSegmentAt
(
int
i)
const
{
111
return
data
.
getSegmentAt
(i);
112
}
113
114
double
getBulgeAt
(
int
i)
const
{
115
return
data
.
getBulgeAt
(i);
116
}
117
118
void
setBulgeAt
(
int
i,
double
b) {
119
data
.
setBulgeAt
(i, b);
120
}
121
122
double
getDirection1
()
const
{
123
return
data
.
getDirection1
();
124
}
125
126
double
getDirection2
()
const
{
127
return
data
.
getDirection2
();
128
}
129
130
bool
reverse
() {
131
return
data
.
reverse
();
132
}
133
134
RVector
getEndPoint
()
const
{
135
return
data
.
getEndPoint
();
136
}
137
138
RVector
getStartPoint
()
const
{
139
return
data
.
getStartPoint
();
140
}
141
142
void
setClosed
(
bool
on) {
143
data
.
setClosed
(on);
144
}
145
146
bool
isClosed
()
const
{
147
return
data
.
isClosed
();
148
}
149
150
bool
isLogicallyClosed
()
const
{
151
return
data
.
isLogicallyClosed
();
152
}
153
154
QList<QSharedPointer<RShape> >
getExploded
()
const
{
155
return
data
.
getExploded
();
156
}
157
158
virtual
int
getComplexity
()
const
{
159
return
countSegments
();
160
}
161
162
protected
:
163
virtual
void
print
(QDebug dbg)
const
;
164
165
protected
:
166
RPolylineData
data
;
167
};
168
169
Q_DECLARE_METATYPE
(
RPolylineEntity
*)
170
Q_DECLARE_METATYPE
(QSharedPointer<
RPolylineEntity
>)
171
Q_DECLARE_METATYPE
(QSharedPointer<
RPolylineEntity
>*)
172
173
#endif
src
entity
RPolylineEntity.h
Generated on Tue Jun 26 2012 18:41:08 for QCAD Application Framework by
1.8.1.1