#include "HYDROGUI_PolylineOp.h"
#include <HYDROData_Image.h>
+#include <HYDROData_Profile.h>
#include <HYDROData_Lambert93.h>
#include <HYDROData_Tool.h>
connect( anApp, SIGNAL( operationFinished( const QString&, const QString&, const QStringList& ) ),
this, SLOT( onExternalOperationFinished( const QString&, const QString&, const QStringList& ) ) );
+ HYDROGUI_Tool::setOCCActionShown( this, OCCViewer_ViewWindow::MaximizedId, false );
+
return aRes;
}
disconnect( getApp(), SIGNAL( operationFinished( const QString&, const QString&, const QStringList& ) ),
this, SLOT( onExternalOperationFinished( const QString&, const QString&, const QStringList& ) ) );
+ HYDROGUI_Tool::setOCCActionShown( this, OCCViewer_ViewWindow::MaximizedId, true );
+
return LightApp_Module::deactivateModule( theStudy );
}
bool anIsSplittedImage = false;
bool anIsMustBeUpdatedImage = false;
bool anIsPolyline = false;
+ bool anIsPolyline3D = false;
bool anIsProfile = false;
+ bool anIsValidProfile = false;
+ bool anAllAreProfiles = false;
bool anIsBathymetry = false;
bool anIsCalculation = false;
bool anIsImmersibleZone = false;
bool anIsRegion = false;
bool anIsZone = false;
bool anIsObstacle = false;
+ bool anIsStream = false;
bool anIsGeomObject = false;
// check the selected GEOM objects
// check the selected data model objects
HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( this );
+ int aNbOfSelectedProfiles = 0;
for( Standard_Integer anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
{
Handle(HYDROData_Entity) anObject = aSeq.Value( anIndex );
anIsVisibleInSelection |= aVisibility;
anIsHiddenInSelection |= !aVisibility;
- if( anObject->GetKind() == KIND_IMAGE )
+ ObjectKind anObjectKind = anObject->GetKind();
+ if( anObjectKind == KIND_IMAGE )
{
anIsImage = true;
Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast( anObject );
}
}
}
- else if( anObject->GetKind() == KIND_POLYLINEXY )
+ else if( anObjectKind == KIND_POLYLINEXY )
anIsPolyline = true;
- else if( anObject->GetKind() == KIND_PROFILE )
+ else if( anObjectKind == KIND_POLYLINE )
+ anIsPolyline3D = true;
+ else if( anObjectKind == KIND_PROFILE )
+ {
anIsProfile = true;
- else if( anObject->GetKind() == KIND_CALCULATION )
+ aNbOfSelectedProfiles++;
+
+ Handle(HYDROData_Profile) aProfile =
+ Handle(HYDROData_Profile)::DownCast( anObject );
+ if( !aProfile.IsNull() && aProfile->IsValid() ) {
+ anIsValidProfile = true;
+ }
+ }
+ else if( anObjectKind == KIND_CALCULATION )
anIsCalculation = true;
- else if( anObject->GetKind() == KIND_IMMERSIBLE_ZONE )
+ else if( anObjectKind == KIND_IMMERSIBLE_ZONE )
anIsImmersibleZone = true;
- else if( anObject->GetKind() == KIND_VISUAL_STATE )
+ else if( anObjectKind == KIND_VISUAL_STATE )
anIsVisualState = true;
- else if( anObject->GetKind() == KIND_REGION )
+ else if( anObjectKind == KIND_REGION )
anIsRegion = true;
- else if( anObject->GetKind() == KIND_ZONE )
+ else if( anObjectKind == KIND_ZONE )
anIsZone = true;
- else if( anObject->GetKind() == KIND_BATHYMETRY )
+ else if( anObjectKind == KIND_BATHYMETRY )
anIsBathymetry = true;
- else if( anObject->GetKind() == KIND_OBSTACLE )
+ else if( anObjectKind == KIND_OBSTACLE )
anIsObstacle = true;
+ else if( anObjectKind == KIND_STREAM )
+ anIsStream = true;
}
anIsGeomObject = HYDROData_Tool::IsGeometryObject( anObject );
}
+ // Check if all selected objects are profiles
+ anAllAreProfiles = ( aNbOfSelectedProfiles > 0 ) &&
+ ( aNbOfSelectedProfiles == aSeq.Length() );
+
// check the selected partitions
if( !anIsSelectedDataObjects && anIsObjectBrowser )
{
case KIND_POLYLINEXY:
theMenu->addAction( action( CreatePolylineId ) );
break;
+ case KIND_POLYLINE:
+ theMenu->addAction( action( CreatePolyline3DId ) );
+ break;
case KIND_PROFILE:
theMenu->addAction( action( CreateProfileId ) );
theMenu->addAction( action( ImportProfilesId ) );
+ theMenu->addAction( action( AllGeoreferencementId ) );
break;
case KIND_VISUAL_STATE:
theMenu->addAction( action( SaveVisualStateId ) );
theMenu->addAction( action( EditPolylineId ) );
theMenu->addSeparator();
}
+ else if( anIsPolyline3D )
+ {
+ theMenu->addAction( action( EditPolyline3DId ) );
+ theMenu->addSeparator();
+ }
else if( anIsProfile )
{
theMenu->addAction( action( EditProfileId ) );
+ theMenu->addAction( action( SelectedGeoreferencementId ) );
theMenu->addSeparator();
}
else if( anIsCalculation )
theMenu->addAction( action( EditImmersibleZoneId ) );
theMenu->addSeparator();
}
+ else if( anIsStream )
+ {
+ theMenu->addAction( action( EditStreamId ) );
+ theMenu->addSeparator();
+ }
else if( anIsVisualState && anIsObjectBrowser )
{
theMenu->addAction( action( SaveVisualStateId ) );
theMenu->addAction( action( SetColorId ) );
theMenu->addSeparator();
}
+ } else if ( anAllAreProfiles ) {
+ theMenu->addAction( action( SelectedGeoreferencementId ) );
+ theMenu->addSeparator();
}
theMenu->addAction( action( DeleteId ) );
theMenu->addSeparator();
- if( anIsImage || anIsPolyline || anIsImmersibleZone || anIsZone || anIsRegion || anIsBathymetry || anIsObstacle )
+ if( anIsImage || anIsPolyline || anIsPolyline3D || anIsImmersibleZone || anIsZone ||
+ anIsRegion || anIsBathymetry || anIsObstacle || anIsStream || anIsValidProfile )
{
if( anIsHiddenInSelection )
theMenu->addAction( action( ShowId ) );
if( OCCViewer_ViewFrame* aViewFrame = dynamic_cast<OCCViewer_ViewFrame*>( theViewWindow ) )
{
aViewFrame->onTopView();
+
+ HYDROGUI_Tool::setOCCActionShown( aViewFrame, OCCViewer_ViewWindow::MaximizedId, false );
}
}
}