Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchLine.cpp
1 // File:        PartSet_OperationSketchLine.h
2 // Created:     20 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #include <PartSet_OperationSketchLine.h>
6
7 #include <SketchPlugin_Feature.h>
8
9 #ifdef _DEBUG
10 #include <QDebug>
11 #endif
12
13 using namespace std;
14
15 PartSet_OperationSketchLine::PartSet_OperationSketchLine(const QString& theId,
16                                                   QObject* theParent,
17                                               boost::shared_ptr<ModelAPI_Feature> theFeature)
18 : PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature)
19 {
20 }
21
22 PartSet_OperationSketchLine::~PartSet_OperationSketchLine()
23 {
24 }
25
26 bool PartSet_OperationSketchLine::isGranted() const
27 {
28   return true;
29 }
30
31 int PartSet_OperationSketchLine::getSelectionMode() const
32 {
33   return TopAbs_FACE;
34 }
35
36 void PartSet_OperationSketchLine::setSelectedShapes(const NCollection_List<TopoDS_Shape>& theList)
37 {
38   if (theList.IsEmpty())
39     return;
40 }
41
42 void PartSet_OperationSketchLine::startOperation()
43 {
44   PartSet_OperationSketchBase::startOperation();
45
46   if (mySketch) {
47     boost::shared_ptr<SketchPlugin_Feature> aFeature = 
48                            boost::dynamic_pointer_cast<SketchPlugin_Feature>(mySketch);
49
50     aFeature->addSub(feature());
51   }
52 }