Salome HOME
Dialog for delete operation (Bug #300).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ProfileDlg.cxx
index e4725a2a174115a69f966747d9eaf6d5f5550bda..499e5ec74d4f589de2ba21498d30da8c49ecfe0e 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <CurveCreator_Widget.h>
 #include <CurveCreator_ICurve.hxx>
+#include <CurveCreator_Utils.h>
 
 #include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_Utilities.h>
@@ -37,8 +38,6 @@
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 
-#include <GEOMUtils.hxx>
-
 #include <QGroupBox>
 #include <QHBoxLayout>
 #include <QLabel>
@@ -126,6 +125,7 @@ HYDROGUI_ProfileDlg::~HYDROGUI_ProfileDlg()
 void HYDROGUI_ProfileDlg::reset()
 {
   myEditorWidget->reset();
+  myEditorWidget->setActionMode( CurveCreator_Widget::AdditionMode );
 }
 
 Handle(AIS_InteractiveContext) HYDROGUI_ProfileDlg::getAISContext()
@@ -147,6 +147,11 @@ QString HYDROGUI_ProfileDlg::getProfileName() const
 void HYDROGUI_ProfileDlg::setProfile( CurveCreator_ICurve* theProfile )
 {
   myEditorWidget->setCurve( theProfile );
+
+  // select the single section by default
+  QList<int> aSections;
+  aSections << 0;
+  myEditorWidget->setSelectedSections( aSections );
 }
 
 QList<int> HYDROGUI_ProfileDlg::getSelectedSections()
@@ -198,7 +203,7 @@ void HYDROGUI_ProfileDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEve
   OCCViewer_ViewWindow* anOCCViewWindow = 
     dynamic_cast<OCCViewer_ViewWindow*>(theViewWindow);
   if ( anOCCViewWindow && anOCCViewWindow->getViewPort() ) {
-    gp_Pnt aPnt = GEOMUtils::ConvertClickToPoint( 
+    gp_Pnt aPnt = CurveCreator_Utils::ConvertClickToPoint( 
       theEvent->x(), theEvent->y(), anOCCViewWindow->getViewPort()->getView() );
 
     // Show the coordinates
@@ -210,9 +215,12 @@ void HYDROGUI_ProfileDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEve
 
 bool HYDROGUI_ProfileDlg::eventFilter( QObject* theObj, QEvent* theEvent )
 {
-  if ( theObj->inherits( "OCCViewer_ViewPort" ) && 
-       theEvent->type() == QEvent::Leave ) {
-    myCoordLabel->clear();
+  if ( theObj->inherits( "OCCViewer_ViewPort" ) )
+  {
+    if ( theEvent->type() == QEvent::Leave )
+      myCoordLabel->clear();
+
+    return false;
   }
 
   return HYDROGUI_InputPanel::eventFilter( theObj, theEvent );