4 #include "rs_atomicentity.h"
8 * Holds the data that defines a solid.
14 * Default constructor. Leaves the data object uninitialized.
18 for(int i=0; i<4; ++i)
19 corner[i] = Vector(false);
23 * Constructor for a solid with 3 corners.
25 RS_SolidData(const Vector & corner1, const Vector & corner2, const Vector & corner3)
30 corner[3] = Vector(false);
34 * Constructor for a solid with 4 corners.
36 RS_SolidData(const Vector & corner1, const Vector & corner2, const Vector & corner3, const Vector & corner4)
44 friend class RS_Solid;
46 friend std::ostream & operator<<(std::ostream & os, const RS_SolidData & pd)
50 for(int i=0; i<4; i++)
62 * Class for a solid entity (e.g. dimension arrows).
64 * @author Andrew Mustun
66 class RS_Solid: public RS_AtomicEntity
69 RS_Solid(RS_EntityContainer * parent, const RS_SolidData & d);
71 virtual RS_Entity * clone();
72 virtual RS2::EntityType rtti() const;
73 virtual Vector getStartpoint() const;
74 virtual Vector getEndpoint() const;
75 RS_SolidData getData() const;
77 Vector getCorner(int num);
78 void shapeArrow(const Vector & point, double angle, double arrowSize);
80 virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL);
81 virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true,
82 double * dist = NULL, RS_Entity ** entity = NULL);
83 virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL);
84 virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL);
85 virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL);
86 virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL,
87 RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE);
88 virtual void move(Vector offset);
89 virtual void rotate(Vector center, double angle);
90 virtual void scale(Vector center, Vector factor);
91 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
92 virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0);
94 friend std::ostream & operator<<(std::ostream & os, const RS_Solid & p);
96 /** Recalculates the borders of this entity. */
97 virtual void calculateBorders ();