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

# Tools/PotentialFields/PotentialFunctions.cpp File Reference

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

`#include "PotentialFunctions.h"`
`#include "PfieldDatatypes.h"`
`#include "PfieldGeometry.h"`

Include dependency graph for PotentialFunctions.cpp:

Go to the source code of this file.

## 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

Implementation of several functions used by potential fields.

Author:
  Tim Laue

Definition in file PotentialFunctions.cpp.

## 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: