X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Module.cxx;h=c9aa1704b558d9240ed4175263256604bdb95820;hb=f34b90e9e4e02ba65419134d5d37a2e42aecfabf;hp=09cd00f85a37587359680c4b37a6453f03db52c5;hpb=42c150905c5e9fbd5582687d0c78b8f102a77cea;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 09cd00f8..c9aa1704 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -592,6 +592,11 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, theMenu->addAction( action( EditDigueId ) ); theMenu->addSeparator(); } + else if( anIsObstacle ) + { + theMenu->addAction( action( TranslateObstacleId ) ); + theMenu->addSeparator(); + } else if( anIsVisualState && anIsObjectBrowser ) { theMenu->addAction( action( SaveVisualStateId ) ); @@ -655,7 +660,6 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, if ( anIsOCCView || anIsVTKView ) { theMenu->addSeparator(); theMenu->addAction( action( CopyViewerPositionId ) ); - myPopupPos = QCursor::pos(); } } @@ -1050,6 +1054,35 @@ void HYDROGUI_Module::setObjectVTKPrs( const int theViewId aViewShapes.append( theShape ); } +void HYDROGUI_Module::removeObjectVTKPrs( const int theViewId, + const QString& theEntry ) +{ + if ( !myVTKPrsMap.contains( theViewId ) ) + return; + + ListOfVTKPrs& aViewShapes = myVTKPrsMap[ theViewId ]; + Handle(HYDROData_Entity) anObject; + QString anEntryRef; + for ( int i = 0; i < aViewShapes.length(); ) + { + HYDROGUI_VTKPrs* aShape = aViewShapes.at( i ); + anObject = aShape->getObject(); + anEntryRef = HYDROGUI_DataObject::dataObjectEntry( anObject ); + if ( aShape && (!anObject.IsNull()) && ( anEntryRef == theEntry ) ) + { + delete aShape; + aViewShapes.removeAt( i ); + continue; + } + + ++i; + } + + // Invalidate global Z range + double anInvalidRange[2] = { HYDROGUI_VTKPrs::InvalidZValue(), HYDROGUI_VTKPrs::InvalidZValue() }; + getVTKDisplayer()->SetZRange( theViewId, anInvalidRange ); +} + void HYDROGUI_Module::removeObjectVTKPrs( const int theViewId, const Handle(HYDROData_Entity)& theObject ) { @@ -1457,7 +1490,8 @@ void HYDROGUI_Module::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEvent* bool doShow = false; HYDROGUI_Displayer* aDisplayer = getDisplayer(); if ( aDisplayer ) - doShow = aDisplayer->GetCursorViewCoordinates( theViewWindow, QCursor::pos(), aX, aY, aZ ); + aDisplayer->SaveCursorViewPosition( theViewWindow ); + doShow = aDisplayer->GetCursorViewCoordinates( theViewWindow, aX, aY, aZ ); if ( doShow ) { @@ -1485,12 +1519,3 @@ int HYDROGUI_Module::getObjectDisplayOrder( return anObjectEntries.indexOf( anEntry ); } - -/** - * Get the popup menu position - * \return the position - */ -QPoint HYDROGUI_Module::getPopupPosition() const -{ - return myPopupPos; -}