QCAD
Open Source 2D CAD
RLineData.h
Go to the documentation of this file.
1 
20 #ifndef RLINEDATA_H
21 #define RLINEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RLine.h"
29 #include "RVector.h"
30 
39 class QCADENTITY_EXPORT RLineData: public REntityData, protected RLine {
40 
41  friend class RLineEntity;
42 
43 protected:
45 
46 public:
47  RLineData();
48  RLineData(const RLine& line);
49  RLineData(const RVector& startPoint, const RVector& endPoint);
50 
52  return *this;
53  }
54 
55  virtual RPolyline getHull(double offset) const;
56 
58  return RLine::getStartPoint();
59  }
60  RVector getEndPoint() const {
61  return RLine::getEndPoint();
62  }
63  double getAngle() const {
64  return RLine::getAngle();
65  }
66  double getDirection1() const {
67  return RLine::getDirection1();
68  }
69  double getDirection2() const {
70  return RLine::getDirection2();
71  }
72  bool reverse() {
73  return RLine::reverse();
74  }
75 
76  RS::Ending getTrimEnd(const RVector& coord, const RVector& trimPoint) {
77  return RLine::getTrimEnd(coord, trimPoint);
78  }
79  void trimStartPoint(const RVector& p) {
80  return RLine::trimStartPoint(p);
81  }
82  void trimEndPoint(const RVector& p) {
83  return RLine::trimEndPoint(p);
84  }
85 
86  RS::Side getSideOfPoint(const RVector& point) const {
87  return RLine::getSideOfPoint(point);
88  }
89 
90  virtual QList<RVector> getReferencePoints(
92 
93  virtual bool moveReferencePoint(const RVector& referencePoint,
94  const RVector& targetPoint);
95 
96  virtual RShape* castToShape() {
97  return this;
98  }
99 
100  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
101  Q_UNUSED(queryBox)
102 
103  return QList<QSharedPointer<RShape> >() <<
104  QSharedPointer<RShape>(new RLine(*this));
105  }
106 };
107 
111 Q_DECLARE_METATYPE(QSharedPointer<RLineData>)
112 
113 #endif
RLineData data
Definition: RLineEntity.h:157
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
virtual RS::Ending getTrimEnd(const RVector &coord, const RVector &trimPoint)
Definition: RLine.cpp:337
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
RLine getLine()
Definition: RLineData.h:51
RS::Side getSideOfPoint(const RVector &point) const
Definition: RLine.cpp:188
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
virtual RPolyline getHull(double offset) const
Definition: REntityData.cpp:250
virtual RVector getStartPoint() const
Definition: RLine.cpp:88
virtual double getDirection2() const
Definition: RLine.cpp:84
RVector getEndPoint() const
Definition: RLineData.h:60
RS::Ending getTrimEnd(const RVector &coord, const RVector &trimPoint)
Definition: RLineData.h:76
virtual RShape * castToShape()
Definition: RLineData.h:96
RVector getStartPoint() const
Definition: RLineData.h:57
virtual bool reverse()
Definition: RLine.cpp:311
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:118
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: RLineData.h:100
Side
Side used for side of a point relativ to an entity (right hand or left hand side) ...
Definition: RS.h:129
double getAngle() const
Definition: RLine.cpp:72
virtual void trimEndPoint(const RVector &p)
Definition: RLine.cpp:364
Line entity.
Definition: RLineEntity.h:38
virtual QList< RVector > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
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 *)
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RLineData.h:39
double getAngle() const
Definition: RLineData.h:63
double getDirection1() const
Definition: RLineData.h:66
RS::Side getSideOfPoint(const RVector &point) const
Definition: RLineData.h:86
virtual RVector getEndPoint() const
Definition: RLine.cpp:96
Low-level mathematical representation of a line.
Definition: RLine.h:42
Definition: RS.h:119
bool reverse()
Definition: RLineData.h:72
void trimEndPoint(const RVector &p)
Definition: RLineData.h:82
RLine()
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RLine.cpp:28
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
virtual double getDirection1() const
Definition: RLine.cpp:80
Interface for geometrical shape classes.
Definition: RShape.h:52
void trimStartPoint(const RVector &p)
Definition: RLineData.h:79
virtual void trimStartPoint(const RVector &p)
Definition: RLine.cpp:356
double getDirection2() const
Definition: RLineData.h:69
RDocument * document
Definition: RObject.h:251