#include "HEXABLOCKGUI_OccGraphicView.hxx"
#include "HEXABLOCKGUI_GraphicViewsHandler.hxx"
-#include <HEXABLOCK_version.h>
+#include "HEXABLOCK_version.h"
#include "MyBasicGUI_PointDlg.hxx"
{
docGView->setViewWindow(graphicViewsHandler->createVtkWindow());
docGView->getViewWindow()->installEventFilter(this);
+ showAllMenus();
}
else
docGView->setViewWindow(currentDocGView->getViewWindow());
SVTK_ViewWindow* window = dynamic_cast<SVTK_ViewWindow*>(svw);
if (window != NULL)
{
-
//VTK clean close
if (currentDocGView != NULL && currentDocGView->getViewWindow() == window)
{ //HexaBlock Vtk Window has been closed
// if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
currentOccGView->getViewWindow()->removeEventFilter(this);
-
currentOccGView->setViewWindow(NULL);
}
}
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;
//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();
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;
if (vf == NULL)
return;
-// vf->EraseAll();
if (lastOccPrs != NULL)
vf->Erase(lastOccPrs);
currentOccGView->globalSelection();
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();
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<SALOME_View*>(occView->getViewManager()->getViewModel());
if (vf == NULL)
return;
-// vf->EraseAll();
SOCC_Prs* currentOccPrs = getOccPrs(currentDocGView);
if (currentOccPrs != NULL)
vf->Erase(currentOccPrs);
occView->onResetView();
}
+void HEXABLOCKGUI::showOnlyActor()
+{
+ showVtkActor();
+ showOccActor();
+}
+
+void HEXABLOCKGUI::hideActor()
+{
+ hideVtkActor();
+ hideOccActor();
+}
+
void HEXABLOCKGUI::showDockWidgets(bool isVisible)
{