Engauge Digitizer  2
GeometryStrategyContext.cpp
Go to the documentation of this file.
1 /******************************************************************************************************
2  * (C) 2016 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "CurveConnectAs.h"
8 #include "DocumentModelCoords.h"
9 #include "DocumentModelGeneral.h"
15 #include "Transformation.h"
16 
18 {
19  m_strategies.insert (CONNECT_AS_FUNCTION_SMOOTH , new GeometryStrategyFunctionSmooth ());
21  m_strategies.insert (CONNECT_AS_RELATION_SMOOTH , new GeometryStrategyRelationSmooth ());
23 }
24 
26 {
27  qDeleteAll (m_strategies);
28 }
29 
31  const DocumentModelCoords &modelCoords,
32  const DocumentModelGeneral &modelGeneral,
33  const MainWindowModel &modelMainWindow,
34  const Transformation &transformation,
35  CurveConnectAs connectAs,
36  QString &funcArea,
37  QString &polyArea,
38  QVector<QString> &x,
39  QVector<QString> &y,
40  QVector<bool> &isPotentialExportAmbiguity,
41  QVector<QString> &distanceGraphForward,
42  QVector<QString> &distancePercentForward,
43  QVector<QString> &distanceGraphBackward,
44  QVector<QString> &distancePercentBackward) const
45 {
46  if (transformation.transformIsDefined()) {
47 
48  m_strategies [connectAs]->calculateGeometry (points,
49  modelCoords,
50  modelGeneral,
51  modelMainWindow,
52  transformation,
53  funcArea,
54  polyArea,
55  x,
56  y,
57  isPotentialExportAmbiguity,
58  distanceGraphForward,
59  distancePercentForward,
60  distanceGraphBackward,
61  distancePercentBackward);
62  }
63 }
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Calculate for line through the points that is smoothly connected as a function.
Calculate for line through the points that is straightly connected as a function. ...
GeometryStrategyContext()
Single constructor.
void calculateGeometry(const Points &points, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &modelMainWindow, const Transformation &transformation, CurveConnectAs connectAs, QString &funcArea, QString &polyArea, QVector< QString > &x, QVector< QString > &y, QVector< bool > &isPotentialExportAmbiguity, QVector< QString > &distanceGraphForward, QVector< QString > &distancePercentForward, QVector< QString > &distanceGraphBackward, QVector< QString > &distancePercentBackward) const
Calculate geometry parameters.
Calculate for line through the points that is smoothly connected as a relation.
Affine transformation between screen and graph coordinates, based on digitized axis points...
Calculate for line through the points that is straightly connected as a relation. ...
Model for DlgSettingsMainWindow.
Model for DlgSettingsCoords and CmdSettingsCoords.
CurveConnectAs
QList< Point > Points
Definition: Points.h:13
bool transformIsDefined() const
Transform is defined when at least three axis points have been digitized.