From: vsv Date: Tue, 10 Jun 2008 13:19:53 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: TG_VISU_2008_2008-06-26~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=04a8a1c871c7c8bcd57699cf594192369f0b926c;p=modules%2Fvisu.git *** empty log message *** --- diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index dc9c0784..306fb924 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -3411,6 +3411,14 @@ Please, refer to the documentation. BTN_IMPORT Import... + + IMPORT_TITLE + Import from... + + + SELECT_VIEW + Select View window: + VisuGUI_SegmentationMgr diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index b101ecff..dc89ef24 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1642,7 +1642,8 @@ void VisuGUI ::OnSweep() { - mySweep->show(); + mySweep->toggleViewAction()->setChecked(true); + mySweep->onPlay(true); } //---------------------------------------------------------------------------- @@ -2644,7 +2645,8 @@ VisuGUI 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' " @@ -2655,6 +2657,7 @@ VisuGUI 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'}"; diff --git a/src/VISUGUI/VisuGUI_ClippingPlaneMgr.cxx b/src/VISUGUI/VisuGUI_ClippingPlaneMgr.cxx index c75610f6..7c0f4703 100644 --- a/src/VISUGUI/VisuGUI_ClippingPlaneMgr.cxx +++ b/src/VISUGUI/VisuGUI_ClippingPlaneMgr.cxx @@ -22,18 +22,22 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_ViewExtender.h" #include "VISU_Actor.h" #include #include #include +#include #include #include #include #include #include +#include +#include #include #include @@ -46,6 +50,7 @@ #include #include #include +#include #include #include @@ -158,6 +163,7 @@ VisuGUI_ClippingPlaneMgr::VisuGUI_ClippingPlaneMgr(VisuGUI* theModule, 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 @@ -590,6 +596,71 @@ void VisuGUI_ClippingPlaneMgr::setDirection(double theVal[3]) //**************************************************************** void VisuGUI_ClippingPlaneMgr::onImportPlane() { + SalomeApp_Application* aApp = myModule->getApp(); + if (!aApp) return; + + ViewManagerList aManagers; + aApp->viewManagers(SVTK_Viewer::Type(), aManagers); + + QStringList aTitles; + QList aViews; + for (int i = 0; i < aManagers.size(); i++) { + SUIT_ViewManager* aVMgr = aManagers.at(i); + QVector 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(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(); } @@ -614,3 +685,4 @@ void VisuGUI_ClippingPlaneMgr::onHelp() } } + diff --git a/src/VISUGUI/VisuGUI_ClippingPlaneMgr.h b/src/VISUGUI/VisuGUI_ClippingPlaneMgr.h index b6c57ba1..013d646a 100644 --- a/src/VISUGUI/VisuGUI_ClippingPlaneMgr.h +++ b/src/VISUGUI/VisuGUI_ClippingPlaneMgr.h @@ -74,6 +74,7 @@ private slots: void onDeletePlane(); void onValueChanged(); void onImportPlane(); + void onShowPreview(int); private: QWidget* createVectorTab(QWidget* theParent); diff --git a/src/VISUGUI/VisuGUI_Sweep.cxx b/src/VISUGUI/VisuGUI_Sweep.cxx index 11c0569b..1f457d7c 100644 --- a/src/VISUGUI/VisuGUI_Sweep.cxx +++ b/src/VISUGUI/VisuGUI_Sweep.cxx @@ -234,6 +234,7 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule, aQtxDockWidget->setVisible( false ); connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) ); + connect( myToggleViewAction, SIGNAL( toggled( bool ) ), aQtxDockWidget, SLOT( setVisible( bool ) ) ); //---------------------------------------------------------------------------- myTimer = new QTimer( this ); @@ -496,6 +497,9 @@ void VisuGUI_Sweep::onStop( bool on ) myNextButton->setEnabled( !on ); myLastButton->setEnabled( !on ); + + if (myViewWindow) + myViewWindow->Repaint(); }