1 // File: PartSet_OperationSketchBase.cpp
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #include <PartSet_OperationSketchBase.h>
7 #include <SketchPlugin_Feature.h>
9 #include <V3d_View.hxx>
19 PartSet_OperationSketchBase::PartSet_OperationSketchBase(const QString& theId,
21 : ModuleBase_Operation(theId, theParent)
25 PartSet_OperationSketchBase::~PartSet_OperationSketchBase()
29 boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
30 boost::shared_ptr<ModelAPI_Feature> theFeature)
32 boost::shared_ptr<SketchPlugin_Feature> aFeature =
33 boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
35 return boost::shared_ptr<GeomAPI_Shape>();
36 return aFeature->preview();
39 std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
40 PartSet_OperationSketchBase::subPreview() const
42 return std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >();
45 std::list<int> PartSet_OperationSketchBase::getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const
47 std::list<int> aModes;
48 aModes.push_back(TopAbs_VERTEX);
49 aModes.push_back(TopAbs_EDGE);
52 boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchBase::createFeature(const bool theFlushMessage)
54 boost::shared_ptr<ModelAPI_Feature> aFeature = ModuleBase_Operation::createFeature(theFlushMessage);
56 emit featureConstructed(aFeature, FM_Activation);
61 void PartSet_OperationSketchBase::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
62 const std::list<XGUI_ViewerPrs>& theSelected,
63 const std::list<XGUI_ViewerPrs>& theHighlighted)
66 void PartSet_OperationSketchBase::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
67 const std::list<XGUI_ViewerPrs>& theSelected,
68 const std::list<XGUI_ViewerPrs>& theHighlighted)
71 void PartSet_OperationSketchBase::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView)
75 void PartSet_OperationSketchBase::keyReleased(const int theKey)
78 case Qt::Key_Escape: {
87 void PartSet_OperationSketchBase::keyReleased(std::string theName, QKeyEvent* theEvent)
89 keyReleased(theEvent->key());
92 void PartSet_OperationSketchBase::restartOperation(const std::string& theType,
93 boost::shared_ptr<ModelAPI_Feature> theFeature)
95 emit launchOperation(theType, theFeature);