QCAD
Open Source 2D CAD
RDirected.h
Go to the documentation of this file.
1 
20 #ifndef RDIRECTED_H
21 #define RDIRECTED_H
22 
23 #include "../core_global.h"
24 
25 #include <QSharedPointer>
26 
27 #include "RShape.h"
28 
37 public:
38  virtual ~RDirected() {}
39 
40  virtual double getDirection1() const = 0;
41  virtual double getDirection2() const = 0;
42 
43  virtual RS::Side getSideOfPoint(const RVector& point) const = 0;
44 
45  virtual RVector getStartPoint() const = 0;
46  virtual RVector getEndPoint() const = 0;
47 
48  virtual bool reverse() = 0;
49 
54  virtual bool trimStartPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid) = 0;
55 
60  virtual bool trimEndPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid) = 0;
61 
66  virtual RS::Ending getTrimEnd(const RVector& trimPoint, const RVector& clickPoint) = 0;
67 
72  virtual double getDistanceFromStart(const RVector& p) const {
73  Q_UNUSED(p)
74  return RMAXDOUBLE;
75  }
76 };
77 
80 Q_DECLARE_METATYPE(QSharedPointer<RDirected>)
81 Q_DECLARE_METATYPE(QSharedPointer<RDirected>*)
82 
83 #endif
Ending
Entity ending.
Definition: RS.h:149
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define QCADCORE_EXPORT
Definition: core_global.h:10
virtual ~RDirected()
Definition: RDirected.h:38
Side
Side used for side of a point relativ to an entity (right hand or left hand side) ...
Definition: RS.h:139
virtual double getDistanceFromStart(const RVector &p) const
Definition: RDirected.h:72
Q_DECLARE_METATYPE(RMath *)
void trimEndPoint(void shape, void trimPoint, void clickPoint)
Definition: library.js:182
#define RMAXDOUBLE
Definition: RMath.h:63
void trimStartPoint(void shape, void trimPoint, void clickPoint)
Definition: library.js:676
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDirected.h:36
static const RVector invalid
invalid vector
Definition: RVector.h:307