Salome HOME
projects
/
modules
/
hydro.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for the bug #255: VTK viewer is not updated after modification of objects.
[modules/hydro.git]
/
src
/
HYDROGUI
/
HYDROGUI_PolylineDlg.cxx
diff --git
a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx
b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx
index 40a831d80db3cab3a7a59f1fe96dfed29b8fc29d..abbd6ae4850f1c7f001de1df568cbb0b18dd33aa 100755
(executable)
--- a/
src/HYDROGUI/HYDROGUI_PolylineDlg.cxx
+++ b/
src/HYDROGUI/HYDROGUI_PolylineDlg.cxx
@@
-24,8
+24,11
@@
#include "HYDROGUI_Module.h"
#include <CurveCreator_Widget.h>
#include "HYDROGUI_Module.h"
#include <CurveCreator_Widget.h>
-#include <CurveCreator_Curve.hxx>
+#include <CurveCreator_
I
Curve.hxx>
+#include <OCCViewer_ViewModel.h>
+
+#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
@@
-34,37
+37,60
@@
HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS
: HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL)
{
QHBoxLayout* aNameLayout = new QHBoxLayout();
: HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL)
{
QHBoxLayout* aNameLayout = new QHBoxLayout();
- QLabel* aNameLabel = new QLabel(tr("
CURV
E_NAME_TLT"), this);
+ QLabel* aNameLabel = new QLabel(tr("
POLYLIN
E_NAME_TLT"), this);
aNameLayout->addWidget(aNameLabel);
myName = new QLineEdit(this);
aNameLayout->addWidget(myName);
addLayout(aNameLayout);
aNameLayout->addWidget(aNameLabel);
myName = new QLineEdit(this);
aNameLayout->addWidget(myName);
addLayout(aNameLayout);
- myEditorWidget =
- new CurveCreator_Widget( this, NULL );
+ myEditorWidget = new CurveCreator_Widget( this, NULL );
+ addWidget( myEditorWidget, 3 );
+
+ myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this );
+ addWidget( myAddElementBox, 2 );
- addWidget( myEditorWidget );
+ QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox );
+ anAddElementLayout->setMargin( 0 );
+ anAddElementLayout->setSpacing( 5 );
connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
- connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*
) ), this, SLOT( processStartedSubOperation(QWidget*
) ) );
+ connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*
, bool) ), this, SLOT( processStartedSubOperation(QWidget*, bool
) ) );
connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
+
+ myAddElementBox->hide();
}
HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg()
{
}
}
HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg()
{
}
-void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget )
+void HYDROGUI_PolylineDlg::setOCCViewer( OCCViewer_Viewer* theViewer )
+{
+ myEditorWidget->setOCCViewer( theViewer );
+}
+
+void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget, bool theIsEdit )
{
myEditorWidget->setEnabled( false );
{
myEditorWidget->setEnabled( false );
- activateWidget( theWidget );
+
+ myAddElementBox->setTitle( theIsEdit ? tr( "EDIT_ELEMENT" ) : tr( "ADD_ELEMENT" ) );
+ QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+ anAddElementLayout->addWidget( theWidget );
+
+ theWidget->show();
+ myAddElementBox->show();
}
void HYDROGUI_PolylineDlg::processFinishedSubOperation( QWidget* theWidget )
{
myEditorWidget->setEnabled( true );
}
void HYDROGUI_PolylineDlg::processFinishedSubOperation( QWidget* theWidget )
{
myEditorWidget->setEnabled( true );
- activateWidget( 0 );
+
+ QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+ anAddElementLayout->removeWidget( theWidget );
+
+ theWidget->hide();
+ myAddElementBox->hide();
}
void HYDROGUI_PolylineDlg::reset()
}
void HYDROGUI_PolylineDlg::reset()
@@
-81,7
+107,7
@@
QString HYDROGUI_PolylineDlg::getPolylineName() const
return myName->text();
}
return myName->text();
}
-void HYDROGUI_PolylineDlg::setCurve( CurveCreator_Curve* theCurve )
+void HYDROGUI_PolylineDlg::setCurve( CurveCreator_
I
Curve* theCurve )
{
myEditorWidget->setCurve( theCurve );
}
{
myEditorWidget->setCurve( theCurve );
}
@@
-91,7
+117,18
@@
QList<int> HYDROGUI_PolylineDlg::getSelectedSections()
return myEditorWidget->getSelectedSections();
}
return myEditorWidget->getSelectedSections();
}
-QList< QPair< int, int > > HYDROGUI_PolylineDlg::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->
getSelectedPoints
();
+ return myEditorWidget->
removeEnabled
();
}
}