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 
57  virtual RS::EntityType getType() const {
58  return RS::EntityEllipse;
59  }
61  return *this;
62  }
63 
64  QList<RVector> getFoci() const {
65  return REllipse::getFoci();
66  }
67  RVector getCenter() const {
68  return REllipse::getCenter();
69  }
70  double getMajorRadius() const {
71  return REllipse::getMajorRadius();
72  }
74  return REllipse::getMajorPoint();
75  }
77  return REllipse::getMinorPoint();
78  }
79  void setMinorPoint(const RVector& p) {
81  }
82  double getRatio() const {
83  return REllipse::getRatio();
84  }
85  double getAngle() const {
86  return REllipse::getAngle();
87  }
88  double getStartParam() const {
89  return REllipse::getStartParam();
90  }
91  double getEndParam() const {
92  return REllipse::getEndParam();
93  }
94  bool isFullEllipse() const {
95  return REllipse::isFullEllipse();
96  }
97 
98  double getParamTo(const RVector& pos) {
99  return REllipse::getParamTo(pos);
100  }
101 
102  double getLength() const {
103  return REllipse::getLength();
104  }
105 
106  double getSweep() const {
107  return REllipse::getSweep();
108  }
109 
110  RVector getPointAt(double angle) const {
111  return REllipse::getPointAt(angle);
112  }
113 
114  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
115 
116  virtual bool moveReferencePoint(const RVector& referencePoint, const RVector& targetPoint);
117 
118  virtual bool reverse() {
119  return REllipse::reverse();
120  }
121 
122  virtual RShape* castToShape() {
123  return this;
124  }
125 
126  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const {
127  Q_UNUSED(queryBox)
128  Q_UNUSED(ignoreComplex)
129  Q_UNUSED(segment)
130 
131  return QList<QSharedPointer<RShape> >() <<
132  QSharedPointer<RShape>(new REllipse(*this));
133  }
134 };
135 
139 Q_DECLARE_METATYPE(QSharedPointer<REllipseData>)
140 
141 #endif
Represents a box e.g.
Definition: RBox.h:43
Base class for all entity data classes.
Definition: REntityData.h:65
double getAngle() const
Definition: REllipseData.h:85
double getEndParam() const
Definition: REllipseData.h:91
virtual RShape * castToShape()
Definition: REllipseData.h:122
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
double getMajorRadius() const
Definition: REllipse.cpp:405
void setMinorPoint(const RVector &p)
Definition: REllipseData.h:79
void setMinorPoint(const RVector &p)
Sets the minor point relative to the center point.
Definition: REllipse.cpp:233
double getSweep() const
Definition: REllipse.cpp:973
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
Ellipse entity.
Definition: REllipseEntity.h:39
RVector getMajorPoint() const
Definition: REllipseData.h:73
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:498
bool isFullEllipse() const
Definition: REllipseData.h:94
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: REllipseData.h:126
double getMajorRadius() const
Definition: REllipseData.h:70
double getLength() const
Definition: REllipse.cpp:447
QList< RVector > getFoci() const
Definition: REllipse.cpp:59
double getRatio() const
Definition: REllipse.cpp:253
double getParamTo(const RVector &pos)
Definition: REllipseData.h:98
double getEndParam() const
Definition: REllipse.cpp:278
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:131
RVector getCenter() const
Definition: REllipse.cpp:197
Ellipse.
Definition: RS.h:101
double getStartParam() const
Definition: REllipseData.h:88
RVector getMajorPoint() const
Definition: REllipse.cpp:208
double getRatio() const
Definition: REllipseData.h:82
REllipse()
Creates an ellipse shape with invalid.
Definition: REllipse.cpp:30
bool isFullEllipse() const
Definition: REllipse.cpp:430
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
Q_DECLARE_METATYPE(RMath *)
Low-level mathematical representation of an ellipse or ellipse arc.
Definition: REllipse.h:42
REllipse getEllipse()
Definition: REllipseData.h:60
REllipseData data
Definition: REllipseEntity.h:245
double getSweep() const
Definition: REllipseData.h:106
double getStartParam() const
Definition: REllipse.cpp:266
virtual bool reverse()
Definition: REllipseData.h:118
Definition: RS.h:132
RVector getMinorPoint() const
Definition: REllipse.cpp:223
double getParamTo(const RVector &pos) const
Definition: REllipse.cpp:163
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: REllipseData.h:40
RVector getPointAt(double angle) const
Definition: REllipseData.h:110
RVector getMinorPoint() const
Definition: REllipseData.h:76
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: REntity.h:426
virtual bool reverse()
Definition: REllipse.cpp:901
Interface for geometrical shape classes.
Definition: RShape.h:52
QList< RVector > getFoci() const
Definition: REllipseData.h:64
double getAngle() const
Definition: REllipse.cpp:419
RVector getCenter() const
Definition: REllipseData.h:67
double getLength() const
Definition: REllipseData.h:102
virtual RS::EntityType getType() const
Definition: REllipseData.h:57
RVector getPointAt(double param) const
Definition: REllipse.cpp:183
RDocument * document
Definition: RObject.h:271