1 // File: PartSet_OperationSketchLine.h
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PartSet_OperationSketchLine_H
6 #define PartSet_OperationSketchLine_H
10 #include <PartSet_OperationSketchBase.h>
14 \class PartSet_OperationSketchLine
15 * \brief The operation for the sketch feature creation
17 class PARTSET_EXPORT PartSet_OperationSketchLine : public PartSet_OperationSketchBase
22 /// \param theId the feature identifier
23 /// \param theParent the operation parent
24 /// \param theFeature the parent feature
25 PartSet_OperationSketchLine(const QString& theId, QObject* theParent,
26 boost::shared_ptr<ModelAPI_Feature> theSketchFeature);
28 virtual ~PartSet_OperationSketchLine();
30 /// Returns that this operator can be started above already running one.
31 /// The runned operation should be the sketch feature modified operation
32 virtual bool isGranted() const;
34 /// Returns the operation local selection mode
35 /// \return the selection mode
36 virtual int getSelectionMode() const;
38 /// Gives the current selected objects to be processed by the operation
39 /// \param theList a list of interactive selected shapes
40 /// \param theSelectedPoint a point clidked in the viewer
41 virtual void setSelectedShapes(const NCollection_List<TopoDS_Shape>& theList,
42 const gp_Pnt& thePoint);
43 /// Gives the current mouse point in the viewer
44 /// \param thePoint a point clidked in the viewer
45 virtual void setMouseMovePoint(const gp_Pnt& thePoint);
48 /// \brief Virtual method called when operation is started
49 /// Virtual method called when operation started (see start() method for more description)
50 /// After the parent operation body perform, set sketch feature to the created line feature
51 virtual void startOperation();
53 /// \brief Virtual method called when operation is started
54 /// Virtual method called when operation stopped - committed or aborted.
55 /// After the parent operation body perform, reset selection point mode of the operation
56 virtual void stopOperation();
59 /// \brief Save the point to the line.
60 /// \param thePoint the 3D point in the viewer
61 /// \param theAttribute the start or end attribute of the line
62 void setLinePoint(const gp_Pnt& thePoint, const std::string& theAttribute);
65 ///< Structure to lists the possible types of point selection modes
66 enum PointSelectionMode {SM_FirstPoint, SM_SecondPoint, SM_None};
69 boost::shared_ptr<ModelAPI_Feature> mySketch; ///< the sketch feature
70 PointSelectionMode myPointSelectionMode; ///< point selection mode