#include <HYDROData_Iterator.h>
#include <HYDROData_Lambert93.h>
-#include <HYDROOperations_Factory.h>
+#include <HYDROData_OperationsFactory.h>
#include <GraphicsView_ViewManager.h>
#include <GraphicsView_ViewPort.h>
Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( anIterator.Current() );
if( !anImageObj.IsNull() )
{
- if( myIsEdit && HYDROGUI_Tool::IsEqual( anImageObj, myEditedObject ) )
+ if( myIsEdit && IsEqual( anImageObj, myEditedObject ) )
continue;
QPoint aPointA1, aPointB1, aPointC1;
if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anImageName ) )
{
// check that there are no other objects with the same name in the document
- Handle(HYDROData_Object) anObject = HYDROGUI_Tool::FindObjectByName( module(), anImageName );
+ Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anImageName );
if( !anObject.IsNull() )
{
theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anImageName );
{
aViewPort = aViewer->getActiveViewPort();
connect( aViewer, SIGNAL( selectionChanged( GV_SelectionChangeStatus ) ),
- this, SLOT( onPointSelected() ) );
+ this, SLOT( onRefPointSelected() ) );
}
}
}
onPointSelected( myRefPreviewPrs && myRefPreviewPrs->isSelected() );
}
+void HYDROGUI_ImportImageOp::onRefPointSelected()
+{
+ onPointSelected( true );
+}
+
void HYDROGUI_ImportImageOp::onPointSelected( bool theIsRefImage )
{
HYDROGUI_PrsImage* aPrs = theIsRefImage ? myRefPreviewPrs : myPreviewPrs;
void HYDROGUI_ImportImageOp::closeView( GraphicsView_ViewManager* &aViewMgr )
{
- // It's very strange, but without calling this method (it's quite safe) a crash is stably reproduced.
- // Scenario: create any non-Graphics view, activate import op, click apply.
- // Result: a few SIGSEGVs coming from processEvents(), then crash.
if( aViewMgr )
{
+ GraphicsView_ViewPort* aViewPort = 0;
if( GraphicsView_Viewer* aViewer = aViewMgr->getViewer() )
{
- if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() )
- {
- aViewPort->onBoundingRectChanged();
- }
+ aViewPort = aViewer->getActiveViewPort();
}
disconnect( aViewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
// Nullify appropriate presentation pointer
+ HYDROGUI_PrsImage* aPrs;
switch ( module()->getViewManagerRole( aViewMgr ) )
{
case HYDROGUI_Module::VMR_ReferenceImage:
+ aPrs = myRefPreviewPrs;
myRefPreviewPrs = 0;
break;
case HYDROGUI_Module::VMR_TransformImage:
+ aPrs = myPreviewPrs;
myPreviewPrs = 0;
}
- // Delete the view and all its presentations
+ // Remove the appropriate presentation from the view
+ if( aPrs && aViewPort )
+ {
+ aViewPort->removeItem( aPrs );
+ delete aPrs;
+ }
+
+ // Delete the view
module()->getApp()->removeViewManager( aViewMgr ); // aViewMgr is deleted here
aViewMgr = 0;
}