QCAD
Open Source 2D CAD
RXLineData.h
Go to the documentation of this file.
1 
20 #ifndef RXLINEDATA_H
21 #define RXLINEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RVector.h"
29 #include "RXLine.h"
30 
39 class QCADENTITY_EXPORT RXLineData: public REntityData, protected RXLine {
40 
41  friend class RXLineEntity;
42 
43 protected:
45 
46 public:
47  RXLineData();
48  RXLineData(const RXLine& line);
49  RXLineData(const RVector& basePoint, const RVector& dir);
50 
51  virtual RS::EntityType getType() const {
52  return RS::EntityXLine;
53  }
55  return *this;
56  }
57 
59  return RXLine::getBasePoint();
60  }
63  }
64  double getAngle() const {
65  return RXLine::getAngle();
66  }
67 
68  bool hasFixedAngle() const {
69  return fixedAngle;
70  }
71 
72  void setFixedAngle(bool on) {
73  fixedAngle = on;
74  }
75 
76  bool reverse() {
77  return RXLine::reverse();
78  }
79 
80  RS::Ending getTrimEnd(const RVector& trimPoint, const RVector& clickPoint) {
81  return RXLine::getTrimEnd(trimPoint, clickPoint);
82  }
83  bool trimStartPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid, bool extend = false) {
84  return RXLine::trimStartPoint(trimPoint, clickPoint, extend);
85  }
86  bool trimEndPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid, bool extend = false) {
87  return RXLine::trimEndPoint(trimPoint, clickPoint, extend);
88  }
89 
90  RS::Side getSideOfPoint(const RVector& point) const {
91  return RXLine::getSideOfPoint(point);
92  }
93 
94  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
95 
96  virtual bool moveReferencePoint(const RVector& referencePoint, const RVector& targetPoint);
97 
98  virtual RShape* castToShape() {
99  return this;
100  }
101 
102  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const {
103  Q_UNUSED(queryBox)
104  Q_UNUSED(ignoreComplex)
105  Q_UNUSED(segment)
106 
107  return QList<QSharedPointer<RShape> >() <<
108  QSharedPointer<RShape>(new RXLine(*this));
109  }
110 
111 private:
113 };
114 
118 Q_DECLARE_METATYPE(QSharedPointer<RXLineData>)
119 
120 #endif
virtual bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RXLine.cpp:116
Represents a box e.g.
Definition: RBox.h:43
Ending
Entity ending.
Definition: RS.h:204
Base class for all entity data classes.
Definition: REntityData.h:65
RXLine getXLine()
Definition: RXLineData.h:54
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
RVector getDirectionVector() const
Definition: RXLineData.h:61
#define RDEFAULT_RBOX
Definition: RBox.h:32
virtual RS::Side getSideOfPoint(const RVector &point) const
Definition: RXLine.cpp:93
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:125
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
void setFixedAngle(bool on)
Definition: RXLineData.h:72
RXLine()
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RXLine.cpp:27
RS::Ending getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)
Definition: RXLineData.h:80
virtual bool trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RXLine.cpp:105
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:183
Side
Side used for side of a point relativ to an entity (right hand or left hand side) ...
Definition: RS.h:194
bool reverse()
Definition: RXLineData.h:76
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RXLineData.h:39
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RXLineData.h:86
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint)=0
Moves the given reference point to the given target point or does nothing if this entity has no refer...
Q_DECLARE_METATYPE(RMath *)
virtual bool reverse()
Definition: RXLine.cpp:261
bool trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RXLineData.h:83
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: RXLineData.h:102
bool fixedAngle
Definition: RXLineData.h:112
RXLineData data
Definition: RXLineEntity.h:171
virtual RS::Ending getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)
Definition: RXLine.cpp:128
virtual RS::EntityType getType() const
Definition: RXLineData.h:51
Low-level mathematical representation of an infinite line.
Definition: RXLine.h:42
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
double getAngle() const
Definition: RXLine.cpp:72
Definition: RS.h:184
double getAngle() const
Definition: RXLineData.h:64
RVector getBasePoint() const
Definition: RXLineData.h:58
XLine.
Definition: RS.h:145
RS::Side getSideOfPoint(const RVector &point) const
Definition: RXLineData.h:90
virtual RShape * castToShape()
Definition: RXLineData.h:98
Infinite line entity.
Definition: RXLineEntity.h:38
RVector getBasePoint() const
Definition: RXLine.cpp:145
Interface for geometrical shape classes.
Definition: RShape.h:52
static const RVector invalid
invalid vector
Definition: RVector.h:322
RVector getDirectionVector() const
Definition: RXLine.cpp:161
bool hasFixedAngle() const
Definition: RXLineData.h:68
RDocument * document
Definition: RObject.h:306