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

Tools/PotentialFields/PfieldGeometry.h File Reference

Definition of several geometric functions and objects used by potential fields. More...

#include "PfieldDatatypes.h"
#include "PotentialFunctions.h"

Include dependency graph for PfieldGeometry.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

class  PfieldGeometricObject
 Abstract base class for geometric objects used by potentialfields. More...

class  Polygon
 A class representing a convex polygon. More...

class  Line
 A class representing a line. More...

class  Circle
 A class representing a circle. More...

class  NoGeometry
 A class representing an empty geometric object. More...

class  Sector
 A class representing a sector. More...


Enumerations

enum  GeometryType {
  POLYGON, LINE, CIRCLE,
  NONE
}
 Definition of the different types of geometric objects. More...


Functions

bool pointPerpendicularToLine (const PfVec &l1, const PfVec &l2, const PfVec &p, double &distance, PfVec &perpendicularPoint)
 Determines if a point is perpendicular to a line.

void reduceToConvexHullByWrapping (Polygon &p)
 Reduces the points of a polygon to its convex hull.

void intersectGeometricObjects (PfieldGeometricObject *g1, PfieldGeometricObject *g2, std::vector< PfVec > &intersections)
 Intersects two geometric objects and returns the intersection points as well as significant points of the second object inside the intersection.

void intersectLineAndLine (const Line &l1, const Line &l2, std::vector< PfVec > &intersections)
 Intersects a line with another line (basic intersection checking has to be done before).

void intersectLineAndCircle (const Line &line, const Circle &circle, std::vector< PfVec > &intersections)
 Intersects a line with a circle (basic intersection checking has to be done before).

void intersectPolygonAndCircle (const Polygon &polygon, const Circle &circle, std::vector< PfVec > &intersections)
 Intersects a polygon with a circle (basic intersection checking has to be done before).

void intersectCircleAndCircle (const Circle &circle1, const Circle &circle2, std::vector< PfVec > &intersections)
 Intersects a circle with a circle (basic intersection checking has to be done before).


Detailed Description

Definition of several geometric functions and objects used by potential fields.

Author:
Tim Laue

Definition in file PfieldGeometry.h.


Enumeration Type Documentation

enum GeometryType
 

Definition of the different types of geometric objects.

Enumeration values:
POLYGON 
LINE 
CIRCLE 
NONE 

Definition at line 23 of file PfieldGeometry.h.

Referenced by NoGeometry::getType(), Circle::getType(), Line::getType(), and Polygon::getType().


Function Documentation

bool pointPerpendicularToLine const PfVec l1,
const PfVec l2,
const PfVec p,
double &  distance,
PfVec perpendicularPoint
[inline]
 

Determines if a point is perpendicular to a line.

Parameters:
l1 One end of the line
l2 The other end of the line
p The point
distance The distance to the line, if perpendicular
perpendicularPoint The point on the line, if perpendicular
Returns:
true, if point is perpendicular.

Definition at line 14 of file PfieldGeometry.cpp.

References PfVec::distanceTo(), EPSILON, PfVec::scalarProduct(), PfVec::x, and PfVec::y.

Referenced by Polygon::distanceTo(), and Line::distanceTo().

Here is the call graph for this function:

void reduceToConvexHullByWrapping Polygon p  ) 
 

Reduces the points of a polygon to its convex hull.

Parameters:
p The polygon

Definition at line 61 of file PfieldGeometry.cpp.

References pi2, Polygon::pts, and theta().

Referenced by AmongFormation::updateGeometry(), and BetweenFormation::updateGeometry().

Here is the call graph for this function:

void intersectGeometricObjects PfieldGeometricObject g1,
PfieldGeometricObject g2,
std::vector< PfVec > &  intersections
 

Intersects two geometric objects and returns the intersection points as well as significant points of the second object inside the intersection.

Parameters:
g1 The first geometric object
g2 The second geometric object
intersections The intersections

Definition at line 297 of file PfieldGeometry.cpp.

References CIRCLE, PfieldGeometricObject::getType(), PfieldGeometricObject::intersectable, intersectCircleAndCircle(), intersectLineAndCircle(), intersectLineAndLine(), intersectLineAndPolygon(), intersectPolygonAndCircle(), PfVec::length(), LINE, POLYGON, PfieldGeometricObject::position, and PfieldGeometricObject::radiusOfCollisionCircle.

Referenced by FutureWorldModelGenerator::getMaxRotationForObject(), and FutureWorldModelGenerator::getMaxTranslationForObject().

Here is the call graph for this function:

void intersectLineAndLine const Line l1,
const Line l2,
std::vector< PfVec > &  intersections
 

Intersects a line with another line (basic intersection checking has to be done before).

Parameters:
l1 A line
l2 Another line
intersections The intersections found

Definition at line 139 of file PfieldGeometry.cpp.

References Line::p1, Line::p2, testIntersection(), PfVec::x, and PfVec::y.

Referenced by intersectGeometricObjects(), and intersectLineAndPolygon().

Here is the call graph for this function:

void intersectLineAndCircle const Line line,
const Circle circle,
std::vector< PfVec > &  intersections
 

Intersects a line with a circle (basic intersection checking has to be done before).

Parameters:
line A line
circle A circle
intersections The intersections found

Definition at line 175 of file PfieldGeometry.cpp.

References Line::p1, Line::p2, PfieldGeometricObject::position, PfieldGeometricObject::radiusOfCollisionCircle, and PfVec::scalarProduct().

Referenced by intersectGeometricObjects(), and intersectPolygonAndCircle().

Here is the call graph for this function:

void intersectPolygonAndCircle const Polygon polygon,
const Circle circle,
std::vector< PfVec > &  intersections
 

Intersects a polygon with a circle (basic intersection checking has to be done before).

Parameters:
polygon A polygon
circle A circle
intersections The intersections found

Definition at line 215 of file PfieldGeometry.cpp.

References intersectLineAndCircle(), Line::p1, Line::p2, and Polygon::pts.

Referenced by intersectGeometricObjects().

Here is the call graph for this function:

void intersectCircleAndCircle const Circle circle1,
const Circle circle2,
std::vector< PfVec > &  intersections
 

Intersects a circle with a circle (basic intersection checking has to be done before).

Parameters:
circle1 A circle
circle2 Another circle
intersections The intersections found

Definition at line 229 of file PfieldGeometry.cpp.

References EPSILON, pi, PfieldGeometricObject::position, Circle::radius, PfVec::x, and PfVec::y.

Referenced by intersectGeometricObjects().


Generated on Thu Sep 23 20:03:18 2004 for GT2004 by doxygen 1.3.6