X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHEXABLOCKGUI%2FHEXABLOCKGUI.cxx;h=a928adba0ff692978d1db2f5678783f89f95f4aa;hb=5347e8abe119e8704d59c83638836f0fd94c732e;hp=1cf55c6eaf30ff941f656e8e879667692006d9b7;hpb=7e372bca8f08bce752e415ebf847d0a93fa703dc;p=modules%2Fhexablock.git diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx index 1cf55c6..a928adb 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx @@ -98,7 +98,7 @@ #include "HEXABLOCKGUI_OccGraphicView.hxx" #include "HEXABLOCKGUI_GraphicViewsHandler.hxx" -#include +#include "HEXABLOCK_version.h" #include "MyBasicGUI_PointDlg.hxx" @@ -108,12 +108,8 @@ #include -#include -#include #include #include -#include -#include #include #include #include @@ -621,6 +617,7 @@ void HEXABLOCKGUI::onObjectBrowserClick(const QModelIndex& index) { docGView->setViewWindow(graphicViewsHandler->createVtkWindow()); docGView->getViewWindow()->installEventFilter(this); + showAllMenus(); } else docGView->setViewWindow(currentDocGView->getViewWindow()); @@ -653,7 +650,6 @@ void HEXABLOCKGUI::onWindowClosed( SUIT_ViewWindow* svw) SVTK_ViewWindow* window = dynamic_cast(svw); if (window != NULL) { - //VTK clean close if (currentDocGView != NULL && currentDocGView->getViewWindow() == window) { //HexaBlock Vtk Window has been closed @@ -701,7 +697,6 @@ void HEXABLOCKGUI::onWindowClosed( SUIT_ViewWindow* svw) // if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog(); currentOccGView->getViewWindow()->removeEventFilter(this); - currentOccGView->setViewWindow(NULL); } } @@ -1693,35 +1688,13 @@ void HEXABLOCKGUI::showMeshMenus(bool show) setToolShown( _computeMesh, show); } -void HEXABLOCKGUI::showActor() -{ - VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); - if (currentVtkGView == NULL || currentVtkGView->getViewWindow() == NULL || - currentVtkGView->isEmpty() || currentVtkGView->getDocumentActor() == NULL) - return; - - currentVtkGView->getViewWindow()->setFocus(); - currentVtkGView->getViewWindow()->Display(currentVtkGView->getDocumentActor()->getIO()); - currentVtkGView->update(); - currentVtkGView->getViewWindow()->onFitAll(); - - //update the visibility state now - SalomeApp_Study* aStudy = HEXABLOCKGUI::activeStudy(); - SUIT_ViewManager* vman = currentVtkGView->getViewWindow()->getViewManager(); - if (aStudy == NULL || vman == NULL) return; - - Handle(SALOME_InteractiveObject) anIO = currentVtkGView->getDocumentActor()->getIO(); - aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 1 ); - displayer()->setVisibilityState(anIO->getEntry(), Qtx::ShownState); -} - -//SOCC_Prs* currentPrs = NULL; -void HEXABLOCKGUI::showOnlyActor() +void HEXABLOCKGUI::showVtkActor() { VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); if (currentVtkGView == NULL || currentVtkGView->isEmpty() || currentVtkGView->getDocumentActor() == NULL) return; + SVTK_ViewWindow* vtkView = currentVtkGView->getViewWindow(); if (vtkView == NULL) return; @@ -1731,8 +1704,8 @@ void HEXABLOCKGUI::showOnlyActor() //show only the current actor ----------------- vtkView->setFocus(); -// vtkView->DisplayOnly(currentVtkGView->getDocumentActor()->getIO()); - Document_Actor *lastDocActor, *currentDocActor = currentVtkGView->getDocumentActor(); + // vtkView->DisplayOnly(currentVtkGView->getDocumentActor()->getIO()); + Document_Actor *lastDocActor; if (lastVtkDocGView != NULL) { lastDocActor = lastVtkDocGView->getDocumentActor(); @@ -1753,11 +1726,12 @@ void HEXABLOCKGUI::showOnlyActor() displayer()->setVisibilityState(anIO->getEntry(), Qtx::ShownState); } vtkView->onFitAll(); +} -// //showOnly in occ viewer ------------- - +void HEXABLOCKGUI::showOccActor() +{ if (currentOccGView == NULL) - return; + return; OCCViewer_ViewWindow* occView = currentOccGView->getViewWindow(); if (occView == NULL) return; @@ -1765,7 +1739,6 @@ void HEXABLOCKGUI::showOnlyActor() if (vf == NULL) return; -// vf->EraseAll(); if (lastOccPrs != NULL) vf->Erase(lastOccPrs); currentOccGView->globalSelection(); @@ -1776,13 +1749,12 @@ void HEXABLOCKGUI::showOnlyActor() occView->onFitAll(); } -void HEXABLOCKGUI::hideActor() +void HEXABLOCKGUI::hideVtkActor() { - // * vtk -- VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); if (currentVtkGView == NULL || currentVtkGView->isEmpty() || - currentVtkGView->getViewWindow() == NULL || - currentVtkGView->getDocumentActor() == NULL) return; + currentVtkGView->getViewWindow() == NULL || + currentVtkGView->getDocumentActor() == NULL) return; currentVtkGView->getViewWindow()->Erase(currentVtkGView->getDocumentActor()->getIO()); currentVtkGView->getViewWindow()->onResetView(); @@ -1795,17 +1767,19 @@ void HEXABLOCKGUI::hideActor() Handle(SALOME_InteractiveObject) anIO = currentVtkGView->getDocumentActor()->getIO(); aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 0 ); displayer()->setVisibilityState(anIO->getEntry(), Qtx::HiddenState); +} - // * occ -- +void HEXABLOCKGUI::hideOccActor() +{ OCCViewer_ViewWindow* occView = currentOccGView == NULL ? NULL : currentOccGView->getViewWindow(); - DocumentModel* docModel = currentVtkGView->getDocumentModel(); + VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); + DocumentModel* docModel = (currentVtkGView == NULL ? NULL : currentVtkGView->getDocumentModel()); if (occView == NULL || docModel == NULL) return; SALOME_View* vf = dynamic_cast(occView->getViewManager()->getViewModel()); if (vf == NULL) return; -// vf->EraseAll(); SOCC_Prs* currentOccPrs = getOccPrs(currentDocGView); if (currentOccPrs != NULL) vf->Erase(currentOccPrs); @@ -1813,6 +1787,18 @@ void HEXABLOCKGUI::hideActor() occView->onResetView(); } +void HEXABLOCKGUI::showOnlyActor() +{ + showVtkActor(); + showOccActor(); +} + +void HEXABLOCKGUI::hideActor() +{ + hideVtkActor(); + hideOccActor(); +} + void HEXABLOCKGUI::showDockWidgets(bool isVisible) { @@ -2926,12 +2912,12 @@ QStringList HEXABLOCKGUI::getQuickDirList() extern "C" { - HexaExport CAM_Module* createModule() + HEXABLOCK_EXPORT CAM_Module* createModule() { return new HEXABLOCKGUI(); } - HexaExport char* getModuleVersion() + HEXABLOCK_EXPORT char* getModuleVersion() { return (char*)HEXABLOCK_VERSION_STR; }