X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fconstructionline.cpp;fp=src%2Fbase%2Fconstructionline.cpp;h=923fca2f547b808c9f76f97f418070ce9f96969a;hb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;hp=877a64d422137ccff6180b6f4575155756f8f6bc;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/base/constructionline.cpp b/src/base/constructionline.cpp index 877a64d..923fca2 100644 --- a/src/base/constructionline.cpp +++ b/src/base/constructionline.cpp @@ -22,8 +22,8 @@ /** * Constructor. */ -RS_ConstructionLine::RS_ConstructionLine(RS_EntityContainer * parent, - const RS_ConstructionLineData & d): RS_AtomicEntity(parent), data(d) +ConstructionLine::ConstructionLine(EntityContainer * parent, + const ConstructionLineData & d): AtomicEntity(parent), data(d) { calculateBorders(); } @@ -31,19 +31,19 @@ RS_ConstructionLine::RS_ConstructionLine(RS_EntityContainer * parent, /** * Destructor. */ -RS_ConstructionLine::~RS_ConstructionLine() +ConstructionLine::~ConstructionLine() { } -RS_Entity * RS_ConstructionLine::clone() +Entity * ConstructionLine::clone() { - RS_ConstructionLine * c = new RS_ConstructionLine(*this); + ConstructionLine * c = new ConstructionLine(*this); c->initId(); return c; } /** @return RS2::EntityConstructionLine */ -/*virtual*/ RS2::EntityType RS_ConstructionLine::rtti() const +/*virtual*/ RS2::EntityType ConstructionLine::rtti() const { return RS2::EntityConstructionLine; } @@ -52,7 +52,7 @@ RS_Entity * RS_ConstructionLine::clone() * @todo * @return Start point of the entity. */ -/*virtual*/ Vector RS_ConstructionLine::getStartpoint() const +/*virtual*/ Vector ConstructionLine::getStartpoint() const { return Vector(false); } @@ -61,35 +61,35 @@ RS_Entity * RS_ConstructionLine::clone() * @todo * @return End point of the entity. */ -/*virtual*/ Vector RS_ConstructionLine::getEndpoint() const +/*virtual*/ Vector ConstructionLine::getEndpoint() const { return Vector(false); } /** @return Copy of data that defines the line. */ -RS_ConstructionLineData RS_ConstructionLine::getData() const +ConstructionLineData ConstructionLine::getData() const { return data; } /** @return First definition point. */ -Vector RS_ConstructionLine::getPoint1() const +Vector ConstructionLine::getPoint1() const { return data.point1; } /** @return Second definition point. */ -Vector RS_ConstructionLine::getPoint2() const +Vector ConstructionLine::getPoint2() const { return data.point2; } -void RS_ConstructionLine::calculateBorders() +void ConstructionLine::calculateBorders() { minV = Vector::minimum(data.point1, data.point2); maxV = Vector::maximum(data.point1, data.point2); } -Vector RS_ConstructionLine::getNearestEndpoint(const Vector & coord, double * dist) +Vector ConstructionLine::getNearestEndpoint(const Vector & coord, double * dist) { double dist1, dist2; Vector * nearerPoint; @@ -115,8 +115,8 @@ Vector RS_ConstructionLine::getNearestEndpoint(const Vector & coord, double * di return *nearerPoint; } -Vector RS_ConstructionLine::getNearestPointOnEntity(const Vector & coord, - bool /*onEntity*/, double * /*dist*/, RS_Entity ** entity) +Vector ConstructionLine::getNearestPointOnEntity(const Vector & coord, + bool /*onEntity*/, double * /*dist*/, Entity ** entity) { if (entity != NULL) *entity = this; @@ -136,7 +136,7 @@ Vector RS_ConstructionLine::getNearestPointOnEntity(const Vector & coord, return data.point1 + ba; } -Vector RS_ConstructionLine::getNearestCenter(const Vector & /*coord*/, double * dist) +Vector ConstructionLine::getNearestCenter(const Vector & /*coord*/, double * dist) { if (dist != NULL) *dist = RS_MAXDOUBLE; @@ -144,7 +144,7 @@ Vector RS_ConstructionLine::getNearestCenter(const Vector & /*coord*/, double * return Vector(false); } -Vector RS_ConstructionLine::getNearestMiddle(const Vector & /*coord*/, double * dist) +Vector ConstructionLine::getNearestMiddle(const Vector & /*coord*/, double * dist) { if (dist != NULL) *dist = RS_MAXDOUBLE; @@ -152,7 +152,7 @@ Vector RS_ConstructionLine::getNearestMiddle(const Vector & /*coord*/, double * return Vector(false); } -Vector RS_ConstructionLine::getNearestDist(double /*distance*/, const Vector & /*coord*/, +Vector ConstructionLine::getNearestDist(double /*distance*/, const Vector & /*coord*/, double * dist) { if (dist != NULL) @@ -161,11 +161,11 @@ Vector RS_ConstructionLine::getNearestDist(double /*distance*/, const Vector & / return Vector(false); } -double RS_ConstructionLine::getDistanceToPoint(const Vector& coord, - RS_Entity** entity, +double ConstructionLine::getDistanceToPoint(const Vector& coord, + Entity** entity, RS2::ResolveLevel /*level*/, double /*solidDist*/) { - RS_DEBUG->print("RS_ConstructionLine::getDistanceToPoint"); + DEBUG->print("ConstructionLine::getDistanceToPoint"); if (entity != NULL) *entity = this; @@ -180,11 +180,11 @@ double RS_ConstructionLine::getDistanceToPoint(const Vector& coord, return dist; // Orthogonal projection from both sides: - Vector ba = ae * Vector::dotP(ae, ap) / RS_Math::pow(ae.magnitude(), 2); - Vector be = ea * Vector::dotP(ea, ep) / RS_Math::pow(ea.magnitude(), 2); + Vector ba = ae * Vector::dotP(ae, ap) / Math::pow(ae.magnitude(), 2); + Vector be = ea * Vector::dotP(ea, ep) / Math::pow(ea.magnitude(), 2); - RS_DEBUG->print("ba: %f", ba.magnitude()); - RS_DEBUG->print("ae: %f", ae.magnitude()); + DEBUG->print("ba: %f", ba.magnitude()); + DEBUG->print("ae: %f", ae.magnitude()); Vector cp = Vector::crossP(ap, ae); dist = cp.magnitude() / ae.magnitude(); @@ -192,41 +192,41 @@ double RS_ConstructionLine::getDistanceToPoint(const Vector& coord, return dist; } -void RS_ConstructionLine::move(Vector offset) +void ConstructionLine::move(Vector offset) { data.point1.move(offset); data.point2.move(offset); //calculateBorders(); } -void RS_ConstructionLine::rotate(Vector center, double angle) +void ConstructionLine::rotate(Vector center, double angle) { data.point1.rotate(center, angle); data.point2.rotate(center, angle); //calculateBorders(); } -void RS_ConstructionLine::scale(Vector center, Vector factor) +void ConstructionLine::scale(Vector center, Vector factor) { data.point1.scale(center, factor); data.point2.scale(center, factor); //calculateBorders(); } -void RS_ConstructionLine::mirror(Vector axisPoint1, Vector axisPoint2) +void ConstructionLine::mirror(Vector axisPoint1, Vector axisPoint2) { data.point1.mirror(axisPoint1, axisPoint2); data.point2.mirror(axisPoint1, axisPoint2); } -/*virtual*/ void RS_ConstructionLine::draw(PaintInterface *, GraphicView *, double) +/*virtual*/ void ConstructionLine::draw(PaintInterface *, GraphicView *, double) { } /** * Dumps the point's data to stdout. */ -std::ostream & operator<<(std::ostream & os, const RS_ConstructionLine & l) +std::ostream & operator<<(std::ostream & os, const ConstructionLine & l) { os << " ConstructionLine: " << l.getData() << "\n"; return os;