OpenWalnut  1.5.0dev
Classes | Typedefs | Functions
WAngleHelper Namespace Reference

Contains functions to help determine the path with the smallest angle change. More...

Classes

struct  HashFn
 Hash function for the unorder map. More...
 

Typedefs

typedef std::unordered_map< WPosition, WPosition, HashFnPositionMap
 An unordered map from WPosition to WPosition. More...
 
typedef std::unordered_map< WPosition, double, HashFnPositionDoubleMap
 An unordered map from WPosition to double. More...
 
typedef std::unordered_map< WPosition, PositionMap, HashFnPositionLineMap
 An unordered map from WPosition to a PositionDoubleMap. More...
 
typedef std::pair< WAngleHelper::PositionLineMap, WAngleHelper::PositionLineMapDJLinePair
 The output of the createLine function. More...
 
typedef std::pair< PositionMap, PositionDoubleMapDJOut
 The output of the dijkstra algorithm. More...
 

Functions

std::vector< WPositionfindSmoothestPath (std::vector< WPosition > positions)
 Determines the path with the smallest angle change. More...
 
std::vector< WPositionfindSmoothestPath (std::vector< WPosition > positions, WFiberHandler::PCFiber fiber)
 Determines the path with the smallest angle change based on the given fiber. More...
 
double calculateAngle (WPosition a, WPosition b)
 Calculates the angle between two positions. More...
 

Detailed Description

Contains functions to help determine the path with the smallest angle change.

Typedef Documentation

◆ DJLinePair

The output of the createLine function.

Definition at line 75 of file WAngleHelper.h.

◆ DJOut

The output of the dijkstra algorithm.

Definition at line 80 of file WAngleHelper.h.

◆ PositionDoubleMap

typedef std::unordered_map< WPosition, double, HashFn > WAngleHelper::PositionDoubleMap

An unordered map from WPosition to double.

Definition at line 65 of file WAngleHelper.h.

◆ PositionLineMap

typedef std::unordered_map< WPosition, PositionMap, HashFn > WAngleHelper::PositionLineMap

An unordered map from WPosition to a PositionDoubleMap.

Definition at line 70 of file WAngleHelper.h.

◆ PositionMap

typedef std::unordered_map< WPosition, WPosition, HashFn > WAngleHelper::PositionMap

An unordered map from WPosition to WPosition.

Definition at line 60 of file WAngleHelper.h.

Function Documentation

◆ calculateAngle()

double WAngleHelper::calculateAngle ( WPosition  a,
WPosition  b 
)

Calculates the angle between two positions.

Parameters
aThe first position.
bThe second position.
Returns
double The angle.

Definition at line 75 of file WAngleHelper.cpp.

Referenced by WMPointConnector::isAdaptivelyHidden().

+ Here is the caller graph for this function:

◆ findSmoothestPath() [1/2]

std::vector< WPosition > WAngleHelper::findSmoothestPath ( std::vector< WPosition positions)

Determines the path with the smallest angle change.

Parameters
positionsThe positions to build the path upon
Returns
std::vector< WPosition > All the positions on the smallest path

Definition at line 193 of file WAngleHelper.cpp.

References SaptData::distance, SaptData::endPoint, and SaptData::prevs.

Referenced by WMPointConnector::createPrediction(), findSmoothestPath(), and WMPointConnector::handleLeftSelection().

+ Here is the caller graph for this function:

◆ findSmoothestPath() [2/2]

std::vector< WPosition > WAngleHelper::findSmoothestPath ( std::vector< WPosition positions,
WFiberHandler::PCFiber  fiber 
)

Determines the path with the smallest angle change based on the given fiber.

Parameters
positionsThe positions to build the path upon
fiberThe fiber used to adjust the path
Returns
std::vector< WPosition > All the positions on the smallest path

Definition at line 269 of file WAngleHelper.cpp.

References findSmoothestPath().

+ Here is the call graph for this function: