QCAD
Open Source 2D CAD
RArcData.h
Go to the documentation of this file.
1 
20 #ifndef RARCDATA_H
21 #define RARCDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RPoint.h"
29 #include "RVector.h"
30 #include "RArc.h"
31 
40 class QCADENTITY_EXPORT RArcData: public REntityData, protected RArc {
41 
42  friend class RArcEntity;
43 
44 protected:
46 
47 public:
48  RArcData();
49  RArcData(const RArc& arc);
50  RArcData(const RVector& center, double radius, double startAngle,
51  double endAngle, bool reversed = false);
52 
54  return *this;
55  }
56 
57  RVector getCenter() const {
58  return RArc::getCenter();
59  }
60  double getRadius() const {
61  return RArc::getRadius();
62  }
63  double getBulge() const {
64  return RArc::getBulge();
65  }
66  double getStartAngle() const {
67  return RArc::getStartAngle();
68  }
69  double getEndAngle() const {
70  return RArc::getEndAngle();
71  }
72  bool isReversed() const {
73  return RArc::isReversed();
74  }
75  double getDirection1() const {
76  return RArc::getDirection1();
77  }
78  double getDirection2() const {
79  return RArc::getDirection2();
80  }
81  bool reverse() {
82  return RArc::reverse();
83  }
84 
86  const RVector& trimPoint) {
87  return RArc::getTrimEnd(coord, trimPoint);
88  }
89  void trimStartPoint(const RVector& p) {
90  return RArc::trimStartPoint(p);
91  }
92  void trimEndPoint(const RVector& p) {
93  return RArc::trimEndPoint(p);
94  }
95 
96  double getLength() const {
97  return RArc::getLength();
98  }
99  double getAngleLength(bool allowForZeroLength = false) const {
100  return RArc::getAngleLength(allowForZeroLength);
101  }
102 
103  virtual QList<RVector> getReferencePoints(
105 
106  virtual bool moveReferencePoint(const RVector& referencePoint,
107  const RVector& targetPoint);
108 
109  RPolyline approximateWithLines(double segmentLength) {
110  return RArc::approximateWithLines(segmentLength);
111  }
112 
113  virtual RShape* castToShape() {
114  return this;
115  }
116 
117  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
118  Q_UNUSED(queryBox)
119 
120  return QList<QSharedPointer<RShape> >() <<
121  QSharedPointer<RShape>(new RArc(*this));
122  }
123 };
124 
128 Q_DECLARE_METATYPE(QSharedPointer<RArcData>)
129 
130 #endif
Represents a box e.g.
Definition: RBox.h:43
Ending
Entity ending.
Definition: RS.h:136
Base class for all entity data classes.
Definition: REntityData.h:64
double getRadius() const
Definition: RArc.cpp:361
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
void trimEndPoint(const RVector &p)
Definition: RArcData.h:92
double getRadius() const
Definition: RArcData.h:60
double getAngleLength(bool allowForZeroLength=false) const
Definition: RArcData.h:99
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
Low-level mathematical representation of an arc.
Definition: RArc.h:41
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint)
Moves the given reference point to the given target point or does nothing if this entity has no refer...
Definition: REntity.h:470
RPolyline approximateWithLines(double segmentLength)
Definition: RArcData.h:109
RS::Ending getTrimEnd(const RVector &coord, const RVector &trimPoint)
Definition: RArcData.h:85
RVector getCenter() const
Definition: RArc.cpp:353
double getBulge() const
Definition: RArc.cpp:244
virtual bool reverse()
Definition: RArc.cpp:603
Arc entity.
Definition: RArcEntity.h:39
RArc getArc()
Definition: RArcData.h:53
virtual void trimEndPoint(const RVector &p)
Definition: RArc.cpp:680
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:118
double getStartAngle() const
Definition: RArcData.h:66
double getLength() const
Definition: RArcData.h:96
bool isReversed() const
Definition: RArcData.h:72
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: RArcData.h:117
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
Q_DECLARE_METATYPE(RMath *)
bool isReversed() const
Definition: RArc.cpp:413
RPolyline approximateWithLines(double segmentLength)
Definition: RArc.cpp:695
double getDirection2() const
Definition: RArcData.h:78
double getAngleLength(bool allowForZeroLength=false) const
Definition: RArc.cpp:300
virtual RShape * castToShape()
Definition: RArcData.h:113
double getDirection1() const
Definition: RArc.cpp:183
Definition: RS.h:119
virtual QList< RVector > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: REntity.h:398
double getDirection1() const
Definition: RArcData.h:75
double getDirection2() const
Definition: RArc.cpp:192
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RArcData.h:40
RArc()
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RArc.cpp:29
void trimStartPoint(const RVector &p)
Definition: RArcData.h:89
virtual void trimStartPoint(const RVector &p)
Definition: RArc.cpp:676
double getLength() const
Definition: RArc.cpp:253
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
double getBulge() const
Definition: RArcData.h:63
Interface for geometrical shape classes.
Definition: RShape.h:52
bool reverse()
Definition: RArcData.h:81
virtual RS::Ending getTrimEnd(const RVector &coord, const RVector &trimPoint)
Definition: RArc.cpp:657
double getEndAngle() const
Definition: RArcData.h:69
double getEndAngle() const
Definition: RArc.cpp:377
double getStartAngle() const
Definition: RArc.cpp:369
RVector getCenter() const
Definition: RArcData.h:57
RArcData data
Definition: RArcEntity.h:187
RDocument * document
Definition: RObject.h:251