if ( anIsOCCView || anIsVTKView ) {
theMenu->addSeparator();
theMenu->addAction( action( CopyViewerPositionId ) );
- myPopupPos = QCursor::pos();
}
}
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 )
{
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 )
{
return anObjectEntries.indexOf( anEntry );
}
-
-/**
- * Get the popup menu position
- * \return the position
- */
-QPoint HYDROGUI_Module::getPopupPosition() const
-{
- return myPopupPos;
-}