27#include <QPainterPath>
29#include <QSharedPointer>
56 FixedPenColor = 0x0008,
57 FixedBrushColor = 0x0010,
65 SimplePointDisplay = 0x1000,
68 ScreenBasedLinetype = 0x8000,
72 Q_DECLARE_FLAGS(Modes, Mode)
80 void setPath(
const QPainterPath& path);
82 QList<QSharedPointer<RShape> > getShapes()
const;
85 return RVector(currentPosition().x(), currentPosition().y());
91 QPainterPath::moveTo(v.
x, v.
y);
95 if (!isAtPosition(v)) {
101 QPainterPath::moveTo(x, y);
108 QPainterPath::moveTo(p);
112 QPainterPath::lineTo(v.
x, v.
y);
116 QPainterPath::lineTo(x, y);
123 QPainterPath::lineTo(p);
127 QPainterPath::quadTo(cp.
x, cp.
y, v.
x, v.
y);
130 void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty) {
131 QPainterPath::quadTo(ctrlPtx, ctrlPty, endPtx, endPty);
135 QPainterPath::cubicTo(cp1.
x, cp1.
y, cp2.
x, cp2.
y, v.
x, v.
y);
138 void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty) {
139 QPainterPath::cubicTo(ctrlPt1x, ctrlPt1y, ctrlPt2x, ctrlPt2y, endPtx, endPty);
143 QPainterPath::closeSubpath();
159 return QPainterPath::contains(QPointF(v.
x, v.
y));
169 void addRect(
double x1,
double y1,
double x2,
double y2);
170 void addRect(
const QRectF& rect);
171 void addBox(
const RBox& box);
173 RBox getBoundingBox()
const;
178 bool isValid()
const;
179 void setValid(
bool on);
183 int getZLevel()
const;
184 void setZLevel(
int zl);
188 void setPen(
const QPen& p);
190 QBrush getBrush()
const;
191 void setBrush(
const QBrush& b);
196 void setHighlighted(
bool on);
197 bool isHighlighted()
const;
199 void setSelected(
bool on);
200 bool isSelected()
const;
202 void setFixedPenColor(
bool on);
203 bool isFixedPenColor()
const;
205 void setFixedBrushColor(
bool on);
206 bool isFixedBrushColor()
const;
208 void setAutoRegen(
bool on);
209 bool getAutoRegen()
const;
211 void setAlwaysRegen(
bool on);
212 bool getAlwaysRegen()
const;
214 void setInheritPen(
bool on);
215 bool getInheritPen()
const;
217 void setPixelUnit(
bool on);
218 bool getPixelUnit()
const;
220 void setNoClipping(
bool on);
221 bool getNoClipping()
const;
223 void setNoColorMode(
bool on);
224 bool getNoColorMode()
const;
226 void setSimplePointDisplay(
bool on);
227 bool getSimplePointDisplay()
const;
229 void setPolylineGen(
bool on);
230 bool getPolylineGen()
const;
232 void setNoPattern(
bool on);
233 bool getNoPattern()
const;
235 void setScreenBasedLinetype(
bool on);
236 bool getScreenBasedLinetype()
const;
238 void setWipeout(
bool on);
239 bool getWipeout()
const;
241 void setFrameless(
bool on);
242 bool getFrameless()
const;
244 void setPixelWidth(
bool on);
245 bool getPixelWidth()
const;
247 void setFeatureSize(
double s);
248 double getFeatureSize()
const;
250 void setPixelSizeHint(
double s);
251 double getPixelSizeHint()
const;
253 double getDistanceTo(
const RVector& point)
const;
257 void setPoints(
const QList<RVector>& p);
258 QList<RVector> getPoints()
const;
260 void transform(
const QTransform& t);
262 void rotate(
double angle);
263 void scale(
double fx,
double fy);
265 int getElementCount()
const;
266 double getXAt(
int i)
const;
267 double getYAt(
int i)
const;
268 QPainterPath::ElementType getTypeAt(
int i)
const;
269 bool isEmpty()
const;
271 void addShape(QSharedPointer<RShape> shape);
273 void addOriginalShape(QSharedPointer<RShape> shape);
274 bool hasOriginalShapes()
const;
275 int countOriginalShapes()
const;
276 QSharedPointer<RShape> getOriginalShape(
int i)
const;
278#if QT_VERSION >= 0x060000
288 static void rotateList(QList<RPainterPath>& pps,
double angle);
289 static void translateList(QList<RPainterPath>& pps,
const RVector& offset);
290 static void scaleList(QList<RPainterPath>& pps,
double fx,
double fy);
291 static RVector getMinList(QList<RPainterPath>& pps);
292 static RVector getMaxList(QList<RPainterPath>& pps);
312Q_DECLARE_OPERATORS_FOR_FLAGS(RPainterPath::Modes)
Q_DECLARE_METATYPE(RMath *)
QCADCORE_EXPORT bool operator<(const RPainterPath &p1, const RPainterPath &p2)
This operator allows us to sort painter paths based on z-level.
Definition RPainterPath.cpp:765
QCADCORE_EXPORT QDebug operator<<(QDebug dbg, RPainterPath &p)
Stream operator for QDebug.
Definition RPainterPath.cpp:772
int i
Copyright (c) 2011-2018 by Andrew Mustun.
Definition autostart.js:32
Low-level mathematical representation of an arc.
Definition RArc.h:42
Represents a box e.g.
Definition RBox.h:46
Low-level mathematical representation of a line.
Definition RLine.h:41
Extended painter path with a z-level and a pen.
Definition RPainterPath.h:48
QList< QSharedPointer< RShape > > originalShapes
Definition RPainterPath.h:303
void lineTo(const RVector &v)
Definition RPainterPath.h:111
void moveTo(const QPointF &p)
Definition RPainterPath.h:107
void cubicTo(const RVector &cp1, const RVector &cp2, const RVector &v)
Definition RPainterPath.h:134
void quadTo(const RVector &cp, const RVector &v)
Definition RPainterPath.h:126
double pixelSizeHint
Definition RPainterPath.h:302
QList< RVector > points
Definition RPainterPath.h:299
void lineTo(const QPointF &p)
Definition RPainterPath.h:122
double featureSize
Definition RPainterPath.h:301
void moveTo(const RVector &v)
Definition RPainterPath.h:90
Mode
Definition RPainterPath.h:51
QPen pen
Definition RPainterPath.h:296
RVector getCurrentPosition() const
Definition RPainterPath.h:84
int zLevel
Definition RPainterPath.h:295
void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty)
Definition RPainterPath.h:138
void moveTo(qreal x, qreal y)
Definition RPainterPath.h:100
bool containsPoint(const RVector &v) const
Definition RPainterPath.h:158
Modes modes
Definition RPainterPath.h:298
void lineTo(qreal x, qreal y)
Definition RPainterPath.h:115
void moveToOrNop(const RVector &v)
Definition RPainterPath.h:94
QBrush brush
Definition RPainterPath.h:297
void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
Definition RPainterPath.h:130
void closeSubpath()
Definition RPainterPath.h:142
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition RPolyline.h:50
static const double PointTolerance
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RS.h:920
Interface for geometrical shape classes.
Definition RShape.h:72
Low-level mathematical representation of a spline.
Definition RSpline.h:59
Represents a 3d vector (x/y/z).
Definition RVector.h:47
double x
Getter function for this property: getX Setter function for this property: setX
Definition RVector.h:313
double y
Getter function for this property: getY Setter function for this property: setY
Definition RVector.h:319
#define QCADCORE_EXPORT
Definition core_global.h:10
void addSpline(void points, void closed)
Adds a spline to the drawing.
Definition simple_create.js:15
void addPolyline(void points, void closed, void relative)
Adds a polyline to the drawing.
Definition simple_create.js:79
void addArc(void center, void radius, void startAngle, void endAngle, void reversed)
Adds an arc to the drawing.
Definition simple_create.js:109
void rotate(void e, void angle, void center)
Rotates the given entity or shape by the given angle around the given center.
Definition simple_modify.js:109
void move(void e, void offset)
Moves the given entity or shape by the given offset.
Definition simple_modify.js:58
void scale(void e, void factor, void focusPoint)
Scales the given entity or shape by the given factor with the given focus point.
Definition simple_modify.js:15
void addShape(void shape, void color, void linetype, void lineweight)
Adds the given RShape to the drawing as a new entity using current layer and attributes.
Definition simple_create.js:50
void addPoint(void position)
Adds a point to the drawing.
Definition simple_create.js:210
void addLine(void startPoint, void endPoint)
Adds a line to the drawing.
Definition simple_create.js:198
char s
Definition opennurbs_string.cpp:32