1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROGUI_IMPORTIMAGEDLG_H
24 #define HYDROGUI_IMPORTIMAGEDLG_H
26 #include "HYDROGUI_InputPanel.h"
36 class QtxDoubleSpinBox;
39 class HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel
44 enum TransformationMode { Manual = 0, RefImage };
47 typedef QPair< QPoint, QPointF > TransformationData;
48 typedef QMap< int, TransformationData > TransformationDataMap;
50 typedef QPair< QString, TransformationDataMap > PrsPointData;
51 typedef QList< PrsPointData > PrsPointDataList;
52 typedef QListIterator< PrsPointData > PrsPointDataListIterator;
55 HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle );
56 virtual ~HYDROGUI_ImportImageDlg();
58 void setIsEdit( const bool theIsEdit );
61 void setImageName( const QString& theName );
62 QString getImageName() const;
64 void setImageSize( const QSize& theSize,
65 const bool theIsRefImage = false );
67 int getTransformationMode() const;
69 void setTransformationDataMap( const TransformationDataMap& theMap,
70 const bool theIsOnlyInput = false,
71 const bool theIsRefImage = false );
72 bool getTransformationDataMap( TransformationDataMap& theMap,
73 const bool theIsRefImage = false ) const;
75 void setPrsPointDataList( const PrsPointDataList& theList );
77 void initializePointSelection();
81 void onModeActivated( int );
82 void onRefImageActivated( const QString& );
83 void onPointBtnToggled( bool );
84 void onPointCoordChanged( int );
87 void createPreview( QImage );
88 void activatePointSelection( int );
89 void pointCoordChanged( bool theIsRef,
93 void refImageActivated( const QString& );
96 QGroupBox* myFileNameGroup;
97 QLineEdit* myFileName;
99 QGroupBox* myImageNameGroup;
100 QLineEdit* myImageName;
102 QGroupBox* myTransformGroup;
103 QButtonGroup* myModeGroup;
105 QWidget* myRefImageWg;
106 QComboBox* myRefImage;
108 QList<QLabel*> myLambertLabels;
110 QMap<int, QPushButton*> myPointBtnMap;
111 QMap<int, QtxIntSpinBox*> myPointXMap;
112 QMap<int, QtxIntSpinBox*> myPointYMap;
113 QMap<int, QtxIntSpinBox*> myPointXDegMap;
114 QMap<int, QtxIntSpinBox*> myPointYDegMap;
115 QMap<int, QtxIntSpinBox*> myPointXMinMap;
116 QMap<int, QtxIntSpinBox*> myPointYMinMap;
117 QMap<int, QtxDoubleSpinBox*> myPointXSecMap;
118 QMap<int, QtxDoubleSpinBox*> myPointYSecMap;
120 QMap<int, QtxIntSpinBox*> myRefPointXMap;
121 QMap<int, QtxIntSpinBox*> myRefPointYMap;
123 PrsPointDataList myPrsPointDataList;