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 "CallbackAddPointsInCurvesGraphs.h" 00008 #include "CoordSystem.h" 00009 00010 extern const QString AXIS_CURVE_NAME; 00011 00012 CallbackAddPointsInCurvesGraphs::CallbackAddPointsInCurvesGraphs(CoordSystem &coordSystem) : 00013 m_coordSystem (coordSystem) 00014 { 00015 } 00016 00017 CallbackSearchReturn CallbackAddPointsInCurvesGraphs::callback (const QString &curveName, 00018 const Point &point) 00019 { 00020 const QString identifier = point.identifier (); 00021 00022 if (curveName == AXIS_CURVE_NAME) { 00023 m_coordSystem.addPointAxisWithSpecifiedIdentifier (point.posScreen (), 00024 point.posGraph (), 00025 identifier, 00026 point.ordinal (), 00027 point.isXOnly ()); 00028 } else { 00029 m_coordSystem.addPointGraphWithSpecifiedIdentifier (curveName, 00030 point.posScreen (), 00031 identifier, 00032 point.ordinal ()); 00033 } 00034 00035 return CALLBACK_SEARCH_RETURN_CONTINUE; 00036 }