Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchLine.h
index 27a03a43f8af98192646aed69c014b04fe319ba3..86b1eacebc7cb3b9cb6b2a9a20bb728915543dda 100644 (file)
@@ -32,17 +32,27 @@ public:
   virtual bool isGranted() const;
 
   /// Returns the operation local selection mode
+  /// \param theFeature the feature object to get the selection mode
   /// \return the selection mode
-  virtual int getSelectionMode() const;
+  virtual int getSelectionMode(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
 
   /// Gives the current selected objects to be processed by the operation
-  /// \param theList a list of interactive selected shapes
-  /// \param theSelectedPoint a point clidked in the viewer
-  virtual void setSelectedShapes(const NCollection_List<TopoDS_Shape>& theList,
-                                 const gp_Pnt& thePoint);
+  /// \param thePoint a point clicked in the viewer
+  virtual void mouseReleased(const gp_Pnt& thePoint);
   /// Gives the current mouse point in the viewer
-  /// \param thePoint a point clidked in the viewer
-  virtual void setMouseMovePoint(const gp_Pnt& thePoint);
+  /// \param thePoint a point clicked in the viewer
+  virtual void mouseMoved(const gp_Pnt& thePoint);
+  /// Processes the key pressed in the view
+  /// \param theKey a key value
+  virtual void keyReleased(const int theKey);
+
+signals:
+  /// signal about the sketch plane is selected
+  /// \param theX the value in the X direction of the plane
+  /// \param theX the value in the Y direction value of the plane
+  /// \param theX the value in the Z direction of the plane
+  void localContextChanged(boost::shared_ptr<ModelAPI_Feature> theFeature,
+                           int theMode);
 
 protected:
   /// \brief Virtual method called when operation is started
@@ -61,6 +71,19 @@ protected:
   /// \param theAttribute the start or end attribute of the line
   void setLinePoint(const gp_Pnt& thePoint, const std::string& theAttribute);
 
+  /// \brief Set the point to the line by the point of the source line.
+  /// \param theSourceFeature the feature, where the point is obtained
+  /// \param theSourceAttribute the start or end attribute of the source line
+  /// \param theAttribute the start or end attribute of the line
+  void setLinePoint(boost::shared_ptr<ModelAPI_Feature> theSourceFeature,
+                                               const std::string& theSourceAttribute,
+                                               const std::string& theAttribute);
+  /// \brief Converts the 3D point to the projected coodinates on the sketch plane.
+  /// \param thePoint the 3D point in the viewer
+  /// \param theX the X coordinate
+  /// \param theY the Y coordinate
+  void convertTo2D(const gp_Pnt& thePoint, double& theX, double& theY);
+
 protected:
   ///< Structure to lists the possible types of point selection modes
   enum PointSelectionMode {SM_FirstPoint, SM_SecondPoint, SM_None};