#include "HYDROGUI_ImportGeomObjectOp.h"
#include "HYDROGUI_ShowHideOp.h"
+#include <HYDROData_Tool.h>
#include <HYDROData_Image.h>
+#include <HYDROData_Stream.h>
#include <HYDROData_Profile.h>
#include <HYDROData_Lambert93.h>
-#include <HYDROData_Tool.h>
+#include <HYDROData_Polyline3D.h>
#include <HYDROData_OperationsFactory.h>
bool anIsGroup = false;
bool anIsObjectCanBeColored = false;
bool isRoot = false;
+ bool isStreamHasBottom = false;
SUIT_SelectionMgr* aSelectionMgr = getApp()->selectionMgr();
SUIT_DataOwnerPtrList anOwners;
else if( anObjectKind == KIND_OBSTACLE )
anIsObstacle = true;
else if( anObjectKind == KIND_STREAM )
+ {
anIsStream = true;
+ Handle(HYDROData_Stream) aStream =
+ Handle(HYDROData_Stream)::DownCast( anObject );
+ if ( !aStream.IsNull() )
+ isStreamHasBottom = !aStream->GetBottomPolyline().IsNull();
+ }
else if( anObjectKind == KIND_CHANNEL )
anIsChannel = true;
else if( anObjectKind == KIND_DIGUE )
else if( anIsStream )
{
theMenu->addAction( action( EditStreamId ) );
+ if ( action( RiverBottom ) )
+ {
+ theMenu->addAction( action( RiverBottom ) );
+ action( RiverBottom )->setEnabled( !isStreamHasBottom );
+ }
theMenu->addSeparator();
}
else if( anIsChannel )
#include "HYDROGUI_Tool.h"
#include "HYDROGUI_ObjComboBox.h"
+#include <HYDROData_Stream.h>
+#include <HYDROData_Polyline3D.h>
+
#include <QLabel>
#include <QLayout>
#include <QComboBox>
#include <QGroupBox>
HYDROGUI_RiverBottomDlg::HYDROGUI_RiverBottomDlg( HYDROGUI_Module* theModule, const QString& theTitle )
- : HYDROGUI_InputPanel( theModule, theTitle )
+ : HYDROGUI_InputPanel( theModule, theTitle ),
+ HYDROGUI_ObjComboBoxFilter()
{
// Channel name
QGroupBox* group = new QGroupBox( mainFrame() );
QBoxLayout* base = new QVBoxLayout( group );
base->addWidget( myRivers = new HYDROGUI_ObjComboBox( theModule, tr( "RIVER_OBJECT" ), KIND_STREAM, group ) );
+ myRivers->setObjectFilter( this );
addWidget( group );
myRivers->setSectedObject( theName );
}
+bool HYDROGUI_RiverBottomDlg::isOk( const Handle(HYDROData_Entity)& theEntity ) const
+{
+ Handle(HYDROData_Stream) aStream = Handle(HYDROData_Stream)::DownCast(theEntity);
+ return !aStream.IsNull() && aStream->GetBottomPolyline().IsNull();
+}
+
void HYDROGUI_RiverBottomDlg::onRiverChanged( const QString& )
{
updateState();
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#ifndef HYDROGUI_RIVERBOTTOMDlg_H
-#define HYDROGUI_RIVERBOTTOMDlg_H
+#ifndef HYDROGUI_RIVERBOTTOMDLG_H
+#define HYDROGUI_RIVERBOTTOMDLG_H
#include "HYDROGUI_InputPanel.h"
+#include "HYDROGUI_ObjComboBox.h"
+
class QComboBox;
-class HYDROGUI_ObjComboBox;
-class HYDROGUI_RiverBottomDlg : public HYDROGUI_InputPanel
+class HYDROGUI_RiverBottomDlg : public HYDROGUI_InputPanel, public HYDROGUI_ObjComboBoxFilter
{
Q_OBJECT
QString getRiverName() const;
void setRiverName( const QString& );
+ virtual bool isOk( const Handle(HYDROData_Entity)& ) const;
+
private slots:
void onRiverChanged( const QString& );