/**
* 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;
}
/**
* @return Start point of the entity.
*/
-/*virtual*/ Vector RS_Solid::getStartpoint() const
+/*virtual*/ Vector Solid::getStartpoint() const
{
return Vector(false);
}
/**
* @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;
}
/**
* @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);
}
}
* @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);
calculateBorders();
}
-void RS_Solid::calculateBorders()
+void Solid::calculateBorders()
{
resetBorders();
}
}
-Vector RS_Solid::getNearestEndpoint(const Vector & coord, double * dist)
+Vector Solid::getNearestEndpoint(const Vector & coord, double * dist)
{
double minDist = RS_MAXDOUBLE;
double curDist;
/**
* @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;
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;
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;
*
* @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);
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);
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);
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);
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)),
/**
* 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;