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

FieldDimensions Class Reference

Static class containing some useful functions regarding field dimensions. More...

#include <FieldDimensions.h>

List of all members.

Static Public Member Functions

bool isInsideField (const Vector2< int > &p)
 Returns true when p is inside the field.

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

bool isInsideGoal (const Vector2< int > &p)
 Returns true when p is inside one of the goals.

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

bool isInsideOwnGoal (const Vector2< int > &p)
 Returns true when p is inside the own goal.

bool isInsideOpponentGoal (const Vector2< int > &p)
 Returns true when p is inside the opponent goal.

bool isOnOwnGoalGroundline (const Vector2< int > &p)
 Returns true when p is on the groundline of the own goal.

bool isOnOpponentGoalGroundline (const Vector2< int > &p)
 Returns true when p is on the groundline of the opponent goal.

double distanceToOpponentPenaltyArea (const Vector2< double > &p)
 Returns the distance of p to opponents penalty area.

double distanceToOwnPenaltyArea (const Vector2< double > &p)
 Returns the distance of p to own penalty area.

double distanceToOwnPenaltyArea (const Pose2D &p)
double distanceToBorder (const Vector2< double > &p)
 Returns the distance to the nearest field border.

void vectorToBorder (const Vector2< double > &p, Vector2< double > &result)
 Returns the vector to the nearest field border.

void vectorToBorderIncludingGoals (const Vector2< double > &p, Vector2< double > &result)
 Returns the vector to the nearest field border including the goals.

bool clipLineWithField (Vector2< int > &point1, Vector2< int > &point2)
 Clips a line with the field.

bool clipLineWithFieldAndGoalAreas (Vector2< int > &point1, Vector2< int > &point2)
 Clips a line with the field and the areas inside the goals.


Detailed Description

Static class containing some useful functions regarding field dimensions.

Author:
Max Risler

Definition at line 345 of file FieldDimensions.h.


Member Function Documentation

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

Returns true when p is inside the field.

Definition at line 101 of file FieldDimensions.cpp.

References Geometry::getDistanceToLine(), Vector2< V >::x, and Vector2< V >::y.

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

Here is the call graph for this function:

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

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

Definition at line 356 of file FieldDimensions.h.

References isInsideField().

Here is the call graph for this function:

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

Returns true when p is inside one of the goals.

Definition at line 124 of file FieldDimensions.cpp.

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

Referenced by isInsideGoal().

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

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

Definition at line 369 of file FieldDimensions.h.

References isInsideGoal().

Here is the call graph for this function:

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

Returns true when p is inside the own goal.

Definition at line 136 of file FieldDimensions.cpp.

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

Referenced by vectorToBorderIncludingGoals().

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

Returns true when p is inside the opponent goal.

Definition at line 144 of file FieldDimensions.cpp.

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

Referenced by vectorToBorderIncludingGoals().

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

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

Definition at line 354 of file FieldDimensions.cpp.

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

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

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

Definition at line 363 of file FieldDimensions.cpp.

References 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 11 of file FieldDimensions.cpp.

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

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

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

Returns the distance of p to own penalty area.

Definition at line 51 of file FieldDimensions.cpp.

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

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

Definition at line 57 of file FieldDimensions.cpp.

References Pose2D::translation, Vector2< double >::x, and Vector2< double >::y.

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

Returns the distance to the nearest field border.

Definition at line 153 of file FieldDimensions.cpp.

References isInsideField(), min, Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

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

Returns the vector to the nearest field border.

Definition at line 169 of file FieldDimensions.cpp.

References Geometry::Line::direction, Geometry::getDistanceToLine(), isInsideField(), Vector2< V >::normalize(), Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y.

Here is the call graph for this function:

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 237 of file FieldDimensions.cpp.

References Geometry::Line::direction, Geometry::getDistanceToLine(), isInsideField(), isInsideOpponentGoal(), isInsideOwnGoal(), Vector2< V >::normalize(), Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y.

Here is the call graph for this function:

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 373 of file FieldDimensions.cpp.

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

Here is the call graph for this function:

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 455 of file FieldDimensions.cpp.

References Geometry::clipLineWithRectangleCohenSutherland(), Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:06:10 2004 for GT2004 by doxygen 1.3.6