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

ArLineSegment Class Reference

This is the class for a line segment to do some geometric manipulation. More...

#include <ariaUtil.h>

Inheritance diagram for ArLineSegment:

ArLineFinderSegment List of all members.

Public Member Functions

 ArLineSegment (ArPose pose1, ArPose pose2)
 Constructor with endpoints as poses.
 ArLineSegment (double x1, double y1, double x2, double y2)
 Constructor with endpoints.
 ArLineSegment ()
 Constructor.
const double getA (void) const
 Gets the A line parameter.
const double getB (void) const
 Gets the B line parameter.
const double getC (void) const
 Gets the C line parameter.
double getDistToLine (const ArPose pose)
 Gets the distance from the line to a point.
ArPose getEndPoint1 (void) const
 Gets the endpoint of X1, Y1.
ArPose getEndPoint2 (void) const
 Gets the endpoint of X2, Y2.
const ArLinegetLine (void) const
double getPerpDist (const ArPose pose)
 Gets the distance from the line to a point perp with the line.
bool getPerpPoint (const ArPose *pose, ArPose *perpPoint)
 Gets the point at which the given pose is perpindicular to the line.
bool getPerpPoint (ArPose pose, ArPose *perpPoint)
 Gets the point at which the given pose is perpindicular to the line.
const double getX1 (void) const
 Gets the x coordinate of the first endpoint (only use on segments).
const double getX2 (void) const
 Gets the x coordinate of the second endpoint (only use on segments).
const double getY1 (void) const
 Gets the y coordinate of the first endpoint (only use on segments).
const double getY2 (void) const
 Gets the y coordinate of the second endpoint (only use on segments).
bool intersects (ArLineSegment *line, ArPose *pose)
 Sees if a line segment intersects with this segment.
bool intersects (const ArLine *line, ArPose *pose)
 Sees if a line intersects with this segment.
const bool linePointIsInSegment (ArPose *pose) const
 Internal function for seeing if a point on our line is within our segment.
void newEndPoints (double x1, double y1, double x2, double y2)
 Gives the line some new end points (makes it a segment).
virtual ~ArLineSegment ()
 Destructor.

Protected Attributes

ArPose myIntersection
ArLine myLine
ArLine myPerpLine
double myX1
 Internal function to set the parameters of the line from endpoitns.
double myX2
 Internal function to set the parameters of the line from endpoitns.
double myY1
 Internal function to set the parameters of the line from endpoitns.
double myY2
 Internal function to set the parameters of the line from endpoitns.

Detailed Description

This is the class for a line segment to do some geometric manipulation.

Definition at line 852 of file ariaUtil.h.


Member Function Documentation

double ArLineSegment::getDistToLine const ArPose  pose  )  [inline]
 

Gets the distance from the line to a point.

Parameters:
pose the pointer of the pose to find the distance to
Returns:

Definition at line 966 of file ariaUtil.h.

References ArPose::findDistanceTo(), ArUtil::findMin(), getEndPoint1(), getEndPoint2(), intersects(), and ArLine::makeLinePerp().

Referenced by ArActionTriangleDriveTo::findTriangle().

double ArLineSegment::getPerpDist const ArPose  pose  )  [inline]
 

Gets the distance from the line to a point perp with the line.

Parameters:
pose the pointer of the pose to find the perp point of
Returns:
if the pose does not intersect segment it will return < 0 if the pose intersects the segment it will return the distance to the intersection

Definition at line 952 of file ariaUtil.h.

References ArPose::findDistanceTo(), intersects(), and ArLine::makeLinePerp().

Referenced by ArForbiddenRangeDevice::processReadings().

bool ArLineSegment::getPerpPoint const ArPose pose,
ArPose perpPoint
[inline]
 

Gets the point at which the given pose is perpindicular to the line.

This is just a faster version for certain critical spots than the above one... use the above one if you can... If the point is beyond either segment end this will return false

Parameters:
pose the pointer of the pose to find the perp point of
perpPoint the pointer of the pose to set to the found point
Returns:
true if the pose is within the bounds of the line segment

Definition at line 939 of file ariaUtil.h.

References intersects(), and ArLine::makeLinePerp().

bool ArLineSegment::getPerpPoint ArPose  pose,
ArPose perpPoint
[inline]
 

Gets the point at which the given pose is perpindicular to the line.

If the point is beyond either segment end this will return false

Parameters:
pose the pointer of the pose to find the perp point of
pose the pointer of the pose to set to the found point
Returns:
true if the pose is within the bounds of the line segment

Definition at line 923 of file ariaUtil.h.

References intersects(), and ArLine::makeLinePerp().

Referenced by ArSick::filterAddAndCleanCumulative().

bool ArLineSegment::intersects ArLineSegment line,
ArPose pose
[inline]
 

Sees if a line segment intersects with this segment.

Parameters:
line the line segment to check if it intersects with this line
pose if the lines intersect, the pose is set to the location
Returns:
true if they intersect, false if they do not

Definition at line 902 of file ariaUtil.h.

References ArLine::intersects(), linePointIsInSegment(), and ArPose::setPose().

bool ArLineSegment::intersects const ArLine line,
ArPose pose
[inline]
 

Sees if a line intersects with this segment.

Parameters:
line the line to check if it intersects with this line
pose if the lines intersect, the pose is set to the location
Returns:
true if they intersect, false if they do not

Definition at line 883 of file ariaUtil.h.

References ArLine::intersects(), linePointIsInSegment(), and ArPose::setPose().

Referenced by getDistToLine(), getPerpDist(), and getPerpPoint().


The documentation for this class was generated from the following file:
Generated on Wed Oct 19 12:56:49 2005 for Aria by  doxygen 1.4.0