Engauge Digitizer  2
CallbackUpdateTransform.cpp
1 /******************************************************************************************************
2  * (C) 2014 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 "CallbackUpdateTransform.h"
8 #include "EngaugeAssert.h"
9 #include "Point.h"
10 
12  DocumentAxesPointsRequired documentAxesPointsRequired) :
13  CallbackAxisPointsAbstract (modelCoords,
14  documentAxesPointsRequired)
15 {
16 }
17 
19 {
20  switch (documentAxesPointsRequired ()) {
21  case DOCUMENT_AXES_POINTS_REQUIRED_2:
22  return !isError () && (numberAxisPoints () == 2);
23 
24  case DOCUMENT_AXES_POINTS_REQUIRED_3:
25  return !isError () && (numberAxisPoints () == 3);
26 
27  case DOCUMENT_AXES_POINTS_REQUIRED_4:
28  return !isError () && (numberAxisPoints () == 4);
29 
30  default:
31  ENGAUGE_ASSERT (false);
32  }
33 
34  return !isError () && (numberAxisPoints () == 4);
35 }
CallbackUpdateTransform(const DocumentModelCoords &modelCoords, DocumentAxesPointsRequired documentAxesPointsRequired)
Single constructor.
unsigned int numberAxisPoints() const
Number of axis points which is less than 3 if the axes curve is incomplete.
Model for DlgSettingsCoords and CmdSettingsCoords.
bool transformIsDefined() const
True if enough Points were available to create a Transformation.
bool isError() const
This value is checked after iterating to see if the axis data is correct.
Callback for collecting axis points and then performing common calculations on those axis points...
DocumentAxesPointsRequired documentAxesPointsRequired() const
Number of axes points required for the transformation.