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);
614 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
615 mgr->selectedObjects(aList);
617 Handle(SALOME_InteractiveObject) anIO;
618 for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
620 CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
621 if ( !CORBA::is_nil( anObject ) ) {
622 // is it Prs3d object ?
623 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
625 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
626 //UpdateViewer( this, aPrsObject );
627 SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
630 displayer()->Display( anIO->getEntry() );
631 vw->highlight(anIO, 1);
636 VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
638 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
639 //PlotCurve( this, aCurve, VISU::eDisplay );
640 displayer()->Display( anIO->getEntry() );
644 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
646 if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
647 //PlotContainer( this, aContainer, VISU::eDisplay );
648 displayer()->Display( anIO->getEntry() );
652 VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
654 if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
655 //PlotTable( this, aTable, VISU::eDisplay );
656 displayer()->Display( anIO->getEntry() );
661 SVTK_ViewWindow* vw = GetViewWindow( this );
663 vw->getRenderer()->ResetCameraClippingRange();
666 QApplication::restoreOverrideCursor();
681 if(MYDEBUG) MESSAGE("OnErasePrs");
683 QApplication::setOverrideCursor(Qt::waitCursor);
685 SVTK_ViewWindow* vw = GetViewWindow( this );
687 vw->unHighlightAll();
690 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
691 mgr->selectedObjects(aList);
693 Handle(SALOME_InteractiveObject) anIO;
694 for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
696 CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
697 ErasePrs( this, anObject, false );
703 QApplication::restoreOverrideCursor();
711 Handle(SALOME_InteractiveObject) anIO;
712 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
713 EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg,1>(this, aPrs3d);
714 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
715 aViewWindow->highlight(anIO, 1);
723 OnEditDeformedShape()
725 Handle(SALOME_InteractiveObject) anIO;
726 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
727 EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg,1>(this, aPrs3d);
728 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
729 aViewWindow->highlight(anIO, 1);
739 Handle(SALOME_InteractiveObject) anIO;
740 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
741 EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg,0>(this, aPrs3d);
742 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
743 aViewWindow->highlight(anIO, 1);
753 Handle(SALOME_InteractiveObject) anIO;
754 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
755 EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg,0>(this, aPrs3d);
756 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
757 aViewWindow->highlight(anIO, 1);
767 Handle(SALOME_InteractiveObject) anIO;
768 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
769 EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg,1>(this, aPrs3d);
770 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
771 aViewWindow->highlight(anIO, 1);
781 Handle(SALOME_InteractiveObject) anIO;
782 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
783 EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg,1>(this, aPrs3d);
784 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
785 aViewWindow->highlight(anIO, 1);
795 Handle(SALOME_InteractiveObject) anIO;
796 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
797 EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg,1>(this, aPrs3d);
798 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
799 aViewWindow->highlight(anIO, 1);
809 Handle(SALOME_InteractiveObject) anIO;
810 if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
811 EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg,0>(this, aPrs3d);
812 if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
813 aViewWindow->highlight(anIO, 1);
823 startOperation( myEraseAll );
824 if (SVTK_ViewWindow* vw = GetViewWindow()) {
825 vw->unHighlightAll();
826 if (vtkRenderer *aRen = vw->getRenderer()) {
828 vtkActorCollection *anActColl = aRen->GetActors();
829 for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
830 if (anActor->GetVisibility() > 0)
831 if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
832 anVISUActor = anVISUActor->GetParent();
833 anVISUActor->VisibilityOff();
838 } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
847 ChangeRepresentation(this, VISU::SURFACEFRAME);
854 ChangeRepresentation(this, VISU::INSIDEFRAME);
861 ChangeRepresentation(this, VISU::WIREFRAME);
868 ChangeRepresentation(this, VISU::SHADED);
875 ChangeRepresentation(this, VISU::POINT);
882 ChangeRepresentation(this, VISU::SHRINK);
889 SetShading(this, true);
896 SetShading(this, false);
903 Handle(SALOME_InteractiveObject) anIO;
904 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
905 if (CORBA::is_nil(anObject)) return;
906 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
907 if (!aServant.in()) return;
909 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
912 SVTK_ViewWindow* vw = GetViewWindow();
915 VISU_Actor* anActor = GetActor(aPrs3d, vw);
916 if (!anActor) return;
918 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
919 VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
920 SALOMEDS::Color anOldColor, aNewColor;
921 int aRepresent = anActor->GetRepresentation();
923 switch (aRepresent) {
925 anOldColor = aMesh->GetNodeColor();
927 case VISU::WIREFRAME :
928 case VISU::INSIDEFRAME :
929 anOldColor = aMesh->GetLinkColor();
932 case VISU::SURFACEFRAME :
933 anOldColor = aMesh->GetCellColor();
936 } else if (aDeformedShape) {
937 anOldColor = aDeformedShape->GetColor();
942 QColor aColor (int(255*anOldColor.R),
943 int(255*anOldColor.G),
944 int(255*anOldColor.B));
945 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
946 if (aColorNew.isValid()) {
947 aNewColor.R = aColorNew.red()/255.;
948 aNewColor.G = aColorNew.green()/255.;
949 aNewColor.B = aColorNew.blue()/255.;
951 switch (aRepresent) {
953 aMesh->SetNodeColor(aNewColor);
955 case VISU::WIREFRAME :
956 case VISU::INSIDEFRAME :
957 aMesh->SetLinkColor(aNewColor);
960 case VISU::SURFACEFRAME :
961 aMesh->SetCellColor(aNewColor);
965 aDeformedShape->SetColor(aNewColor);
967 RecreateActor(this, aPrs3d);
973 OnChangeWireframeColor()
975 Handle(SALOME_InteractiveObject) anIO;
976 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
977 if (CORBA::is_nil(anObject)) return;
978 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
979 if (!aServant.in()) return;
981 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
984 SVTK_ViewWindow* vw = GetViewWindow();
987 VISU_Actor* anActor = GetActor(aPrs3d, vw);
988 if (!anActor) return;
990 if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
991 SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor;
992 QColor aColor (int(255*anOldColor.R),
993 int(255*anOldColor.G),
994 int(255*anOldColor.B));
995 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
996 if (aColorNew.isValid()) {
997 aNewColor.R = aColorNew.red()/255.;
998 aNewColor.G = aColorNew.green()/255.;
999 aNewColor.B = aColorNew.blue()/255.;
1000 aMesh->SetLinkColor(aNewColor);
1001 RecreateActor(this, aMesh);
1010 Handle(SALOME_InteractiveObject) anIO;
1011 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1012 if (CORBA::is_nil(anObject)) return;
1013 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1014 if (!aServant.in()) return;
1016 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1017 if (!aPrsObject) return;
1019 SVTK_ViewWindow* vw = GetViewWindow();
1022 VISU_Actor* anActor = GetActor(aPrsObject, vw);
1023 if (!anActor) return;
1025 VisuGUI_CursorDlg* CursorDlg =
1026 new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_OPACITY_TITLE"), TRUE);
1028 CursorDlg->Comment1->setText(tr("DLG_OPACITY_CMT1"));
1029 CursorDlg->Comment2->setText(tr("DLG_OPACITY_CMT2"));
1030 CursorDlg->SpinBox1->setMinValue(0);
1031 CursorDlg->SpinBox1->setMaxValue(100);
1033 float oldopac = anActor->GetOpacity();
1034 int intopac = int(oldopac*100. + 0.5);
1035 CursorDlg->SpinBox1->setValue(intopac);
1037 int ret = CursorDlg->exec();
1039 intopac = CursorDlg->SpinBox1->value();
1040 float newopac = intopac/100.;
1041 anActor->SetOpacity(newopac);
1050 Handle(SALOME_InteractiveObject) anIO;
1051 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1052 if (CORBA::is_nil(anObject)) return;
1053 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1054 if (!aServant.in()) return;
1056 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1057 if (!aPrsObject) return;
1059 SVTK_ViewWindow* vw = GetViewWindow();
1062 VISU_Actor* anActor = GetActor(aPrsObject, vw);
1063 if (!anActor) return;
1065 VisuGUI_CursorDlg* CursorDlg =
1066 new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_LINEWIDTH_TITLE"), TRUE);
1068 CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
1069 CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
1070 CursorDlg->SpinBox1->setMinValue(1);
1071 CursorDlg->SpinBox1->setMaxValue(10);
1073 float oldlwid = anActor->GetLineWidth();
1074 int intlwid = int(oldlwid);
1075 CursorDlg->SpinBox1->setValue(intlwid);
1077 int ret = CursorDlg->exec();
1079 intlwid = CursorDlg->SpinBox1->value();
1080 float newlwid = intlwid;
1081 anActor->SetLineWidth(newlwid);
1090 Handle(SALOME_InteractiveObject) anIO;
1091 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1093 if ( !CORBA::is_nil( anObject ) ) {
1094 VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject );
1095 if ( !CORBA::is_nil( aVisuObj ) && aVisuObj->GetType() == VISU::TTABLE ) {
1096 CORBA::Object_ptr aTable = VISU::Table::_narrow( anObject );
1097 if( !CORBA::is_nil( aTable ) ) {
1098 VISU::Table_i* table = dynamic_cast<VISU::Table_i*>( VISU::GetServant(aTable).in() );
1100 SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( table->GetObjectEntry() );
1105 // possibly this is Table SObject
1106 SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( anIO->getEntry() );
1109 if( !IsSObjectTable( SO ) )
1112 VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
1115 //SAL2670 Orientation of show tables
1116 VisuGUI_TableDlg::ttAuto,
1125 Handle(SALOME_InteractiveObject) anIO;
1126 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1127 _PTR(Study) aStudy = GetCStudy( GetAppStudy( this ) );
1128 _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
1129 VISU::CutLines_var aCutLines = VISU::CutLines::_narrow( anObject );
1130 if(!aCutLines->_is_nil() || IsSObjectTable(aSObject)) {
1131 GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
1132 UpdateObjBrowser(this);
1140 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1141 if (CheckLock(aCStudy))
1144 SALOME_ListIO aList;
1145 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
1146 mgr->selectedObjects(aList,QString::null,false);
1147 int i = 0, nbSelected = aList.Extent();
1148 if (nbSelected < 1) return;
1150 const char* entries [nbSelected];
1151 Handle(SALOME_InteractiveObject) anIO;
1152 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1154 if (anIO->hasEntry())
1155 entries[i++] = anIO->getEntry();
1158 if (nbSelected < 1) return;
1160 // There is a transaction
1161 _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
1162 aStudyBuilder->NewCommand();
1164 for (i = 0; i < nbSelected; i++) {
1165 _PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]);
1167 DeleteSObject(this, aCStudy, aSObject);
1171 // Finish transaction
1172 aStudyBuilder->CommitCommand();
1174 //GetActiveStudy()->unHighlightAll();
1175 UpdateObjBrowser(this, true);
1182 Handle(SALOME_InteractiveObject) anIO;
1183 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1185 _PTR(GenericAttribute) anAttr;
1186 _PTR(AttributeName) aName;
1188 _PTR(Study) aStudy = GetCStudy( GetAppStudy( this ) );
1190 if ( !CORBA::is_nil( anObject ) ) {
1191 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1192 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TTABLE) {
1193 // Table (VISU object) is selected
1194 CORBA::Object_ptr aTbl = VISU::Table::_narrow( anObject );
1195 if( !CORBA::is_nil( aTbl ) ) {
1196 VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTbl).in());
1198 _PTR(SObject) SO = aStudy->FindObjectID( table->GetObjectEntry() );
1199 if ( IsSObjectTable(SO) ) {
1200 // get name of SObject
1201 if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
1203 SOName = QString( aName->Value().c_str() );
1205 VisuGUI_SetupPlot2dDlg* dlg = new VisuGUI_SetupPlot2dDlg( SO, GetDesktop( this ) );
1206 if ( dlg->exec() == QDialog::Accepted ) {
1207 if ( !IsStudyLocked( aStudy ) ) {
1208 // if study is not locked - create new container, create curves and insert them
1209 // into container, then plot container if current viewer is of VIEW_PLOT2D type
1211 QValueList<int> verIndices;
1212 dlg->getCurvesSource( horIndex, verIndices );
1213 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1214 CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
1215 if( !CORBA::is_nil( aContainer ) ) {
1216 VISU::Container_i* pContainer =
1217 dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1219 for ( int i = 0; i < verIndices.count(); i++ ) {
1220 CORBA::Object_var aNewCurve =
1221 GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
1222 if( !CORBA::is_nil( aNewCurve ) ) {
1223 VISU::Curve_i* pCrv =
1224 dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
1227 int marker, line, lineWidth;
1229 if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
1230 line, lineWidth, color) && !isAuto ) {
1232 c.R = color.red() /255.;
1233 c.G = color.green()/255.;
1234 c.B = color.blue() /255.;
1235 pCrv->SetColor( c );
1236 pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
1237 pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1239 pContainer->AddCurve( pCrv->_this() );
1243 UpdateObjBrowser(this);
1244 PlotContainer( this, pContainer, VISU::eDisplay );
1250 // if study is locked just get curves info and plot them
1251 // if current viewer is of VIEW_PLOT2D type
1252 QPtrList<Plot2d_Curve> container;
1253 dlg->getCurves( container );
1254 if ( !container.isEmpty() ) {
1255 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1256 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
1266 else if ( !anIO.IsNull() ) {
1267 // check if Table SObject is selected
1268 SO = aStudy->FindObjectID( anIO->getEntry() );
1269 if ( IsSObjectTable(SO) ) {
1270 // get name of SObject
1271 if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
1273 SOName = QString( aName->Value().c_str() );
1275 VisuGUI_SetupPlot2dDlg* dlg = new VisuGUI_SetupPlot2dDlg( SO, GetDesktop( this ) );
1276 if ( dlg->exec() == QDialog::Accepted ) {
1277 if ( !IsStudyLocked( aStudy ) ) {
1278 // if study is not locked - create new table and container objects, create curves
1279 // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
1281 QValueList<int> verIndices;
1282 dlg->getCurvesSource( horIndex, verIndices );
1283 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1284 CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
1285 CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
1286 if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
1287 VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
1288 VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1290 if ( pContainer && pTable ) {
1291 for ( int i = 0; i < verIndices.count(); i++ ) {
1292 CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve
1293 ( pTable->_this(), horIndex+1, verIndices[i]+1 );
1294 if( !CORBA::is_nil( aNewCurve ) ) {
1295 VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
1298 int marker, line, lineWidth;
1300 if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
1301 line, lineWidth, color) && !isAuto ) {
1303 c.R = color.red()/255.;
1304 c.G = color.green()/255.;
1305 c.B = color.blue()/255.;
1306 pCrv->SetColor( c );
1307 pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
1308 pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1310 pContainer->AddCurve( pCrv->_this() );
1314 UpdateObjBrowser(this);
1315 PlotContainer( this, pContainer, VISU::eDisplay );
1320 // if study is locked just get curves info and plot them
1321 QPtrList<Plot2d_Curve> container;
1322 dlg->getCurves( container );
1323 if ( !container.isEmpty() ) {
1324 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1325 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
1338 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1339 SALOME_ListIO aListIO;
1340 aSelectionMgr->selectedObjects(aListIO);
1341 if (aListIO.Extent() != 1) return;
1343 SalomeApp_Study* aAppStudy = GetAppStudy(this);
1344 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1345 CORBA::Object_var anObject = GetSelectedObj( aAppStudy, anIO->getEntry() );
1346 if (CORBA::is_nil( anObject )) return;
1348 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1349 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) {
1351 CORBA::Object_ptr aCurve = VISU::Curve::_narrow( anObject );
1352 if( !CORBA::is_nil( aCurve ) ) {
1353 VISU::Curve_i* aDSCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
1354 if ( aDSCurve && (!IsStudyLocked( GetCStudy(aAppStudy) )) ) {
1355 Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
1357 aDlg.setLine( (int)aDSCurve->GetLine(), aDSCurve->GetLineWidth() );
1358 aDlg.setMarker( (int)aDSCurve->GetMarker() );
1359 SALOMEDS::Color aColor = aDSCurve->GetColor();
1360 aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
1361 if( aDlg.exec() == QDialog::Accepted ) {
1362 aDSCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
1363 aDSCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
1364 SALOMEDS::Color newColor;
1365 newColor.R = aDlg.getColor().red()/255.;
1366 newColor.G = aDlg.getColor().green()/255.;
1367 newColor.B = aDlg.getColor().blue()/255.;
1368 aDSCurve->SetColor( newColor );
1369 PlotCurve(this, aDSCurve, VISU::eDisplay);
1380 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1381 if (CheckLock(aCStudy))
1383 Handle(SALOME_InteractiveObject) anIO;
1384 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1385 if (anIO.IsNull() || CORBA::is_nil(anObject))
1388 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1389 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCONTAINER) {
1391 CORBA::Object_ptr aCnt = VISU::Container::_narrow(anObject);
1392 if (!CORBA::is_nil(aCnt)) {
1393 VISU::Container_i* container = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
1394 if (container && container->GetNbCurves() > 0) {
1396 UpdateObjBrowser(this);
1406 Handle(SALOME_InteractiveObject) anIO;
1407 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1408 if (CORBA::is_nil(anObject)) return;
1410 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1411 if (!aServant.in()) return;
1412 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aServant.in());
1413 if (!aContainer) return;
1415 VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
1416 aDlg->initFromPrsObject(aContainer);
1418 aDlg->storeToPrsObject(aContainer);
1419 UpdateObjBrowser(this, true);
1428 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1429 if (CheckLock(aCStudy))
1432 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1433 if (aViewMgr->getType() != SVTK_Viewer::Type())
1436 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1437 SALOME_ListIO aListIO;
1438 aSelectionMgr->selectedObjects(aListIO);
1439 if (aListIO.Extent() > 1)
1442 if (aListIO.Extent() == 0) {
1443 VISU::View3D_i::SaveViewParams(aViewMgr, VISU::View3D_i::GenerateViewParamsName().latin1());
1445 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1446 VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
1448 UpdateObjBrowser(this);
1453 OnRestoreViewParams()
1455 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1456 if (aViewMgr->getType() != SVTK_Viewer::Type())
1459 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1460 SALOME_ListIO aListIO;
1461 aSelectionMgr->selectedObjects(aListIO);
1462 if (aListIO.Extent() != 1)
1465 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1466 //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
1467 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
1468 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
1469 VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
1476 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1477 if (CheckLock(aCStudy))
1480 Handle(SALOME_InteractiveObject) anIO;
1481 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1483 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
1486 //TEST DU PARENT == VISU
1487 _PTR(StudyBuilder) aBuilder = aCStudy->NewBuilder();
1488 _PTR(GenericAttribute) anAttr = aBuilder->FindOrCreateAttribute(aSObj, "AttributeName");
1490 _PTR(AttributeName) aName (anAttr);
1491 QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
1492 if (!Name.isEmpty()) {
1493 QApplication::setOverrideCursor(Qt::waitCursor);
1495 // rename specific objects
1496 if (!CORBA::is_nil(anObject)) {
1497 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1498 if (!CORBA::is_nil(aVisuObj)) {
1499 switch (aVisuObj->GetType()) {
1500 case VISU::TCURVE: // Curve object
1502 CORBA::Object_ptr aCurve = VISU::Curve::_narrow(anObject);
1503 if (!CORBA::is_nil(aCurve)) {
1504 VISU::Curve_i* curve =
1505 dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
1507 curve->SetName(Name.latin1());
1511 case VISU::TTABLE: // Table object
1513 CORBA::Object_ptr aTable = VISU::Table::_narrow(anObject);
1514 if (!CORBA::is_nil(aTable)) {
1515 VISU::Table_i* table =
1516 dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
1518 table->SetName(Name.latin1());
1522 case VISU::TCONTAINER: // Container object
1524 CORBA::Object_ptr aContainer = VISU::Container::_narrow(anObject);
1525 if (!CORBA::is_nil(aContainer)) {
1526 VISU::Container_i* container =
1527 dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1529 container->SetName(Name.latin1());
1540 // rename the study object
1541 aName->SetValue(Name.latin1()); // rename the SObject
1542 anIO->setName(Name.latin1()); // rename the InteractiveObject
1544 ViewManagerList pvm_list;
1545 getApp()->viewManagers( SPlot2d_Viewer::Type(), pvm_list );
1546 for( SUIT_ViewManager* mgr = pvm_list.first(); mgr; mgr = pvm_list.next() )
1548 Plot2d_ViewManager* pvm = dynamic_cast<Plot2d_ViewManager*>( mgr );
1551 SPlot2d_Viewer* pv = dynamic_cast<SPlot2d_Viewer*>( pvm->getViewModel() );
1553 pv->renameAll( anIO, Name.latin1() );
1557 UpdateObjBrowser(this, false);
1559 QApplication::restoreOverrideCursor();
1568 new VisuGUI_ClippingDlg (this, "", false);
1576 Handle(SALOME_InteractiveObject) anIO;
1577 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1578 if (CORBA::is_nil(anObject)) return;
1579 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1580 if (!aServant.in()) return;
1582 VISU::ScalarMap_i* aPrsObject = dynamic_cast<VISU::ScalarMap_i*>(aServant.in());
1583 if (!aPrsObject) return;
1585 SVTK_ViewWindow* vw = GetViewWindow();
1588 VISU_Actor* aActor = GetActor(aPrsObject, vw);
1589 if (!aActor) return;
1591 if (!aActor->GetVisibility()) {
1592 aActor->VisibilityOn();
1595 // Get sweep parameters
1596 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
1598 double aTempoDbl = aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1);
1599 int aTemp = int(1.E6 * aTempoDbl);
1601 int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
1602 int aSteps = aResourceMgr->integerValue("VISU", "sweeping_time_step", 40);
1605 QApplication::setOverrideCursor(Qt::waitCursor);
1606 for (int j = 0; j < aCycles; j++) {
1607 for (int i = 0; i <= aSteps; i++) {
1609 float aPercents = float(i)/aSteps;
1610 aPrsObject->SetMapScale(aPercents);
1611 aPrsObject->UpdateActor(aActor);
1612 vw->getRenderWindow()->getRenderWindow()->Render();
1614 } catch (std::exception& exc) {
1615 INFOS("Follow exception was occured :\n" << exc.what());
1617 INFOS("Unknown exception was occured!");
1621 QApplication::restoreOverrideCursor();
1628 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1629 VisuGUI_TimeAnimationDlg* aAnimationDlg =
1630 // new VisuGUI_TimeAnimationDlg(GetDesktop(this), aCStudy);
1631 new VisuGUI_TimeAnimationDlg (this, aCStudy);
1633 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1634 SALOME_ListIO aListIO;
1635 aSelectionMgr->selectedObjects(aListIO);
1637 bool isDefined = false;
1639 SALOME_ListIteratorOfListIO It (aListIO);
1640 for (; It.More(); It.Next()) {
1641 _PTR(SObject) aSObject = aCStudy->FindObjectID(It.Value()->getEntry());
1642 if (!aSObject) continue;
1643 if (getValue(aSObject, "myComment") == QString("FIELD")) {
1644 long aNumber = getValue(aSObject, "myNbTimeStamps").toLong();
1648 aAnimationDlg->addField(aSObject);
1650 } else if (aNbTimes == aNumber) {
1651 aAnimationDlg->addField(aSObject);
1656 if (isDefined) aAnimationDlg->show();
1657 else delete aAnimationDlg;
1660 //************************************************************************
1665 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1666 SALOME_ListIO aListIO;
1667 aSelectionMgr->selectedObjects(aListIO);
1669 if (aListIO.Extent() != 1)
1672 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1674 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1676 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
1679 VISU::Storable::TRestoringMap aMap;
1680 _PTR(GenericAttribute) anAttr;
1681 if (!aSObj->FindAttribute(anAttr, "AttributeComment")) return;
1683 _PTR(AttributeComment) aComment (anAttr);
1684 string aComm = aComment->Value();
1685 QString strIn (aComm.c_str());
1686 VISU::Storable::StrToMap(strIn, aMap);
1688 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
1689 if (aType != VISU::TANIMATION) return;
1691 VisuGUI_TimeAnimationDlg* aAnimationDlg =
1692 new VisuGUI_TimeAnimationDlg(this, aCStudy);
1693 aAnimationDlg->restoreFromStudy(aSObj);
1694 aAnimationDlg->show();
1699 OnCopyPresentation()
1701 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1702 if (CheckLock(aCStudy))
1705 Handle(SALOME_InteractiveObject) anIO;
1706 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1707 if (CORBA::is_nil(anObject)) return;
1708 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1709 if (!aServant.in()) return;
1711 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1712 if (!aPrsObject) return;
1714 switch (aPrsObject->GetType()) {
1717 VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
1718 VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
1719 aSameMesh->SameAs(aMeshPrs);
1720 UpdateViewer(this, aSameMesh);
1723 case VISU::TSCALARMAP:
1725 VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1726 VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
1727 aSameScalar->SameAs(aScalarPrs);
1728 UpdateViewer(this, aSameScalar);
1731 case VISU::TDEFORMEDSHAPE:
1733 VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
1734 VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
1735 aSameDeformed->SameAs(aDefPrs);
1736 UpdateViewer(this, aSameDeformed);
1739 case VISU::TCUTPLANES:
1741 VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
1742 VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
1743 aSameCut->SameAs(aCutPrs);
1744 UpdateViewer(this, aSameCut);
1747 case VISU::TCUTLINES:
1749 VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
1750 VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
1751 aSameCut->SameAs(aCutPrs);
1752 UpdateViewer(this, aSameCut);
1755 case VISU::TISOSURFACE:
1757 VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
1758 VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
1759 aSameIso->SameAs(aIsoPrs);
1760 UpdateViewer(this, aSameIso);
1763 case VISU::TSTREAMLINES:
1765 VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
1766 VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
1767 aSameLines->SameAs(aLinesPrs);
1768 UpdateViewer(this, aSameLines);
1771 case VISU::TVECTORS:
1773 VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
1774 VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
1775 aSameVectors->SameAs(aVectorsPrs);
1776 UpdateViewer(this, aSameVectors);
1781 VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
1782 VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
1783 aSamePlot3D->SameAs(aPlot3DPrs);
1784 UpdateViewer(this, aSamePlot3D);
1788 UpdateObjBrowser(this);
1795 if (GetViewWindow())
1796 (new VisuGUI_SelectionDlg(GetDesktop(this)))->show();
1798 SUIT_MessageBox::warn1(GetDesktop(this),
1800 tr("ERR_ACTIVATE_VIEW3D"),
1808 VisuGUI_NonIsometricDlg* m_NonIsoDlg =
1809 new VisuGUI_NonIsometricDlg (GetDesktop(this), "m_NonIsoDlg",
1810 false, Qt::WDestructiveClose);
1811 m_NonIsoDlg->show();
1818 //Show dialog that allows to select scale function and corresponding scale factor
1819 VisuGUI_CubeAxesDlg* aDlg = new VisuGUI_CubeAxesDlg (GetDesktop(this));
1827 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1828 SALOME_ListIO aListIO;
1829 aSelectionMgr->selectedObjects(aListIO);
1831 SALOME_ListIteratorOfListIO It (aListIO);
1833 // first find the bounds
1834 double aMin, aMax; bool first = true;
1835 for (; It.More(); It.Next()) {
1836 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1837 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
1838 if (!aPrsList.empty()) {
1839 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1840 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1842 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1846 aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
1848 if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
1849 if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
1857 // set the computed range to every selected ScalarMap
1858 bool update = false;
1859 for (It.Initialize(aListIO); It.More(); It.Next() ) {
1860 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1861 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
1862 if (!aPrsList.empty()) {
1863 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1864 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1866 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1868 aScalar->SetRange(aMin, aMax);
1869 RecreateActor(this, aScalar);
1877 if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
1878 //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
1879 vw->getRenderer()->ResetCameraClippingRange();
1890 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1891 SALOME_ListIO aListIO;
1892 aSelectionMgr->selectedObjects(aListIO);
1894 SALOME_ListIteratorOfListIO It (aListIO);
1896 // restore the source range for every ScalarMap
1897 bool update = false;
1898 for (; It.More(); It.Next()) {
1899 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1900 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
1901 if (!aPrsList.empty()) {
1902 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1903 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1905 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1907 aScalar->SetSourceRange();
1908 RecreateActor(this, aScalar);
1916 if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
1917 //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
1918 vw->getRenderer()->ResetCameraClippingRange();
1929 if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs");
1930 VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
1932 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1934 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1935 SALOME_ListIO aListIO;
1936 aSelectionMgr->selectedObjects(aListIO);
1938 SALOME_ListIteratorOfListIO It (aListIO);
1939 for (; It.More(); It.Next()) {
1940 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1941 if (anIO->hasEntry()) {
1942 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
1944 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
1945 if (!CORBA::is_nil(aCORBAObject)) {
1946 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
1947 if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in())) {
1948 aDlg->addPresentation(aPrsObject);
1954 if (aDlg->getPrsCount() > 0)
1964 SVTK_ViewWindow* vw = GetViewWindow();
1966 ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
1975 initialize( CAM_Application* theApp )
1977 SalomeApp_Module::initialize( theApp );
1990 QWidget* aParent = application()->desktop();
1991 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
1994 createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
1995 tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
1996 this, SLOT(OnImportFromFile()));
1998 createAction( VISU_EXPLORE_MED, "", QIconSet(),
1999 tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
2000 this, SLOT(OnExploreMEDFile()));
2002 createAction( VISU_IMPORT_TABLE, "", QIconSet(),
2003 tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
2004 this, SLOT(OnImportTableFromFile()));
2006 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
2007 createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIconSet(aPixmap),
2008 tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
2009 this, SLOT(OnCreateScalarMap()));
2011 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
2012 createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIconSet(aPixmap),
2013 tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
2014 this, SLOT(OnCreateDeformedShape()));
2016 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
2017 createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap),
2018 tr("MEN_VECTORS"), "", 0, aParent, false,
2019 this, SLOT(OnCreateVectors()));
2021 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
2022 createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIconSet(aPixmap),
2023 tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
2024 this, SLOT(OnCreateIsoSurfaces()));
2026 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
2027 createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIconSet(aPixmap),
2028 tr("MEN_CUT_PLANES"), "", 0, aParent, false,
2029 this, SLOT(OnCreateCutPlanes()));
2031 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
2032 createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIconSet(aPixmap),
2033 tr("MEN_STREAM_LINES"), "", 0, aParent, false,
2034 this, SLOT(OnCreateStreamLines()));
2036 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
2037 createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIconSet(aPixmap),
2038 tr("MEN_CUT_LINES"), "", 0, aParent, false,
2039 this, SLOT(OnCreateCutLines()));
2041 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2042 createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIconSet(aPixmap),
2043 tr("MEN_PLOT_3D"), "", 0, aParent, false,
2044 this, SLOT(OnCreatePlot3D()));
2046 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
2047 createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIconSet(aPixmap),
2048 tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
2049 this, SLOT(OnCreatePlot2dView()));
2051 createAction( VISU_DELETE_OBJS, tr("MEN_DELETE_OBJS"), QIconSet(),
2052 tr("MEN_DELETE_OBJS"), "", 0, aParent, false,
2053 this, SLOT(OnDeleteObjects()));
2055 createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIconSet(),
2056 tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
2057 this, SLOT(OnShowTable()));
2059 createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIconSet(),
2060 tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
2061 this, SLOT(OnPlotData()));
2063 createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(),
2064 tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
2065 this, SLOT(OnExportTableToFile()));
2067 createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIconSet(),
2068 tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
2069 this, SLOT(OnImportMedField()));
2071 createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIconSet(),
2072 tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
2073 this, SLOT(OnImportMedField()));
2075 createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIconSet(),
2076 tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
2077 this, SLOT(OnImportMedField()));
2079 createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIconSet(),
2080 tr("MEN_CREATE_PRS"), "", 0, aParent, false,
2081 this, SLOT(OnCreateMesh()));
2083 createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIconSet(),
2084 tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
2085 this, SLOT(OnCreateManyMesh()));
2087 createAction( VISU_TRANSLATE_PRS, tr("MEN_TRANSLATE_PRS"), QIconSet(),
2088 tr("MEN_TRANSLATE_PRS"), "", 0, aParent, false,
2089 this, SLOT(OnTranslatePrs()));
2091 createAction( VISU_MERGE_SCALAR_BARS, tr("MEN_MERGE_SCALAR_BARS"), QIconSet(),
2092 tr("MEN_MERGE_SCALAR_BARS"), "", 0, aParent, false,
2093 this, SLOT(OnMergeScalarBars()));
2095 createAction( VISU_FREE_SCALAR_BARS, tr("MEN_FREE_SCALAR_BARS"), QIconSet(),
2096 tr("MEN_FREE_SCALAR_BARS"), "", 0, aParent, false,
2097 this, SLOT(OnFreeScalarBars()));
2099 createAction( VISU_ERASE, tr("MEN_ERASE"), QIconSet(),
2100 tr("MEN_ERASE"), "", 0, aParent, false,
2101 this, SLOT(OnErasePrs()));
2103 createAction( VISU_DISPLAY, tr("MEN_DISPLAY"), QIconSet(),
2104 tr("MEN_DISPLAY"), "", 0, aParent, false,
2105 this, SLOT(OnDisplayPrs()));
2107 createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIconSet(),
2108 tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
2109 this, SLOT(OnDisplayOnlyPrs()));
2111 createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIconSet(),
2112 tr("MEN_COPY_PRS"), "", 0, aParent, false,
2113 this, SLOT(OnCopyPresentation()));
2115 createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIconSet(),
2116 tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
2117 this, SLOT(OnCurveProperties()));
2119 createAction( VISU_RENAME, tr("MEN_RENAME"), QIconSet(), tr("MEN_RENAME"), "", 0, aParent, false,
2120 this, SLOT(OnRename()));
2122 createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIconSet(),
2123 tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
2124 this, SLOT(OnEditContainer()));
2126 createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(),
2127 tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
2128 this, SLOT(OnClearContainer()));
2130 createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
2131 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2132 this, SLOT(OnSaveViewParams()));
2133 createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
2134 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2135 this, SLOT(OnSaveViewParams()));
2137 createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIconSet(),
2138 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
2139 this, SLOT(OnRestoreViewParams()));
2141 //createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(),
2142 // tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
2143 // this, SLOT(OnDeleteObjects()));
2145 createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIconSet(),
2146 tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false,
2147 this, SLOT(OnArrangeActors()));
2149 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
2150 createAction( VISU_POINTS, tr("MEN_POINTS"), QIconSet(aPixmap),
2151 tr("MEN_POINTS"), "", 0, aParent, false,
2152 this, SLOT(OnMakePoints()));
2154 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
2155 createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIconSet(aPixmap),
2156 tr("MEN_WIREFRAME"), "", 0, aParent, false,
2157 this, SLOT(OnMakeWireframe()));
2159 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
2160 createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIconSet(aPixmap),
2161 tr("MEN_SURFACE"), "", 0, aParent, false,
2162 this, SLOT(OnMakeSurface()));
2164 createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIconSet(),
2165 tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
2166 this, SLOT(OnMakeInsideframe()));
2168 createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIconSet(),
2169 tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
2170 this, SLOT(OnMakeSurfaceframe()));
2172 createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIconSet(),
2173 tr("MEN_SHRINK"), "", 0, aParent, false,
2174 this, SLOT(OnMakeShrink()));
2176 createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(),
2177 tr("MEN_UNSHRINK"), "", 0, aParent, false,
2178 this, SLOT(OnMakeShrink()));
2180 createAction( VISU_SHADING, tr("MEN_SHADING"), QIconSet(),
2181 tr("MEN_SHADING"), "", 0, aParent, false,
2182 this, SLOT(OnSetShadingOn()));
2184 createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIconSet(),
2185 tr("MEN_NOSHADING"), "", 0, aParent, false,
2186 this, SLOT(OnSetShadingOff()));
2188 createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(),
2189 tr("MEN_CELL_COLOR"), "", 0, aParent, false,
2190 this, SLOT(OnChangeColor()));
2192 createAction( VISU_COLOR, tr("MEN_COLOR"), QIconSet(),
2193 tr("MEN_COLOR"), "", 0, aParent, false,
2194 this, SLOT(OnChangeColor()));
2196 createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIconSet(),
2197 tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
2198 this, SLOT(OnChangeWireframeColor()));
2200 createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIconSet(),
2201 tr("MEN_OPACITY"), "", 0, aParent, false,
2202 this, SLOT(OnChangeOpacity()));
2204 createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIconSet(),
2205 tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
2206 this, SLOT(OnChangeLines()));
2209 createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIconSet(),
2210 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2211 this, SLOT(OnEditScalarMap()));
2213 createAction( VISU_EDIT_DEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIconSet(),
2214 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2215 this, SLOT(OnEditDeformedShape()));
2217 createAction( VISU_EDIT_CUTPLANES, tr("MEN_EDIT_PRS"), QIconSet(),
2218 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2219 this, SLOT(OnEditCutPlanes()));
2221 createAction( VISU_EDIT_CUTLINES, tr("MEN_EDIT_PRS"), QIconSet(),
2222 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2223 this, SLOT(OnEditCutLines()));
2225 createAction( VISU_EDIT_ISOSURFACE, tr("MEN_EDIT_PRS"), QIconSet(),
2226 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2227 this, SLOT(OnEditIsoSurfaces()));
2229 createAction( VISU_EDIT_VECTORS, tr("MEN_EDIT_PRS"), QIconSet(),
2230 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2231 this, SLOT(OnEditVectors()));
2233 createAction( VISU_EDIT_STREAMLINES, tr("MEN_EDIT_PRS"), QIconSet(),
2234 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2235 this, SLOT(OnEditStreamLines()));
2237 createAction( VISU_EDIT_PLOT3D, tr("MEN_EDIT_PRS"), QIconSet(),
2238 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2239 this, SLOT(OnEditPlot3D()));
2242 createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
2243 tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
2244 this, SLOT(OnCreateTable()));
2246 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP"));
2247 createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIconSet(aPixmap),
2248 tr("MEN_SWEEP"), "", 0, aParent, false,
2249 this, SLOT(OnSweep()));
2251 createAction( VISU_CLIPPING, tr("MEN_CLIPPING"), QIconSet(),
2252 tr("MEN_CLIPPING"), "", 0, aParent, false,
2253 this, SLOT(OnClippingPlanes()));
2255 createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIconSet(),
2256 tr("MEN_SELECTION_INFO"), "", 0, aParent, false,
2257 this, SLOT(OnSelectionInfo()));
2259 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2260 createAction( VISU_ANIMATION, tr("MEN_ANIMATION"), QIconSet(aPixmap),
2261 tr("MEN_ANIMATION"), "", 0, aParent, false,
2262 this, SLOT(OnTimeAnimation()));
2264 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
2265 createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIconSet(aPixmap),
2266 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
2267 this, SLOT(OnEraseAll()));
2269 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
2270 createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
2271 tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
2272 //this, SLOT(OnEraseAll()));
2275 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
2276 createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
2277 tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
2278 //this, SLOT(OnEraseAll()));
2281 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALING"));
2282 createAction( VISU_SCALING, tr("MEN_SCALING"), QIconSet(aPixmap),
2283 tr("MEN_SCALING"), "", 0, aParent, false,
2284 this, SLOT(OnScaling()));
2286 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUBE_AXES"));
2287 createAction( VISU_CUBE_AXES, tr("MEN_CUBE_AXES"), QIconSet(aPixmap),
2288 tr("MEN_CUBE_AXES"), "", 0, aParent, false,
2289 this, SLOT(OnCubeAxes()));
2291 createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(),
2292 tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
2293 this, SLOT(OnShowAnimation()));
2300 // Add actions to menus
2302 aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
2303 createMenu( separator(), aMenuId, -1, 10 );
2304 createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file
2305 createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file
2306 createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table
2308 aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
2309 createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
2310 createMenu( VISU_DEFORMED_SHAPE, aMenuId, 10 ); // deformed shape
2311 createMenu( VISU_VECTORS, aMenuId, 10 ); // vectors
2312 createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
2313 createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
2314 createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
2315 createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
2316 createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
2318 aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
2319 createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
2321 aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
2323 createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
2324 createMenu( VISU_POINTS, parentId, 10 ); // points
2325 createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
2326 createMenu( VISU_SURFACE, parentId, 10 ); // surface
2327 createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
2328 createMenu( VISU_GLOBAL_SELECTION, aMenuId, 10 ); // global selection
2329 createMenu( VISU_PARTIAL_SELECTION, aMenuId, 10 ); // partial selection
2330 createMenu( VISU_SCALING, aMenuId, 10 ); // scaling
2331 createMenu( VISU_CUBE_AXES, aMenuId, 10 ); // scaling
2338 int aToolId = createTool(tr("TOOL_VISUALISATION"));
2339 createTool( VISU_SCALAR_MAP, aToolId );
2340 createTool( VISU_DEFORMED_SHAPE, aToolId );
2341 createTool( VISU_VECTORS, aToolId );
2342 createTool( VISU_ISO_SURFACES, aToolId );
2343 createTool( VISU_CUT_PLANES, aToolId );
2344 createTool( VISU_CUT_LINES, aToolId );
2345 createTool( VISU_STREAM_LINES, aToolId );
2346 createTool( VISU_PLOT_3D, aToolId );
2348 aToolId = createTool(tr("TOOL_REPRESENTATION"));
2349 createTool( VISU_POINTS, aToolId );
2350 createTool( VISU_WIREFRAME, aToolId );
2351 createTool( VISU_SURFACE, aToolId );
2352 createTool( VISU_ERASE_ALL, aToolId );
2353 createTool( VISU_GLOBAL_SELECTION, aToolId );
2354 createTool( VISU_PARTIAL_SELECTION, aToolId );
2355 createTool( VISU_SCALING, aToolId );
2356 createTool( VISU_CUBE_AXES, aToolId );
2363 // Prepare popup menus
2364 QtxPopupMgr* mgr = popupMgr();
2366 // VISU root commands
2367 mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED file
2368 mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
2369 mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
2371 //mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
2374 mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
2375 mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
2376 mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
2377 mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
2378 mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
2379 mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
2380 mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
2381 mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
2383 mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
2384 mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
2386 mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
2389 mgr->insert( action( VISU_EDIT_SCALARMAP ), -1, -1, -1 );
2390 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
2391 mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
2392 mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
2393 mgr->insert( action( VISU_EDIT_ISOSURFACE ), -1, -1, -1 );
2394 mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
2395 mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
2396 mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
2397 mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
2400 mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
2403 mgr->insert( action( VISU_COPY_PRS ), -1, -1, -1 );
2406 mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
2409 //mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
2410 //mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
2411 //mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
2413 mgr->insert( separator(), -1, -1, -1 );
2415 mgr->insert( action( VISU_ERASE ), -1, -1, -1 ); // erase
2416 mgr->insert( action( VISU_DISPLAY ), -1, -1, -1 ); // display
2417 mgr->insert( action( VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
2419 // "Representation" submenu
2420 int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 );
2421 mgr->insert( action( VISU_POINTS ) , parentId, -1, -1 ); // points
2422 mgr->insert( action( VISU_WIREFRAME ) , parentId, -1, -1 ); // wireframe
2423 mgr->insert( action( VISU_SURFACE ) , parentId, -1, -1 ); // surface
2424 mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
2425 mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
2426 mgr->insert( action( VISU_SHRINK ) , parentId, -1, -1 ); // shrink
2427 mgr->insert( action( VISU_UNSHRINK ) , parentId, -1, -1 ); // unshrink
2428 mgr->insert( separator(), parentId, -1, -1 );
2429 mgr->insert( action( VISU_SHADING ) , parentId, -1, -1 ); // shading
2430 mgr->insert( action( VISU_NOSHADING ) , parentId, -1, -1 ); // noshading
2432 // "Properties" submenu
2433 parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
2434 mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
2435 mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
2436 mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
2437 mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
2438 mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
2440 mgr->insert( separator(), -1, -1, -1 );
2442 // Other presentations management
2443 mgr->insert( action( VISU_TRANSLATE_PRS ), -1, -1, -1 );
2444 mgr->insert( action( VISU_CLIPPING ), -1, -1, -1 );
2446 mgr->insert( action( VISU_MERGE_SCALAR_BARS ), -1, -1, -1 );
2447 mgr->insert( action( VISU_FREE_SCALAR_BARS ), -1, -1, -1 );
2449 mgr->insert( action( VISU_SWEEP ), -1, -1, -1 );
2450 mgr->insert( action( VISU_ANIMATION ), -1, -1, -1 );
2452 mgr->insert( separator(), -1, -1, -1 );
2454 // view parameters commands
2455 mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
2456 mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
2457 mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
2458 //mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
2460 mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
2462 mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
2464 mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
2468 QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
2469 "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'");
2471 // VISU root commands
2472 QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
2473 mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule, true );
2474 mgr->setRule( action( VISU_IMPORT_TABLE ), aRule, true );
2475 mgr->setRule( action( VISU_PLOT2D ), aRule, true );
2477 // timestamp commands
2478 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTIMESTAMP'";
2479 mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
2480 mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
2481 mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
2482 mgr->setRule( action( VISU_CUT_LINES ), aRule, true );
2483 mgr->setRule( action( VISU_PLOT_3D ), aRule, true );
2484 aRule += " and nbComponents>1";
2485 mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule, true );
2486 mgr->setRule( action( VISU_VECTORS ), aRule, true );
2487 mgr->setRule( action( VISU_STREAM_LINES ), aRule, true );
2489 // display/erase commands
2490 QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
2491 QString aTableOrCont = "(type='VISU::TTABLE' and nbChildren>0) or type='VISU::TCONTAINER'";
2492 QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
2493 QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
2494 QString aPrsVisible = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
2495 QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
2497 QString anEraseRule = "selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
2498 " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + ")))";
2500 QString aDisplayRule = "selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
2501 " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + ")))";
2503 QString aDOnlyRule = "selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' " + aPrsAll + "})"
2504 " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
2505 " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'}))))";
2507 mgr->setRule( action( VISU_ERASE ), anEraseRule, true );
2508 mgr->setRule( action( VISU_DISPLAY ), aDisplayRule, true );
2509 mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule, true );
2511 aRule = "selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "}";
2512 mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule, true );
2514 aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
2515 mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule, true );
2516 mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule, true );
2519 aRule = "selcount=1 and type='VISU::TVIEW3D'";
2520 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule, true );
2521 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0", true );
2522 mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
2523 //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
2525 mgr->setRule( action( VISU_ARRANGE_ACTORS ), "client='VTKViewer' and selcount=0", true );
2527 // 3D presentations commands
2528 QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
2529 QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
2530 QString aSurfType = " and $type in {'VISU::TMESH'}";
2531 QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' "
2532 "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D'}";
2533 QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
2534 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'}";
2536 aRule = "selcount=1";
2537 mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType, true );
2539 // "Representation" submenu
2540 QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
2541 QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
2542 QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
2543 QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME'}";
2544 QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}";
2546 mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints, true );
2547 mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType + aNotWirefr, true );
2548 mgr->setRule( action( VISU_SURFACE ) , aRule + aPrsType + aNotSurfac, true );
2549 mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + aInsideType + aNotInside, true );
2550 mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType + aNotSurffr, true );
2552 mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0", true );
2553 mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true );
2555 mgr->setRule( action( VISU_SHADING ) , aRule + " and isScalarMapAct=1 and isShading=0", true );
2556 mgr->setRule( action( VISU_NOSHADING ), aRule + " and isScalarMapAct=1 and isShading=1", true );
2558 // "Properties" submenu
2559 mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
2560 mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
2561 mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
2562 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
2563 "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))", true );
2564 mgr->setRule( action( VISU_OPACITY ), aRule + aShrinkType + " and hasActor=1", true );
2565 mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
2568 QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'";
2570 aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' " + aCurveAll + " " + aPrsAll + "})";
2571 mgr->setRule( action( VISU_RENAME ), aRule, true );
2573 // copy presentation command
2574 aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
2575 mgr->setRule( action( VISU_COPY_PRS ), aRule, true );
2578 aRule = "selcount=1 and type='VISU::TCURVE'";
2579 mgr->setRule( action( VISU_CURVE_PROPS ), aRule, true );
2581 // curve container commands
2582 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
2583 mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule, true );
2584 mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
2586 mgr->setRule( action( VISU_EDIT_SCALARMAP ),
2587 "selcount=1 and type='VISU::TSCALARMAP'", true );
2588 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
2589 "selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
2590 mgr->setRule( action( VISU_EDIT_CUTPLANES ),
2591 "selcount=1 and type='VISU::TCUTPLANES'", true );
2592 mgr->setRule( action( VISU_EDIT_CUTLINES ),
2593 "selcount=1 and type='VISU::TCUTLINES'", true );
2594 mgr->setRule( action( VISU_EDIT_ISOSURFACE ),
2595 "selcount=1 and type='VISU::TISOSURFACE'", true );
2596 mgr->setRule( action( VISU_EDIT_VECTORS ),
2597 "selcount=1 and type='VISU::TVECTORS'", true );
2598 mgr->setRule( action( VISU_EDIT_STREAMLINES ),
2599 "selcount=1 and type='VISU::TSTREAMLINES'", true );
2600 mgr->setRule( action( VISU_EDIT_PLOT3D ),
2601 "selcount=1 and type='VISU::TPLOT3D'", true );
2603 aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
2604 mgr->setRule( action( VISU_CREATE_TABLE ), aRule, true );
2606 aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
2607 mgr->setRule( action( VISU_SWEEP ), aRule, true );
2609 // "Selection info" popup item
2610 aRule = "client='VTKViewer' and selcount=1" + aInsideType;
2611 mgr->setRule( action( VISU_SELECTION_INFO ), aRule, true );
2613 aRule = "client='ObjectBrowser' and selcount>0 and $type in {'VISU::TFIELD'} and nbTimeStamps>1";
2614 mgr->setRule( action( VISU_ANIMATION ), aRule, true );
2616 aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
2617 mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
2618 mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
2620 //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
2621 //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
2624 //***************************************************************************
2625 void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, QString& theTitle )
2627 SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
2629 OB_Browser* ob = getApp()->objectBrowser();
2630 bool isOBClient = (ob && theClient == ob->popupClientType());
2632 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2633 SALOME_ListIO aListIO;
2634 aSelectionMgr->selectedObjects(aListIO);
2636 if (aListIO.Extent() < 1) return;
2638 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2640 // Check if "Merge Scalar Range" can be applied
2642 SALOME_ListIteratorOfListIO It (aListIO);
2643 for (; It.More(); It.Next()) {
2644 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2646 if (!anIO.IsNull() && anIO->hasEntry()) {
2647 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
2648 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
2649 if (CORBA::is_nil(aCORBAObject)) {
2650 _PTR(GenericAttribute) anAttr;
2651 if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
2652 _PTR(AttributeComment) aComment (anAttr);
2653 string aComm = aComment->Value();
2654 QString strIn (aComm.c_str());
2655 VISU::Storable::TRestoringMap pMap;
2656 VISU::Storable::StrToMap(strIn, pMap);
2658 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
2659 if (isExist && aType == VISU::TTIMESTAMP) {
2660 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
2662 for (; anIter->More(); anIter->Next()) {
2663 aPrs = anIter->Value();
2664 if (!aPrs) continue;
2665 std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
2666 nbPrs += aSubList.size();
2675 theMenu->insertSeparator();
2676 action( VISU_MERGE_SCALAR_BARS )->addTo(theMenu);
2677 action( VISU_FREE_SCALAR_BARS )->addTo(theMenu);
2680 theMenu->insertSeparator();
2682 // Check if some (nb > 0) removable objects selected
2683 if (isOBClient && IsRemovableSelected(this)) {
2684 action( VISU_DELETE_OBJS )->addTo(theMenu);
2687 // Check if some curves selected (for bug PAL10611)
2688 bool isCurves = false;
2689 SALOME_ListIteratorOfListIO It1 (aListIO);
2690 for (; It1.More() && !isCurves; It1.Next()) {
2691 Handle(SALOME_InteractiveObject)& anIO = It1.Value();
2693 if (!anIO.IsNull() && anIO->hasEntry()) {
2694 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
2695 _PTR(GenericAttribute) anAttr;
2696 if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
2697 _PTR(AttributeComment) aComment (anAttr);
2698 string aComm = aComment->Value();
2699 QString strIn (aComm.c_str());
2700 VISU::Storable::TRestoringMap pMap;
2701 VISU::Storable::StrToMap(strIn, pMap);
2703 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
2704 if (isExist && aType == VISU::TCURVE) {
2711 action( myDisplay )->removeFrom(theMenu);
2712 action( myErase )->removeFrom(theMenu);
2713 action( myDisplayOnly )->removeFrom(theMenu);
2714 action( myEraseAll )->removeFrom(theMenu);
2717 // Check single selection
2718 if (aListIO.Extent() != 1) return;
2720 Handle(SALOME_InteractiveObject) anIO;
2721 VISU::Storable::TRestoringMap aMap;
2722 CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
2724 _PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
2726 VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
2728 if (aType == VISU::TANIMATION) {
2729 action( VISU_SHOW_ANIMATION )->addTo(theMenu);
2731 } else if (isOBClient) {
2732 if (IsSObjectTable(SO)) {
2733 action( VISU_SHOW_TABLE )->addTo(theMenu);
2734 action( VISU_CREATE_CURVES )->addTo(theMenu);
2735 action( VISU_EXPORT_TABLE )->addTo(theMenu);
2736 theMenu->insertSeparator();
2738 if (!CORBA::is_nil(anObject)) {
2739 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
2740 if (!CORBA::is_nil(aMED.in())) {
2741 action( VISU_IMPORT_MED_STRUCTURE )->addTo(theMenu);
2744 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject); // "Import Structure"
2745 if (!CORBA::is_nil(aField)) {
2746 action( VISU_IMPORT_MED_TIMESTAMP )->addTo(theMenu); // "Import TimeStamp"
2749 _PTR(SObject) aSFather = SO->GetFather();
2751 _PTR(GenericAttribute) anAttr;
2752 aSFather->FindAttribute(anAttr, "AttributeName");
2754 _PTR(AttributeName) aName (anAttr);
2755 std::string aValue = aName->Value();
2756 if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
2757 action( VISU_IMPORT_MED_FIELD )->addTo(theMenu); // "Import Field"
2767 //***************************************************************************
2770 windows( QMap<int, int>& theMap ) const
2773 theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
2774 theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::DockBottom );
2780 viewManagers( QStringList& theList ) const
2783 theList.append( SVTK_Viewer::Type() );
2791 CORBA::String_var anIOR = GetVisuGen(this)->GetID();
2792 return QString(anIOR.in());
2798 activateModule( SUIT_Study* theStudy )
2800 SalomeApp_Module::activateModule( theStudy );
2802 setMenuShown( true );
2803 setToolShown( true );
2810 deactivateModule( SUIT_Study* theStudy )
2812 setMenuShown( false );
2813 setToolShown( false );
2815 SalomeApp_Module::deactivateModule( theStudy );
2821 createSelection() const
2823 return new VisuGUI_Selection( (SalomeApp_Module*)this );
2826 //******************************************************************
2827 void VisuGUI::studyActivated()
2829 GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
2837 return new VisuGUI();
2841 void VisuGUI::createPreferences()
2843 int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
2845 int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
2846 int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
2847 addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
2848 int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
2849 addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
2852 fam.append( tr( "VISU_FONT_ARIAL" ) );
2853 fam.append( tr( "VISU_FONT_COURIER" ) );
2854 fam.append( tr( "VISU_FONT_TIMES" ) );
2855 int wflag = ( QtxListResourceEdit::FontItem::All & ( ~( QtxListResourceEdit::FontItem::Size | QtxListResourceEdit::FontItem::UserSize ) ) );
2857 setPreferenceProperty( tfont, "families", fam );
2858 setPreferenceProperty( tfont, "system", false );
2859 setPreferenceProperty( tfont, "widget_flags", wflag );
2860 setPreferenceProperty( lfont, "families", fam );
2861 setPreferenceProperty( lfont, "system", false );
2862 setPreferenceProperty( lfont, "widget_flags", wflag );
2864 int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
2866 int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
2867 setPreferenceProperty( numcol, "min", 2 );
2868 setPreferenceProperty( numcol, "max", 64 );
2870 int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
2871 setPreferenceProperty( numlab, "min", 2 );
2872 setPreferenceProperty( numlab, "max", 65 );
2874 int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab );
2875 int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
2876 QStringList orients;
2877 orients.append( tr( "VISU_VERTICAL" ) );
2878 orients.append( tr( "VISU_HORIZONTAL" ) );
2879 QValueList<QVariant> indices;
2880 indices.append( 0 );
2881 indices.append( 1 );
2882 setPreferenceProperty( orient, "strings", orients );
2883 setPreferenceProperty( orient, "indexes", indices );
2885 int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
2886 int xv = addPreference( tr( "VISU_X" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
2887 int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
2888 int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
2889 int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
2890 setPreferenceProperty( xv, "step", 0.1 );
2891 setPreferenceProperty( yv, "step", 0.1 );
2892 setPreferenceProperty( wv, "step", 0.1 );
2893 setPreferenceProperty( hv, "step", 0.1 );
2894 setPreferenceProperty( xv, "min", 0.0 );
2895 setPreferenceProperty( yv, "min", 0.0 );
2896 setPreferenceProperty( wv, "min", 0.0 );
2897 setPreferenceProperty( hv, "min", 0.0 );
2898 setPreferenceProperty( xv, "max", 1.0 );
2899 setPreferenceProperty( yv, "max", 1.0 );
2900 setPreferenceProperty( wv, "max", 1.0 );
2901 setPreferenceProperty( hv, "max", 1.0 );
2903 int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
2904 int xh = addPreference( tr( "VISU_X" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
2905 int yh = addPreference( tr( "VISU_Y" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
2906 int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
2907 int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
2908 setPreferenceProperty( xh, "step", 0.1 );
2909 setPreferenceProperty( yh, "step", 0.1 );
2910 setPreferenceProperty( wh, "step", 0.1 );
2911 setPreferenceProperty( hh, "step", 0.1 );
2912 setPreferenceProperty( xh, "min", 0.0 );
2913 setPreferenceProperty( yh, "min", 0.0 );
2914 setPreferenceProperty( wh, "min", 0.0 );
2915 setPreferenceProperty( hh, "min", 0.0 );
2916 setPreferenceProperty( xh, "max", 1.0 );
2917 setPreferenceProperty( yh, "max", 1.0 );
2918 setPreferenceProperty( wh, "max", 1.0 );
2919 setPreferenceProperty( hh, "max", 1.0 );
2921 int srangeTab = addPreference( tr( "Scalar range, Sweep, MED import" ) );
2923 int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), srangeTab );
2924 setPreferenceProperty( rangeGr, "columns", 1 );
2926 int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" );
2928 modes.append( tr( "VISU_MODULUS" ) );
2929 modes.append( tr( "VISU_COMPONENT" ) + tr("1") );
2930 modes.append( tr( "VISU_COMPONENT" ) + tr("2") );
2931 modes.append( tr( "VISU_COMPONENT" ) + tr("3") );
2933 indices.append( 0 );
2934 indices.append( 1 );
2935 indices.append( 2 );
2936 indices.append( 3 );
2937 setPreferenceProperty( mode, "strings", modes );
2938 setPreferenceProperty( mode, "indexes", indices );
2940 addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
2942 int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" );
2944 types.append( tr( "VISU_FIELD_RANGE" ) );
2945 types.append( tr( "VISU_IMPOSED_RANGE" ) );
2947 indices.append( 0 );
2948 indices.append( 1 );
2949 setPreferenceProperty( rangetype, "strings", types );
2950 setPreferenceProperty( rangetype, "indexes", indices );
2952 int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), srangeTab );
2954 int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
2955 int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
2956 setPreferenceProperty( min, "step", 0.1 );
2957 setPreferenceProperty( max, "step", 0.1 );
2959 int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
2960 setPreferenceProperty( sweepGr, "columns", 1 );
2962 int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
2963 int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
2964 int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
2965 setPreferenceProperty( timestep, "min", 0.1 );
2966 setPreferenceProperty( timestep, "step", 0.1 );
2967 setPreferenceProperty( timestep, "max", 1000 );
2968 setPreferenceProperty( nbcycles, "max", 100 );
2969 setPreferenceProperty( nbsteps, "max", 200 );
2971 int importGr = addPreference( tr( "MED files import" ), srangeTab );
2972 addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
2975 void VisuGUI::preferencesChanged( const QString&, const QString& )
2981 ::getViewManager(const QString& theType,
2982 const bool theIsCreate)
2984 return getApp()->getViewManager(theType,theIsCreate);
2987 LightApp_Displayer* VisuGUI::displayer()
2990 myDisplayer = new VisuGUI_Displayer( getApp() );