UGDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions
pyramidworks::geometry::GeometricShape Class Reference

#include <pyramidworks/geometry/geometricshape.h>

Inheritance diagram for pyramidworks::geometry::GeometricShape:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~GeometricShape ()
virtual bool Intersects (const ugdk::Vector2D &this_pos, const GeometricShape *obj, const ugdk::Vector2D &that_pos) const =0
 Checks if this shape intersects another shape.
virtual bool Intersects (const ugdk::Vector2D &this_pos, const Circle *obj, const ugdk::Vector2D &that_pos) const =0
 Checks if there's an intersection with a Circle.
virtual bool Intersects (const ugdk::Vector2D &this_pos, const Rect *obj, const ugdk::Vector2D &that_pos) const =0
 Checks if there's an intersection with a Rect.
virtual bool Intersects (const ugdk::Vector2D &this_pos, const ConvexPolygon *obj, const ugdk::Vector2D &that_pos) const =0
 Checks if there's an intersection with a Convex Polygon.
virtual ugdk::ikdtree::Box< 2 > GetBoundingBox (const ugdk::Vector2D &position) const =0
 Returns a bounding box for this shape.

Protected Member Functions

 GeometricShape ()

Detailed Description

A geometric shape.


Constructor & Destructor Documentation

Parameters:
offsetAn offset to the position. Defaults to (0,0)

Member Function Documentation

virtual ugdk::ikdtree::Box<2> pyramidworks::geometry::GeometricShape::GetBoundingBox ( const ugdk::Vector2D position) const [pure virtual]

Returns a bounding box for this shape.

The box is at the shape's position and offset

Parameters:
positionThe absolute position for this shape.
Returns:
A 2D Box around this shape

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::Vector2D this_pos,
const GeometricShape obj,
const ugdk::Vector2D that_pos 
) const [pure virtual]

Checks if this shape intersects another shape.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::Vector2D this_pos,
const Circle obj,
const ugdk::Vector2D that_pos 
) const [pure virtual]

Checks if there's an intersection with a Circle.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::Vector2D this_pos,
const Rect obj,
const ugdk::Vector2D that_pos 
) const [pure virtual]

Checks if there's an intersection with a Rect.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::Vector2D this_pos,
const ConvexPolygon obj,
const ugdk::Vector2D that_pos 
) const [pure virtual]

Checks if there's an intersection with a Convex Polygon.

Parameters:
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns:
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines