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
RSplineEntity.h
Go to the documentation of this file.
1
#ifndef RSPLINEENTITY_H
2
#define RSPLINEENTITY_H
3
4
#include "
REntity.h
"
5
#include "
RSplineData.h
"
6
7
class
RDocument
;
8
class
RExporter
;
9
17
class
RSplineEntity
:
public
REntity
{
18
19
public
:
20
static
RPropertyTypeId
PropertyCustom
;
21
static
RPropertyTypeId
PropertyHandle
;
22
static
RPropertyTypeId
PropertyType
;
23
static
RPropertyTypeId
PropertyBlock
;
24
static
RPropertyTypeId
PropertyLayer
;
25
static
RPropertyTypeId
PropertyLinetype
;
26
static
RPropertyTypeId
PropertyLineweight
;
27
static
RPropertyTypeId
PropertyColor
;
28
static
RPropertyTypeId
PropertyDrawOrder
;
29
30
static
RPropertyTypeId
PropertyControlPointNX
;
31
static
RPropertyTypeId
PropertyControlPointNY
;
32
static
RPropertyTypeId
PropertyControlPointNZ
;
33
static
RPropertyTypeId
PropertyFitPointNX
;
34
static
RPropertyTypeId
PropertyFitPointNY
;
35
static
RPropertyTypeId
PropertyFitPointNZ
;
36
static
RPropertyTypeId
PropertyPeriodic
;
37
static
RPropertyTypeId
PropertyDegree
;
38
39
public
:
40
RSplineEntity
(
RDocument
*
document
,
const
RSplineData
&
data
,
41
RObject::Id
objectId
=
RObject::INVALID_ID
);
42
virtual
~RSplineEntity
();
43
44
static
void
init
();
45
46
virtual
RSplineEntity
*
clone
()
const
{
47
return
new
RSplineEntity
(*
this
);
48
}
49
50
virtual
RS::EntityType
getType
()
const
{
51
return
RS::EntitySpline
;
52
}
53
54
bool
setProperty
(
RPropertyTypeId
propertyTypeId,
const
QVariant& value);
55
QPair<QVariant, RPropertyAttributes>
getProperty
(
56
RPropertyTypeId
propertyTypeId,
57
bool
humanReadable =
false
,
bool
noAttributes =
false
);
58
59
virtual
void
exportEntity
(
RExporter
& e,
bool
preview=
false
)
const
;
60
61
virtual
void
setUndone
(
bool
on) {
62
REntity::setUndone
(on);
63
data
.
updateInternal
();
64
}
65
66
virtual
RSplineData
&
getData
() {
67
return
data
;
68
}
69
70
virtual
const
RSplineData
&
getData
()
const
{
71
return
data
;
72
}
73
74
bool
isValid
()
const
{
75
return
data
.
isValid
();
76
}
77
78
double
getDegree
()
const
{
79
return
data
.
getDegree
();
80
}
81
82
double
getDirection1
()
const
{
83
return
data
.
getDirection1
();
84
}
85
86
double
getDirection2
()
const
{
87
return
data
.
getDirection2
();
88
}
89
90
RVector
getTangentAtStart
()
const
{
91
return
data
.
getTangentAtStart
();
92
}
93
94
RVector
getTangentAtEnd
()
const
{
95
return
data
.
getTangentAtEnd
();
96
}
97
98
bool
isClosed
()
const
{
99
return
data
.
isClosed
();
100
}
101
102
bool
isPeriodic
()
const
{
103
return
data
.
isPeriodic
();
104
}
105
106
QList<RVector>
getControlPoints
()
const
{
107
return
data
.
getControlPoints
();
108
}
109
110
QList<RVector>
getControlPointsWrapped
()
const
{
111
return
data
.
getControlPointsWrapped
();
112
}
113
114
QList<RVector>
getFitPoints
()
const
{
115
return
data
.
getFitPoints
();
116
}
117
118
QList<double>
getKnotVector
()
const
{
119
return
data
.
getKnotVector
();
120
}
121
122
QList<double>
getWeights
()
const
{
123
return
data
.
getWeights
();
124
}
125
126
//RSpline getSubSpline(double d1, double d2) const {
127
// return data.getSubSpline(d1, d2);
128
//}
129
130
double
getLength
()
const
{
131
return
data
.
getLength
();
132
}
133
134
RVector
getStartPoint
()
const
{
135
return
data
.
getStartPoint
();
136
}
137
138
RVector
getEndPoint
()
const
{
139
return
data
.
getEndPoint
();
140
}
141
142
bool
reverse
() {
143
return
data
.
reverse
();
144
}
145
146
virtual
int
getComplexity
()
const
{
147
return
getData
().
getExploded
().count();
148
}
149
150
QList<QSharedPointer<RShape> >
getExploded
()
const
{
151
return
data
.
getExploded
();
152
}
153
154
/*
155
double getAngle() const {
156
return data.getAngle();
157
}
158
159
double getDirection1() const {
160
return data.getDirection1();
161
}
162
163
double getDirection2() const {
164
return data.getDirection2();
165
}
166
167
RS::Side getSideOfPoint(const RVector& point) const {
168
return data.getSideOfPoint(point);
169
}
170
*/
171
172
protected
:
173
virtual
void
print
(QDebug dbg)
const
;
174
175
protected
:
176
RSplineData
data
;
177
};
178
179
Q_DECLARE_METATYPE
(
RSplineEntity
*)
180
Q_DECLARE_METATYPE
(QSharedPointer<
RSplineEntity
>)
181
Q_DECLARE_METATYPE
(QSharedPointer<
RSplineEntity
>*)
182
183
#endif
src
entity
RSplineEntity.h
Generated on Tue Jun 26 2012 18:41:08 for QCAD Application Framework by
1.8.1.1