20#ifndef RSPLINEENTITY_H
21#define RSPLINEENTITY_H
32#define RDEFAULT_MIN1 -1
96 virtual QSharedPointer<RObject>
clone()
const {
101 return QSharedPointer<RSplineEntity>(
new RSplineEntity(*
this));
106 virtual QPair<QVariant, RPropertyAttributes>
getProperty(
108 bool humanReadable =
false,
bool noAttributes =
false,
bool showOnRequest =
false);
128 return data.isValid();
132 return data.getTDelta();
136 return data.getTMin();
140 return data.getTMax();
144 return data.getTAtPoint(point);
148 return data.getTAtDistance(distance);
152 return data.getDegree();
156 return data.getDirection1();
160 return data.getDirection2();
164 return data.getTrimEnd(trimPoint, clickPoint);
168 return data.trimStartPoint(trimPoint, clickPoint, extend);
171 return data.trimEndPoint(trimPoint, clickPoint, extend);
175 return data.splitAtPoints(points);
178 return data.splitAtParams(params);
182 return data.getTangentAtStart();
186 return data.getTangentAtEnd();
190 return data.isClosed();
194 return data.isGeometricallyClosed(tolerance);
198 return data.isPeriodic();
202 data.appendControlPoint(point);
206 data.appendFitPoint(point);
210 data.prependFitPoint(point);
214 data.insertFitPointAt(point);
218 data.removeFitPointAt(point);
222 data.setPeriodic(on);
226 return data.getControlPoints();
230 return data.getControlPointsWrapped();
234 return data.countControlPoints();
238 return data.getControlPointAt(
i);
242 return data.getFitPoints();
246 return data.hasFitPoints();
250 return data.countFitPoints();
254 return data.getFitPointAt(
i);
258 return data.getKnotVector();
262 return data.getActualKnotVector();
266 return data.getWeights();
274 return data.getLength();
278 return data.getPointAt(t);
282 return data.getPointAtDistance(distance);
286 return data.getAngleAt(distance, from);
290 return data.getStartPoint();
294 return data.getEndPoint();
298 return data.setStartPoint(sp);
302 return data.setEndPoint(ep);
306 return data.toPolyline(segments);
310 return data.approximateWithArcs(tolerance, radiusLimit);
314 return data.reverse();
318 return data.getSideOfPoint(point);
324 return data.getExploded(segments);
328 data.simplify(tolerance);
332 return data.getBezierSegments(queryBox);
354 virtual void print(QDebug dbg)
const;
#define RDEFAULT_RBOX
Definition RBox.h:35
#define RDEFAULT_MIN1
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RExplodable.h:30
Q_DECLARE_METATYPE(RMath *)
int i
Copyright (c) 2011-2018 by Andrew Mustun.
Definition autostart.js:32
Represents a box e.g.
Definition RBox.h:46
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
virtual int getComplexity() const
Definition REntity.h:675
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.
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition REntity.cpp:487
Abstract base class for exporters.
Definition RExporter.h:78
void setUndone(bool on)
Definition RObject.cpp: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
From
End used to specify from which end of a shape to measure a distance.
Definition RS.h:371
@ FromStart
Definition RS.h:372
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ EntitySpline
Spline.
Definition RS.h:276
static const double PointTolerance
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RS.h:920
Side
Side used for side of a point relative to an entity (right hand or left hand side)
Definition RS.h:313
Ending
Entity ending.
Definition RS.h:323
Stores and manages all data that defines the geometry and appearance of a spline entity.
Definition RSplineData.h:53
Spline entity.
Definition RSplineEntity.h:42
static RPropertyTypeId PropertyControlPointNX
Definition RSplineEntity.h:59
RVector getControlPointAt(int i) const
Definition RSplineEntity.h:237
double getTDelta() const
Definition RSplineEntity.h:131
QList< RVector > getControlPoints() const
Definition RSplineEntity.h:225
RPolyline toPolyline(int segments) const
Definition RSplineEntity.h:305
static RPropertyTypeId PropertyLayer
Definition RSplineEntity.h:51
static RPropertyTypeId PropertyDegree
Definition RSplineEntity.h:67
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition RSplineEntity.h:92
QList< RVector > getFitPoints() const
Definition RSplineEntity.h:241
double getTMax() const
Definition RSplineEntity.h:139
void removeFitPointAt(const RVector &point)
Definition RSplineEntity.h:217
void appendFitPoint(const RVector &point)
Definition RSplineEntity.h:205
static RPropertyTypeId PropertyTotalLength
Definition RSplineEntity.h:79
static RPropertyTypeId PropertyDisplayedColor
Definition RSplineEntity.h:56
bool isClosed() const
Definition RSplineEntity.h:189
int getDegree() const
Definition RSplineEntity.h:151
static RPropertyTypeId PropertyProtected
Definition RSplineEntity.h:47
static RPropertyTypeId PropertyFitPointNZ
Definition RSplineEntity.h:64
virtual void setUndone(bool on)
Definition RSplineEntity.h:112
RSplineData data
Definition RSplineEntity.h:357
double getTAtDistance(double distance) const
Definition RSplineEntity.h:147
static RPropertyTypeId PropertyLength
Definition RSplineEntity.h:78
QList< RVector > getControlPointsWrapped() const
Definition RSplineEntity.h:229
int countFitPoints() const
Definition RSplineEntity.h:249
RVector getStartPoint() const
Definition RSplineEntity.h:289
void setEndPoint(const RVector &ep)
Definition RSplineEntity.h:301
QList< double > getWeights() const
Definition RSplineEntity.h:265
RVector getPointAt(double t) const
Definition RSplineEntity.h:277
static RPropertyTypeId PropertyLinetypeScale
Definition RSplineEntity.h:53
QList< RSpline > getBezierSegments(const RBox &queryBox=RDEFAULT_RBOX) const
Definition RSplineEntity.h:331
static RPropertyTypeId PropertyHandle
Definition RSplineEntity.h:46
void appendControlPoint(const RVector &point)
Definition RSplineEntity.h:201
void simplify(double tolerance)
Definition RSplineEntity.h:327
QList< QSharedPointer< RShape > > getExploded(int segments=RDEFAULT_MIN1) const
Definition RSplineEntity.h:323
QList< RSpline > splitAtParams(const QList< double > ¶ms) const
Definition RSplineEntity.h:177
int countControlPoints() const
Definition RSplineEntity.h:233
RS::Side getSideOfPoint(const RVector &point) const
Definition RSplineEntity.h:317
static RPropertyTypeId PropertyBlock
Definition RSplineEntity.h:50
RVector getTangentAtEnd() const
Definition RSplineEntity.h:185
RVector getEndPoint() const
Definition RSplineEntity.h:293
static RPropertyTypeId PropertyUseEndTangent
Definition RSplineEntity.h:73
void insertFitPointAt(const RVector &point)
Definition RSplineEntity.h:213
virtual const RSplineData & getData() const
Definition RSplineEntity.h:121
RPolyline approximateWithArcs(double tolerance, double radiusLimit=RDEFAULT_MIN1) const
Definition RSplineEntity.h:309
bool isValid() const
Definition RSplineEntity.h:127
static RPropertyTypeId PropertyDrawOrder
Definition RSplineEntity.h:57
static RPropertyTypeId PropertyEndTangentY
Definition RSplineEntity.h:75
static RPropertyTypeId PropertyEndTangentX
Definition RSplineEntity.h:74
bool hasFitPoints() const
Definition RSplineEntity.h:245
bool trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition RSplineEntity.h:167
RVector getPointAtDistance(double distance) const
Definition RSplineEntity.h:281
double getLength() const
Definition RSplineEntity.h:273
RS::Ending getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)
Definition RSplineEntity.h:163
QList< RSpline > splitAtPoints(const QList< RVector > &points) const
Definition RSplineEntity.h:174
QList< double > getKnotVector() const
Definition RSplineEntity.h:257
static RPropertyTypeId PropertyControlPointNY
Definition RSplineEntity.h:60
bool reverse()
Definition RSplineEntity.h:313
static RPropertyTypeId PropertyStartTangentY
Definition RSplineEntity.h:71
static RPropertyTypeId PropertyEndTangentZ
Definition RSplineEntity.h:76
bool isPeriodic() const
Definition RSplineEntity.h:197
double getDirection1() const
Definition RSplineEntity.h:155
static RPropertyTypeId PropertyStartTangentX
Definition RSplineEntity.h:70
static RPropertyTypeId PropertyLinetype
Definition RSplineEntity.h:52
QSharedPointer< RSplineEntity > cloneToSplineEntity() const
Definition RSplineEntity.h:100
virtual RSplineData & getData()
Definition RSplineEntity.h:117
static RPropertyTypeId PropertyLineweight
Definition RSplineEntity.h:54
static RPropertyTypeId PropertyPeriodic
Definition RSplineEntity.h:66
static RPropertyTypeId PropertyStartTangentZ
Definition RSplineEntity.h:72
void setPeriodic(bool on)
Definition RSplineEntity.h:221
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RSplineEntity.h:45
RVector getTangentAtStart() const
Definition RSplineEntity.h:181
static RPropertyTypeId PropertyKnotN
Definition RSplineEntity.h:65
double getTMin() const
Definition RSplineEntity.h:135
void prependFitPoint(const RVector &point)
Definition RSplineEntity.h:209
bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition RSplineEntity.h:170
static RPropertyTypeId PropertyType
Definition RSplineEntity.h:49
bool isGeometricallyClosed(double tolerance=RS::PointTolerance) const
Definition RSplineEntity.h:193
static RPropertyTypeId PropertyUseStartTangent
Definition RSplineEntity.h:69
static RPropertyTypeId PropertyColor
Definition RSplineEntity.h:55
virtual QSharedPointer< RObject > clone() const
Definition RSplineEntity.h:96
static RPropertyTypeId PropertyControlPointNZ
Definition RSplineEntity.h:61
static RS::EntityType getRtti()
Definition RSplineEntity.h:88
QList< double > getActualKnotVector() const
Definition RSplineEntity.h:261
static RPropertyTypeId PropertyWorkingSet
Definition RSplineEntity.h:48
RVector getFitPointAt(int i) const
Definition RSplineEntity.h:253
double getTAtPoint(const RVector &point) const
Definition RSplineEntity.h:143
double getAngleAt(double distance, RS::From from=RS::FromStart) const
Definition RSplineEntity.h:285
static RPropertyTypeId PropertyFitPointNX
Definition RSplineEntity.h:62
double getDirection2() const
Definition RSplineEntity.h:159
void setStartPoint(const RVector &sp)
Definition RSplineEntity.h:297
static RPropertyTypeId PropertyFitPointNY
Definition RSplineEntity.h:63
Low-level mathematical representation of a spline.
Definition RSpline.h:59
Transaction implementation.
Definition RTransaction.h:73
Represents a 3d vector (x/y/z).
Definition RVector.h:47
static const RVector invalid
invalid vector
Definition RVector.h:335
#define QCADENTITY_EXPORT
Definition entity_global.h:10
char s
Definition opennurbs_string.cpp:32
#define NULL
Definition opennurbs_system.h:256