00001 /****************************************************************************************************** 00002 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released * 00003 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file * 00004 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. * 00005 ******************************************************************************************************/ 00006 00007 #include "CallbackCheckAddPointAxis.h" 00008 #include "Curve.h" 00009 #include "Point.h" 00010 00011 extern const QString AXIS_CURVE_NAME; 00012 00013 CallbackCheckAddPointAxis::CallbackCheckAddPointAxis(const DocumentModelCoords &modelCoords, 00014 const QPointF &posScreen, 00015 const QPointF &posGraph, 00016 DocumentAxesPointsRequired documentAxesPointsRequired, 00017 bool isXOnly) : 00018 CallbackAxisPointsAbstract (modelCoords, 00019 documentAxesPointsRequired) 00020 { 00021 // Insert an extra Point as if it already was in the axes curve. This is done before iterating rather 00022 // than after since there is no safe place to do this afterwards (isError and errorMessage may be called more than once) 00023 Point point (AXIS_CURVE_NAME, 00024 posScreen, 00025 posGraph, 00026 isXOnly); 00027 00028 callback (AXIS_CURVE_NAME, 00029 point); 00030 } 00031 00032 bool CallbackCheckAddPointAxis::isError () const 00033 { 00034 return CallbackAxisPointsAbstract::isError (); 00035 } 00036 00037 QString CallbackCheckAddPointAxis::errorMessage () const 00038 { 00039 return CallbackAxisPointsAbstract::errorMessage (); 00040 }