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 "CallbackUpdateTransform.h" 00008 #include "EngaugeAssert.h" 00009 #include "Point.h" 00010 00011 CallbackUpdateTransform::CallbackUpdateTransform(const DocumentModelCoords &modelCoords, 00012 DocumentAxesPointsRequired documentAxesPointsRequired) : 00013 CallbackAxisPointsAbstract (modelCoords, 00014 documentAxesPointsRequired) 00015 { 00016 } 00017 00018 bool CallbackUpdateTransform::transformIsDefined () const 00019 { 00020 switch (documentAxesPointsRequired ()) { 00021 case DOCUMENT_AXES_POINTS_REQUIRED_2: 00022 return !isError () && (numberAxisPoints () == 2); 00023 00024 case DOCUMENT_AXES_POINTS_REQUIRED_3: 00025 return !isError () && (numberAxisPoints () == 3); 00026 00027 case DOCUMENT_AXES_POINTS_REQUIRED_4: 00028 return !isError () && (numberAxisPoints () == 4); 00029 00030 default: 00031 ENGAUGE_ASSERT (false); 00032 } 00033 00034 return !isError () && (numberAxisPoints () == 4); 00035 }