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

# Tools/PotentialFields/PotentialFunctions.h File Reference

Definition of several functions used by potential fields. More...

`#include <cmath>`
`#include <cassert>`

Include dependency graph for PotentialFunctions.h:

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

Go to the source code of this file.

## Classes
class | PotentialfieldFunction
| An abstract class representing a function in a potential field. More...
class | LinearFunction
| A class representing a linear function in a potential field f(x) = a*x +b. More...
class | ParabolicFunction
| A class representing a parabolic function in a potential field f(x) = a*x*x +b. More...
class | AsymptoticFunction
| A class representing an asymptotic function in a potential field f(x) = a/x +b. More...
class | SocialFunction
| A class representing a social function in a potential field. More...
class | NoFunction
| A class representing an empty function. More...
## Enumerations
enum | ObjectType { ATTRACTIVE, REPULSIVE }
| The object types. More...
enum | FunctionType { NO_FUNCTION, LINEAR_FUNCTION, PARABOLIC_FUNCTION, ASYMPTOTIC_FUNCTION }
| The function types. More...
enum | FieldType { POINT_FIELD, SHAPE_FIELD, SECTOR_FIELD }
| The field types. More...
## Functions
double | computeChargeForPointfield (const PfPose &objectPose, const PfPose &testedPose, PotentialfieldFunction *function)
| Computes the charge at a position in a Pointfield.
double | computeChargeForShapefield (const PfPose &objectPose, const PfPose &testedPose, PotentialfieldFunction *function, PfieldGeometricObject *geometry)
| Computes the charge at a position in a Shapefield.
double | computeChargeForSectorfield (const PfPose &objectPose, const PfPose &testedPose, PotentialfieldFunction *function, const Sector &sector)
| Computes the charge at a position in a Sectorfield.
PfVec | computeGradientForPointfield (const PfPose &objectPose, const PfPose &testedPose, PotentialfieldFunction *function)
| Computes the gradient at a position in a Pointfield.
PfVec | computeGradientForShapefield (const PfPose &objectPose, const PfPose &testedPose, PotentialfieldFunction *function, PfieldGeometricObject *geometry, ObjectType objectType)
| Computes the gradient at a position in a Shapefield.
PfVec | computeGradientForSectorfield (const PfPose &objectPose, const PfPose &testedPose, PotentialfieldFunction *function, const Sector &sector)
| Computes the gradient at a position in a Sectorfield.

## Detailed Description

Definition of several functions used by potential fields.

Author:
  Tim Laue

Definition in file PotentialFunctions.h.

## Enumeration Type Documentation

enum ObjectType

  | The object types. Enumeration values:
  ATTRACTIVE |
  REPULSIVE |
Definition at line 24 of file PotentialFunctions.h. Referenced by PotentialFieldsObject::getType(), and Parser::parseObject().

enum FunctionType

  | The function types. Enumeration values:
  NO_FUNCTION |
  LINEAR_FUNCTION |
  PARABOLIC_FUNCTION |
  ASYMPTOTIC_FUNCTION |
Definition at line 27 of file PotentialFunctions.h.

enum FieldType

  | The field types. Enumeration values:
  POINT_FIELD |
  SHAPE_FIELD |
  SECTOR_FIELD |
Definition at line 30 of file PotentialFunctions.h.

## Function Documentation

double computeChargeForPointfield | ( | const PfPose & | objectPose,
|  | const PfPose & | testedPose,
|  | PotentialfieldFunction * | function
| ) |

  | Computes the charge at a position in a Pointfield. Parameters:
  objectPose | The pose of the object to which the field belongs
  testedPose | The pose for which the charge is computed
  function | The function
Returns: The charge Definition at line 77 of file PotentialFunctions.cpp. References PotentialfieldFunction::computeValue(), PfVec::distanceTo(), and PfPose::pos. Referenced by PotentialFieldsObject::computeChargeForSinglePose().

Here is the call graph for this function:

double computeChargeForShapefield | ( | const PfPose & | objectPose,
|  | const PfPose & | testedPose,
|  | PotentialfieldFunction * | function,
|  | PfieldGeometricObject * | geometry
| ) |

  | Computes the charge at a position in a Shapefield. Parameters:
  objectPose | The pose of the object to which the field belongs
  testedPose | The pose for which the charge is computed
  function | The function
  geometry | The geometric shape of the object
Returns: The charge Definition at line 85 of file PotentialFunctions.cpp. References PotentialfieldFunction::computeValue(), PfieldGeometricObject::distanceTo(), and PfPose::pos. Referenced by PotentialFieldsObject::computeChargeForSinglePose().

Here is the call graph for this function:

double computeChargeForSectorfield | ( | const PfPose & | objectPose,
|  | const PfPose & | testedPose,
|  | PotentialfieldFunction * | function,
|  | const Sector & | sector
| ) |

  | Computes the charge at a position in a Sectorfield. Parameters:
  objectPose | The pose of the object to which the field belongs
  testedPose | The pose for which the charge is computed
  function | The function
  sector | The sector of the field
Returns: The charge Definition at line 102 of file PotentialFunctions.cpp. References PotentialfieldFunction::computeValue(), Sector::crossFunction, PfVec::distanceTo(), PfPose::getAngleTo(), PotentialfieldFunction::getRange(), Sector::openingAngle, Sector::pointInside(), PfPose::pos, and PotentialfieldFunction::setParameters(). Referenced by PotentialFieldsObject::computeChargeForSinglePose().

Here is the call graph for this function:

PfVec computeGradientForPointfield | ( | const PfPose & | objectPose,
|  | const PfPose & | testedPose,
|  | PotentialfieldFunction * | function
| ) |

  | Computes the gradient at a position in a Pointfield. Parameters:
  objectPose | The pose of the object to which the field belongs
  testedPose | The pose for which the charge is computed
  function | The function
Returns: The gradient Definition at line 119 of file PotentialFunctions.cpp. References PotentialfieldFunction::computeDerivativeValue(), PfVec::length(), PfVec::normalize(), and PfPose::pos. Referenced by PotentialFieldsObject::computeGradientVecForSinglePose().

Here is the call graph for this function:

PfVec computeGradientForShapefield | ( | const PfPose & | objectPose,
|  | const PfPose & | testedPose,
|  | PotentialfieldFunction * | function,
|  | PfieldGeometricObject * | geometry,
|  | ObjectType | objectType
| ) |

  | Computes the gradient at a position in a Shapefield. Parameters:
  objectPose | The pose of the object to which the field belongs
  testedPose | The pose for which the charge is computed
  function | The function
  geometry | The geometric shape of the object
  objectType | The type of the object
Returns: The gradient Definition at line 132 of file PotentialFunctions.cpp. References ATTRACTIVE, PotentialfieldFunction::computeDerivativeValue(), PfieldGeometricObject::distanceTo(), PfVec::normalize(), and PfPose::pos. Referenced by PotentialFieldsObject::computeGradientVecForSinglePose().

Here is the call graph for this function:

PfVec computeGradientForSectorfield | ( | const PfPose & | objectPose,
|  | const PfPose & | testedPose,
|  | PotentialfieldFunction * | function,
|  | const Sector & | sector
| ) |

  | Computes the gradient at a position in a Sectorfield. Parameters:
  objectPose | The pose of the object to which the field belongs
  testedPose | The pose for which the charge is computed
  function | The function
  sector | The sector of the field
Returns: The gradient Definition at line 165 of file PotentialFunctions.cpp. References PotentialfieldFunction::computeDerivativeValue(), PotentialfieldFunction::computeValue(), Sector::crossFunction, PfVec::distanceTo(), PfPose::getAngleTo(), PotentialfieldFunction::getRange(), PfVec::length(), PfVec::normalize(), Sector::openingAngle, Sector::pointInside(), PfPose::pos, PfVec::rotate(), PfPose::rotation, and PotentialfieldFunction::setParameters(). Referenced by PotentialFieldsObject::computeGradientVecForSinglePose().

Here is the call graph for this function: