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"
37 class QtxDoubleSpinBox;
40 class HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel
45 enum TransformationMode { ManualLambert = 0, ManualCartesian, RefImage };
48 struct TransformationData
52 QPointF CartesianPoint;
54 TransformationData() {}
56 TransformationData( const QPoint& theImagePoint,
57 const QPointF& theLambertPoint,
58 const QPointF& theCartesianPoint ) :
59 ImagePoint( theImagePoint ),
60 LambertPoint( theLambertPoint ),
61 CartesianPoint( theCartesianPoint ) {}
63 typedef QMap< int, TransformationData > TransformationDataMap;
65 typedef QPair< QString, TransformationDataMap > PrsPointData;
66 typedef QList< PrsPointData > PrsPointDataList;
67 typedef QListIterator< PrsPointData > PrsPointDataListIterator;
70 HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle );
71 virtual ~HYDROGUI_ImportImageDlg();
73 void setIsEdit( const bool theIsEdit );
76 void setImageName( const QString& theName );
77 QString getImageName() const;
79 QString getFileName() const;
81 void setImageSize( const QSize& theSize,
82 const bool theIsRefImage = false );
84 void setTransformationMode( const int theMode );
85 int getTransformationMode() const;
87 void setTransformationDataMap( const TransformationDataMap& theMap,
88 const bool theIsOnlyInput = false,
89 const bool theIsRefImage = false );
90 bool getTransformationDataMap( TransformationDataMap& theMap,
91 const bool theIsRefImage = false ) const;
93 QString getRefImageName() const;
95 void setPrsPointDataList( const PrsPointDataList& theList );
97 void initializePointSelection();
101 void onModeActivated( int );
102 void onRefImageActivated( const QString& );
103 void onPointBtnToggled( bool );
104 void onPointCoordChanged( int );
106 void onLambertCoordChanged();
107 void onLambertCoordChanged( const int thePointType );
109 void onCartesianCoordChanged();
110 void onCartesianCoordChanged( const int thePointType );
113 void blockSignalsLambert( const bool theState );
114 void blockSignalsCartesian( const bool theState );
117 void createPreview( QImage );
118 void activatePointSelection( int );
119 void pointCoordChanged( bool theIsRef,
123 void modeActivated( int );
124 void refImageActivated( const QString& );
127 QGroupBox* myFileNameGroup;
128 QLineEdit* myFileName;
130 QGroupBox* myImageNameGroup;
131 QLineEdit* myImageName;
133 QGroupBox* myTransformGroup;
135 QButtonGroup* myModeGroup;
136 QComboBox* myRefImage;
138 QList<QLabel*> myLambertLabels;
140 QMap<int, QPushButton*> myPointBtnMap;
141 QMap<int, QtxIntSpinBox*> myPointXMap;
142 QMap<int, QtxIntSpinBox*> myPointYMap;
143 QMap<int, QtxIntSpinBox*> myPointXDegMap;
144 QMap<int, QtxIntSpinBox*> myPointYDegMap;
145 QMap<int, QtxIntSpinBox*> myPointXMinMap;
146 QMap<int, QtxIntSpinBox*> myPointYMinMap;
147 QMap<int, QtxDoubleSpinBox*> myPointXSecMap;
148 QMap<int, QtxDoubleSpinBox*> myPointYSecMap;
150 QMap<int, QtxDoubleSpinBox*> myCartPointXMap;
151 QMap<int, QtxDoubleSpinBox*> myCartPointYMap;
153 QMap<int, QtxIntSpinBox*> myRefPointXMap;
154 QMap<int, QtxIntSpinBox*> myRefPointYMap;
156 QCheckBox* myPointCEnabler;
158 PrsPointDataList myPrsPointDataList;
160 bool myIsInitialized;