/**
* Holds the data that defines a line.
*/
-class RS_LineData
+class LineData
{
public:
/**
* Default constructor. Leaves the data object uninitialized.
*/
- RS_LineData() {}
+ LineData() {}
+ LineData(const Vector & start, const Vector & end): startpoint(start), endpoint(end) {}
- RS_LineData(const Vector & start, const Vector & end): startpoint(start), endpoint(end)
- {
-// this->startpoint = startpoint;
-// this->endpoint = endpoint;
- }
-
- friend class RS_Line;
- friend class RS_ActionDrawLine;
+ friend class Line;
+ friend class ActionDrawLine;
- friend std::ostream & operator<<(std::ostream & os, const RS_LineData & ld)
+ friend std::ostream & operator<<(std::ostream & os, const LineData & ld)
{
os << "(" << ld.startpoint << "/" << ld.endpoint << ")";
return os;
*
* @author Andrew Mustun
*/
-class RS_Line: public RS_AtomicEntity
+class Line: public AtomicEntity
{
public:
- //RS_Line(RS_EntityContainer* parent);
- //RS_Line(const RS_Line& l);
- RS_Line(RS_EntityContainer * parent, const RS_LineData & d);
- virtual ~RS_Line();
+ Line(EntityContainer * parent, const LineData & d);
+ virtual ~Line();
- virtual RS_Entity * clone();
+ virtual Entity * clone();
virtual RS2::EntityType rtti() const;
virtual bool isEdge() const;
- RS_LineData getData() const;
+ LineData getData() const;
virtual VectorSolutions getRefPoints();
virtual Vector getStartpoint() const;
virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL);
virtual Vector getNearestPointOnEntity(const Vector & coord,
- bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL);
+ bool onEntity = true, double * dist = NULL, Entity ** entity = NULL);
virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL);
virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL);
virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL);
virtual Vector getNearestDist(double distance, bool startp);
//virtual Vector getNearestRef(const Vector& coord, double* dist = NULL);
virtual double getDistanceToPoint(const Vector & coord,
- RS_Entity ** entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone,
+ Entity ** entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone,
double solidDist = RS_MAXDOUBLE);
virtual void move(Vector offset);
virtual void moveRef(const Vector & ref, const Vector & offset);
virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0);
- friend std::ostream & operator<<(std::ostream & os, const RS_Line & l);
+ friend std::ostream & operator<<(std::ostream & os, const Line & l);
virtual void calculateBorders();
protected:
- RS_LineData data;
+ LineData data;
};
#endif