VisuGUI
::OnSweep()
{
- mySweep->show();
+ mySweep->toggleViewAction()->setChecked(true);
+ mySweep->onPlay(true);
}
//----------------------------------------------------------------------------
mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'VVTK'} and selcount=0" );
// 3D presentations commands
- QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
+ QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TGAUSSPOINTS' " + aPrsAll + "}";
+ //QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
aRule = "selcount=1";
mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
+ aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
// "Representation" submenu
QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewExtender.h"
#include "VISU_Actor.h"
#include <LightApp_Application.h>
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
+#include <SUIT_ViewManager.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <QtxDoubleSpinBox.h>
#include <SALOME_Actor.h>
#include <VTKViewer_Utilities.h>
+#include <SalomeApp_Application.h>
+#include <SVTK_ViewModel.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QComboBox>
#include <QCheckBox>
#include <QPushButton>
+#include <QInputDialog>
#include <vtkMath.h>
#include <vtkPlaneSource.h>
myShowPreview = new QCheckBox(tr("CHK_SHOW_PREVIEW"), this);
myShowPreview->setCheckState(Qt::Checked);
+ connect(myShowPreview, SIGNAL(stateChanged(int)), this, SLOT(onShowPreview(int)));
aManageBox->addWidget(myShowPreview);
// Dialog buttons
//****************************************************************
void VisuGUI_ClippingPlaneMgr::onImportPlane()
{
+ SalomeApp_Application* aApp = myModule->getApp();
+ if (!aApp) return;
+
+ ViewManagerList aManagers;
+ aApp->viewManagers(SVTK_Viewer::Type(), aManagers);
+
+ QStringList aTitles;
+ QList<SUIT_ViewWindow*> aViews;
+ for (int i = 0; i < aManagers.size(); i++) {
+ SUIT_ViewManager* aVMgr = aManagers.at(i);
+ QVector<SUIT_ViewWindow*> aWinList = aVMgr->getViews();
+ for (int j = 0; j < aWinList.size(); j++) {
+ if (aWinList[j] != myViewWindow) {
+ aViews.append(aWinList[j]);
+ aTitles.append(aWinList[j]->windowTitle());
+ }
+ }
+ }
+ if (aTitles.size() == 0) return;
+
+ bool aOk = false;
+ QString aSelected = QInputDialog::getItem(this, tr("IMPORT_TITLE"),
+ tr("SELECT_VIEW"), aTitles,
+ 0, false, &aOk);
+ if (aOk) {
+ int aId = aTitles.indexOf(aSelected);
+ if (aId < 0) return;
+ SVTK_ViewWindow* aWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(aId));
+ if (!aWindow) return;
+
+ VisuGUI_ViewExtender* aExtender = (VisuGUI_ViewExtender*) myModule->getViewExtender();
+ VisuGUI_SegmentationMgr* aSegmentMgr = aExtender->getSegmentationMgr(aWindow);
+ if (!aSegmentMgr) return;
+ const QListOfPlanes& aPlanes = aSegmentMgr->getPlanes();
+ for (int i = 0; i < aPlanes.size(); i++) {
+ const PlaneDef& aSource = aPlanes.at(i);
+ PlaneDef aDest;
+ aDest.plane = CutPlaneFunction::New();
+ aDest.isAuto = aSource.isAuto;
+ aDest.name = aSource.name;
+ aDest.plane->SetOrigin(aSource.plane->GetOrigin());
+ aDest.plane->SetNormal(aSource.plane->GetNormal());
+
+ myPlanes.append(aDest);
+ PreviewPlane* aPreview = new PreviewPlane(myViewWindow, aDest, myBounds);
+ aPreview->setVisible(myShowPreview->checkState() == Qt::Checked);
+ myPreviewList.append(aPreview);
+
+ myPlanesList->addItem(aDest.name);
+ myMethodTab->setEnabled(true);
+
+ }
+ myPlanesList->setCurrentRow(myPlanes.size() - 1);
+ myViewWindow->getRenderer()->ResetCameraClippingRange();
+ myViewWindow->Repaint();
+ }
+}
+
+//****************************************************************
+void VisuGUI_ClippingPlaneMgr::onShowPreview(int theVal)
+{
+ bool isVisible = (theVal == Qt::Checked);
+ for (int i = 0; i < myPreviewList.size(); i++)
+ myPreviewList.at(i)->setVisible(isVisible);
+ myViewWindow->Repaint();
}
}
}
+