]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_OperationSketchBase.cpp
Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchBase.cpp
1 // File:        PartSet_OperationSketchBase.cpp
2 // Created:     20 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #include <PartSet_OperationSketchBase.h>
6
7 #include <SketchPlugin_Feature.h>
8 #include <Model_Object.h>
9
10 #include <V3d_View.hxx>
11
12 #ifdef _DEBUG
13 #include <QDebug>
14 #endif
15
16 using namespace std;
17
18 PartSet_OperationSketchBase::PartSet_OperationSketchBase(const QString& theId,
19                                                              QObject* theParent)
20 : ModuleBase_Operation(theId, theParent)
21 {
22 }
23
24 PartSet_OperationSketchBase::~PartSet_OperationSketchBase()
25 {
26 }
27
28 boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
29                                       boost::shared_ptr<ModelAPI_Feature> theFeature) const
30 {
31   boost::shared_ptr<SketchPlugin_Feature> aFeature = 
32                               boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
33   if (!aFeature) { // if it is reference to a object feature
34     boost::shared_ptr<Model_Object> anObj = 
35       boost::dynamic_pointer_cast<Model_Object>(theFeature);
36     if (anObj) 
37       aFeature = boost::dynamic_pointer_cast<SketchPlugin_Feature>(anObj->featureRef());
38   }
39   return aFeature->preview();
40 }
41
42 std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
43                                                      PartSet_OperationSketchBase::preview() const
44 {
45   return std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >();
46 }
47
48 boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchBase::createFeature()
49 {
50   boost::shared_ptr<ModelAPI_Feature> aFeature = ModuleBase_Operation::createFeature();
51   emit featureConstructed(aFeature, FM_Activation);
52   return aFeature;
53 }
54
55
56 void PartSet_OperationSketchBase::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
57                                                const std::list<XGUI_ViewerPrs>& theSelected)
58 {
59 }
60 void PartSet_OperationSketchBase::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
61                                                 const std::list<XGUI_ViewerPrs>& theSelected)
62 {
63 }
64 void PartSet_OperationSketchBase::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView)
65 {
66 }