FieldDimensions Class Reference

#include <FieldDimensions.h>

List of all members.

Static Public Member Functions

static bool isInsideField (const Vector2< int > &p)
static bool isInsideField (int x, int y)
static bool isInsideGoal (const Vector2< int > &p)
static bool isInsideGoal (int x, int y)
static bool isInsideOwnGoal (const Vector2< int > &p)
static bool isInsideOpponentGoal (const Vector2< int > &p)
static bool isOnOwnGoalGroundline (const Vector2< int > &p)
static bool isOnOpponentGoalGroundline (const Vector2< int > &p)
static double distanceToOpponentPenaltyArea (const Vector2< double > &p)
static double distanceToOwnPenaltyArea (const Vector2< double > &p)
static double distanceToOwnPenaltyArea (const Pose2D &p)
static double distanceToBorder (const Vector2< double > &p)
static void vectorToBorder (const Vector2< double > &p, Vector2< double > &result)
static void vectorToBorderIncludingGoals (const Vector2< double > &p, Vector2< double > &result)
static bool clipLineWithField (Vector2< int > &point1, Vector2< int > &point2)
static bool clipLineWithFieldAndGoalAreas (Vector2< int > &point1, Vector2< int > &point2)


Detailed Description

Static class containing some useful functions regarding field dimensions.

Author:
Max Risler

Definition at line 429 of file FieldDimensions.h.


Member Function Documentation

bool FieldDimensions::clipLineWithField ( Vector2< int > &  point1,
Vector2< int > &  point2 
) [static]

Clips a line with the field

Parameters:
point1 The starting point of the line
point2 The end point of the line
Returns:
states whether clipping was necessary (and done)

Definition at line 372 of file FieldDimensions.cpp.

References Geometry::clipLineWithRectangleCohenSutherland(), Geometry::getDistanceToLine(), Geometry::getIntersectionOfLines(), opponentLeftCorner(), opponentRightCorner(), ownLeftCorner(), ownRightCorner(), Vector2< V >::x, and Vector2< V >::y.

bool FieldDimensions::clipLineWithFieldAndGoalAreas ( Vector2< int > &  point1,
Vector2< int > &  point2 
) [static]

Clips a line with the field and the areas inside the goals

Parameters:
point1 The starting point of the line
point2 The end point of the line
Returns:
states whether clipping was necessary (and done)

Definition at line 456 of file FieldDimensions.cpp.

References Geometry::clipLineWithRectangleCohenSutherland(), opponentGoalLeftRearPanel, opponentGoalRightPost, ownGoalLeftPost, ownGoalRightRearPanel, Vector2< V >::x, and Vector2< V >::y.

double FieldDimensions::distanceToBorder ( const Vector2< double > &  p  )  [static]

Returns the distance to the nearest field border.

Definition at line 151 of file FieldDimensions.cpp.

References distance(), Geometry::getDistanceToEdge(), Geometry::getDistanceToLine(), isInsideField(), min, opponentGoalLeftWall(), opponentLeftCorner(), opponentLeftGroundline(), Vector2< V >::x, and Vector2< V >::y.

double FieldDimensions::distanceToOpponentPenaltyArea ( const Vector2< double > &  p  )  [static]

Returns the distance of p to opponents penalty area.

Definition at line 21 of file FieldDimensions.cpp.

References Vector2< V >::x, and Vector2< V >::y.

Referenced by AngleSymbols::calculateCombinedAngles(), and GT2004StrategySymbols::computeRole().

double FieldDimensions::distanceToOwnPenaltyArea ( const Pose2D p  )  [static]

Definition at line 67 of file FieldDimensions.cpp.

References fmax(), Pose2D::translation, Vector2< V >::x, and Vector2< V >::y.

double FieldDimensions::distanceToOwnPenaltyArea ( const Vector2< double > &  p  )  [static]

Returns the distance of p to own penalty area.

Definition at line 61 of file FieldDimensions.cpp.

Referenced by BallSymbols::getDistanceSeenBallToOwnPenaltyArea(), RobotPoseSymbols::getDistanceToOwnPenaltyArea(), and GT2004ObstaclesLocator::setObstaclesModel().

static bool FieldDimensions::isInsideField ( int  x,
int  y 
) [inline, static]

Returns true when (x,y) is inside the field.

Definition at line 440 of file FieldDimensions.h.

References isInsideField().

bool FieldDimensions::isInsideField ( const Vector2< int > &  p  )  [static]

Returns true when p is inside the field.

Definition at line 97 of file FieldDimensions.cpp.

References Geometry::getDistanceToLine(), opponentLeftCorner(), opponentRightCorner(), ownLeftCorner(), ownRightCorner(), Vector2< V >::x, and Vector2< V >::y.

Referenced by distanceToBorder(), isInsideField(), vectorToBorder(), and vectorToBorderIncludingGoals().

static bool FieldDimensions::isInsideGoal ( int  x,
int  y 
) [inline, static]

Returns true when (x,y) is inside one of the goals.

Definition at line 453 of file FieldDimensions.h.

References isInsideGoal().

bool FieldDimensions::isInsideGoal ( const Vector2< int > &  p  )  [static]

Returns true when p is inside one of the goals.

Definition at line 122 of file FieldDimensions.cpp.

References Vector2< V >::x, and Vector2< V >::y.

Referenced by isInsideGoal().

bool FieldDimensions::isInsideOpponentGoal ( const Vector2< int > &  p  )  [static]

Returns true when p is inside the opponent goal.

Definition at line 142 of file FieldDimensions.cpp.

References Vector2< V >::x, and Vector2< V >::y.

Referenced by vectorToBorderIncludingGoals().

bool FieldDimensions::isInsideOwnGoal ( const Vector2< int > &  p  )  [static]

Returns true when p is inside the own goal.

Definition at line 134 of file FieldDimensions.cpp.

References Vector2< V >::x, and Vector2< V >::y.

Referenced by vectorToBorderIncludingGoals().

bool FieldDimensions::isOnOpponentGoalGroundline ( const Vector2< int > &  p  )  [static]

Returns true when p is on the groundline of the opponent goal.

Definition at line 362 of file FieldDimensions.cpp.

References Vector2< V >::x, and Vector2< V >::y.

bool FieldDimensions::isOnOwnGoalGroundline ( const Vector2< int > &  p  )  [static]

Returns true when p is on the groundline of the own goal.

Definition at line 353 of file FieldDimensions.cpp.

References Vector2< V >::x, and Vector2< V >::y.

void FieldDimensions::vectorToBorder ( const Vector2< double > &  p,
Vector2< double > &  result 
) [static]

Returns the vector to the nearest field border.

Definition at line 168 of file FieldDimensions.cpp.

References Geometry::Line::direction, distance(), Geometry::getDistanceToLine(), isInsideField(), leftWall(), Vector2< V >::normalize(), opponentLeftCorner(), opponentLeftGroundline(), opponentRightCorner(), ownLeftCorner(), ownLeftGroundline(), ownRightCorner(), rightWall(), Vector2< V >::x, and Vector2< V >::y.

void FieldDimensions::vectorToBorderIncludingGoals ( const Vector2< double > &  p,
Vector2< double > &  result 
) [static]

Returns the vector to the nearest field border including the goals.

Definition at line 236 of file FieldDimensions.cpp.

References Geometry::Line::direction, distance(), Geometry::getDistanceToLine(), isInsideField(), isInsideOpponentGoal(), isInsideOwnGoal(), leftWall(), Vector2< V >::normalize(), opponentGoalLeftWall(), opponentGoalRearWall(), opponentGoalRightWall(), opponentLeftCorner(), opponentLeftGroundline(), opponentRightCorner(), ownGoalLeftWall(), ownGoalRearWall(), ownGoalRightWall(), ownLeftCorner(), ownLeftGroundline(), ownRightCorner(), rightWall(), Vector2< V >::x, and Vector2< V >::y.


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:31:34 2006 for DT2005.panorama by  doxygen 1.4.7