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
refs #562: basic logic for Strickler table operation and dialog.
[modules/hydro.git]
/
src
/
HYDROGUI
/
HYDROGUI_Module.cxx
diff --git
a/src/HYDROGUI/HYDROGUI_Module.cxx
b/src/HYDROGUI/HYDROGUI_Module.cxx
index 3c752c2996aa99ce20d71eaaae911d8d1504efb2..2fadc91100629997bd96d46f12c3e9e606e4539f 100644
(file)
--- a/
src/HYDROGUI/HYDROGUI_Module.cxx
+++ b/
src/HYDROGUI/HYDROGUI_Module.cxx
@@
-1,8
+1,4
@@
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015 EDF-R&D
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
@@
-340,6
+336,7
@@
void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
bool anIsRegion = false;
bool anIsZone = false;
bool anIsObstacle = false;
bool anIsRegion = false;
bool anIsZone = false;
bool anIsObstacle = false;
+ bool anIsStricklerTable = false;
bool anIsStream = false;
bool anIsChannel = false;
bool anIsDigue = false;
bool anIsStream = false;
bool anIsChannel = false;
bool anIsDigue = false;
@@
-458,6
+455,8
@@
void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
anIsBathymetry = true;
else if( anObjectKind == KIND_OBSTACLE )
anIsObstacle = true;
anIsBathymetry = true;
else if( anObjectKind == KIND_OBSTACLE )
anIsObstacle = true;
+ else if( anObjectKind == KIND_STRICKLER_TABLE )
+ anIsStricklerTable = true;
else if( anObjectKind == KIND_STREAM )
{
anIsStream = true;
else if( anObjectKind == KIND_STREAM )
{
anIsStream = true;
@@
-511,6
+510,9
@@
void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
theMenu->addAction( action( CreateBoxId ) );
theMenu->addAction( action( CreateCylinderId ) );
break;
theMenu->addAction( action( CreateBoxId ) );
theMenu->addAction( action( CreateCylinderId ) );
break;
+ case KIND_STRICKLER_TABLE:
+ theMenu->addAction( action( ImportStricklerTableFromFileId ) );
+ break;
case KIND_CALCULATION:
theMenu->addAction( action( CreateCalculationId ) );
break;
case KIND_CALCULATION:
theMenu->addAction( action( CreateCalculationId ) );
break;
@@
-637,6
+639,12
@@
void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
theMenu->addAction( action( TranslateObstacleId ) );
theMenu->addSeparator();
}
theMenu->addAction( action( TranslateObstacleId ) );
theMenu->addSeparator();
}
+ else if( anIsStricklerTable )
+ {
+ theMenu->addAction( action( EditStricklerTableId ) );
+ theMenu->addAction( action( ExportStricklerTableFromFileId ) );
+ theMenu->addSeparator();
+ }
else if( anIsVisualState && anIsObjectBrowser )
{
theMenu->addAction( action( SaveVisualStateId ) );
else if( anIsVisualState && anIsObjectBrowser )
{
theMenu->addAction( action( SaveVisualStateId ) );
@@
-710,6
+718,21
@@
void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
if( isRoot )
theMenu->addAction( action( EditLocalCSId ) );
if( isRoot )
theMenu->addAction( action( EditLocalCSId ) );
+
+ if( anIsObjectBrowser && anOwners.size()==1 )
+ {
+ if( aSeq.Size() > 0 )
+ {
+ Handle( HYDROData_Object ) anObject = Handle( HYDROData_Object )::DownCast( aSeq.First() );
+ if( !anObject.IsNull() )
+ {
+ theMenu->addSeparator();
+ theMenu->addAction( action( SubmersibleId ) );
+ action( SubmersibleId )->setCheckable( true );
+ action( SubmersibleId )->setChecked( anObject->IsSubmersible() );
+ }
+ }
+ }
}
void HYDROGUI_Module::createPreferences()
}
void HYDROGUI_Module::createPreferences()
@@
-940,6
+963,17
@@
bool HYDROGUI_Module::isObjectVisible( const int theViewId,
if( theObject.IsNull() )
return false;
if( theObject.IsNull() )
return false;
+ if( theViewId < 0 )
+ {
+ //search in all
+ foreach( int aViewId, myObjectStateMap.keys() )
+ {
+ if( isObjectVisible( aViewId, theObject ) )
+ return true;
+ }
+ return false;
+ }
+
ViewId2Entry2ObjectStateMap::const_iterator anIter1 = myObjectStateMap.find( theViewId );
if( anIter1 != myObjectStateMap.end() )
{
ViewId2Entry2ObjectStateMap::const_iterator anIter1 = myObjectStateMap.find( theViewId );
if( anIter1 != myObjectStateMap.end() )
{