#include <PfieldGeometry.h>
Inheritance diagram for Polygon:
Public Member Functions | |
void | addPoint (const PfVec &p) |
Adds a point to the polygon. | |
GeometryType | getType () const |
Returns the type of a geometric object. | |
PfieldGeometricObject * | clone () const |
Clones a polygon. | |
double | distanceTo (const PfPose &base, const PfVec &pos, PfVec &contact) const |
Computes the distance from the border of the object to a given point. | |
virtual void | initRadiusOfCollisionCircle () |
Computes value of the radiusOfCollisionCircle variable. | |
PfieldGeometricObject * | getAbs (const PfPose &base) const |
Returns a geometric object with absolute coordinates. | |
virtual void | getPoints (std::vector< PfVec > &points) |
Returns all points of the object. | |
bool | pointInside (const PfVec &point) const |
Tests if a point is inside the polygon. | |
void | setAbsoluteFromOther (const PfPose &base, PfieldGeometricObject *other) |
Computes absolute coordinates from a base pose and another, relative polygon. | |
Public Attributes | |
std::vector< PfVec > | pts |
A list of points. |
Definition at line 168 of file PfieldGeometry.h.
|
Adds a point to the polygon.
Definition at line 177 of file PfieldGeometry.h. References pts. Referenced by Parser::parseGeometricObject(). |
|
Returns the type of a geometric object.
Implements PfieldGeometricObject. Definition at line 183 of file PfieldGeometry.h. References GeometryType, and POLYGON. |
|
Clones a polygon.
Implements PfieldGeometricObject. Definition at line 583 of file PfieldGeometry.cpp. References PfieldGeometricObject::intersectable, PfieldGeometricObject::position, pts, and PfieldGeometricObject::radiusOfCollisionCircle. Referenced by getAbs(). |
|
Computes the distance from the border of the object to a given point.
Implements PfieldGeometricObject. Definition at line 472 of file PfieldGeometry.cpp. References PfVec::distanceTo(), pointInside(), pointPerpendicularToLine(), PfPose::pos, pts, PfVec::rotate(), and PfPose::rotation. Referenced by SingleFormation::getPosition(). |
Here is the call graph for this function:
|
Computes value of the radiusOfCollisionCircle variable.
Implements PfieldGeometricObject. Definition at line 515 of file PfieldGeometry.cpp. References pts. Referenced by Parser::parseGeometricObject(), AmongFormation::updateGeometry(), and BetweenFormation::updateGeometry(). |
|
Returns a geometric object with absolute coordinates.
Implements PfieldGeometricObject. Definition at line 557 of file PfieldGeometry.cpp. References clone(), PfPose::pos, pts, and PfPose::rotation. |
Here is the call graph for this function:
|
Returns all points of the object.
Reimplemented from PfieldGeometricObject. Definition at line 595 of file PfieldGeometry.cpp. |
|
Tests if a point is inside the polygon.
Definition at line 531 of file PfieldGeometry.cpp. References EPSILON, PfVec::length(), pi2, pts, and PfVec::scalarProduct(). Referenced by distanceTo(), AmongFormation::positionInsideFormation(), and BetweenFormation::positionInsideFormation(). |
Here is the call graph for this function:
|
Computes absolute coordinates from a base pose and another, relative polygon. Use careful! The other object has to be the same type and the size! Only positions are changed, other members will be ignored!
Implements PfieldGeometricObject. Definition at line 570 of file PfieldGeometry.cpp. References PfPose::pos, pts, and PfPose::rotation. |
|
A list of points.
Definition at line 172 of file PfieldGeometry.h. Referenced by addPoint(), clone(), distanceTo(), getAbs(), getPoints(), initRadiusOfCollisionCircle(), intersectLineAndPolygon(), intersectPolygonAndCircle(), pointInside(), reduceToConvexHullByWrapping(), setAbsoluteFromOther(), AmongFormation::updateGeometry(), and BetweenFormation::updateGeometry(). |