Salome HOME
Final version of "Profile interpolation".
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ProfileInterpolateOp.h
index d437d55cc891f2683047205781eab747b32954e7..dabd86ec18d52008c3ff0edb377038e8835734c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 #include <HYDROData_Profile.h>
 
-class HYDROGUI_CurveCreatorProfile;
+#include <AIS_Shape.hxx>
+
+#include <QPair>
+#include <QList>
+
+class HYDROData_IProfilesInterpolator;
 
 class HYDROGUI_ProfileInterpolateOp : public HYDROGUI_Operation
 {
   Q_OBJECT
 
 public:
-  HYDROGUI_ProfileInterpolateOp( HYDROGUI_Module* theModule, bool isEdit );
+  HYDROGUI_ProfileInterpolateOp( HYDROGUI_Module* theModule );
   virtual ~HYDROGUI_ProfileInterpolateOp();
 
-  void                       deleteSelected();
-  bool                       deleteEnabled();
+protected:
+  typedef QList< QPair<QString, QString> > ParamsList;
 
 protected:
   virtual void               startOperation();
@@ -50,14 +55,22 @@ protected:
   virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
                                            QStringList& theBrowseObjectsEntries );
 
-private:
-  void                       displayPreview();
-  void                       erasePreview();
+  QStringList                interpolators() const;
+  HYDROData_IProfilesInterpolator* interpolator( const QString& ) const;
+  void                       updateInterpolator( HYDROData_IProfilesInterpolator* );
+  std::vector<double>        profile( const QString& ) const;
+  ParamsList                 parameters( const QString& ) const;
+  QString                    parameters( const ParamsList& ) const;
+
+  TopoDS_Shape               previewShape( HYDROData_IProfilesInterpolator*, int ) const;
+
+private slots:
+  void                       updatePreview();
+  void                       onRiverChanged( const QString& );
+  void                       onInterpolatorChanged( const QString& );
 
 private:
-  bool                       myIsEdit;
-  Handle(HYDROData_Profile)  myEditedObject;
-  HYDROGUI_CurveCreatorProfile* myProfile;
+  Handle(AIS_Shape)          myPreview;
 };
 
 #endif