#include <STD_TabDesktop.h>
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
+#include <SUIT_ViewWindow.h>
#include <QtxWorkstack.h>
#include <QApplication>
#include <QFileInfo>
}
// Delete the view
+ module()->removeViewManager(aViewMgr); // clean HYDROGUI module structure
+ aViewMgr->getActiveView()->hide();
module()->getApp()->removeViewManager( aViewMgr ); // aViewMgr is deleted here
aViewMgr = 0;
+ DEBTRACE("end of closeView");
}
}
myViewManagerMap.insert( ViewManagerId++, anInfo );
}
-void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
+void HYDROGUI_Module::removeViewManager( SUIT_ViewManager* theViewManager)
{
- DEBTRACE("HYDROGUI_Module::onViewManagerRemoved");
- LightApp_Module::onViewManagerRemoved( theViewManager );
-
- createSelector( theViewManager ); // replace the default selector
+ DEBTRACE("removeViewManager")
size_t anId = getViewManagerId( theViewManager );
if( anId != 0 )
{
+ bool isDisableGVSelector = theViewManager->getType() == GraphicsView_Viewer::Type();
+ createSelector( theViewManager, isDisableGVSelector ); // replace the default selector
+
OCCViewer_ViewManager* anOCCViewManager =
::qobject_cast<OCCViewer_ViewManager*>( myViewManagerMap[ anId ].first );
if ( anOCCViewManager )
}
}
+void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
+{
+ DEBTRACE("HYDROGUI_Module::onViewManagerRemoved");
+ removeViewManager(theViewManager);
+ LightApp_Module::onViewManagerRemoved( theViewManager );
+
+}
+
void HYDROGUI_Module::onViewCreated( SUIT_ViewWindow* theViewWindow )
{
DEBTRACE("HYDROGUI_Module::onViewCreated");
}
}
-void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager )
+void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager, bool isDisableGV )
{
- DEBTRACE("HYDROGUI_Module::createSelector");
+ DEBTRACE("HYDROGUI_Module::createSelector " << isDisableGV);
if( !theViewManager )
return;
DEBTRACE("Selector " << aSelector->type().toStdString());
if (dynamic_cast<HYDROGUI_GVSelector*>( aSelector ))
{
- isOk = true;
+ isOk = !isDisableGV;
isGV = true;
- DEBTRACE("HYDROGUI_GVSelector");
+ DEBTRACE("HYDROGUI_GVSelector " << isOk);
}
else if (dynamic_cast<SVTK_Selector*>( aSelector ))
{
void removeObjectVTKPrs( const size_t theViewId,
const QString& theEntry );
+ void removeViewManager( SUIT_ViewManager* );
/**
* Update global imposed range of Z values for the given VTK viewer id
const bool theIsForced = false,
const bool theDoFitAll = false );
- void createSelector( SUIT_ViewManager* viewMgr );
+ void createSelector( SUIT_ViewManager* viewMgr , bool isDisableGV = false);
bool setUpdateEnabled( const bool theState );
bool isUpdateEnabled() const;
#include <QMouseEvent>
#include <QLayout>
-//#define _DEVDEBUG_
+#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
class HYDROGUI_OverviewBand : public QtxPolyRubberBand
myMainView = theMainView;
if( !myMainView )
return;
+ DEBTRACE("setMainView");
OCCViewer_ViewWindow* aMainView = myMainView->getView( OCCViewer_ViewFrame::MAIN_VIEW );
connect( aMainView, SIGNAL( vpTransformationFinished( OCCViewer_ViewWindow::OperationType ) ),
}
}
-#if defined(TEST_MODE) || defined(_DEBUG)
- //qApp->installEventFilter( this );
-#endif
+//#if defined(TEST_MODE) || defined(_DEBUG)
+//qApp->installEventFilter( this );
+//#endif
qApp->processEvents();
bool HYDROGUI_Overview::eventFilter( QObject* theObject, QEvent* theEvent )
{
-#if defined(TEST_MODE) || defined(_DEBUG)
- /*switch( theEvent->type() )
+//#if defined(TEST_MODE) || defined(_DEBUG)
+ if (theEvent->type() == 12) // paint
{
- case QEvent::MouseMove:
- {
- QPoint mp = ((QMouseEvent*)theEvent)->pos();
- //mp = getViewPort(false)->mapFromGlobal(mp);
- QString coords = QString( "(%0, %1)" ).arg( mp.x() ).arg( mp.y() );
- std::string scoords = coords.toStdString();
- qDebug( scoords.c_str() );
- }
- break;
- }*/
-#endif
+ DEBTRACE("eventFilter " << theEvent->type() << " object " << theObject << " " << theObject->objectName().toStdString());
+ }
+
+// switch( theEvent->type() )
+// {
+// case QEvent::MouseMove:
+// {
+// QPoint mp = ((QMouseEvent*)theEvent)->pos();
+// //mp = getViewPort(false)->mapFromGlobal(mp);
+// QString coords = QString( "(%0, %1)" ).arg( mp.x() ).arg( mp.y() );
+// std::string scoords = coords.toStdString();
+// qDebug( scoords.c_str() );
+// }
+// break;
+// }
+//#endif
return QFrame::eventFilter( theObject, theEvent );
}