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 QString getFileName() const;
66 void setImageSize( const QSize& theSize,
67 const bool theIsRefImage = false );
69 int getTransformationMode() const;
71 void setTransformationDataMap( const TransformationDataMap& theMap,
72 const bool theIsOnlyInput = false,
73 const bool theIsRefImage = false );
74 bool getTransformationDataMap( TransformationDataMap& theMap,
75 const bool theIsRefImage = false ) const;
77 void setPrsPointDataList( const PrsPointDataList& theList );
79 void initializePointSelection();
83 void onModeActivated( int );
84 void onRefImageActivated( const QString& );
85 void onPointBtnToggled( bool );
86 void onPointCoordChanged( int );
89 void createPreview( QImage );
90 void activatePointSelection( int );
91 void pointCoordChanged( bool theIsRef,
95 void refImageActivated( const QString& );
98 QGroupBox* myFileNameGroup;
99 QLineEdit* myFileName;
101 QGroupBox* myImageNameGroup;
102 QLineEdit* myImageName;
104 QGroupBox* myTransformGroup;
105 QButtonGroup* myModeGroup;
107 QWidget* myRefImageWg;
108 QComboBox* myRefImage;
110 QList<QLabel*> myLambertLabels;
112 QMap<int, QPushButton*> myPointBtnMap;
113 QMap<int, QtxIntSpinBox*> myPointXMap;
114 QMap<int, QtxIntSpinBox*> myPointYMap;
115 QMap<int, QtxIntSpinBox*> myPointXDegMap;
116 QMap<int, QtxIntSpinBox*> myPointYDegMap;
117 QMap<int, QtxIntSpinBox*> myPointXMinMap;
118 QMap<int, QtxIntSpinBox*> myPointYMinMap;
119 QMap<int, QtxDoubleSpinBox*> myPointXSecMap;
120 QMap<int, QtxDoubleSpinBox*> myPointYSecMap;
122 QMap<int, QtxIntSpinBox*> myRefPointXMap;
123 QMap<int, QtxIntSpinBox*> myRefPointYMap;
125 PrsPointDataList myPrsPointDataList;