1 // VISU VISUGUI : GUI of VISU component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
25 // Author : Laurent CORNABE
38 #include <qptrvector.h>
39 #include <qcolordialog.h>
42 #include <vtkRenderer.h>
43 #include <vtkRenderWindow.h>
44 #include <vtkActorCollection.h>
47 #include "SALOME_LifeCycleCORBA.hxx"
49 #include "SUIT_ResourceMgr.h"
50 #include "SUIT_MessageBox.h"
52 #include "SUIT_ViewWindow.h"
53 #include "SUIT_ViewManager.h"
55 #include "CAM_Module.h"
57 #include "SVTK_RenderWindow.h"
58 #include "SVTK_ViewWindow.h"
59 #include "SVTK_ViewModel.h"
60 #include "SVTK_Functor.h"
62 #include "SPlot2d_ViewModel.h"
63 #include "VisuGUI_SetupPlot2dDlg.h"
64 #include "Plot2d_SetupCurveDlg.h"
65 #include "Plot2d_ViewManager.h"
67 #include "OB_Browser.h"
69 #include "SALOME_ListIO.hxx"
70 #include "SALOME_ListIteratorOfListIO.hxx"
72 #include "SalomeApp_Application.h"
73 #include "SalomeApp_DataModel.h"
74 #include "SalomeApp_Study.h"
75 #include "LightApp_SelectionMgr.h"
76 #include "LightApp_Selection.h"
77 #include "LightApp_Preferences.h"
79 #include "QtxAction.h"
81 #include "VISUConfig.hh"
82 #include "VISU_Gen_i.hh"
83 #include "VISU_Mesh_i.hh"
84 #include "VISU_Table_i.hh"
85 #include "VISU_Result_i.hh"
86 #include "VISU_View_i.hh"
87 #include "VISU_ViewManager_i.hh"
88 #include "VISU_Plot3D_i.hh"
90 #include "VISU_Actor.h"
92 #include "VisuGUI_Prs3dTools.h"
93 #include "VisuGUI_Tools.h"
95 #include "VisuGUI_PopupTools.h"
96 #include "VisuGUI_NameDlg.h"
97 #include "VisuGUI_FileDlg.h"
98 #include "VisuGUI_CursorDlg.h"
99 #include "VisuGUI_Selection.h"
100 #include "VisuGUI_TimeAnimation.h"
101 #include "VisuGUI_EditContainerDlg.h"
102 #include "VisuGUI_NonIsometricDlg.h"
103 #include "VisuGUI_ClippingDlg.h"
104 #include "VisuGUI_Plot3DDlg.h"
105 #include "VisuGUI_CubeAxesDlg.h"
106 #include "VisuGUI_OffsetDlg.h"
107 #include "VisuGUI_Displayer.h"
109 #include "VISU_ScalarMap_i.hh"
110 #include "VisuGUI_ScalarBarDlg.h"
112 #include "VISU_DeformedShape_i.hh"
113 #include "VisuGUI_DeformedShapeDlg.h"
115 #include "VISU_IsoSurfaces_i.hh"
116 #include "VisuGUI_IsoSurfacesDlg.h"
118 #include "VISU_CutPlanes_i.hh"
119 #include "VisuGUI_CutPlanesDlg.h"
121 #include "VISU_CutLines_i.hh"
122 #include "VisuGUI_CutLinesDlg.h"
124 #include "VISU_StreamLines_i.hh"
125 #include "VisuGUI_StreamLinesDlg.h"
127 #include "VISU_Vectors_i.hh"
128 #include "VisuGUI_VectorsDlg.h"
130 #include "VisuGUI_TableDlg.h"
132 #include "SALOMEconfig.h"
133 #include CORBA_SERVER_HEADER(MED_Gen)
135 #include "utilities.h"
137 #include "VisuGUI_ActionsDef.h"
139 using namespace VISU;
142 static int MYDEBUG = 1;
144 static int MYDEBUG = 0;
147 //////////////////////////////////////////////////
149 //////////////////////////////////////////////////
152 SalomeApp_Module( "VISU" ),
167 if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
168 if ( CheckLock(GetCStudy(GetAppStudy(this))) )
170 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
173 aFilter.append( tr("FLT_MED_FILES") );
174 aFilter.append( tr("FLT_ALL_FILES") );
176 QFileInfo aFileInfo =
177 SUIT_FileDlg::getFileName(GetDesktop(this),
180 tr("MEN_IMPORT_FROM_FILE"),
182 if(aFileInfo.exists()) {
183 application()->putInfo( "Importing From File " + aFileInfo.filePath() + "..." );
185 VISU::Result_var aResult;
186 bool anIsBuild = aResourceMgr->booleanValue("VISU", "full_med_loading", false);
187 if (VisuGUI_FileDlg::IsBuild) {
188 aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
189 if (!CORBA::is_nil(aResult.in()))
190 if (Result_i* aRes = dynamic_cast<Result_i*>(GetServant(aResult).in())) {
191 if (!aRes->IsPossible())
192 SUIT_MessageBox::warn1(GetDesktop(this),
194 tr("ERR_CANT_BUILD_PRESENTATION"),
200 aResourceMgr->setValue("VISU", "full_med_loading", false);
201 aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
202 aResourceMgr->setValue("VISU", "full_med_loading", anIsBuild);
205 if (CORBA::is_nil(aResult.in())) {
206 SUIT_MessageBox::warn1(GetDesktop(this),
208 tr("ERR_ERROR_IN_THE_FILE"),
211 application()->putInfo(aFileInfo.filePath() + tr("INF_DONE"));
212 UpdateObjBrowser(this);
222 if(MYDEBUG) MESSAGE("VisuGUI::OnExploreMEDFile()");
223 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
224 if ( CheckLock(aStudy) )
227 SALOME_MED::MED_Gen_var aGen = GetMEDEngine();
230 aFilter.append( tr("FLT_MED_FILES") );
231 aFilter.append( tr("FLT_ALL_FILES") );
233 QFileInfo aFileInfo =
234 SUIT_FileDlg::getFileName(GetDesktop(this),
237 tr("MEN_EXPLORE_MED_FILE"),
239 if(aFileInfo.exists()){
240 application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." );
241 std::string aStudyName = aStudy->Name();
244 aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
248 SUIT_MessageBox::warn1(GetDesktop(this),
250 tr("ERR_ERROR_IN_THE_FILE"),
253 application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
254 getApp()->updateObjectBrowser(true); // as need to update MED tree
255 getApp()->updateActions();
262 OnImportTableFromFile()
264 if(MYDEBUG) MESSAGE("VisuGUI::OnImportTableFromFile()");
265 if ( CheckLock(GetCStudy(GetAppStudy(this))) )
269 aFilter.append( tr("FLT_TABLE_FILES") );
270 aFilter.append( tr("FLT_ALL_FILES") );
272 QFileInfo aFileInfo =
273 SUIT_FileDlg::getFileName(GetDesktop(this),
276 tr("MEN_IMPORT_TABLE"),
278 if (aFileInfo.exists()) {
279 application()->putInfo( tr("MEN_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
281 CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath());
283 if (CORBA::is_nil(anObject.in())) {
284 SUIT_MessageBox::warn1(GetDesktop(this),
286 tr("ERR_ERROR_IN_THE_FILE"),
289 application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
290 UpdateObjBrowser(this);
297 OnExportTableToFile()
299 if(MYDEBUG) MESSAGE("VisuGUI::OnExportTableToFile()");
301 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
303 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
304 SALOME_ListIO aListIO;
305 aSelectionMgr->selectedObjects(aListIO);
307 if (aListIO.Extent() > 0) {
308 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
309 if (anIO->hasEntry()) {
310 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
313 // find table attribute
315 _PTR(GenericAttribute) anAttr;
317 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
319 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
320 // if the current SObject is a table title
321 // we take a father contaning the table
322 aSObj = aSObj->GetFather();
324 if (aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
327 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
334 // get table title in order to have default name of the file
337 _PTR(AttributeTableOfReal) aTabAttr (anAttr);
338 if (!aTabAttr) return;
339 aTitle = aTabAttr->GetTitle().c_str();
341 _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
342 if (!aTabAttr) return;
343 aTitle = aTabAttr->GetTitle().c_str();
345 aTitle.simplifyWhiteSpace();
346 aTitle = aTitle.replace(QRegExp(" "), "_").replace(QRegExp("\\*"), "" );
348 // get default path for the file
349 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
350 QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
351 if (aDir.isEmpty()) {
352 aDir = aResourceMgr->stringValue("VISU","InputDir","");
353 if (aDir.isEmpty()) {
354 aDir = getenv("CSF_PATHData");
357 QString aPath = Qtx::addSlash(aDir) + aTitle;
359 // get name for the file
361 aFilter.append("Table Files (*.xls)");
363 QFileInfo aFileInfo =
364 SUIT_FileDlg::getFileName(GetDesktop(this),
367 tr("MEN_EXPORT_TABLE"), // "Export Table To File"
371 QString aFile = aFileInfo.filePath();
372 if (!aFile.isEmpty()) {
373 application()->putInfo(tr("MEN_EXPORT_TABLE") + " " + aFile + " ...");
374 aDir = Qtx::dir(aFile, true);
375 aResourceMgr->setValue("VISU", "OutputDir", aDir);
378 GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), aFile.latin1());
379 application()->putInfo(aFile + " " + tr("INF_DONE"));
380 } catch(std::exception& ex) {
382 SUIT_MessageBox::warn1(GetDesktop(this),
384 tr("ERR_ERROR_DURING_EXPORT") + " " + tr(ex.what()),
387 INFOS(tr("ERR_ERROR_DURING_EXPORT"));
388 SUIT_MessageBox::warn1(GetDesktop(this),
390 tr("ERR_ERROR_DURING_EXPORT"),
402 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
403 if (CheckLock(aCStudy))
405 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
407 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
408 SALOME_ListIO aListIO;
409 aSelectionMgr->selectedObjects(aListIO);
411 SALOME_ListIteratorOfListIO It (aListIO);
412 QApplication::setOverrideCursor(Qt::waitCursor);
413 for (; It.More(); It.Next()) {
414 Handle(SALOME_InteractiveObject) anIO = It.Value();
415 SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
416 if (!aSObject->_is_nil()) {
417 CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
418 if (!CORBA::is_nil(anObject)) {
419 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
420 if (!CORBA::is_nil(aMED.in()))
421 GetVisuGen(this)->ImportMed(aSObject);
422 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
423 if (!CORBA::is_nil(aField.in()))
424 GetVisuGen(this)->ImportMedField(aField);
426 SALOMEDS::SObject_var aSFather = aSObject->GetFather();
427 SALOMEDS::GenericAttribute_var anAttr;
428 aSFather->FindAttribute(anAttr, "AttributeName");
429 SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
430 CORBA::String_var aValue = aName->Value();
431 if (strcmp(aValue.in(), "MEDFIELD") == 0)
432 GetVisuGen(this)->ImportMed(aSObject);
436 UpdateObjBrowser(this, true);
437 QApplication::restoreOverrideCursor();
441 CreateCurves( SalomeApp_Module* theModule,
442 VISU::CutLines_i* thePrs,
444 const bool theCreate = true )
448 VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg );
452 _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
453 _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry().latin1() );
455 if ( !theCreate && aSObject ) {
457 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
458 _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
459 for (; aIter->More(); aIter->Next()) {
460 _PTR(SObject) aTblObj = aIter->Value();
462 _PTR(GenericAttribute) anAttr;
463 if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
464 aBuilder->RemoveObjectWithChildren( aIter->Value() ); // We should have only one child
471 if ( aCutDlg->isGenerateTable() ) {
472 GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
473 if ( aCutDlg->isGenerateCurves() ) {
475 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
476 _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
477 for (; aIter->More(); aIter->Next()) {
478 _PTR(SObject) aTblObj = aIter->Value();
480 _PTR(GenericAttribute) anAttr;
481 if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
482 CreatePlot( theModule, aTblObj );
490 if (!theCreate && aSObject) {
491 UpdateObjBrowser(theModule);
499 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
500 if (CheckLock(aStudy))
503 // Get selected SObject
504 Handle(SALOME_InteractiveObject) anIO;
505 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
506 if (anIO.IsNull() || !anIO->hasEntry())
509 // create a VTK view window if it does not exist
510 GetViewWindow( this, /*create=*/true );
512 CreateMesh(this, anIO);
519 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
520 if (CheckLock(aStudy))
523 // create a VTK view window if it does not exist
524 GetViewWindow( this, /*create=*/true );
526 // Get selected SObject
527 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
528 SALOME_ListIO aListIO;
529 aSelectionMgr->selectedObjects(aListIO);
530 SALOME_ListIteratorOfListIO anIter (aListIO);
531 for (; anIter.More(); anIter.Next()) {
532 Handle(SALOME_InteractiveObject) anIO = anIter.Value();
533 if (anIO.IsNull() || !anIO->hasEntry())
536 CreateMesh(this, anIO);
544 CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
550 OnCreateDeformedShape()
552 CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
559 CreatePrs3d<VISU::Vectors_i,VisuGUI_VectorsDlg,1>(this);
564 OnCreateIsoSurfaces()
566 CreatePrs3d<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg,1>(this);
573 CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,0>(this);
580 CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,0>(this);
585 OnCreateStreamLines()
587 CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
594 CreatePrs3d<VISU::Plot3D_i,VisuGUI_Plot3DDlg,0>(this);
601 CheckLock(GetCStudy(GetAppStudy(this)));
602 GetVisuGen( this )->CreateContainer();
603 UpdateObjBrowser(this);
610 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
612 QApplication::setOverrideCursor(Qt::waitCursor);
613 SALOME_ListIO aSel, aList;
614 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
615 mgr->selectedObjects( aSel );
617 extractContainers( aSel, aList );
619 Handle(SALOME_InteractiveObject) anIO;
620 for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
622 CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
623 if ( !CORBA::is_nil( anObject ) ) {
624 // is it Prs3d object ?
625 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
627 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
628 //UpdateViewer( this, aPrsObject );
629 SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
632 displayer()->Display( anIO->getEntry() );
633 vw->highlight(anIO, 1);
638 VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
640 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
641 //PlotCurve( this, aCurve, VISU::eDisplay );
642 displayer()->Display( anIO->getEntry() );
646 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
648 if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
649 //PlotContainer( this, aContainer, VISU::eDisplay );
650 displayer()->Display( anIO->getEntry() );
654 VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
656 if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
657 //PlotTable( this, aTable, VISU::eDisplay );
658 displayer()->Display( anIO->getEntry() );
663 SVTK_ViewWindow* vw = GetViewWindow( this );
665 vw->getRenderer()->ResetCameraClippingRange();
668 QApplication::restoreOverrideCursor();
683 if(MYDEBUG) MESSAGE("OnErasePrs");
685 QApplication::setOverrideCursor(Qt::waitCursor);
687 SVTK_ViewWindow* vw = GetViewWindow( this );
689 vw->unHighlightAll();
691 SALOME_ListIO aList, aSel;
692 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
693 mgr->selectedObjects( aSel );
695 extractContainers( aSel, aList );
697 Handle(SALOME_InteractiveObject) anIO;
698 for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
700 CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
701 ErasePrs( this, anObject, false );
707 QApplication::restoreOverrideCursor();
715 Handle(SALOME_InteractiveObject) anIO;
716 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
717 EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg,1>(this, aPrs3d);
718 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
719 aViewWindow->highlight(anIO, 1);
727 OnEditDeformedShape()
729 Handle(SALOME_InteractiveObject) anIO;
730 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
731 EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg,1>(this, aPrs3d);
732 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
733 aViewWindow->highlight(anIO, 1);
743 Handle(SALOME_InteractiveObject) anIO;
744 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
745 EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg,0>(this, aPrs3d);
746 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
747 aViewWindow->highlight(anIO, 1);
757 Handle(SALOME_InteractiveObject) anIO;
758 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
759 EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg,0>(this, aPrs3d);
760 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
761 aViewWindow->highlight(anIO, 1);
771 Handle(SALOME_InteractiveObject) anIO;
772 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
773 EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg,1>(this, aPrs3d);
774 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
775 aViewWindow->highlight(anIO, 1);
785 Handle(SALOME_InteractiveObject) anIO;
786 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
787 EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg,1>(this, aPrs3d);
788 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
789 aViewWindow->highlight(anIO, 1);
799 Handle(SALOME_InteractiveObject) anIO;
800 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
801 EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg,1>(this, aPrs3d);
802 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
803 aViewWindow->highlight(anIO, 1);
813 Handle(SALOME_InteractiveObject) anIO;
814 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
815 EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg,0>(this, aPrs3d);
816 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
817 aViewWindow->highlight(anIO, 1);
827 startOperation( myEraseAll );
828 if (SVTK_ViewWindow* vw = GetViewWindow()) {
829 vw->unHighlightAll();
830 if (vtkRenderer *aRen = vw->getRenderer()) {
832 vtkActorCollection *anActColl = aRen->GetActors();
833 for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
834 if (anActor->GetVisibility() > 0)
835 if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
836 anVISUActor = anVISUActor->GetParent();
837 anVISUActor->VisibilityOff();
842 } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
851 ChangeRepresentation(this, VISU::SURFACEFRAME);
858 ChangeRepresentation(this, VISU::INSIDEFRAME);
865 ChangeRepresentation(this, VISU::WIREFRAME);
872 ChangeRepresentation(this, VISU::SHADED);
879 ChangeRepresentation(this, VISU::POINT);
886 ChangeRepresentation(this, VISU::SHRINK);
893 SetShading(this, true);
900 SetShading(this, false);
907 Handle(SALOME_InteractiveObject) anIO;
908 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
909 if (CORBA::is_nil(anObject)) return;
910 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
911 if (!aServant.in()) return;
913 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
916 SVTK_ViewWindow* vw = GetViewWindow();
919 VISU_Actor* anActor = GetActor(aPrs3d, vw);
920 if (!anActor) return;
922 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
923 VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
924 SALOMEDS::Color anOldColor, aNewColor;
925 int aRepresent = anActor->GetRepresentation();
927 switch (aRepresent) {
929 anOldColor = aMesh->GetNodeColor();
931 case VISU::WIREFRAME :
932 case VISU::INSIDEFRAME :
933 anOldColor = aMesh->GetLinkColor();
936 case VISU::SURFACEFRAME :
937 anOldColor = aMesh->GetCellColor();
940 } else if (aDeformedShape) {
941 anOldColor = aDeformedShape->GetColor();
946 QColor aColor (int(255*anOldColor.R),
947 int(255*anOldColor.G),
948 int(255*anOldColor.B));
949 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
950 if (aColorNew.isValid()) {
951 aNewColor.R = aColorNew.red()/255.;
952 aNewColor.G = aColorNew.green()/255.;
953 aNewColor.B = aColorNew.blue()/255.;
955 switch (aRepresent) {
957 aMesh->SetNodeColor(aNewColor);
959 case VISU::WIREFRAME :
960 case VISU::INSIDEFRAME :
961 aMesh->SetLinkColor(aNewColor);
964 case VISU::SURFACEFRAME :
965 aMesh->SetCellColor(aNewColor);
969 aDeformedShape->SetColor(aNewColor);
971 RecreateActor(this, aPrs3d);
977 OnChangeWireframeColor()
979 Handle(SALOME_InteractiveObject) anIO;
980 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
981 if (CORBA::is_nil(anObject)) return;
982 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
983 if (!aServant.in()) return;
985 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
988 SVTK_ViewWindow* vw = GetViewWindow();
991 VISU_Actor* anActor = GetActor(aPrs3d, vw);
992 if (!anActor) return;
994 if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
995 SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor;
996 QColor aColor (int(255*anOldColor.R),
997 int(255*anOldColor.G),
998 int(255*anOldColor.B));
999 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1000 if (aColorNew.isValid()) {
1001 aNewColor.R = aColorNew.red()/255.;
1002 aNewColor.G = aColorNew.green()/255.;
1003 aNewColor.B = aColorNew.blue()/255.;
1004 aMesh->SetLinkColor(aNewColor);
1005 RecreateActor(this, aMesh);
1014 Handle(SALOME_InteractiveObject) anIO;
1015 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1016 if (CORBA::is_nil(anObject)) return;
1017 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1018 if (!aServant.in()) return;
1020 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1021 if (!aPrsObject) return;
1023 SVTK_ViewWindow* vw = GetViewWindow();
1026 VISU_Actor* anActor = GetActor(aPrsObject, vw);
1027 if (!anActor) return;
1029 VisuGUI_CursorDlg* CursorDlg =
1030 new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_OPACITY_TITLE"), TRUE);
1032 CursorDlg->Comment1->setText(tr("DLG_OPACITY_CMT1"));
1033 CursorDlg->Comment2->setText(tr("DLG_OPACITY_CMT2"));
1034 CursorDlg->SpinBox1->setMinValue(0);
1035 CursorDlg->SpinBox1->setMaxValue(100);
1037 float oldopac = anActor->GetOpacity();
1038 int intopac = int(oldopac*100. + 0.5);
1039 CursorDlg->SpinBox1->setValue(intopac);
1041 int ret = CursorDlg->exec();
1043 intopac = CursorDlg->SpinBox1->value();
1044 float newopac = intopac/100.;
1045 anActor->SetOpacity(newopac);
1054 Handle(SALOME_InteractiveObject) anIO;
1055 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1056 if (CORBA::is_nil(anObject)) return;
1057 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1058 if (!aServant.in()) return;
1060 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1061 if (!aPrsObject) return;
1063 SVTK_ViewWindow* vw = GetViewWindow();
1066 VISU_Actor* anActor = GetActor(aPrsObject, vw);
1067 if (!anActor) return;
1069 VisuGUI_CursorDlg* CursorDlg =
1070 new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_LINEWIDTH_TITLE"), TRUE);
1072 CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
1073 CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
1074 CursorDlg->SpinBox1->setMinValue(1);
1075 CursorDlg->SpinBox1->setMaxValue(10);
1077 float oldlwid = anActor->GetLineWidth();
1078 int intlwid = int(oldlwid);
1079 CursorDlg->SpinBox1->setValue(intlwid);
1081 int ret = CursorDlg->exec();
1083 intlwid = CursorDlg->SpinBox1->value();
1084 float newlwid = intlwid;
1085 anActor->SetLineWidth(newlwid);
1094 Handle(SALOME_InteractiveObject) anIO;
1095 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1097 if ( !CORBA::is_nil( anObject ) ) {
1098 VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject );
1099 if ( !CORBA::is_nil( aVisuObj ) && aVisuObj->GetType() == VISU::TTABLE ) {
1100 CORBA::Object_ptr aTable = VISU::Table::_narrow( anObject );
1101 if( !CORBA::is_nil( aTable ) ) {
1102 VISU::Table_i* table = dynamic_cast<VISU::Table_i*>( VISU::GetServant(aTable).in() );
1104 SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( table->GetObjectEntry() );
1109 // possibly this is Table SObject
1110 SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( anIO->getEntry() );
1113 if( !IsSObjectTable( SO ) )
1116 VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
1119 //SAL2670 Orientation of show tables
1120 VisuGUI_TableDlg::ttAuto,
1129 Handle(SALOME_InteractiveObject) anIO;
1130 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1131 _PTR(Study) aStudy = GetCStudy( GetAppStudy( this ) );
1132 _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
1133 VISU::CutLines_var aCutLines = VISU::CutLines::_narrow( anObject );
1134 if(!aCutLines->_is_nil() || IsSObjectTable(aSObject)) {
1135 GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
1136 UpdateObjBrowser(this);
1144 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1145 if (CheckLock(aCStudy))
1148 SALOME_ListIO aList;
1149 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
1150 mgr->selectedObjects(aList,QString::null,false);
1151 int i = 0, nbSelected = aList.Extent();
1152 if (nbSelected < 1) return;
1154 const char* entries [nbSelected];
1155 Handle(SALOME_InteractiveObject) anIO;
1156 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1158 if (anIO->hasEntry())
1159 entries[i++] = anIO->getEntry();
1162 if (nbSelected < 1) return;
1164 // There is a transaction
1165 _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
1166 aStudyBuilder->NewCommand();
1168 for (i = 0; i < nbSelected; i++) {
1169 _PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]);
1171 DeleteSObject(this, aCStudy, aSObject);
1175 // Finish transaction
1176 aStudyBuilder->CommitCommand();
1178 //GetActiveStudy()->unHighlightAll();
1179 UpdateObjBrowser(this, true);
1186 Handle(SALOME_InteractiveObject) anIO;
1187 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1189 _PTR(GenericAttribute) anAttr;
1190 _PTR(AttributeName) aName;
1192 _PTR(Study) aStudy = GetCStudy( GetAppStudy( this ) );
1194 if ( !CORBA::is_nil( anObject ) ) {
1195 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1196 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TTABLE) {
1197 // Table (VISU object) is selected
1198 CORBA::Object_ptr aTbl = VISU::Table::_narrow( anObject );
1199 if( !CORBA::is_nil( aTbl ) ) {
1200 VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTbl).in());
1202 _PTR(SObject) SO = aStudy->FindObjectID( table->GetObjectEntry() );
1203 if ( IsSObjectTable(SO) ) {
1204 // get name of SObject
1205 if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
1207 SOName = QString( aName->Value().c_str() );
1209 VisuGUI_SetupPlot2dDlg* dlg = new VisuGUI_SetupPlot2dDlg( SO, GetDesktop( this ) );
1210 if ( dlg->exec() == QDialog::Accepted ) {
1211 if ( !IsStudyLocked( aStudy ) ) {
1212 // if study is not locked - create new container, create curves and insert them
1213 // into container, then plot container if current viewer is of VIEW_PLOT2D type
1215 QValueList<int> verIndices;
1216 dlg->getCurvesSource( horIndex, verIndices );
1217 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1218 CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
1219 if( !CORBA::is_nil( aContainer ) ) {
1220 VISU::Container_i* pContainer =
1221 dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1223 for ( int i = 0; i < verIndices.count(); i++ ) {
1224 CORBA::Object_var aNewCurve =
1225 GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
1226 if( !CORBA::is_nil( aNewCurve ) ) {
1227 VISU::Curve_i* pCrv =
1228 dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
1231 int marker, line, lineWidth;
1233 if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
1234 line, lineWidth, color) && !isAuto ) {
1236 c.R = color.red() /255.;
1237 c.G = color.green()/255.;
1238 c.B = color.blue() /255.;
1239 pCrv->SetColor( c );
1240 pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
1241 pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1243 pContainer->AddCurve( pCrv->_this() );
1247 UpdateObjBrowser(this);
1248 PlotContainer( this, pContainer, VISU::eDisplay );
1254 // if study is locked just get curves info and plot them
1255 // if current viewer is of VIEW_PLOT2D type
1256 QPtrList<Plot2d_Curve> container;
1257 dlg->getCurves( container );
1258 if ( !container.isEmpty() ) {
1259 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1260 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
1270 else if ( !anIO.IsNull() ) {
1271 // check if Table SObject is selected
1272 SO = aStudy->FindObjectID( anIO->getEntry() );
1273 if ( IsSObjectTable(SO) ) {
1274 // get name of SObject
1275 if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
1277 SOName = QString( aName->Value().c_str() );
1279 VisuGUI_SetupPlot2dDlg* dlg = new VisuGUI_SetupPlot2dDlg( SO, GetDesktop( this ) );
1280 if ( dlg->exec() == QDialog::Accepted ) {
1281 if ( !IsStudyLocked( aStudy ) ) {
1282 // if study is not locked - create new table and container objects, create curves
1283 // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
1285 QValueList<int> verIndices;
1286 dlg->getCurvesSource( horIndex, verIndices );
1287 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1288 CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
1289 CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
1290 if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
1291 VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
1292 VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1294 if ( pContainer && pTable ) {
1295 for ( int i = 0; i < verIndices.count(); i++ ) {
1296 CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve
1297 ( pTable->_this(), horIndex+1, verIndices[i]+1 );
1298 if( !CORBA::is_nil( aNewCurve ) ) {
1299 VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
1302 int marker, line, lineWidth;
1304 if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
1305 line, lineWidth, color) && !isAuto ) {
1307 c.R = color.red()/255.;
1308 c.G = color.green()/255.;
1309 c.B = color.blue()/255.;
1310 pCrv->SetColor( c );
1311 pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
1312 pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1314 pContainer->AddCurve( pCrv->_this() );
1318 UpdateObjBrowser(this);
1319 PlotContainer( this, pContainer, VISU::eDisplay );
1324 // if study is locked just get curves info and plot them
1325 QPtrList<Plot2d_Curve> container;
1326 dlg->getCurves( container );
1327 if ( !container.isEmpty() ) {
1328 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1329 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
1342 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1343 SALOME_ListIO aListIO;
1344 aSelectionMgr->selectedObjects(aListIO);
1345 if (aListIO.Extent() != 1) return;
1347 SalomeApp_Study* aAppStudy = GetAppStudy(this);
1348 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1349 CORBA::Object_var anObject = GetSelectedObj( aAppStudy, anIO->getEntry() );
1350 if (CORBA::is_nil( anObject )) return;
1352 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1353 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) {
1355 CORBA::Object_ptr aCurve = VISU::Curve::_narrow( anObject );
1356 if( !CORBA::is_nil( aCurve ) ) {
1357 VISU::Curve_i* aDSCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
1358 if ( aDSCurve && (!IsStudyLocked( GetCStudy(aAppStudy) )) ) {
1359 Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
1361 aDlg.setLine( (int)aDSCurve->GetLine(), aDSCurve->GetLineWidth() );
1362 aDlg.setMarker( (int)aDSCurve->GetMarker() );
1363 SALOMEDS::Color aColor = aDSCurve->GetColor();
1364 aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
1365 if( aDlg.exec() == QDialog::Accepted ) {
1366 aDSCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
1367 aDSCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
1368 SALOMEDS::Color newColor;
1369 newColor.R = aDlg.getColor().red()/255.;
1370 newColor.G = aDlg.getColor().green()/255.;
1371 newColor.B = aDlg.getColor().blue()/255.;
1372 aDSCurve->SetColor( newColor );
1373 PlotCurve(this, aDSCurve, VISU::eDisplay);
1384 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1385 if (CheckLock(aCStudy))
1387 Handle(SALOME_InteractiveObject) anIO;
1388 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1389 if (anIO.IsNull() || CORBA::is_nil(anObject))
1392 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1393 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCONTAINER) {
1395 CORBA::Object_ptr aCnt = VISU::Container::_narrow(anObject);
1396 if (!CORBA::is_nil(aCnt)) {
1397 VISU::Container_i* container = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
1398 if (container && container->GetNbCurves() > 0) {
1400 UpdateObjBrowser(this);
1410 Handle(SALOME_InteractiveObject) anIO;
1411 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1412 if (CORBA::is_nil(anObject)) return;
1414 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1415 if (!aServant.in()) return;
1416 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aServant.in());
1417 if (!aContainer) return;
1419 VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
1420 aDlg->initFromPrsObject(aContainer);
1422 aDlg->storeToPrsObject(aContainer);
1423 UpdateObjBrowser(this, true);
1432 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1433 if (CheckLock(aCStudy))
1436 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1437 if (aViewMgr->getType() != SVTK_Viewer::Type())
1440 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1441 SALOME_ListIO aListIO;
1442 aSelectionMgr->selectedObjects(aListIO);
1443 if (aListIO.Extent() > 1)
1446 if (aListIO.Extent() == 0) {
1447 VISU::View3D_i::SaveViewParams(aViewMgr, VISU::View3D_i::GenerateViewParamsName().latin1());
1449 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1450 VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
1452 UpdateObjBrowser(this);
1457 OnRestoreViewParams()
1459 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1460 if (aViewMgr->getType() != SVTK_Viewer::Type())
1463 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1464 SALOME_ListIO aListIO;
1465 aSelectionMgr->selectedObjects(aListIO);
1466 if (aListIO.Extent() != 1)
1469 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1470 //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
1471 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
1472 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
1473 VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
1480 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1481 if (CheckLock(aCStudy))
1484 Handle(SALOME_InteractiveObject) anIO;
1485 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1487 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
1490 //TEST DU PARENT == VISU
1491 _PTR(StudyBuilder) aBuilder = aCStudy->NewBuilder();
1492 _PTR(GenericAttribute) anAttr = aBuilder->FindOrCreateAttribute(aSObj, "AttributeName");
1494 _PTR(AttributeName) aName (anAttr);
1495 QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
1496 if (!Name.isEmpty()) {
1497 QApplication::setOverrideCursor(Qt::waitCursor);
1499 // rename specific objects
1500 if (!CORBA::is_nil(anObject)) {
1501 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1502 if (!CORBA::is_nil(aVisuObj)) {
1503 switch (aVisuObj->GetType()) {
1504 case VISU::TCURVE: // Curve object
1506 CORBA::Object_ptr aCurve = VISU::Curve::_narrow(anObject);
1507 if (!CORBA::is_nil(aCurve)) {
1508 VISU::Curve_i* curve =
1509 dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
1511 curve->SetName(Name.latin1());
1515 case VISU::TTABLE: // Table object
1517 CORBA::Object_ptr aTable = VISU::Table::_narrow(anObject);
1518 if (!CORBA::is_nil(aTable)) {
1519 VISU::Table_i* table =
1520 dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
1522 table->SetName(Name.latin1());
1526 case VISU::TCONTAINER: // Container object
1528 CORBA::Object_ptr aContainer = VISU::Container::_narrow(anObject);
1529 if (!CORBA::is_nil(aContainer)) {
1530 VISU::Container_i* container =
1531 dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1533 container->SetName(Name.latin1());
1544 // rename the study object
1545 aName->SetValue(Name.latin1()); // rename the SObject
1546 anIO->setName(Name.latin1()); // rename the InteractiveObject
1548 ViewManagerList pvm_list;
1549 getApp()->viewManagers( SPlot2d_Viewer::Type(), pvm_list );
1550 for( SUIT_ViewManager* mgr = pvm_list.first(); mgr; mgr = pvm_list.next() )
1552 Plot2d_ViewManager* pvm = dynamic_cast<Plot2d_ViewManager*>( mgr );
1555 SPlot2d_Viewer* pv = dynamic_cast<SPlot2d_Viewer*>( pvm->getViewModel() );
1557 pv->renameAll( anIO, Name.latin1() );
1561 UpdateObjBrowser(this, false);
1563 QApplication::restoreOverrideCursor();
1572 new VisuGUI_ClippingDlg (this, "", false);
1580 Handle(SALOME_InteractiveObject) anIO;
1581 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1582 if (CORBA::is_nil(anObject)) return;
1583 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1584 if (!aServant.in()) return;
1586 VISU::ScalarMap_i* aPrsObject = dynamic_cast<VISU::ScalarMap_i*>(aServant.in());
1587 if (!aPrsObject) return;
1589 SVTK_ViewWindow* vw = GetViewWindow();
1592 VISU_Actor* aActor = GetActor(aPrsObject, vw);
1593 if (!aActor) return;
1595 if (!aActor->GetVisibility()) {
1596 aActor->VisibilityOn();
1599 // Get sweep parameters
1600 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
1602 double aTempoDbl = aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1);
1603 int aTemp = int(1.E6 * aTempoDbl);
1605 int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
1606 int aSteps = aResourceMgr->integerValue("VISU", "sweeping_time_step", 40);
1609 QApplication::setOverrideCursor(Qt::waitCursor);
1610 for (int j = 0; j < aCycles; j++) {
1611 for (int i = 0; i <= aSteps; i++) {
1613 float aPercents = float(i)/aSteps;
1614 aPrsObject->SetMapScale(aPercents);
1615 aPrsObject->UpdateActor(aActor);
1616 vw->getRenderWindow()->getRenderWindow()->Render();
1618 } catch (std::exception& exc) {
1619 INFOS("Follow exception was occured :\n" << exc.what());
1621 INFOS("Unknown exception was occured!");
1625 QApplication::restoreOverrideCursor();
1632 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1633 VisuGUI_TimeAnimationDlg* aAnimationDlg =
1634 // new VisuGUI_TimeAnimationDlg(GetDesktop(this), aCStudy);
1635 new VisuGUI_TimeAnimationDlg (this, aCStudy);
1637 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1638 SALOME_ListIO aListIO;
1639 aSelectionMgr->selectedObjects(aListIO);
1641 bool isDefined = false;
1643 SALOME_ListIteratorOfListIO It (aListIO);
1644 for (; It.More(); It.Next()) {
1645 _PTR(SObject) aSObject = aCStudy->FindObjectID(It.Value()->getEntry());
1646 if (!aSObject) continue;
1647 if (getValue(aSObject, "myComment") == QString("FIELD")) {
1648 long aNumber = getValue(aSObject, "myNbTimeStamps").toLong();
1652 aAnimationDlg->addField(aSObject);
1654 } else if (aNbTimes == aNumber) {
1655 aAnimationDlg->addField(aSObject);
1660 if (isDefined) aAnimationDlg->show();
1661 else delete aAnimationDlg;
1664 //************************************************************************
1669 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1670 SALOME_ListIO aListIO;
1671 aSelectionMgr->selectedObjects(aListIO);
1673 if (aListIO.Extent() != 1)
1676 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1678 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1680 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
1683 VISU::Storable::TRestoringMap aMap;
1684 _PTR(GenericAttribute) anAttr;
1685 if (!aSObj->FindAttribute(anAttr, "AttributeComment")) return;
1687 _PTR(AttributeComment) aComment (anAttr);
1688 string aComm = aComment->Value();
1689 QString strIn (aComm.c_str());
1690 VISU::Storable::StrToMap(strIn, aMap);
1692 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
1693 if (aType != VISU::TANIMATION) return;
1695 VisuGUI_TimeAnimationDlg* aAnimationDlg =
1696 new VisuGUI_TimeAnimationDlg(this, aCStudy);
1697 aAnimationDlg->restoreFromStudy(aSObj);
1698 aAnimationDlg->show();
1703 OnCopyPresentation()
1705 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1706 if (CheckLock(aCStudy))
1709 Handle(SALOME_InteractiveObject) anIO;
1710 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1711 if (CORBA::is_nil(anObject)) return;
1712 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1713 if (!aServant.in()) return;
1715 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1716 if (!aPrsObject) return;
1718 switch (aPrsObject->GetType()) {
1721 VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
1722 VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
1723 aSameMesh->SameAs(aMeshPrs);
1724 UpdateViewer(this, aSameMesh);
1727 case VISU::TSCALARMAP:
1729 VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1730 VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
1731 aSameScalar->SameAs(aScalarPrs);
1732 UpdateViewer(this, aSameScalar);
1735 case VISU::TDEFORMEDSHAPE:
1737 VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
1738 VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
1739 aSameDeformed->SameAs(aDefPrs);
1740 UpdateViewer(this, aSameDeformed);
1743 case VISU::TCUTPLANES:
1745 VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
1746 VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
1747 aSameCut->SameAs(aCutPrs);
1748 UpdateViewer(this, aSameCut);
1751 case VISU::TCUTLINES:
1753 VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
1754 VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
1755 aSameCut->SameAs(aCutPrs);
1756 UpdateViewer(this, aSameCut);
1759 case VISU::TISOSURFACE:
1761 VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
1762 VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
1763 aSameIso->SameAs(aIsoPrs);
1764 UpdateViewer(this, aSameIso);
1767 case VISU::TSTREAMLINES:
1769 VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
1770 VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
1771 aSameLines->SameAs(aLinesPrs);
1772 UpdateViewer(this, aSameLines);
1775 case VISU::TVECTORS:
1777 VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
1778 VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
1779 aSameVectors->SameAs(aVectorsPrs);
1780 UpdateViewer(this, aSameVectors);
1785 VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
1786 VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
1787 aSamePlot3D->SameAs(aPlot3DPrs);
1788 UpdateViewer(this, aSamePlot3D);
1792 UpdateObjBrowser(this);
1799 if (GetViewWindow())
1800 (new VisuGUI_SelectionDlg(GetDesktop(this)))->show();
1802 SUIT_MessageBox::warn1(GetDesktop(this),
1804 tr("ERR_ACTIVATE_VIEW3D"),
1812 VisuGUI_NonIsometricDlg* m_NonIsoDlg =
1813 new VisuGUI_NonIsometricDlg (GetDesktop(this), "m_NonIsoDlg",
1814 false, Qt::WDestructiveClose);
1815 m_NonIsoDlg->show();
1822 //Show dialog that allows to select scale function and corresponding scale factor
1823 VisuGUI_CubeAxesDlg* aDlg = new VisuGUI_CubeAxesDlg (GetDesktop(this));
1831 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1832 SALOME_ListIO aListIO;
1833 aSelectionMgr->selectedObjects(aListIO);
1835 SALOME_ListIteratorOfListIO It (aListIO);
1837 // first find the bounds
1838 double aMin, aMax; bool first = true;
1839 for (; It.More(); It.Next()) {
1840 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1841 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
1842 if (!aPrsList.empty()) {
1843 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1844 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1846 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1850 aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
1852 if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
1853 if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
1861 // set the computed range to every selected ScalarMap
1862 bool update = false;
1863 for (It.Initialize(aListIO); It.More(); It.Next() ) {
1864 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1865 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
1866 if (!aPrsList.empty()) {
1867 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1868 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1870 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1872 aScalar->SetRange(aMin, aMax);
1873 RecreateActor(this, aScalar);
1881 if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
1882 //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
1883 vw->getRenderer()->ResetCameraClippingRange();
1894 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1895 SALOME_ListIO aListIO;
1896 aSelectionMgr->selectedObjects(aListIO);
1898 SALOME_ListIteratorOfListIO It (aListIO);
1900 // restore the source range for every ScalarMap
1901 bool update = false;
1902 for (; It.More(); It.Next()) {
1903 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1904 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
1905 if (!aPrsList.empty()) {
1906 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1907 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1909 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1911 aScalar->SetSourceRange();
1912 RecreateActor(this, aScalar);
1920 if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
1921 //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
1922 vw->getRenderer()->ResetCameraClippingRange();
1933 if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs");
1934 VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
1936 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1938 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1939 SALOME_ListIO aListIO;
1940 aSelectionMgr->selectedObjects(aListIO);
1942 SALOME_ListIteratorOfListIO It (aListIO);
1943 for (; It.More(); It.Next()) {
1944 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1945 if (anIO->hasEntry()) {
1946 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
1948 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
1949 if (!CORBA::is_nil(aCORBAObject)) {
1950 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
1951 if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in())) {
1952 aDlg->addPresentation(aPrsObject);
1958 if (aDlg->getPrsCount() > 0)
1968 SVTK_ViewWindow* vw = GetViewWindow();
1970 ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
1979 initialize( CAM_Application* theApp )
1981 SalomeApp_Module::initialize( theApp );
1994 QWidget* aParent = application()->desktop();
1995 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
1998 createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
1999 tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
2000 this, SLOT(OnImportFromFile()));
2002 createAction( VISU_EXPLORE_MED, "", QIconSet(),
2003 tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
2004 this, SLOT(OnExploreMEDFile()));
2006 createAction( VISU_IMPORT_TABLE, "", QIconSet(),
2007 tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
2008 this, SLOT(OnImportTableFromFile()));
2010 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
2011 createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIconSet(aPixmap),
2012 tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
2013 this, SLOT(OnCreateScalarMap()));
2015 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
2016 createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIconSet(aPixmap),
2017 tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
2018 this, SLOT(OnCreateDeformedShape()));
2020 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
2021 createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap),
2022 tr("MEN_VECTORS"), "", 0, aParent, false,
2023 this, SLOT(OnCreateVectors()));
2025 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
2026 createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIconSet(aPixmap),
2027 tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
2028 this, SLOT(OnCreateIsoSurfaces()));
2030 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
2031 createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIconSet(aPixmap),
2032 tr("MEN_CUT_PLANES"), "", 0, aParent, false,
2033 this, SLOT(OnCreateCutPlanes()));
2035 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
2036 createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIconSet(aPixmap),
2037 tr("MEN_STREAM_LINES"), "", 0, aParent, false,
2038 this, SLOT(OnCreateStreamLines()));
2040 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
2041 createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIconSet(aPixmap),
2042 tr("MEN_CUT_LINES"), "", 0, aParent, false,
2043 this, SLOT(OnCreateCutLines()));
2045 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2046 createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIconSet(aPixmap),
2047 tr("MEN_PLOT_3D"), "", 0, aParent, false,
2048 this, SLOT(OnCreatePlot3D()));
2050 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
2051 createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIconSet(aPixmap),
2052 tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
2053 this, SLOT(OnCreatePlot2dView()));
2055 createAction( VISU_DELETE_OBJS, tr("MEN_DELETE_OBJS"), QIconSet(),
2056 tr("MEN_DELETE_OBJS"), "", 0, aParent, false,
2057 this, SLOT(OnDeleteObjects()));
2059 createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIconSet(),
2060 tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
2061 this, SLOT(OnShowTable()));
2063 createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIconSet(),
2064 tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
2065 this, SLOT(OnPlotData()));
2067 createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(),
2068 tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
2069 this, SLOT(OnExportTableToFile()));
2071 createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIconSet(),
2072 tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
2073 this, SLOT(OnImportMedField()));
2075 createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIconSet(),
2076 tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
2077 this, SLOT(OnImportMedField()));
2079 createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIconSet(),
2080 tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
2081 this, SLOT(OnImportMedField()));
2083 createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIconSet(),
2084 tr("MEN_CREATE_PRS"), "", 0, aParent, false,
2085 this, SLOT(OnCreateMesh()));
2087 createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIconSet(),
2088 tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
2089 this, SLOT(OnCreateManyMesh()));
2091 createAction( VISU_TRANSLATE_PRS, tr("MEN_TRANSLATE_PRS"), QIconSet(),
2092 tr("MEN_TRANSLATE_PRS"), "", 0, aParent, false,
2093 this, SLOT(OnTranslatePrs()));
2095 createAction( VISU_MERGE_SCALAR_BARS, tr("MEN_MERGE_SCALAR_BARS"), QIconSet(),
2096 tr("MEN_MERGE_SCALAR_BARS"), "", 0, aParent, false,
2097 this, SLOT(OnMergeScalarBars()));
2099 createAction( VISU_FREE_SCALAR_BARS, tr("MEN_FREE_SCALAR_BARS"), QIconSet(),
2100 tr("MEN_FREE_SCALAR_BARS"), "", 0, aParent, false,
2101 this, SLOT(OnFreeScalarBars()));
2103 createAction( VISU_ERASE, tr("MEN_ERASE"), QIconSet(),
2104 tr("MEN_ERASE"), "", 0, aParent, false,
2105 this, SLOT(OnErasePrs()));
2107 createAction( VISU_DISPLAY, tr("MEN_DISPLAY"), QIconSet(),
2108 tr("MEN_DISPLAY"), "", 0, aParent, false,
2109 this, SLOT(OnDisplayPrs()));
2111 createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIconSet(),
2112 tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
2113 this, SLOT(OnDisplayOnlyPrs()));
2115 createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIconSet(),
2116 tr("MEN_COPY_PRS"), "", 0, aParent, false,
2117 this, SLOT(OnCopyPresentation()));
2119 createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIconSet(),
2120 tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
2121 this, SLOT(OnCurveProperties()));
2123 createAction( VISU_RENAME, tr("MEN_RENAME"), QIconSet(), tr("MEN_RENAME"), "", 0, aParent, false,
2124 this, SLOT(OnRename()));
2126 createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIconSet(),
2127 tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
2128 this, SLOT(OnEditContainer()));
2130 createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(),
2131 tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
2132 this, SLOT(OnClearContainer()));
2134 createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
2135 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2136 this, SLOT(OnSaveViewParams()));
2137 createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
2138 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2139 this, SLOT(OnSaveViewParams()));
2141 createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIconSet(),
2142 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
2143 this, SLOT(OnRestoreViewParams()));
2145 //createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(),
2146 // tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
2147 // this, SLOT(OnDeleteObjects()));
2149 createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIconSet(),
2150 tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false,
2151 this, SLOT(OnArrangeActors()));
2153 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
2154 createAction( VISU_POINTS, tr("MEN_POINTS"), QIconSet(aPixmap),
2155 tr("MEN_POINTS"), "", 0, aParent, false,
2156 this, SLOT(OnMakePoints()));
2158 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
2159 createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIconSet(aPixmap),
2160 tr("MEN_WIREFRAME"), "", 0, aParent, false,
2161 this, SLOT(OnMakeWireframe()));
2163 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
2164 createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIconSet(aPixmap),
2165 tr("MEN_SURFACE"), "", 0, aParent, false,
2166 this, SLOT(OnMakeSurface()));
2168 createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIconSet(),
2169 tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
2170 this, SLOT(OnMakeInsideframe()));
2172 createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIconSet(),
2173 tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
2174 this, SLOT(OnMakeSurfaceframe()));
2176 createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIconSet(),
2177 tr("MEN_SHRINK"), "", 0, aParent, false,
2178 this, SLOT(OnMakeShrink()));
2180 createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(),
2181 tr("MEN_UNSHRINK"), "", 0, aParent, false,
2182 this, SLOT(OnMakeShrink()));
2184 createAction( VISU_SHADING, tr("MEN_SHADING"), QIconSet(),
2185 tr("MEN_SHADING"), "", 0, aParent, false,
2186 this, SLOT(OnSetShadingOn()));
2188 createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIconSet(),
2189 tr("MEN_NOSHADING"), "", 0, aParent, false,
2190 this, SLOT(OnSetShadingOff()));
2192 createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(),
2193 tr("MEN_CELL_COLOR"), "", 0, aParent, false,
2194 this, SLOT(OnChangeColor()));
2196 createAction( VISU_COLOR, tr("MEN_COLOR"), QIconSet(),
2197 tr("MEN_COLOR"), "", 0, aParent, false,
2198 this, SLOT(OnChangeColor()));
2200 createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIconSet(),
2201 tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
2202 this, SLOT(OnChangeWireframeColor()));
2204 createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIconSet(),
2205 tr("MEN_OPACITY"), "", 0, aParent, false,
2206 this, SLOT(OnChangeOpacity()));
2208 createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIconSet(),
2209 tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
2210 this, SLOT(OnChangeLines()));
2213 createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIconSet(),
2214 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2215 this, SLOT(OnEditScalarMap()));
2217 createAction( VISU_EDIT_DEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIconSet(),
2218 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2219 this, SLOT(OnEditDeformedShape()));
2221 createAction( VISU_EDIT_CUTPLANES, tr("MEN_EDIT_PRS"), QIconSet(),
2222 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2223 this, SLOT(OnEditCutPlanes()));
2225 createAction( VISU_EDIT_CUTLINES, tr("MEN_EDIT_PRS"), QIconSet(),
2226 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2227 this, SLOT(OnEditCutLines()));
2229 createAction( VISU_EDIT_ISOSURFACE, tr("MEN_EDIT_PRS"), QIconSet(),
2230 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2231 this, SLOT(OnEditIsoSurfaces()));
2233 createAction( VISU_EDIT_VECTORS, tr("MEN_EDIT_PRS"), QIconSet(),
2234 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2235 this, SLOT(OnEditVectors()));
2237 createAction( VISU_EDIT_STREAMLINES, tr("MEN_EDIT_PRS"), QIconSet(),
2238 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2239 this, SLOT(OnEditStreamLines()));
2241 createAction( VISU_EDIT_PLOT3D, tr("MEN_EDIT_PRS"), QIconSet(),
2242 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2243 this, SLOT(OnEditPlot3D()));
2246 createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
2247 tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
2248 this, SLOT(OnCreateTable()));
2250 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP"));
2251 createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIconSet(aPixmap),
2252 tr("MEN_SWEEP"), "", 0, aParent, false,
2253 this, SLOT(OnSweep()));
2255 createAction( VISU_CLIPPING, tr("MEN_CLIPPING"), QIconSet(),
2256 tr("MEN_CLIPPING"), "", 0, aParent, false,
2257 this, SLOT(OnClippingPlanes()));
2259 createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIconSet(),
2260 tr("MEN_SELECTION_INFO"), "", 0, aParent, false,
2261 this, SLOT(OnSelectionInfo()));
2263 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2264 createAction( VISU_ANIMATION, tr("MEN_ANIMATION"), QIconSet(aPixmap),
2265 tr("MEN_ANIMATION"), "", 0, aParent, false,
2266 this, SLOT(OnTimeAnimation()));
2268 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
2269 createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIconSet(aPixmap),
2270 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
2271 this, SLOT(OnEraseAll()));
2273 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
2274 createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
2275 tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
2276 //this, SLOT(OnEraseAll()));
2279 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
2280 createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
2281 tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
2282 //this, SLOT(OnEraseAll()));
2285 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALING"));
2286 createAction( VISU_SCALING, tr("MEN_SCALING"), QIconSet(aPixmap),
2287 tr("MEN_SCALING"), "", 0, aParent, false,
2288 this, SLOT(OnScaling()));
2290 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUBE_AXES"));
2291 createAction( VISU_CUBE_AXES, tr("MEN_CUBE_AXES"), QIconSet(aPixmap),
2292 tr("MEN_CUBE_AXES"), "", 0, aParent, false,
2293 this, SLOT(OnCubeAxes()));
2295 createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(),
2296 tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
2297 this, SLOT(OnShowAnimation()));
2304 // Add actions to menus
2306 aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
2307 createMenu( separator(), aMenuId, -1, 10 );
2308 createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file
2309 createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file
2310 createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table
2312 aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
2313 createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
2314 createMenu( VISU_DEFORMED_SHAPE, aMenuId, 10 ); // deformed shape
2315 createMenu( VISU_VECTORS, aMenuId, 10 ); // vectors
2316 createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
2317 createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
2318 createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
2319 createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
2320 createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
2322 aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
2323 createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
2325 aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
2327 createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
2328 createMenu( VISU_POINTS, parentId, 10 ); // points
2329 createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
2330 createMenu( VISU_SURFACE, parentId, 10 ); // surface
2331 createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
2332 createMenu( VISU_GLOBAL_SELECTION, aMenuId, 10 ); // global selection
2333 createMenu( VISU_PARTIAL_SELECTION, aMenuId, 10 ); // partial selection
2334 createMenu( VISU_SCALING, aMenuId, 10 ); // scaling
2335 createMenu( VISU_CUBE_AXES, aMenuId, 10 ); // scaling
2342 int aToolId = createTool(tr("TOOL_VISUALISATION"));
2343 createTool( VISU_SCALAR_MAP, aToolId );
2344 createTool( VISU_DEFORMED_SHAPE, aToolId );
2345 createTool( VISU_VECTORS, aToolId );
2346 createTool( VISU_ISO_SURFACES, aToolId );
2347 createTool( VISU_CUT_PLANES, aToolId );
2348 createTool( VISU_CUT_LINES, aToolId );
2349 createTool( VISU_STREAM_LINES, aToolId );
2350 createTool( VISU_PLOT_3D, aToolId );
2352 aToolId = createTool(tr("TOOL_REPRESENTATION"));
2353 createTool( VISU_POINTS, aToolId );
2354 createTool( VISU_WIREFRAME, aToolId );
2355 createTool( VISU_SURFACE, aToolId );
2356 createTool( VISU_ERASE_ALL, aToolId );
2357 createTool( VISU_GLOBAL_SELECTION, aToolId );
2358 createTool( VISU_PARTIAL_SELECTION, aToolId );
2359 createTool( VISU_SCALING, aToolId );
2360 createTool( VISU_CUBE_AXES, aToolId );
2367 // Prepare popup menus
2368 QtxPopupMgr* mgr = popupMgr();
2370 // VISU root commands
2371 mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED file
2372 mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
2373 mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
2375 //mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
2378 mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
2379 mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
2380 mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
2381 mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
2382 mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
2383 mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
2384 mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
2385 mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
2387 mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
2388 mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
2390 mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
2393 mgr->insert( action( VISU_EDIT_SCALARMAP ), -1, -1, -1 );
2394 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
2395 mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
2396 mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
2397 mgr->insert( action( VISU_EDIT_ISOSURFACE ), -1, -1, -1 );
2398 mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
2399 mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
2400 mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
2401 mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
2404 mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
2407 mgr->insert( action( VISU_COPY_PRS ), -1, -1, -1 );
2410 mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
2413 //mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
2414 //mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
2415 //mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
2417 mgr->insert( separator(), -1, -1, -1 );
2419 mgr->insert( action( VISU_ERASE ), -1, -1, -1 ); // erase
2420 mgr->insert( action( VISU_DISPLAY ), -1, -1, -1 ); // display
2421 mgr->insert( action( VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
2423 // "Representation" submenu
2424 int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 );
2425 mgr->insert( action( VISU_POINTS ) , parentId, -1, -1 ); // points
2426 mgr->insert( action( VISU_WIREFRAME ) , parentId, -1, -1 ); // wireframe
2427 mgr->insert( action( VISU_SURFACE ) , parentId, -1, -1 ); // surface
2428 mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
2429 mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
2430 mgr->insert( action( VISU_SHRINK ) , parentId, -1, -1 ); // shrink
2431 mgr->insert( action( VISU_UNSHRINK ) , parentId, -1, -1 ); // unshrink
2432 mgr->insert( separator(), parentId, -1, -1 );
2433 mgr->insert( action( VISU_SHADING ) , parentId, -1, -1 ); // shading
2434 mgr->insert( action( VISU_NOSHADING ) , parentId, -1, -1 ); // noshading
2436 // "Properties" submenu
2437 parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
2438 mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
2439 mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
2440 mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
2441 mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
2442 mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
2444 mgr->insert( separator(), -1, -1, -1 );
2446 // Other presentations management
2447 mgr->insert( action( VISU_TRANSLATE_PRS ), -1, -1, -1 );
2448 mgr->insert( action( VISU_CLIPPING ), -1, -1, -1 );
2450 mgr->insert( action( VISU_MERGE_SCALAR_BARS ), -1, -1, -1 );
2451 mgr->insert( action( VISU_FREE_SCALAR_BARS ), -1, -1, -1 );
2453 mgr->insert( action( VISU_SWEEP ), -1, -1, -1 );
2454 mgr->insert( action( VISU_ANIMATION ), -1, -1, -1 );
2456 mgr->insert( separator(), -1, -1, -1 );
2458 // view parameters commands
2459 mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
2460 mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
2461 mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
2462 //mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
2464 mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
2466 mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
2468 mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
2472 QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
2473 "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'");
2475 // VISU root commands
2476 QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
2477 mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule, true );
2478 mgr->setRule( action( VISU_IMPORT_TABLE ), aRule, true );
2479 mgr->setRule( action( VISU_PLOT2D ), aRule, true );
2481 // timestamp commands
2482 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTIMESTAMP'";
2483 mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
2484 mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
2485 mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
2486 mgr->setRule( action( VISU_CUT_LINES ), aRule, true );
2487 mgr->setRule( action( VISU_PLOT_3D ), aRule, true );
2488 aRule += " and nbComponents>1";
2489 mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule, true );
2490 mgr->setRule( action( VISU_VECTORS ), aRule, true );
2491 mgr->setRule( action( VISU_STREAM_LINES ), aRule, true );
2493 // display/erase commands
2494 QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
2495 QString aTableOrCont = "(type='VISU::TTABLE' and nbChildren>0) or type='VISU::TCONTAINER'";
2496 QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
2497 QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
2498 QString aPrsVisible = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
2499 QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
2500 QString aComponent = "( selcount=1 and canBeDisplayed )";
2502 QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
2503 " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent;
2505 QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
2506 " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + "))) ) or" + aComponent;
2508 QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' " + aPrsAll + "})"
2509 " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
2510 " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'})))) ) or" + aComponent;
2512 mgr->setRule( action( VISU_ERASE ), anEraseRule, true );
2513 mgr->setRule( action( VISU_DISPLAY ), aDisplayRule, true );
2514 mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule, true );
2516 aRule = "selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "}";
2517 mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule, true );
2519 aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
2520 mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule, true );
2521 mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule, true );
2524 aRule = "selcount=1 and type='VISU::TVIEW3D'";
2525 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule, true );
2526 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0", true );
2527 mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
2528 //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
2530 mgr->setRule( action( VISU_ARRANGE_ACTORS ), "client='VTKViewer' and selcount=0", true );
2532 // 3D presentations commands
2533 QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
2534 QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
2535 QString aSurfType = " and $type in {'VISU::TMESH'}";
2536 QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' "
2537 "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D'}";
2538 QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
2539 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'}";
2541 aRule = "selcount=1";
2542 mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType, true );
2544 // "Representation" submenu
2545 QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
2546 QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
2547 QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
2548 QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME'}";
2549 QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}";
2551 mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints, true );
2552 mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType + aNotWirefr, true );
2553 mgr->setRule( action( VISU_SURFACE ) , aRule + aPrsType + aNotSurfac, true );
2554 mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + aInsideType + aNotInside, true );
2555 mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType + aNotSurffr, true );
2557 mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0", true );
2558 mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true );
2560 mgr->setRule( action( VISU_SHADING ) , aRule + " and isScalarMapAct=1 and isShading=0", true );
2561 mgr->setRule( action( VISU_NOSHADING ), aRule + " and isScalarMapAct=1 and isShading=1", true );
2563 // "Properties" submenu
2564 mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
2565 mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
2566 mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
2567 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
2568 "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))", true );
2569 mgr->setRule( action( VISU_OPACITY ), aRule + aShrinkType + " and hasActor=1", true );
2570 mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
2573 QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'";
2575 aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' " + aCurveAll + " " + aPrsAll + "})";
2576 mgr->setRule( action( VISU_RENAME ), aRule, true );
2578 // copy presentation command
2579 aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
2580 mgr->setRule( action( VISU_COPY_PRS ), aRule, true );
2583 aRule = "selcount=1 and type='VISU::TCURVE'";
2584 mgr->setRule( action( VISU_CURVE_PROPS ), aRule, true );
2586 // curve container commands
2587 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
2588 mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule, true );
2589 mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
2591 mgr->setRule( action( VISU_EDIT_SCALARMAP ),
2592 "selcount=1 and type='VISU::TSCALARMAP'", true );
2593 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
2594 "selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
2595 mgr->setRule( action( VISU_EDIT_CUTPLANES ),
2596 "selcount=1 and type='VISU::TCUTPLANES'", true );
2597 mgr->setRule( action( VISU_EDIT_CUTLINES ),
2598 "selcount=1 and type='VISU::TCUTLINES'", true );
2599 mgr->setRule( action( VISU_EDIT_ISOSURFACE ),
2600 "selcount=1 and type='VISU::TISOSURFACE'", true );
2601 mgr->setRule( action( VISU_EDIT_VECTORS ),
2602 "selcount=1 and type='VISU::TVECTORS'", true );
2603 mgr->setRule( action( VISU_EDIT_STREAMLINES ),
2604 "selcount=1 and type='VISU::TSTREAMLINES'", true );
2605 mgr->setRule( action( VISU_EDIT_PLOT3D ),
2606 "selcount=1 and type='VISU::TPLOT3D'", true );
2608 aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
2609 mgr->setRule( action( VISU_CREATE_TABLE ), aRule, true );
2611 aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
2612 mgr->setRule( action( VISU_SWEEP ), aRule, true );
2614 // "Selection info" popup item
2615 aRule = "client='VTKViewer' and selcount=1" + aInsideType;
2616 mgr->setRule( action( VISU_SELECTION_INFO ), aRule, true );
2618 aRule = "client='ObjectBrowser' and selcount>0 and $type in {'VISU::TFIELD'} and nbTimeStamps>1";
2619 mgr->setRule( action( VISU_ANIMATION ), aRule, true );
2621 aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
2622 mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
2623 mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
2625 //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
2626 //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
2629 //***************************************************************************
2630 void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, QString& theTitle )
2632 SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
2634 OB_Browser* ob = getApp()->objectBrowser();
2635 bool isOBClient = (ob && theClient == ob->popupClientType());
2637 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2638 SALOME_ListIO aListIO;
2639 aSelectionMgr->selectedObjects(aListIO);
2641 if (aListIO.Extent() < 1) return;
2643 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2645 // Check if "Merge Scalar Range" can be applied
2647 SALOME_ListIteratorOfListIO It (aListIO);
2648 for (; It.More(); It.Next()) {
2649 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2651 if (!anIO.IsNull() && anIO->hasEntry()) {
2652 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
2653 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
2654 if (CORBA::is_nil(aCORBAObject)) {
2655 _PTR(GenericAttribute) anAttr;
2656 if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
2657 _PTR(AttributeComment) aComment (anAttr);
2658 string aComm = aComment->Value();
2659 QString strIn (aComm.c_str());
2660 VISU::Storable::TRestoringMap pMap;
2661 VISU::Storable::StrToMap(strIn, pMap);
2663 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
2664 if (isExist && aType == VISU::TTIMESTAMP) {
2665 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
2667 for (; anIter->More(); anIter->Next()) {
2668 aPrs = anIter->Value();
2669 if (!aPrs) continue;
2670 std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
2671 nbPrs += aSubList.size();
2680 theMenu->insertSeparator();
2681 action( VISU_MERGE_SCALAR_BARS )->addTo(theMenu);
2682 action( VISU_FREE_SCALAR_BARS )->addTo(theMenu);
2685 theMenu->insertSeparator();
2687 // Check if some (nb > 0) removable objects selected
2688 if (isOBClient && IsRemovableSelected(this)) {
2689 action( VISU_DELETE_OBJS )->addTo(theMenu);
2692 // Check if some curves selected (for bug PAL10611)
2693 bool isCurves = false;
2694 SALOME_ListIteratorOfListIO It1 (aListIO);
2695 for (; It1.More() && !isCurves; It1.Next()) {
2696 Handle(SALOME_InteractiveObject)& anIO = It1.Value();
2698 if (!anIO.IsNull() && anIO->hasEntry()) {
2699 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
2700 _PTR(GenericAttribute) anAttr;
2701 if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
2702 _PTR(AttributeComment) aComment (anAttr);
2703 string aComm = aComment->Value();
2704 QString strIn (aComm.c_str());
2705 VISU::Storable::TRestoringMap pMap;
2706 VISU::Storable::StrToMap(strIn, pMap);
2708 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
2709 if (isExist && aType == VISU::TCURVE) {
2716 action( myDisplay )->removeFrom(theMenu);
2717 action( myErase )->removeFrom(theMenu);
2718 action( myDisplayOnly )->removeFrom(theMenu);
2719 action( myEraseAll )->removeFrom(theMenu);
2722 // Check single selection
2723 if (aListIO.Extent() != 1) return;
2725 Handle(SALOME_InteractiveObject) anIO;
2726 VISU::Storable::TRestoringMap aMap;
2727 CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
2729 _PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
2731 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
2733 if (aType == VISU::TANIMATION) {
2734 action( VISU_SHOW_ANIMATION )->addTo(theMenu);
2736 } else if (isOBClient) {
2737 if (IsSObjectTable(SO)) {
2738 action( VISU_SHOW_TABLE )->addTo(theMenu);
2739 action( VISU_CREATE_CURVES )->addTo(theMenu);
2740 action( VISU_EXPORT_TABLE )->addTo(theMenu);
2741 theMenu->insertSeparator();
2743 if (!CORBA::is_nil(anObject)) {
2744 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
2745 if (!CORBA::is_nil(aMED.in())) {
2746 action( VISU_IMPORT_MED_STRUCTURE )->addTo(theMenu);
2749 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject); // "Import Structure"
2750 if (!CORBA::is_nil(aField)) {
2751 action( VISU_IMPORT_MED_TIMESTAMP )->addTo(theMenu); // "Import TimeStamp"
2754 _PTR(SObject) aSFather = SO->GetFather();
2756 _PTR(GenericAttribute) anAttr;
2757 aSFather->FindAttribute(anAttr, "AttributeName");
2759 _PTR(AttributeName) aName (anAttr);
2760 std::string aValue = aName->Value();
2761 if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
2762 action( VISU_IMPORT_MED_FIELD )->addTo(theMenu); // "Import Field"
2772 //***************************************************************************
2775 windows( QMap<int, int>& theMap ) const
2778 theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
2779 theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::DockBottom );
2785 viewManagers( QStringList& theList ) const
2788 theList.append( SVTK_Viewer::Type() );
2796 CORBA::String_var anIOR = GetVisuGen(this)->GetID();
2797 return QString(anIOR.in());
2803 activateModule( SUIT_Study* theStudy )
2805 SalomeApp_Module::activateModule( theStudy );
2807 setMenuShown( true );
2808 setToolShown( true );
2815 deactivateModule( SUIT_Study* theStudy )
2817 setMenuShown( false );
2818 setToolShown( false );
2820 SalomeApp_Module::deactivateModule( theStudy );
2826 createSelection() const
2828 return new VisuGUI_Selection( (SalomeApp_Module*)this );
2831 //******************************************************************
2832 void VisuGUI::studyActivated()
2834 GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
2842 return new VisuGUI();
2846 void VisuGUI::createPreferences()
2848 int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
2850 int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
2851 int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
2852 addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
2853 int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
2854 addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
2857 fam.append( tr( "VISU_FONT_ARIAL" ) );
2858 fam.append( tr( "VISU_FONT_COURIER" ) );
2859 fam.append( tr( "VISU_FONT_TIMES" ) );
2860 int wflag = ( QtxListResourceEdit::FontItem::All & ( ~( QtxListResourceEdit::FontItem::Size | QtxListResourceEdit::FontItem::UserSize ) ) );
2862 setPreferenceProperty( tfont, "families", fam );
2863 setPreferenceProperty( tfont, "system", false );
2864 setPreferenceProperty( tfont, "widget_flags", wflag );
2865 setPreferenceProperty( lfont, "families", fam );
2866 setPreferenceProperty( lfont, "system", false );
2867 setPreferenceProperty( lfont, "widget_flags", wflag );
2869 int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
2871 int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
2872 setPreferenceProperty( numcol, "min", 2 );
2873 setPreferenceProperty( numcol, "max", 64 );
2875 int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
2876 setPreferenceProperty( numlab, "min", 2 );
2877 setPreferenceProperty( numlab, "max", 65 );
2879 int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab );
2880 int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
2881 QStringList orients;
2882 orients.append( tr( "VISU_VERTICAL" ) );
2883 orients.append( tr( "VISU_HORIZONTAL" ) );
2884 QValueList<QVariant> indices;
2885 indices.append( 0 );
2886 indices.append( 1 );
2887 setPreferenceProperty( orient, "strings", orients );
2888 setPreferenceProperty( orient, "indexes", indices );
2890 int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
2891 int xv = addPreference( tr( "VISU_X" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
2892 int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
2893 int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
2894 int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
2895 setPreferenceProperty( xv, "step", 0.1 );
2896 setPreferenceProperty( yv, "step", 0.1 );
2897 setPreferenceProperty( wv, "step", 0.1 );
2898 setPreferenceProperty( hv, "step", 0.1 );
2899 setPreferenceProperty( xv, "min", 0.0 );
2900 setPreferenceProperty( yv, "min", 0.0 );
2901 setPreferenceProperty( wv, "min", 0.0 );
2902 setPreferenceProperty( hv, "min", 0.0 );
2903 setPreferenceProperty( xv, "max", 1.0 );
2904 setPreferenceProperty( yv, "max", 1.0 );
2905 setPreferenceProperty( wv, "max", 1.0 );
2906 setPreferenceProperty( hv, "max", 1.0 );
2908 int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
2909 int xh = addPreference( tr( "VISU_X" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
2910 int yh = addPreference( tr( "VISU_Y" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
2911 int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
2912 int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
2913 setPreferenceProperty( xh, "step", 0.1 );
2914 setPreferenceProperty( yh, "step", 0.1 );
2915 setPreferenceProperty( wh, "step", 0.1 );
2916 setPreferenceProperty( hh, "step", 0.1 );
2917 setPreferenceProperty( xh, "min", 0.0 );
2918 setPreferenceProperty( yh, "min", 0.0 );
2919 setPreferenceProperty( wh, "min", 0.0 );
2920 setPreferenceProperty( hh, "min", 0.0 );
2921 setPreferenceProperty( xh, "max", 1.0 );
2922 setPreferenceProperty( yh, "max", 1.0 );
2923 setPreferenceProperty( wh, "max", 1.0 );
2924 setPreferenceProperty( hh, "max", 1.0 );
2926 int srangeTab = addPreference( tr( "Scalar range, Sweep, MED import" ) );
2928 int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), srangeTab );
2929 setPreferenceProperty( rangeGr, "columns", 1 );
2931 int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" );
2933 modes.append( tr( "VISU_MODULUS" ) );
2934 modes.append( tr( "VISU_COMPONENT" ) + tr("1") );
2935 modes.append( tr( "VISU_COMPONENT" ) + tr("2") );
2936 modes.append( tr( "VISU_COMPONENT" ) + tr("3") );
2938 indices.append( 0 );
2939 indices.append( 1 );
2940 indices.append( 2 );
2941 indices.append( 3 );
2942 setPreferenceProperty( mode, "strings", modes );
2943 setPreferenceProperty( mode, "indexes", indices );
2945 addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
2947 int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" );
2949 types.append( tr( "VISU_FIELD_RANGE" ) );
2950 types.append( tr( "VISU_IMPOSED_RANGE" ) );
2952 indices.append( 0 );
2953 indices.append( 1 );
2954 setPreferenceProperty( rangetype, "strings", types );
2955 setPreferenceProperty( rangetype, "indexes", indices );
2957 int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), srangeTab );
2959 int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
2960 int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
2961 setPreferenceProperty( min, "step", 0.1 );
2962 setPreferenceProperty( max, "step", 0.1 );
2964 int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
2965 setPreferenceProperty( sweepGr, "columns", 1 );
2967 int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
2968 int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
2969 int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
2970 setPreferenceProperty( timestep, "min", 0.1 );
2971 setPreferenceProperty( timestep, "step", 0.1 );
2972 setPreferenceProperty( timestep, "max", 1000 );
2973 setPreferenceProperty( nbcycles, "max", 100 );
2974 setPreferenceProperty( nbsteps, "max", 200 );
2976 int importGr = addPreference( tr( "MED files import" ), srangeTab );
2977 addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
2980 void VisuGUI::preferencesChanged( const QString&, const QString& )
2986 ::getViewManager(const QString& theType,
2987 const bool theIsCreate)
2989 return getApp()->getViewManager(theType,theIsCreate);
2992 LightApp_Displayer* VisuGUI::displayer()
2995 myDisplayer = new VisuGUI_Displayer( getApp() );