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
RPainterPath.h
Go to the documentation of this file.
1
#ifndef RPAINTERPATH_H
2
#define RPAINTERPATH_H
3
4
#include <QPainterPath>
5
#include <QPen>
6
#include <QBrush>
7
#include <QFlags>
8
9
#include "
RVector.h
"
10
11
class
RShape
;
12
13
21
class
RPainterPath
:
public
QPainterPath {
22
23
public
:
24
enum
Mode
{
25
NoModes
= 0x00,
26
Selected
= 0x01,
27
Highlighted
= 0x02,
28
Invalid
= 0x04,
29
FixedPenColor
= 0x08,
30
FixedBrushColor
= 0x10
31
};
32
Q_DECLARE_FLAGS(Modes,
Mode
)
33
34
public:
35
RPainterPath
();
36
RPainterPath(const QPainterPath& path);
37
virtual ~RPainterPath();
38
39
QList<QSharedPointer<
RShape
> >
getShapes
() const;
40
41
void
addPath
(const RPainterPath& path);
42
43
void
moveTo
(const
RVector
& v) {
44
QPainterPath::moveTo
(v.x, v.y);
45
}
46
47
void
lineTo
(
const
RVector
& v) {
48
QPainterPath::lineTo
(v.
x
, v.
y
);
49
}
50
51
void
addRect
(
double
x1,
double
y1,
double
x2,
double
y2);
52
void
addRect
(
const
QRectF& rect);
53
void
addBox
(
const
RBox
& box);
54
55
RBox
getBoundingBox
()
const
;
56
57
RVector
getStartPoint
()
const
;
58
RVector
getEndPoint
()
const
;
59
60
bool
isValid
();
61
void
setValid
(
bool
on);
62
63
int
getZLevel
()
const
;
64
void
setZLevel
(
int
zl);
65
66
//bool hasPen() const;
67
QPen
getPen
()
const
;
68
void
setPen
(
const
QPen& p);
69
70
QBrush
getBrush
()
const
;
71
void
setBrush
(
const
QBrush& b);
72
73
void
setMode
(
RPainterPath::Mode
mode,
bool
on =
true
);
74
bool
getMode
(
RPainterPath::Mode
mode)
const
;
75
76
void
setHighlighted
(
bool
on);
77
bool
isHighlighted
()
const
;
78
79
void
setSelected
(
bool
on);
80
bool
isSelected
()
const
;
81
82
void
setFixedPenColor
(
bool
on);
83
bool
isFixedPenColor
()
const
;
84
85
void
setFixedBrushColor
(
bool
on);
86
bool
isFixedBrushColor
()
const
;
87
88
void
setFeatureSize
(
double
s);
89
double
getFeatureSize
()
const
;
90
91
double
getDistanceTo
(
const
RVector
& point)
const
;
92
93
void
addPoint
(
const
RVector
& position);
94
bool
hasPoints
();
95
void
setPoints
(
const
QList<RVector>& p);
96
QList<RVector>
getPoints
()
const
;
97
98
void
transform
(
const
QTransform& t);
99
100
int
getElementCount
()
const
;
101
double
getXAt
(
int
i)
const
;
102
double
getYAt
(
int
i)
const
;
103
QPainterPath::ElementType
getTypeAt
(
int
i)
const
;
104
bool
isEmpty
()
const
;
105
106
private
:
107
int
zLevel
;
108
QPen
pen
;
109
QBrush
brush
;
110
Modes
modes
;
111
QList<RVector>
points
;
112
double
featureSize
;
113
};
114
115
QDebug
operator<<
(QDebug dbg,
RPainterPath
& p);
116
117
//QDataStream& operator<< (QDataStream& stream, const RPainterPath& path);
118
//QDataStream& operator>> (QDataStream& stream, RPainterPath& path);
119
bool
operator<
(
const
RPainterPath
& p1,
const
RPainterPath
& p2);
120
121
Q_DECLARE_OPERATORS_FOR_FLAGS(RPainterPath::Modes)
122
Q_DECLARE_METATYPE
(
RPainterPath
)
123
Q_DECLARE_METATYPE
(
RPainterPath
*)
124
Q_DECLARE_METATYPE
(QList<
RPainterPath
>)
125
Q_DECLARE_METATYPE
(QList<
RPainterPath
>*)
126
Q_DECLARE_METATYPE
(
RPainterPath
::Mode)
127
Q_DECLARE_METATYPE
(
RPainterPath
::Mode*)
128
129
#endif
src
core
RPainterPath.h
Generated on Tue Jun 26 2012 18:41:07 for QCAD Application Framework by
1.8.1.1