Engauge Digitizer  2
Public Member Functions | Protected Member Functions | List of all members
GeometryStrategyAbstractBase Class Referenceabstract

Base class for all geometry strategies. More...

#include <GeometryStrategyAbstractBase.h>

Inheritance diagram for GeometryStrategyAbstractBase:
GeometryStrategyFunctionSmooth GeometryStrategyFunctionStraight GeometryStrategyRelationSmooth GeometryStrategyRelationStraight

Public Member Functions

 GeometryStrategyAbstractBase ()
 Single constructor.
 
virtual void calculateGeometry (const Points &points, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &modelMainWindow, const Transformation &transformation, QString &funcArea, QString &polyArea, QVector< QString > &x, QVector< QString > &y, QVector< QString > &distanceGraphForward, QVector< QString > &distancePercentForward, QVector< QString > &distanceGraphBackward, QVector< QString > &distancePercentBackward) const =0
 Calculate geometry parameters.
 

Protected Member Functions

void calculatePositionsGraph (const Points &points, const Transformation &transformation, QVector< QPointF > &positionsGraph) const
 Convert screen positions to graph positions.
 
double functionArea (const QVector< QPointF > &positionsGraph) const
 Use trapezoidal approximation to compute area under the function. Does not apply to relation.
 
void insertSubintervalsAndLoadDistances (int subintervalsPerInterval, const QVector< QPointF > &positionsGraph, QVector< QPointF > &positionsGraphWithSubintervals, QVector< QString > &distanceGraphForward, QVector< QString > &distancePercentForward, QVector< QString > &distanceGraphBackward, QVector< QString > &distancePercentBackward) const
 Insert the specified number of subintervals into each interval. More...
 
void loadXY (const QVector< QPointF > &positionsGraph, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &modelMainWindow, const Transformation &transformation, QVector< QString > &x, QVector< QString > &y) const
 Load x and y coordinate vectors.
 
double polygonAreaForSimplyConnected (const QVector< QPointF > &points) const
 Area in polygon using Shoelace formula, which only works if polygon is simply connected. More...
 

Detailed Description

Base class for all geometry strategies.

Each strategy computes geometry parameters according to the curve's settings.

The numbering for the strategies is specified as the CurveConnectAs enumeration

Definition at line 23 of file GeometryStrategyAbstractBase.h.

Member Function Documentation

◆ insertSubintervalsAndLoadDistances()

void GeometryStrategyAbstractBase::insertSubintervalsAndLoadDistances ( int  subintervalsPerInterval,
const QVector< QPointF > &  positionsGraph,
QVector< QPointF > &  positionsGraphWithSubintervals,
QVector< QString > &  distanceGraphForward,
QVector< QString > &  distancePercentForward,
QVector< QString > &  distanceGraphBackward,
QVector< QString > &  distancePercentBackward 
) const
protected

Insert the specified number of subintervals into each interval.

For straight curves subintervalsPerInterval=1 so the linearity is maintained, and for smooth curves subintervalsPerInterval>1 so the geometry calculations take into account the curvature(s) of the line

Definition at line 61 of file GeometryStrategyAbstractBase.cpp.

◆ polygonAreaForSimplyConnected()

double GeometryStrategyAbstractBase::polygonAreaForSimplyConnected ( const QVector< QPointF > &  points) const
protected

Area in polygon using Shoelace formula, which only works if polygon is simply connected.

We do not check to see if the polygon is simply connected since that would be (1) slow and (2) much work

Definition at line 166 of file GeometryStrategyAbstractBase.cpp.


The documentation for this class was generated from the following files: