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, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
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
REllipseData::reverse
virtual bool reverse()
Definition: REllipseData.h:118
REllipseData::getType
virtual RS::EntityType getType() const
Definition: REllipseData.h:57
REntity.h
REllipse::getMajorPoint
RVector getMajorPoint() const
Definition: REllipse.cpp:376
REllipse::isFullEllipse
bool isFullEllipse() const
Definition: REllipse.cpp:598
REllipseData::getStartParam
double getStartParam() const
Definition: REllipseData.h:88
REllipse::getParamTo
double getParamTo(const RVector &pos) const
Definition: REllipse.cpp:331
REllipse::getEndParam
double getEndParam() const
Definition: REllipse.cpp:446
REllipseEntity
Ellipse entity.
Definition: REllipseEntity.h:39
RBox.h
REllipse::getLength
double getLength() const
Definition: REllipse.cpp:615
REllipseData::getSweep
double getSweep() const
Definition: REllipseData.h:106
REllipseData::getRatio
double getRatio() const
Definition: REllipseData.h:82
REntity::getReferencePoints
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: REntity.h:444
REllipse::reverse
virtual bool reverse()
Definition: REllipse.cpp:1077
REllipse::getAngle
double getAngle() const
Definition: REllipse.cpp:587
RVector
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
REllipse::getMajorRadius
double getMajorRadius() const
Definition: REllipse.cpp:573
RS::EntityType
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:125
REllipse::getFoci
QList< RVector > getFoci() const
Definition: REllipse.cpp:204
REllipseData::getEllipse
REllipse getEllipse()
Definition: REllipseData.h:60
RObject::document
RDocument * document
Definition: RObject.h:327
QCADENTITY_EXPORT
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
REllipseEntity::data
REllipseData data
Definition: REllipseEntity.h:247
REllipseData::getMajorRadius
double getMajorRadius() const
Definition: REllipseData.h:70
REllipse::getMinorPoint
RVector getMinorPoint() const
Definition: REllipse.cpp:391
REllipse::getPointAt
RVector getPointAt(double param) const
Definition: REllipse.cpp:351
REllipseData::getCenter
RVector getCenter() const
Definition: REllipseData.h:67
RShape
Interface for geometrical shape classes.
Definition: RShape.h:72
RPoint.h
REllipseData::getEndParam
double getEndParam() const
Definition: REllipseData.h:91
RDocument.h
REntity::moveReferencePoint
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
Moves the given reference point to the given target point or does nothing if this entity has no refer...
Definition: REntity.h:523
RVector.h
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(RMath *)
REllipseData::getLength
double getLength() const
Definition: REllipseData.h:102
REllipse::getStartParam
double getStartParam() const
Definition: REllipse.cpp:434
REntityData
Base class for all entity data classes.
Definition: REntityData.h:65
RDocument
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition: RDocument.h:68
REllipseData::setMinorPoint
void setMinorPoint(const RVector &p)
Definition: REllipseData.h:79
REllipse::setMinorPoint
void setMinorPoint(const RVector &p)
Sets the minor point relative to the center point.
Definition: REllipse.cpp:401
REllipseData::getPointAt
RVector getPointAt(double angle) const
Definition: REllipseData.h:110
REllipseData::getAngle
double getAngle() const
Definition: REllipseData.h:85
REllipseData::getParamTo
double getParamTo(const RVector &pos)
Definition: REllipseData.h:98
REllipse
Low-level mathematical representation of an ellipse or ellipse arc.
Definition: REllipse.h:42
REllipse::getSweep
double getSweep() const
Definition: REllipse.cpp:1149
REllipse::getRatio
double getRatio() const
Definition: REllipse.cpp:421
RS::EntityEllipse
@ EntityEllipse
Ellipse.
Definition: RS.h:151
REllipseData::castToShape
virtual RShape * castToShape()
Definition: REllipseData.h:122
REllipseData::isFullEllipse
bool isFullEllipse() const
Definition: REllipseData.h:94
REllipseData::getShapes
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: REllipseData.h:126
RS::ProjectionRenderingHint
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:184
REllipseData
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: REllipseData.h:40
REllipseData::getFoci
QList< RVector > getFoci() const
Definition: REllipseData.h:64
RDEFAULT_RBOX
#define RDEFAULT_RBOX
Definition: RBox.h:32
REllipseData::getMinorPoint
RVector getMinorPoint() const
Definition: REllipseData.h:76
REllipse.h
RS::RenderTop
@ RenderTop
Definition: RS.h:185
RBox
Represents a box e.g.
Definition: RBox.h:43
entity_global.h
REllipse::REllipse
REllipse()
Creates an ellipse shape with invalid.
Definition: REllipse.cpp:31
REllipse::getCenter
RVector getCenter() const
Definition: REllipse.cpp:365
REllipseData::getMajorPoint
RVector getMajorPoint() const
Definition: REllipseData.h:73