Open Source 2D CAD
Go to the documentation of this file.
20 #ifndef RSOLIDDATA_H
21 #define RSOLIDDATA_H
23 #include "entity_global.h"
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RPolyline.h"
29 #include "RVector.h"
41  friend class RSolidEntity;
43 protected:
46 public:
47  RSolidData();
48  RSolidData(const RTriangle& triangle);
49  RSolidData(const RVector& p1, const RVector& p2, const RVector& p3);
50  RSolidData(const RVector& p1, const RVector& p2, const RVector& p3, const RVector& p4);
52  virtual RS::EntityType getType() const {
53  return RS::EntitySolid;
54  }
56  return RPolyline::getStartPoint();
57  }
58  RVector getEndPoint() const {
59  return RPolyline::getEndPoint();
60  }
61  double getDirection1() const {
62  return RPolyline::getDirection1();
63  }
64  double getDirection2() const {
65  return RPolyline::getDirection2();
66  }
67  bool reverse() {
68  return RPolyline::reverse();
69  }
70  RVector getVertexAt(int i) const {
71  return RPolyline::getVertexAt(i);
72  }
73  int countVertices() const {
74  return RPolyline::countVertices();
75  }
77  RS::Ending getTrimEnd(const RVector& trimPoint, const RVector& clickPoint) {
78  return RPolyline::getTrimEnd(trimPoint, clickPoint);
79  }
80  bool trimStartPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid, bool extend = false) {
81  return RPolyline::trimStartPoint(trimPoint, clickPoint, extend);
82  }
83  bool trimEndPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid, bool extend = false) {
84  return RPolyline::trimEndPoint(trimPoint, clickPoint, extend);
85  }
87  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
89  virtual bool moveReferencePoint(const RVector& referencePoint,
90  const RVector& targetPoint);
92  virtual RShape* castToShape() {
93  return this;
94  }
96  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const {
97  Q_UNUSED(queryBox)
98  Q_UNUSED(ignoreComplex)
99  Q_UNUSED(segment)
101  return QList<QSharedPointer<RShape> >() <<
102  QSharedPointer<RShape>(new RPolyline(*this));
103  }
106  return *this;
107  }
108 };
113 Q_DECLARE_METATYPE(QSharedPointer<RSolidData>)
115 #endif
RVector getVertexAt(int i) const
Definition: RPolyline.cpp:479
Represents a box e.g.
Definition: RBox.h:43
Entity ending.
Definition: RS.h:204
Base class for all entity data classes.
Definition: REntityData.h:65
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Definition: RBox.h:32
virtual RS::Ending getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)
Definition: RPolyline.cpp:1836
int countVertices() const
Definition: RPolyline.cpp:528
Solid entity.
Definition: RSolidEntity.h:38
int countVertices() const
Definition: RSolidData.h:73
Entity types used for property handling / filtering.
Definition: RS.h:125
Definition: entity_global.h:10
bool trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RSolidData.h:80
bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RSolidData.h:83
Low-level mathematical representation of a triangle.
Definition: RTriangle.h:46
RSolidData data
Definition: RSolidEntity.h:151
RS::Ending getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)
Definition: RSolidData.h:77
RPolyline getGeometry()
Definition: RSolidData.h:105
virtual bool trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RPolyline.cpp:1843
double getDirection2() const
Definition: RSolidData.h:64
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RSolidData.h:39
double getDirection1() const
Definition: RSolidData.h:61
Sets the current rendering hint for exports.
Definition: RS.h:183
RVector getStartPoint() const
Definition: RSolidData.h:55
RVector getEndPoint() const
Definition: RSolidData.h:58
Definition: RS.h:151
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: RSolidData.h:96
virtual RVector getStartPoint() const
Definition: RPolyline.cpp:1252
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
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...
virtual RVector getEndPoint() const
Definition: RPolyline.cpp:1260
virtual bool reverse()
Definition: RPolyline.cpp:1796
virtual RShape * castToShape()
Definition: RSolidData.h:92
bool reverse()
Definition: RSolidData.h:67
virtual bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RPolyline.cpp:1850
RVector getVertexAt(int i) const
Definition: RSolidData.h:70
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
virtual double getDirection1() const
Definition: RPolyline.cpp:1306
Definition: RS.h:184
virtual RS::EntityType getType() const
Definition: RSolidData.h:52
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
virtual double getDirection2() const
Definition: RPolyline.cpp:1315
Interface for geometrical shape classes.
Definition: RShape.h:52
static const RVector invalid
invalid vector
Definition: RVector.h:322
Creates a polyline object without points.
Definition: RPolyline.cpp:36
RDocument * document
Definition: RObject.h:306