]> Shamusworld >> Repos - architektonas/blobdiff - src/base/solid.cpp
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / base / solid.cpp
index 5fcb0440ffcfaf6cfd1cd5a2d7ae7aad091eff9e..11eb76ab521e3358b79a407bf30258f8e4ba33dd 100644 (file)
 /**
  * Default constructor.
  */
-RS_Solid::RS_Solid(RS_EntityContainer * parent, const RS_SolidData & d):
-       RS_AtomicEntity(parent), data(d)
+Solid::Solid(EntityContainer * parent, const SolidData & d):
+       AtomicEntity(parent), data(d)
 {
        calculateBorders();
 }
 
-/*virtual*/ RS_Entity * RS_Solid::clone()
+/*virtual*/ Entity * Solid::clone()
 {
-       RS_Solid * s = new RS_Solid(*this);
+       Solid * s = new Solid(*this);
        s->initId();
        return s;
 }
 
 /**    @return RS_ENTITY_POINT */
-/*virtual*/ RS2::EntityType RS_Solid::rtti() const
+/*virtual*/ RS2::EntityType Solid::rtti() const
 {
        return RS2::EntitySolid;
 }
@@ -45,7 +45,7 @@ RS_Solid::RS_Solid(RS_EntityContainer * parent, const RS_SolidData & d):
 /**
  * @return Start point of the entity.
  */
-/*virtual*/ Vector RS_Solid::getStartpoint() const
+/*virtual*/ Vector Solid::getStartpoint() const
 {
        return Vector(false);
 }
@@ -53,19 +53,19 @@ RS_Solid::RS_Solid(RS_EntityContainer * parent, const RS_SolidData & d):
 /**
  * @return End point of the entity.
  */
-/*virtual*/ Vector RS_Solid::getEndpoint() const
+/*virtual*/ Vector Solid::getEndpoint() const
 {
        return Vector(false);
 }
 
 /** @return Copy of data that defines the point. */
-RS_SolidData RS_Solid::getData() const
+SolidData Solid::getData() const
 {
        return data;
 }
 
 /** @return true if this is a triangle. */
-bool RS_Solid::isTriangle()
+bool Solid::isTriangle()
 {
        return !data.corner[3].valid;
 }
@@ -73,13 +73,13 @@ bool RS_Solid::isTriangle()
 /**
  * @return Corner number 'num'.
  */
-Vector RS_Solid::getCorner(int num)
+Vector Solid::getCorner(int num)
 {
        if (num >= 0 && num < 4)
                return data.corner[num];
        else
        {
-               RS_DEBUG->print("Illegal corner requested from Solid", RS_Debug::D_WARNING);
+               DEBUG->print("Illegal corner requested from Solid", Debug::D_WARNING);
                return Vector(false);
        }
 }
@@ -91,7 +91,7 @@ Vector RS_Solid::getCorner(int num)
  * @param angle Direction of the arrow.
  * @param arrowSize Size of arrow (length).
  */
-void RS_Solid::shapeArrow(const Vector & point, double angle, double arrowSize)
+void Solid::shapeArrow(const Vector & point, double angle, double arrowSize)
 {
        double cosv1, sinv1, cosv2, sinv2;
        double arrowSide = arrowSize / cos(0.165);
@@ -109,7 +109,7 @@ void RS_Solid::shapeArrow(const Vector & point, double angle, double arrowSize)
        calculateBorders();
 }
 
-void RS_Solid::calculateBorders()
+void Solid::calculateBorders()
 {
        resetBorders();
 
@@ -123,7 +123,7 @@ void RS_Solid::calculateBorders()
        }
 }
 
-Vector RS_Solid::getNearestEndpoint(const Vector & coord, double * dist)
+Vector Solid::getNearestEndpoint(const Vector & coord, double * dist)
 {
        double minDist = RS_MAXDOUBLE;
        double curDist;
@@ -152,14 +152,14 @@ Vector RS_Solid::getNearestEndpoint(const Vector & coord, double * dist)
 /**
  * @todo Implement this.
  */
-Vector RS_Solid::getNearestPointOnEntity(const Vector & /*coord*/, bool /*onEntity*/,
-       double * /*dist*/, RS_Entity ** /*entity*/)
+Vector Solid::getNearestPointOnEntity(const Vector & /*coord*/, bool /*onEntity*/,
+       double * /*dist*/, Entity ** /*entity*/)
 {
        Vector ret(false);
        return ret;
 }
 
-Vector RS_Solid::getNearestCenter(const Vector & /*coord*/, double * dist)
+Vector Solid::getNearestCenter(const Vector & /*coord*/, double * dist)
 {
        if (dist)
                *dist = RS_MAXDOUBLE;
@@ -167,7 +167,7 @@ Vector RS_Solid::getNearestCenter(const Vector & /*coord*/, double * dist)
        return Vector(false);
 }
 
-Vector RS_Solid::getNearestMiddle(const Vector & /*coord*/, double * dist)
+Vector Solid::getNearestMiddle(const Vector & /*coord*/, double * dist)
 {
        if (dist)
                *dist = RS_MAXDOUBLE;
@@ -175,7 +175,7 @@ Vector RS_Solid::getNearestMiddle(const Vector & /*coord*/, double * dist)
        return Vector(false);
 }
 
-Vector RS_Solid::getNearestDist(double /*distance*/, const Vector & /*coord*/, double * dist)
+Vector Solid::getNearestDist(double /*distance*/, const Vector & /*coord*/, double * dist)
 {
        if (dist)
                *dist = RS_MAXDOUBLE;
@@ -188,13 +188,13 @@ Vector RS_Solid::getNearestDist(double /*distance*/, const Vector & /*coord*/, d
  *
  * @todo implement
  */
-double RS_Solid::getDistanceToPoint(const Vector & /*coord*/, RS_Entity ** /*entity*/,
+double Solid::getDistanceToPoint(const Vector & /*coord*/, Entity ** /*entity*/,
        RS2::ResolveLevel /*level*/, double /*solidDist*/)
 {
        return RS_MAXDOUBLE;
 }
 
-void RS_Solid::move(Vector offset)
+void Solid::move(Vector offset)
 {
        for(int i=0; i<4; ++i)
                data.corner[i].move(offset);
@@ -202,7 +202,7 @@ void RS_Solid::move(Vector offset)
        calculateBorders();
 }
 
-void RS_Solid::rotate(Vector center, double angle)
+void Solid::rotate(Vector center, double angle)
 {
        for(int i=0; i<4; ++i)
                data.corner[i].rotate(center, angle);
@@ -210,7 +210,7 @@ void RS_Solid::rotate(Vector center, double angle)
        calculateBorders();
 }
 
-void RS_Solid::scale(Vector center, Vector factor)
+void Solid::scale(Vector center, Vector factor)
 {
        for(int i=0; i<4; ++i)
                data.corner[i].scale(center, factor);
@@ -218,7 +218,7 @@ void RS_Solid::scale(Vector center, Vector factor)
        calculateBorders();
 }
 
-void RS_Solid::mirror(Vector axisPoint1, Vector axisPoint2)
+void Solid::mirror(Vector axisPoint1, Vector axisPoint2)
 {
        for(int i=0; i<4; ++i)
                data.corner[i].mirror(axisPoint1, axisPoint2);
@@ -226,12 +226,12 @@ void RS_Solid::mirror(Vector axisPoint1, Vector axisPoint2)
        calculateBorders();
 }
 
-void RS_Solid::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/)
+void Solid::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/)
 {
        if (!painter || !view)
                return;
 
-       RS_SolidData d = getData();
+       SolidData d = getData();
 
        if (isTriangle())
                painter->fillTriangle(view->toGui(getCorner(0)), view->toGui(getCorner(1)),
@@ -241,7 +241,7 @@ void RS_Solid::draw(PaintInterface * painter, GraphicView * view, double /*patte
 /**
  * Dumps the point's data to stdout.
  */
-std::ostream & operator<<(std::ostream & os, const RS_Solid & p)
+std::ostream & operator<<(std::ostream & os, const Solid & p)
 {
        os << " Solid: " << p.getData() << "\n";
        return os;