Salome HOME
Feature #86: The hierarchy in the Object Browser (T 19).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_PolylineDlg.cxx
index 52087532823dc23305f6f3f65816ea7b7d54523a..a643eb3433010a8a48191abd18be994d1a659b5c 100755 (executable)
@@ -24,7 +24,9 @@
 
 #include "HYDROGUI_Module.h"
 #include <CurveCreator_Widget.h>
-#include <CurveCreator_Curve.hxx>
+#include <CurveCreator_ICurve.hxx>
+
+#include <OCCViewer_ViewModel.h>
 
 #include <QGroupBox>
 #include <QHBoxLayout>
@@ -35,7 +37,7 @@ HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS
 : HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL)
 {
   QHBoxLayout* aNameLayout = new QHBoxLayout();
-  QLabel* aNameLabel = new QLabel(tr("CURVE_NAME_TLT"), this);
+  QLabel* aNameLabel = new QLabel(tr("POLYLINE_NAME_TLT"), this);
   aNameLayout->addWidget(aNameLabel);
   myName = new QLineEdit(this);
   aNameLayout->addWidget(myName);
@@ -43,7 +45,6 @@ HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS
   addLayout(aNameLayout);
 
   myEditorWidget = new CurveCreator_Widget( this, NULL );
-  myEditorWidget->setInstantSketchingEnabled( true );
   addWidget( myEditorWidget, 3 );
 
   myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this );
@@ -64,6 +65,11 @@ HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg()
 {
 }
 
+void HYDROGUI_PolylineDlg::setOCCViewer( OCCViewer_Viewer* theViewer )
+{
+  myEditorWidget->setOCCViewer( theViewer );
+}
+
 void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget )
 {
   myEditorWidget->setEnabled( false );
@@ -100,7 +106,7 @@ QString HYDROGUI_PolylineDlg::getPolylineName() const
   return myName->text();
 }
 
-void HYDROGUI_PolylineDlg::setCurve( CurveCreator_Curve* theCurve )
+void HYDROGUI_PolylineDlg::setCurve( CurveCreator_ICurve* theCurve )
 {
   myEditorWidget->setCurve( theCurve );
 }
@@ -114,3 +120,19 @@ QList< QPair< int, int > > HYDROGUI_PolylineDlg::getSelectedPoints()
 {
   return myEditorWidget->getSelectedPoints();
 }
+
+/**
+ * Redirect the delete action to editor widget
+ */
+void HYDROGUI_PolylineDlg::deleteSelected()
+{
+  myEditorWidget->removeSelected();
+}
+
+/**
+ * Checks whether there are some to delete
+ */
+bool HYDROGUI_PolylineDlg::deleteEnabled()
+{
+  return myEditorWidget->removeEnabled();
+}