File indexing completed on 2024-05-12 15:26:43
0001 /*************************************************************************** 0002 File : Transform.h 0003 Project : LabPlot 0004 Description : transformation for mapping between scene and 0005 logical coordinates of Datapicker-image 0006 -------------------------------------------------------------------- 0007 Copyright : (C) 2015 by Ankit Wagadre (wagadre.ankit@gmail.com) 0008 ***************************************************************************/ 0009 /*************************************************************************** 0010 * * 0011 * This program is free software; you can redistribute it and/or modify * 0012 * it under the terms of the GNU General Public License as published by * 0013 * the Free Software Foundation; either version 2 of the License, or * 0014 * (at your option) any later version. * 0015 * * 0016 * This program is distributed in the hope that it will be useful, * 0017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0019 * GNU General Public License for more details. * 0020 * * 0021 * You should have received a copy of the GNU General Public License * 0022 * along with this program; if not, write to the Free Software * 0023 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0024 * Boston, MA 02110-1301 USA * 0025 * * 0026 ***************************************************************************/ 0027 0028 #ifndef TRANSFORM_H 0029 #define TRANSFORM_H 0030 0031 #include "backend/datapicker/DatapickerImage.h" 0032 0033 class Transform { 0034 public: 0035 Transform() = default; 0036 QVector3D mapSceneToLogical(QPointF,const DatapickerImage::ReferencePoints&); 0037 QVector3D mapSceneLengthToLogical(QPointF,const DatapickerImage::ReferencePoints&); 0038 0039 private: 0040 bool mapTypeToCartesian(const DatapickerImage::ReferencePoints&); 0041 QVector3D mapCartesianToType(QPointF, const DatapickerImage::ReferencePoints&) const; 0042 0043 //logical coordinates 0044 double x[4]; 0045 double y[4]; 0046 0047 //Scene coordinates 0048 double X[4]; 0049 double Y[4]; 0050 0051 }; 0052 0053 #endif // TRANSFORM_H