Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Line Class Reference

A class representing a line. More...

`#include <PfieldGeometry.h>`

Inheritance diagram for Line:

[legend]
Collaboration diagram for Line:

[legend]
List of all members.

## Public Member Functions
GeometryType | getType () const
| Returns the type of a geometric object.
PfieldGeometricObject * | clone () const
| Clones a line.
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.
void | setAbsoluteFromOther (const PfPose &base, PfieldGeometricObject *other)
| Computes absolute coordinates from a base pose and another, relative polygon.
virtual void | getPoints (std::vector< PfVec > &points)
| Returns all points of the object.
## Public Attributes
PfVec | p1
| One end point of the line.
PfVec | p2
| The other end point of the line.

## Detailed Description

A class representing a line.

Definition at line 234 of file PfieldGeometry.h.

## Member Function Documentation

GeometryType Line::getType | ( |  | ) | const`[inline, virtual]`

| Returns the type of a geometric object. Returns: The type Implements PfieldGeometricObject. Definition at line 245 of file PfieldGeometry.h. References GeometryType, and LINE.

PfieldGeometricObject * Line::clone | ( |  | ) | const`[virtual]`

| Clones a line. Returns: A pointer to a copy of the object Implements PfieldGeometricObject. Definition at line 452 of file PfieldGeometry.cpp. References PfieldGeometricObject::intersectable, p1, p2, PfieldGeometricObject::position, and PfieldGeometricObject::radiusOfCollisionCircle. Referenced by getAbs().

double Line::distanceTo | ( | const PfPose & | base,
|  | const PfVec & | pos,
|  | PfVec & | contact
| ) | const`[virtual]`

  | Computes the distance from the border of the object to a given point. Parameters:
  base | The pose of the object to which the geometric object is assigned
  pos | The tested point
  contact | Returns the next position of the geometric object to the point
Returns: The distance Implements PfieldGeometricObject. Definition at line 391 of file PfieldGeometry.cpp. References PfVec::distanceTo(), p1, p2, pointPerpendicularToLine(), PfPose::pos, PfVec::rotate(), and PfPose::rotation.

Here is the call graph for this function:

void Line::initRadiusOfCollisionCircle | ( |  | ) | `[virtual]`

| Computes value of the radiusOfCollisionCircle variable. Implements PfieldGeometricObject. Definition at line 421 of file PfieldGeometry.cpp. References p1, and p2. Referenced by Parser::parseGeometricObject().

PfieldGeometricObject * Line::getAbs | ( | const PfPose & | base | ) | const`[virtual]`

  | Returns a geometric object with absolute coordinates. Parameters:
  base | The pose of the object
Returns: A pointer to a new geometric object Implements PfieldGeometricObject. Definition at line 440 of file PfieldGeometry.cpp. References clone(), p1, p2, PfPose::pos, PfVec::rotate(), and PfPose::rotation.

Here is the call graph for this function:

void Line::setAbsoluteFromOther | ( | const PfPose & | base,
|  | PfieldGeometricObject * | other
| ) | `[virtual]`

  | 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! Parameters:
  base | The new absolute position
  other | A relative geometric object
Implements PfieldGeometricObject. Definition at line 427 of file PfieldGeometry.cpp. References p1, p2, PfPose::pos, PfVec::rotate(), and PfPose::rotation.

Here is the call graph for this function:

void Line::getPoints | ( | std::vector< PfVec > & | points | ) | `[virtual]`

  | Returns all points of the object. Parameters:
  points | The list of points to which the object's points will be attached
Reimplemented from PfieldGeometricObject. Definition at line 465 of file PfieldGeometry.cpp. References p1, and p2.

## Member Data Documentation

PfVec Line::p1

| One end point of the line. Definition at line 238 of file PfieldGeometry.h. Referenced by clone(), distanceTo(), getAbs(), FutureWorldModelGenerator::getMaxTranslationForObject(), getPoints(), initRadiusOfCollisionCircle(), intersectLineAndCircle(), intersectLineAndLine(), intersectLineAndPolygon(), intersectPolygonAndCircle(), Parser::parseGeometricObject(), setAbsoluteFromOther(), testIntersection(), and RelativeFormation::updateGeometry().

PfVec Line::p2

| The other end point of the line. Definition at line 240 of file PfieldGeometry.h. Referenced by clone(), distanceTo(), getAbs(), FutureWorldModelGenerator::getMaxTranslationForObject(), getPoints(), initRadiusOfCollisionCircle(), intersectLineAndCircle(), intersectLineAndLine(), intersectLineAndPolygon(), intersectPolygonAndCircle(), Parser::parseGeometricObject(), setAbsoluteFromOther(), testIntersection(), and RelativeFormation::updateGeometry().

The documentation for this class was generated from the following files:

- Tools/PotentialFields/PfieldGeometry.h
- Tools/PotentialFields/PfieldGeometry.cpp