X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Finfoarea.cpp;h=9309d60cc20e387b86fed7a16f1a9f1c15c13ac0;hb=2ee84c5948ede7fc2f7b4435c5edef42a030ac05;hp=1046349d95ef72f22fee3e817cc244ff114e763e;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/base/infoarea.cpp b/src/base/infoarea.cpp index 1046349..9309d60 100644 --- a/src/base/infoarea.cpp +++ b/src/base/infoarea.cpp @@ -22,14 +22,14 @@ /** * Constructor. */ -RS_InfoArea::RS_InfoArea() +InfoArea::InfoArea() { } /** * Destructor. */ -RS_InfoArea::~RS_InfoArea() +InfoArea::~InfoArea() { } @@ -38,7 +38,7 @@ RS_InfoArea::~RS_InfoArea() * * @param p co-ordinate of the point */ -void RS_InfoArea::addPoint(const Vector & p) +void InfoArea::addPoint(const Vector & p) { if (thePoints.empty()) baseY = p.y; @@ -49,7 +49,7 @@ void RS_InfoArea::addPoint(const Vector & p) /** * Resets the points. */ -void RS_InfoArea::reset() +void InfoArea::reset() { thePoints.clear(); area = 0.0; @@ -59,13 +59,13 @@ void RS_InfoArea::reset() /** * Closes the polygon if it is not closed already. */ -void RS_InfoArea::close() +void InfoArea::close() { if (isValid() && isClosed() == false) { thePoints.append(thePoints.first()); - RS_DEBUG->print("RS_InfoArea::close: closed"); + DEBUG->print("InfoArea::close: closed"); } } @@ -74,7 +74,7 @@ void RS_InfoArea::close() * identical) * @retval false Otherwise. */ -bool RS_InfoArea::isClosed() +bool InfoArea::isClosed() { return (thePoints.first().distanceTo(thePoints.last()) < 1.0e-4); } @@ -83,16 +83,16 @@ bool RS_InfoArea::isClosed() * @retval true If the area is defined (i.e. there are at least 3 points) * @retval false If there are only two or less points. */ -bool RS_InfoArea::isValid() +bool InfoArea::isValid() { - RS_DEBUG->print("RS_InfoArea::isValid: count: %d", thePoints.count()); + DEBUG->print("InfoArea::isValid: count: %d", thePoints.count()); return (thePoints.count() > 2); } /** * Calculates the area and the circumference of the area. */ -void RS_InfoArea::calculate() +void InfoArea::calculate() { area = 0.0; circumference = 0.0; @@ -131,17 +131,17 @@ void RS_InfoArea::calculate() area = fabs(area); } -double RS_InfoArea::getArea() +double InfoArea::getArea() { return area; } -double RS_InfoArea::getCircumference() +double InfoArea::getCircumference() { return circumference; } -int RS_InfoArea::count() +int InfoArea::count() { return thePoints.count(); } @@ -152,7 +152,7 @@ int RS_InfoArea::count() * @param p1 first point * @param p2 second point */ -double RS_InfoArea::calcSubArea(const Vector & p1, const Vector & p2) +double InfoArea::calcSubArea(const Vector & p1, const Vector & p2) { double width = p2.x - p1.x; double height = (p1.y - baseY) + (p2.y - baseY); @@ -165,7 +165,7 @@ double RS_InfoArea::calcSubArea(const Vector & p1, const Vector & p2) \param _p2 second point */ /*double -RS_InfoArea::calcDistance(Vector *_p1, Vector *_p2) +InfoArea::calcDistance(Vector *_p1, Vector *_p2) { return mtGetDistance(_p1->getX(), _p1->getY(), _p2->getX(), _p2->getY()); }*/