Salome HOME
Bugs on OCC library.
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchLine.h
index 09c33f6f452621540d8d17e9ede546f703c417e7..d0c08e2865a923167bce06b6dfac85eb97d6dada 100644 (file)
@@ -12,6 +12,7 @@
 
 class GeomDataAPI_Point2D;
 class QMouseEvent;
+class QKeyEvent;
 
 /*!
  \class PartSet_OperationSketchLine
@@ -46,21 +47,24 @@ public:
   virtual std::list<int> getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
 
   /// Initializes some fields accorging to the feature
-  /// \param theFeature the feature
-  /// \param thePresentations the list of additional presentations
+  /// \param theSelected the list of selected presentations
+  /// \param theHighlighted the list of highlighted presentations
   virtual void init(boost::shared_ptr<ModelAPI_Feature> theFeature,
-                    const std::list<XGUI_ViewerPrs>& thePresentations);
+                    const std::list<XGUI_ViewerPrs>& theSelected,
+                    const std::list<XGUI_ViewerPrs>& theHighlighted);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
   virtual boost::shared_ptr<ModelAPI_Feature> sketch() const;
 
   /// Gives the current selected objects to be processed by the operation
-  /// \param thePoint a point clicked in the viewer
   /// \param theEvent the mouse event
+  /// \param theView a viewer to have the viewer the eye position
   /// \param theSelected the list of selected presentations
+  /// \param theHighlighted the list of highlighted presentations
  virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
-                             const std::list<XGUI_ViewerPrs>& theSelected);
+                            const std::list<XGUI_ViewerPrs>& theSelected,
+                            const std::list<XGUI_ViewerPrs>& theHighlighted);
   /// Gives the current mouse point in the viewer
   /// \param thePoint a point clicked in the viewer
   /// \param theEvent the mouse event
@@ -69,6 +73,16 @@ public:
   /// \param theKey a key value
   virtual void keyReleased(const int theKey);
 
+  virtual void keyReleased(std::string theName, QKeyEvent* theEvent);
+
+  /// \brief Save the point to the line.
+  /// \param theFeature the line feature
+  /// \param theX the horizontal coordinate
+  /// \param theY the vertical coordinate
+  /// \param theAttribute the start or end attribute of the line
+  static void setLinePoint(boost::shared_ptr<ModelAPI_Feature>, double theX, double theY,
+                           const std::string& theAttribute);
+
 protected:
   /// \brief Virtual method called when operation is started
   /// Virtual method called when operation started (see start() method for more description)
@@ -86,8 +100,9 @@ protected:
   /// Creates an operation new feature
   /// In addition to the default realization it appends the created line feature to
   /// the sketch feature
+  /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature();
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(const bool theFlushMessage = true);
 
   /// Creates a constraint on two points
   /// \param thePoint1 the first point
@@ -99,6 +114,7 @@ protected:
   /// \param theX the horizontal coordnate of the point
   /// \param theY the vertical coordnate of the point
   void setConstraints(double theX, double theY);
+
 protected:
   /// \brief Get the line point 2d coordinates.
   /// \param theFeature the line feature
@@ -115,13 +131,6 @@ protected:
                                                        double theX, double theY);
 
   /// \brief Save the point to the line.
-  /// \param theFeature the line feature
-  /// \param theX the horizontal coordinate
-  /// \param theY the vertical coordinate
-  /// \param theAttribute the start or end attribute of the line
-  void setLinePoint(boost::shared_ptr<ModelAPI_Feature>, double theX, double theY,
-                    const std::string& theAttribute);
-  /// \brief Save the point to the line.
   /// \param thePoint the 3D point in the viewer
   /// \param theAttribute the start or end attribute of the line
   void setLinePoint(const gp_Pnt& thePoint, Handle(V3d_View) theView, const std::string& theAttribute);
@@ -130,6 +139,11 @@ protected:
   ///< Structure to lists the possible types of point selection modes
   enum PointSelectionMode {SM_FirstPoint, SM_SecondPoint, SM_DonePoint};
 
+  ///< Set the point selection mode. Emit signal about focus change if necessary.
+  /// \param theMode a new selection mode
+  /// \param isToEmitSignal the neccessity to emit signal
+  void setPointSelectionMode(const PointSelectionMode& theMode, const bool isToEmitSignal = true);
+
 private:
   boost::shared_ptr<ModelAPI_Feature> mySketch; ///< the sketch feature
   boost::shared_ptr<GeomDataAPI_Point2D> myInitPoint; ///< the first line point