QCAD
Open Source 2D CAD
REllipseData.h
Go to the documentation of this file.
1 
20 #ifndef RELLIPSEDATA_H
21 #define RELLIPSEDATA_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 "REllipse.h"
31 
41 
42  friend class REllipseEntity;
43 
44 protected:
46 
47 public:
48  REllipseData();
49  REllipseData(const REllipse& ellipse);
51  const RVector& center,
52  const RVector& majorPoint,
53  double ratio,
54  double startParam, double endParam,
55  bool reversed = false);
56 
58  return *this;
59  }
60 
61  QList<RVector> getFoci() const {
62  return REllipse::getFoci();
63  }
64  RVector getCenter() const {
65  return REllipse::getCenter();
66  }
67  double getMajorRadius() const {
68  return REllipse::getMajorRadius();
69  }
71  return REllipse::getMajorPoint();
72  }
74  return REllipse::getMinorPoint();
75  }
76  void setMinorPoint(const RVector& p) {
78  }
79  double getRatio() const {
80  return REllipse::getRatio();
81  }
82  double getAngle() const {
83  return REllipse::getAngle();
84  }
85  double getStartParam() const {
86  return REllipse::getStartParam();
87  }
88  double getEndParam() const {
89  return REllipse::getEndParam();
90  }
91  bool isFullEllipse() const {
92  return REllipse::isFullEllipse();
93  }
94 
95  double getParamTo(const RVector& pos) {
96  return REllipse::getParamTo(pos);
97  }
98 
99  double getLength() const {
100  return REllipse::getLength();
101  }
102 
103  double getSweep() const {
104  return REllipse::getSweep();
105  }
106 
107  RVector getPointAt(double angle) const {
108  return REllipse::getPointAt(angle);
109  }
110 
111  virtual QList<RVector> getReferencePoints(
113 
114  virtual bool moveReferencePoint(const RVector& referencePoint,
115  const RVector& targetPoint);
116 
117  virtual bool reverse() {
118  return REllipse::reverse();
119  }
120 
121  virtual RShape* castToShape() {
122  return this;
123  }
124 
125  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
126  Q_UNUSED(queryBox)
127 
128  return QList<QSharedPointer<RShape> >() <<
129  QSharedPointer<RShape>(new REllipse(*this));
130  }
131 };
132 
136 Q_DECLARE_METATYPE(QSharedPointer<REllipseData>)
137 
138 #endif
Represents a box e.g.
Definition: RBox.h:43
Base class for all entity data classes.
Definition: REntityData.h:64
double getAngle() const
Definition: REllipseData.h:82
double getEndParam() const
Definition: REllipseData.h:88
virtual RShape * castToShape()
Definition: REllipseData.h:121
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
double getMajorRadius() const
Definition: REllipse.cpp:348
void setMinorPoint(const RVector &p)
Definition: REllipseData.h:76
void setMinorPoint(const RVector &p)
Sets the minor point relative to the center point.
Definition: REllipse.cpp:192
double getSweep() const
Definition: REllipse.cpp:882
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
Ellipse entity.
Definition: REllipseEntity.h:39
RVector getMajorPoint() const
Definition: REllipseData.h:70
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
bool isFullEllipse() const
Definition: REllipseData.h:91
double getMajorRadius() const
Definition: REllipseData.h:67
double getLength() const
Definition: REllipse.cpp:390
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: REllipseData.h:125
QList< RVector > getFoci() const
Definition: REllipse.cpp:57
double getRatio() const
Definition: REllipse.cpp:212
double getParamTo(const RVector &pos)
Definition: REllipseData.h:95
double getEndParam() const
Definition: REllipse.cpp:229
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:118
RVector getCenter() const
Definition: REllipse.cpp:156
double getStartParam() const
Definition: REllipseData.h:85
RVector getMajorPoint() const
Definition: REllipse.cpp:167
double getRatio() const
Definition: REllipseData.h:79
REllipse()
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: REllipse.cpp:28
bool isFullEllipse() const
Definition: REllipse.cpp:373
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
Q_DECLARE_METATYPE(RMath *)
Low-level mathematical representation of an ellipse or ellipse arc.
Definition: REllipse.h:41
REllipse getEllipse()
Definition: REllipseData.h:57
REllipseData data
Definition: REllipseEntity.h:226
double getSweep() const
Definition: REllipseData.h:103
double getStartParam() const
Definition: REllipse.cpp:221
virtual bool reverse()
Definition: REllipseData.h:117
Definition: RS.h:119
virtual QList< RVector > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: REntity.h:398
RVector getMinorPoint() const
Definition: REllipse.cpp:182
RVector getPointAt(double angle) const
Definition: REllipse.cpp:142
double getParamTo(const RVector &pos) const
Definition: REllipse.cpp:122
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: REllipseData.h:40
RVector getPointAt(double angle) const
Definition: REllipseData.h:107
RVector getMinorPoint() const
Definition: REllipseData.h:73
virtual bool reverse()
Definition: REllipse.cpp:816
Interface for geometrical shape classes.
Definition: RShape.h:52
QList< RVector > getFoci() const
Definition: REllipseData.h:61
double getAngle() const
Definition: REllipse.cpp:362
RVector getCenter() const
Definition: REllipseData.h:64
double getLength() const
Definition: REllipseData.h:99
RDocument * document
Definition: RObject.h:251