/**
* 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();
}
/**
* 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;
}
* @todo
* @return Start point of the entity.
*/
-/*virtual*/ Vector RS_ConstructionLine::getStartpoint() const
+/*virtual*/ Vector ConstructionLine::getStartpoint() const
{
return Vector(false);
}
* @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;
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;
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;
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;
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)
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;
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();
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;