Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchBase.cpp
index 9b34aa2ebd34779ca8525508110440319b93035c..4113c3cba83fbab23eed59174fbd7e08d98cb4a3 100644 (file)
@@ -1,56 +1,53 @@
+// File:        PartSet_OperationSketchBase.cpp
+// Created:     20 Apr 2014
+// Author:      Natalia ERMOLAEVA
+
 #include <PartSet_OperationSketchBase.h>
 
 #include <SketchPlugin_Feature.h>
 
+#include <V3d_View.hxx>
+
 #ifdef _DEBUG
 #include <QDebug>
 #endif
 
 using namespace std;
 
-/*!
- \brief Constructor
-  \param theId an feature index
-  \param theParent the object parent
- */
 PartSet_OperationSketchBase::PartSet_OperationSketchBase(const QString& theId,
                                                             QObject* theParent)
-: ModuleBase_PropPanelOperation(theId, theParent)
+: ModuleBase_Operation(theId, theParent)
 {
 }
 
-/*!
- * \brief Destructor
- */
 PartSet_OperationSketchBase::~PartSet_OperationSketchBase()
 {
 }
 
-/**
- * Returns the feature preview shape
- */
-const TopoDS_Shape& PartSet_OperationSketchBase::preview() const
+boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
+                                      boost::shared_ptr<ModelAPI_Feature> theFeature) const
 {
-  shared_ptr<SketchPlugin_Feature> aFeature = dynamic_pointer_cast<SketchPlugin_Feature>(feature());
-  return *(static_cast<TopoDS_Shape*>(aFeature->preview()->implementation()));
+  boost::shared_ptr<SketchPlugin_Feature> aFeature = 
+                              boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
+  return aFeature->preview();
 }
 
-/*!
- * Perform the operation start and emit signal about visualization of the operation preview
- */
-void PartSet_OperationSketchBase::startOperation()
+boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchBase::createFeature()
 {
-  ModuleBase_PropPanelOperation::startOperation();
-
-  emit visualizePreview(true);
+  boost::shared_ptr<ModelAPI_Feature> aFeature = ModuleBase_Operation::createFeature();
+  emit featureConstructed(aFeature, FM_Activation);
+  return aFeature;
 }
 
-/*!
- * Perform the operation stop and emit signal about visualization stop of the operation preview
- */
-void PartSet_OperationSketchBase::stopOperation()
-{
-  ModuleBase_PropPanelOperation::stopOperation();
 
-  emit visualizePreview(false);
+void PartSet_OperationSketchBase::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView)
+{
+}
+void PartSet_OperationSketchBase::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
+                                                const std::list<XGUI_ViewerPrs>& theSelected)
+{
+}
+void PartSet_OperationSketchBase::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView,
+                                             const std::list<XGUI_ViewerPrs>& theSelected)
+{
 }