Salome HOME
Add a new 'moveSection' operation to change position of section in the list.
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Widget.h
index 0129da991c4d7b19e4bae08cac6ea254da9e9148..f17cf3d17f567238a4f2f6fd6798965141e3740e 100644 (file)
@@ -124,10 +124,10 @@ protected:
   };
 
   enum ActionMode {
+    NoneMode,
     AdditionMode,
     ModificationMode,
-    DetectionMode,
-    NoneMode
+    DetectionMode
   };
 
 private:
@@ -140,10 +140,11 @@ private:
 
   void removeSection();
   void removePoint();
-  bool insertPointToSelectedSegment( const int theXPosition,
+  void insertPointToSelectedSegment( const int theXPosition,
                                      const int theYPosition );
+  void moveSelectedPoints( const int theXPosition, const int theYPosition );
   void updateLocalPointView();
-  void setLocalPointContext( const bool theOpen );
+  void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false );
   void addLocalPointToTable( const double theX, const double theY );
 
   void setDragStarted( const bool theState, const QPoint& thePoint = QPoint() );
@@ -151,9 +152,12 @@ private:
   void getSelectedPonts( const int theSectionId, QList<int>& thePoints );
   void setSelectedPonts( const int theSectionId, const QList<int>& thePoints = QList<int>() );
 
+  void startCurveModification( QList<int>& thePoints, const bool theFillPoints = true );
+  void finishCurveModification( const QList<int>& thePoints );
 
   // curve algorithm
   int  findLocalPointIndex( int theSectionId, float theX, float theY );
+  void findSections( int thePointId, QList<int>& theSections );
 
   // OCC algorithm
   bool pointOnObject( Handle(AIS_InteractiveObject) theObject,
@@ -161,7 +165,7 @@ private:
                       gp_Pnt& thePoint, int& thePoint1, int& thePoint2 );
   bool hasProjectPointOnCurve( const int theX, const int theY,
                                const Handle(Geom_Curve)& theCurve,
-                               gp_Pnt& theOutPoint );
+                               Standard_Real& theParameter );
 
 private:
   QMap<ActionId, QAction*>    myActionMap;
@@ -173,8 +177,10 @@ private:
   int                         mySection;
   int                         myPointNum;
   bool                        myDragStarted;
-  QList<int>                  myDragPoints;
   QPoint                      myDragStartPosition;
+  int                         myDragInteractionStyle;
+  QList<int>                  myDragPoints;
+  bool                        myDragged;
   QByteArray                  myGuiState;
 };