Salome HOME
04d5be75679729c374a514f9a97eb67dff3aeaf6
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchBase.cpp
1 #include <PartSet_OperationSketchBase.h>
2
3 #include <SketchPlugin_Feature.h>
4
5 #ifdef _DEBUG
6 #include <QDebug>
7 #endif
8
9 using namespace std;
10
11 /*!
12  \brief Constructor
13   \param theId an feature index
14   \param theParent the object parent
15  */
16 PartSet_OperationSketchBase::PartSet_OperationSketchBase(const QString& theId,
17                                                              QObject* theParent)
18 : ModuleBase_PropPanelOperation(theId, theParent)
19 {
20 }
21
22 /*!
23  * \brief Destructor
24  */
25 PartSet_OperationSketchBase::~PartSet_OperationSketchBase()
26 {
27 }
28
29 /**
30  * Returns the feature preview shape
31  */
32 const TopoDS_Shape& PartSet_OperationSketchBase::preview() const
33 {
34   boost::shared_ptr<SketchPlugin_Feature> aFeature = 
35     boost::dynamic_pointer_cast<SketchPlugin_Feature>(feature());
36   return aFeature->preview()->impl<TopoDS_Shape>();
37 }
38
39 /*!
40  * Perform the operation start and emit signal about visualization of the operation preview
41  */
42 void PartSet_OperationSketchBase::startOperation()
43 {
44   ModuleBase_PropPanelOperation::startOperation();
45
46   emit visualizePreview(true);
47 }
48
49 /*!
50  * Perform the operation stop and emit signal about visualization stop of the operation preview
51  */
52 void PartSet_OperationSketchBase::stopOperation()
53 {
54   ModuleBase_PropPanelOperation::stopOperation();
55
56   emit visualizePreview(false);
57 }