1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // VISU VISUGUI : GUI of VISU component
28 #include <Standard_math.hxx> // E.A. must be included before Python.h to fix compilation on windows
41 #include <QColorDialog>
46 #include <vtkRenderer.h>
47 #include <vtkRenderWindow.h>
48 #include <vtkActorCollection.h>
49 #include <vtkTimerLog.h>
52 #include "SALOME_LifeCycleCORBA.hxx"
54 #include "SUIT_ResourceMgr.h"
55 #include "SUIT_MessageBox.h"
57 #include "SUIT_ViewWindow.h"
58 #include "SUIT_ViewManager.h"
59 #include "SUIT_Desktop.h"
60 #include "SUIT_DataBrowser.h"
61 #include "SUIT_OverrideCursor.h"
63 #include "CAM_Module.h"
65 #include "SVTK_ViewWindow.h"
66 #include "SVTK_ViewModel.h"
67 #include "SVTK_Functor.h"
68 //#include "SVTK_MainWindow.h"
70 #include "VTKViewer_Algorithm.h"
71 #include "VTKViewer_MarkerDlg.h"
73 #include "SPlot2d_ViewModel.h"
74 #include "VisuGUI_SetupPlot2dDlg.h"
75 #include "Plot2d_SetupCurveDlg.h"
76 #include "Plot2d_ViewManager.h"
78 #include "QtxPagePrefMgr.h"
79 #include "OB_Browser.h"
81 #include "SALOME_ListIteratorOfListIO.hxx"
83 #include "SalomeApp_Application.h"
84 #include "SalomeApp_DataModel.h"
85 #include "SalomeApp_Study.h"
86 #include "SalomeApp_CheckFileDlg.h"
88 #include "LightApp_SelectionMgr.h"
89 #include "LightApp_Selection.h"
90 #include "LightApp_Preferences.h"
91 #include "LightApp_DataOwner.h"
93 #include "QtxAction.h"
94 #include "QtxFontEdit.h"
96 #include "VISUConfig.hh"
97 #include "VISU_Gen_i.hh"
98 #include "VISU_Mesh_i.hh"
99 #include "VISU_Table_i.hh"
100 #include "VISU_PointMap3d_i.hh"
101 #include "VISU_Result_i.hh"
102 #include "VISU_View_i.hh"
103 #include "VISU_ViewManager_i.hh"
104 #include "VISU_Plot3D_i.hh"
106 #include "VISU_Actor.h"
108 #include "VisuGUI_Prs3dTools.h"
109 #include "VisuGUI_Tools.h"
111 #include "VisuGUI_SelectionPanel.h"
112 #include "VisuGUI_FeatureEdgesPanel.h"
113 #include "VisuGUI_NameDlg.h"
114 #include "VisuGUI_CursorDlg.h"
115 #include "VisuGUI_Selection.h"
116 #include "VisuGUI_TimeAnimation.h"
117 #include "VisuGUI_EvolutionDlg.h"
118 #include "VisuGUI_EditContainerDlg.h"
119 #include "VisuGUI_ClippingDlg.h"
120 #include "VisuGUI_Plot3DDlg.h"
121 #include "VisuGUI_OffsetDlg.h"
122 #include "VisuGUI_Displayer.h"
123 #include "VisuGUI_BuildProgressDlg.h"
124 #include "VisuGUI_TransparencyDlg.h"
125 #include "VisuGUI_ShrinkFactorDlg.h"
126 //#include "VisuGUI_CacheDlg.h"
127 #include "VisuGUI_Table3dDlg.h"
128 #include "VisuGUI_ClippingPanel.h"
129 #include "VisuGUI_FilterScalarsDlg.h"
131 #include "VISU_ScalarMap_i.hh"
132 #include "VisuGUI_ScalarBarDlg.h"
134 #include "VISU_DeformedShape_i.hh"
135 #include "VisuGUI_DeformedShapeDlg.h"
137 #include "VISU_DeformedShapeAndScalarMap_i.hh"
138 #include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
140 #include "VISU_IsoSurfaces_i.hh"
141 #include "VisuGUI_IsoSurfacesDlg.h"
143 #include "VISU_CutPlanes_i.hh"
144 #include "VisuGUI_CutPlanesDlg.h"
146 #include "VISU_CutLines_i.hh"
147 #include "VisuGUI_CutLinesDlg.h"
149 #include "VISU_CutSegment_i.hh"
150 #include "VisuGUI_CutSegmentDlg.h"
152 #include "VISU_StreamLines_i.hh"
153 #include "VisuGUI_StreamLinesDlg.h"
155 #include "VISU_Vectors_i.hh"
156 #include "VisuGUI_VectorsDlg.h"
158 #include "VISU_TableDlg.h"
159 #include "VisuGUI_FileInfoDlg.h"
161 #include "SALOMEconfig.h"
162 #include CORBA_SERVER_HEADER(MED_Gen)
164 #include "utilities.h"
166 #include "VisuGUI_ActionsDef.h"
168 #include "VisuGUI_Timer.h"
170 //#include "VVTK_ViewModel.h"
172 #include "VisuGUI_Slider.h"
173 #include "VisuGUI_Sweep.h"
174 #include <VISU_ScalarMapAct.h>
175 #include <VISU_GaussPtsAct.h>
176 #include "VisuGUI_ValuesLabelingDlg.h"
178 using namespace VISU;
181 static int MYDEBUG = 0;
183 static int MYDEBUG = 0;
187 #define usleep(A) _sleep(A/1000)
190 //////////////////////////////////////////////////
192 //////////////////////////////////////////////////
196 SalomeApp_Module( "VISU" ),
197 LightApp_Module("VISU"),
227 if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
229 if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
232 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
236 aFilter.append( tr( "FLT_MED_FILES" ) );
237 aFilter.append( tr( "FLT_DISTRIBUTED_MED_FILES" ) );
238 aFilter.append( tr( "FLT_ALL_FILES" ) );
240 bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
242 SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
243 fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
244 fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
245 fd.setFilters( aFilter );
246 fd.SetChecked( toUseBuildProgress );
247 if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
248 fd.setDirectory( QDir::currentPath() );
250 QStringList fileNames;
252 return; // cancelled, return
254 fileNames = fd.selectedFiles();
255 toUseBuildProgress = fd.IsChecked();
257 if ( fileNames.count() == 0 )
258 return; // nothing selected, return
260 SUIT_OverrideCursor wc;
263 for ( QStringList::ConstIterator it = fileNames.begin(); it != fileNames.end(); ++it ) {
264 QFileInfo aFileInfo( *it );
266 if ( !aFileInfo.exists() ) {
268 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
269 arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
273 if ( !toUseBuildProgress ) {
274 // build progress is not used, use build flags from settings
275 bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
276 bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
277 bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
278 bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
279 bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
281 QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
282 application()->putInfo( anInfo );
284 VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
286 if ( CORBA::is_nil( aResult.in() ) ) {
287 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
288 arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
291 aResult->SetBuildFields( toBuildFields, toBuildMinMax );
292 aResult->SetBuildGroups( toBuildGroups );
293 aResult->Build( toBuildAll, toBuildAtOnce );
294 application()->putInfo( anInfo + tr("INF_DONE") );
296 } // if ( !toUseBuildProgress )
298 // use build progress
300 VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
301 aBuildProgressDlg->setFileName( aFileInfo.filePath() );
302 aBuildProgressDlg->setGenerator( GetVisuGen(this) );
303 aBuildProgressDlg->exec();
308 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
310 } // else // if ( !aFileInfo.exists() )
313 if ( errors.count() > 0 ) {
314 SUIT_MessageBox::critical( GetDesktop(this),
316 tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
319 UpdateObjBrowser(this);
325 ::OnImportTableFromFile()
327 if(MYDEBUG) MESSAGE("VisuGUI::OnImportTableFromFile()");
328 if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
332 aFilter.append( tr("FLT_TABLE_FILES") );
333 aFilter.append( tr("FLT_ALL_FILES") );
335 //QString anInitialPath = "";
336 //if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
337 // anInitialPath = QDir::currentPath();
339 //QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
342 // tr("TLT_IMPORT_TABLE"));
344 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
345 bool aFirstStrAsTitle = aResourceMgr->booleanValue("VISU", "first_str_as_title", false);
347 SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("FIRST_STR_AS_TITLE") );
348 fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
349 fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
350 fd.setFilters( aFilter );
351 fd.SetChecked( aFirstStrAsTitle );
352 if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
353 fd.setDirectory( QDir::currentPath() );
357 return; // cancelled, return
358 aFiles = fd.selectedFiles();
359 aFirstStrAsTitle = fd.IsChecked();
361 if ( aFiles.count() == 0 )
362 return; // nothing selected
365 for ( QStringList::ConstIterator it = aFiles.begin(); it != aFiles.end(); ++it ) {
366 QFileInfo aFileInfo( *it );
368 if ( !aFileInfo.exists() ) {
369 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
370 arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
374 QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
375 application()->putInfo( anInfo );
377 CORBA::Object_var anObject =
378 GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData(),
381 if (CORBA::is_nil(anObject.in())) {
382 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
383 arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
386 application()->putInfo( anInfo + tr("INF_DONE") );
390 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
395 if ( errors.count() > 0 ) {
396 SUIT_MessageBox::critical( GetDesktop(this),
398 tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
401 UpdateObjBrowser(this);
407 ::OnExportTableToFile()
409 if(MYDEBUG) MESSAGE("VisuGUI::OnExportTableToFile()");
411 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
413 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
414 SALOME_ListIO aListIO;
415 aSelectionMgr->selectedObjects(aListIO);
417 if (aListIO.Extent() > 0) {
418 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
419 if (anIO->hasEntry()) {
420 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
423 // find table attribute
425 _PTR(GenericAttribute) anAttr;
427 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
429 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
430 // if the current SObject is a table title
431 // we take a father contaning the table
432 aSObj = aSObj->GetFather();
434 if (aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
437 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
444 // get table title in order to have default name of the file
447 _PTR(AttributeTableOfReal) aTabAttr (anAttr);
448 if (!aTabAttr) return;
449 aTitle = aTabAttr->GetTitle().c_str();
451 _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
452 if (!aTabAttr) return;
453 aTitle = aTabAttr->GetTitle().c_str();
456 aTitle = aTitle.replace(QRegExp(" "), "_").replace(QRegExp("\\*"), "" );
458 // get default path for the file
459 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
460 QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
461 if (aDir.isEmpty()) {
462 aDir = aResourceMgr->stringValue("VISU","InputDir","");
463 if (aDir.isEmpty()) {
464 aDir = getenv("CSF_PATHData");
467 QString aPath = Qtx::addSlash(aDir) + aTitle;
469 // get name for the file
471 aFilter.append("Table Files (*.txt *.tab)");
472 aFilter.append("CSV Table Files (*.csv)");
474 QFileInfo aFileInfo =
475 SUIT_FileDlg::getFileName(GetDesktop(this),
478 tr("MEN_EXPORT_TABLE"), // "Export Table To File"
482 QString aFile = aFileInfo.filePath();
483 if (!aFile.isEmpty()) {
484 application()->putInfo(tr("MEN_EXPORT_TABLE") + " " + aFile + " ...");
485 aDir = Qtx::dir(aFile, true);
486 aResourceMgr->setValue("VISU", "OutputDir", aDir);
489 GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), (const char*)aFile.toLatin1());
490 application()->putInfo(aFile + " " + tr("INF_DONE"));
491 } catch(std::exception& exc) {
493 SUIT_MessageBox::warning(GetDesktop(this),
495 tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()) );
498 INFOS((const char*)tr("ERR_ERROR_DURING_EXPORT").toLatin1());
499 SUIT_MessageBox::warning( GetDesktop(this),
501 tr("ERR_ERROR_DURING_EXPORT") );
513 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
514 if (CheckLock(aCStudy,GetDesktop(this)))
516 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
518 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
519 SALOME_ListIO aListIO;
520 aSelectionMgr->selectedObjects(aListIO);
522 SALOME_ListIteratorOfListIO It (aListIO);
523 QApplication::setOverrideCursor(Qt::WaitCursor);
524 for (; It.More(); It.Next()) {
525 Handle(SALOME_InteractiveObject) anIO = It.Value();
526 SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
527 if (!aSObject->_is_nil()) {
529 // try to load a component data from an opened (presumably) study
530 // The same in SUPERVISION: NPAL14522
532 SALOMEDS::SComponent_ptr aSComp = aSObject->GetFatherComponent();
533 CORBA::String_var aCompIOR;
534 if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
535 CORBA::String_var aCompDataType = aSComp->ComponentDataType();
537 // obtain a driver by a component data type
538 // like it is done in SALOMEDS_DriverFactory_i::GetDriverByType
539 SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_nil();
540 SALOME_LifeCycleCORBA * LCC = getApp()->lcc();
543 anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType);
544 if (CORBA::is_nil(anEngineObj))
545 anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType);
547 if (!CORBA::is_nil(anEngineObj))
548 anEngine = SALOMEDS::Driver::_narrow(anEngineObj);
550 if (!CORBA::is_nil(anEngine)) {
552 SALOMEDS::StudyBuilder_ptr aStudyBuilder = aStudy->NewBuilder();
553 aStudyBuilder->LoadWith(aSComp, anEngine);
561 CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
562 if (!CORBA::is_nil(anObject)) {
563 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
564 if (!CORBA::is_nil(aMED.in()))
565 GetVisuGen(this)->ImportMed(aSObject);
566 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
567 if (!CORBA::is_nil(aField.in()))
568 GetVisuGen(this)->ImportMedField(aField);
570 SALOMEDS::SObject_var aSFather = aSObject->GetFather();
571 SALOMEDS::GenericAttribute_var anAttr;
572 aSFather->FindAttribute(anAttr, "AttributeName");
573 SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
574 CORBA::String_var aValue = aName->Value();
575 if (strcmp(aValue.in(), "MEDFIELD") == 0)
576 GetVisuGen(this)->ImportMed(aSObject);
580 UpdateObjBrowser(this, true);
581 QApplication::restoreOverrideCursor();
584 void VisuGUI::OnLoadComponentData()
586 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
587 if (CheckLock(aCStudy,GetDesktop(this)))
589 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
591 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
592 SALOME_ListIO aListIO;
593 aSelectionMgr->selectedObjects(aListIO);
595 SALOME_ListIteratorOfListIO It (aListIO);
596 QApplication::setOverrideCursor(Qt::WaitCursor);
597 for (; It.More(); It.Next()) {
598 Handle(SALOME_InteractiveObject) anIO = It.Value();
599 SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
600 if (!aSObject->_is_nil()) {
602 // try to load a component data from an opened (presumably) study
603 // The same in SUPERVISION: NPAL14522
605 SALOMEDS::SComponent_ptr aSComp = aSObject->GetFatherComponent();
606 CORBA::String_var aCompIOR;
607 if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
608 CORBA::String_var aCompDataType = aSComp->ComponentDataType();
610 QString anInfo ("Loading ");
611 anInfo = anInfo + aCompDataType.in() + " Component Data ...";
612 application()->putInfo( anInfo );
614 // obtain a driver by a component data type
615 // like it is done in SALOMEDS_DriverFactory_i::GetDriverByType
616 SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_nil();
617 SALOME_LifeCycleCORBA * LCC = getApp()->lcc();
620 anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType);
621 if (CORBA::is_nil(anEngineObj))
622 anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType);
624 if (!CORBA::is_nil(anEngineObj))
625 anEngine = SALOMEDS::Driver::_narrow(anEngineObj);
627 if (!CORBA::is_nil(anEngine)) {
629 SALOMEDS::StudyBuilder_ptr aStudyBuilder = aStudy->NewBuilder();
630 aStudyBuilder->LoadWith(aSComp, anEngine);
633 application()->putInfo( anInfo + tr("INF_DONE"));
636 application()->putInfo( anInfo + tr("INF_FAILED"));
642 QApplication::restoreOverrideCursor();
646 CreateCurves( SalomeApp_Module* theModule,
647 VISU::CutLinesBase_i* thePrs,
649 const bool theCreate = true )
654 // temporary code, to be revised (VisuGUI_CutLinesDlg and VisuGUI_CutSegmentDlg classes
655 // should have common intermediate interface with at least two methods called below)
656 bool isGenerateTable = false;
657 bool isGenerateCurves = false;
658 if ( VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg ) ) {
659 isGenerateTable = aCutDlg->isGenerateTable();
660 isGenerateCurves = aCutDlg->isGenerateCurves();
662 else if ( VisuGUI_CutSegmentDlg* aCutDlg = dynamic_cast<VisuGUI_CutSegmentDlg*>( theDlg ) ) {
663 isGenerateTable = aCutDlg->isGenerateTable();
664 isGenerateCurves = aCutDlg->isGenerateCurves();
669 _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
670 _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry() );
672 if ( !theCreate && aSObject ) {
674 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
675 _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
676 for (; aIter->More(); aIter->Next()) {
677 _PTR(SObject) aTblObj = aIter->Value();
679 _PTR(GenericAttribute) anAttr;
680 if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
681 _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
682 SalomeApp_Study* salome_study = GetAppStudy( theModule );
683 for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
684 salome_study->deleteReferencesTo( aChildIter->Value() );
685 _PTR(SObject) aSO = aChildIter->Value();
687 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
688 if (aRestoringMap["myComment"] == "CURVE") {
689 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
690 if(!CORBA::is_nil(aCORBAObject)){
691 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
692 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
693 PlotRemoveCurve(theModule, aCurve);
701 aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
703 //UpdateObjBrowser(theModule,true,aTblObj);
710 if ( isGenerateTable ) {
711 GetVisuGen( theModule )->CreateTable( thePrs->GetEntry().c_str() );
712 if ( isGenerateCurves ) {
714 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
715 _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
716 for (; aIter->More(); aIter->Next()) {
717 _PTR(SObject) aTblObj = aIter->Value();
719 _PTR(GenericAttribute) anAttr;
720 if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
721 CreatePlot( theModule, aTblObj );
729 if (!theCreate && aSObject) {
730 UpdateObjBrowser(theModule);
738 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
739 if (CheckLock(aStudy,GetDesktop(this)))
742 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
743 if(aSelectionInfo.empty())
746 // Get selected SObject
747 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
748 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
749 if (anIO.IsNull() || !anIO->hasEntry())
752 // create a VTK view window if it does not exist
753 SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
755 // create mesh presentation and display it in aViewWindow
756 VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
757 aViewWindow->highlight(anIO, 1);
759 emit presentationCreated(aPrs);
766 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
767 if (CheckLock(aStudy,GetDesktop(this)))
770 // create a VTK view window if it does not exist
771 SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
773 // Get selected SObject
774 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
775 SALOME_ListIO aListIO;
776 aSelectionMgr->selectedObjects(aListIO);
777 SALOME_ListIteratorOfListIO anIter (aListIO);
778 for (; anIter.More(); anIter.Next()) {
779 Handle(SALOME_InteractiveObject) anIO = anIter.Value();
780 if (anIO.IsNull() || !anIO->hasEntry())
783 // create mesh presentation and display it in aViewWindow
784 VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
785 aViewWindow->highlight(anIO, 1);
787 emit presentationCreated(aPrs);
793 ::OnCreateScalarMap()
795 Prs3d_i* aPrs = CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
797 emit presentationCreated(aPrs);
803 ::OnCreateDeformedShape()
805 Prs3d_i* aPrs = CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
807 emit presentationCreated(aPrs);
812 ::OnCreateDeformedShapeAndScalarMap()
814 Prs3d_i* aPrs = CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
816 emit presentationCreated(aPrs);
823 Prs3d_i* aPrs = CreatePrs3d<VISU::Vectors_i,VisuGUI_VectorsDlg,1>(this);
825 emit presentationCreated(aPrs);
830 ::OnCreateIsoSurfaces()
832 Prs3d_i* aPrs = CreatePrs3d<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg,1>(this);
834 emit presentationCreated(aPrs);
839 ::OnCreateCutPlanes()
841 Prs3d_i* aPrs = CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,0>(this);
843 emit presentationCreated(aPrs);
850 Prs3d_i* aPrs = CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,0>(this);
852 emit presentationCreated(aPrs);
857 ::OnCreateCutSegment()
859 Prs3d_i* aPrs = CreatePrs3d<VISU::CutSegment_i,VisuGUI_CutSegmentDlg,0>(this);
861 emit presentationCreated(aPrs);
866 ::OnCreateStreamLines()
868 Prs3d_i* aPrs = CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
870 emit presentationCreated(aPrs);
877 Prs3d_i* aPrs = CreatePrs3d<VISU::Plot3D_i,VisuGUI_Plot3DDlg,0>(this);
879 emit presentationCreated(aPrs);
884 ::OnCreatePlot2dView()
886 CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this));
887 GetVisuGen( this )->CreateContainer();
888 UpdateObjBrowser(this);
895 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
897 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
901 QApplication::setOverrideCursor(Qt::WaitCursor);
903 SALOME_ListIO aSel, aList;
904 aSelectionMgr->selectedObjects(aSel);
905 extractContainers(aSel, aList);
907 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
908 Handle(SALOME_InteractiveObject) anIO = it.Value();
909 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
910 VISU::Base_i* aBase = anObjectInfo.myBase;
914 VISU::VISUType aType = aBase->GetType();
916 case VISU::TPOINTMAP3D:
917 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
918 displayer()->Display(anIO->getEntry());
919 aViewWindow->highlight(anIO, 1);
920 aViewWindow->getRenderer()->ResetCameraClippingRange();
921 aViewWindow->Repaint();
925 if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false))
927 displayer()->Display(anIO->getEntry());
930 case VISU::TCONTAINER:
932 getViewManager(SPlot2d_Viewer::Type(), true);
933 displayer()->Display(anIO->getEntry());
936 VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(aBase);
938 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
939 displayer()->Display(anIO->getEntry());
940 aViewWindow->highlight(anIO, 1);
941 aViewWindow->getRenderer()->ResetCameraClippingRange();
942 aViewWindow->Repaint();
949 QApplication::restoreOverrideCursor();
956 /// to correct IMP 0016100
957 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
961 SALOME_ListIO aSel, aList;
962 aSelectionMgr->selectedObjects(aSel);
963 extractContainers(aSel, aList);
964 Handle(SALOME_InteractiveObject) anIO = aList.First();
965 activateAppropriateViewer(anIO);
970 void VisuGUI::activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO )
972 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), theIO->getEntry());
973 VISU::Base_i* aBase = anObjectInfo.myBase;
977 std::string anEntry = theIO->getEntry();
978 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
979 _PTR(SObject) SO = aCStudy->FindObjectID( theIO->getEntry() );
981 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(SO);
982 if(CORBA::is_nil(aCORBAObject))
985 VISU::VISUType aType = aBase->GetType();
987 if ( VISU::GetPrs3dFromBase(aBase) ) {
988 // activate SVTK Viewer
989 getApp()->getViewManager( SVTK_Viewer::Type(), true );
995 case VISU::TCONTAINER:
998 GetPlot2dViewer(this, true);
1001 case VISU::TCOLOREDPRS3DHOLDER :
1002 case VISU::TPOINTMAP3D : {
1003 //find curves under pointmap 3d
1004 bool hasCurvesChildren = false;
1006 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1007 QString aViewerType = aViewMgr->getType();
1009 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(SO);
1010 _PTR(SObject) aChild;
1011 for (; anIter->More(); anIter->Next()) {
1012 aChild = anIter->Value();
1013 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aChild);
1014 if(!CORBA::is_nil(aCORBAObject)){
1015 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
1016 if( dynamic_cast<VISU::Curve_i*>(aServant.in()))
1017 hasCurvesChildren = true;
1021 if (hasCurvesChildren && ( aViewerType == SPlot2d_Viewer::Type() || aViewerType == SVTK_Viewer::Type() ) ) {
1024 // activate SVTK Viewer
1025 getApp()->getViewManager( SVTK_Viewer::Type(), true );
1037 if(MYDEBUG) MESSAGE("OnErasePrs");
1038 QApplication::setOverrideCursor(Qt::WaitCursor);
1040 SALOME_ListIO aList, aSel;
1041 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1042 aSelectionMgr->selectedObjects(aSel);
1043 extractContainers(aSel, aList);
1045 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1046 Handle(SALOME_InteractiveObject) anIO = it.Value();
1047 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
1048 VISU::Base_i* aBase = anObjectInfo.myBase;
1049 ErasePrs(this, aBase, /*repaint_view_window = */true);
1052 QApplication::restoreOverrideCursor();
1055 //----------------------------------------------------------------------------
1060 startOperation( myEraseAll );
1061 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
1062 vw->unHighlightAll();
1063 if (vtkRenderer *aRen = vw->getRenderer()) {
1065 VTK::ActorCollectionCopy aCopy(aRen->GetActors());
1066 vtkActorCollection *anActColl = aCopy.GetActors();
1067 for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
1068 if (anActor->GetVisibility() > 0)
1069 if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
1070 RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
1071 anVISUActor->VisibilityOff();
1076 } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
1077 aPlot2d->EraseAll();
1084 //----------------------------------------------------------------------------
1086 GetPrsToModify(const SalomeApp_Module* theModule,
1087 Handle(SALOME_InteractiveObject)& theIO)
1089 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
1090 if(aSelectionInfo.empty())
1093 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1094 theIO = aSelectionItem.myIO;
1095 return VISU::GetPrs3dToModify(theModule, aSelectionItem.myObjectInfo.myBase);
1099 //----------------------------------------------------------------------------
1104 Handle(SALOME_InteractiveObject) anIO;
1105 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1106 EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
1109 //----------------------------------------------------------------------------
1112 ::OnEditDeformedShape()
1114 Handle(SALOME_InteractiveObject) anIO;
1115 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1116 VisuGUI_DeformedShapeDlg::EditPrs3d(this, aPrs3d, anIO);
1117 // EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg, 1>(this, anIO, aPrs3d);
1120 //----------------------------------------------------------------------------
1123 ::OnEditDeformedShapeAndScalarMap()
1125 Handle(SALOME_InteractiveObject) anIO;
1126 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1127 EditPrs3d<VISU::DeformedShapeAndScalarMap_i, VisuGUI_DeformedShapeAndScalarMapDlg, 1>(this, anIO, aPrs3d);
1130 //----------------------------------------------------------------------------
1135 Handle(SALOME_InteractiveObject) anIO;
1136 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1137 EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg, 0>(this, anIO, aPrs3d);
1140 //----------------------------------------------------------------------------
1145 Handle(SALOME_InteractiveObject) anIO;
1146 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1147 EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg, 0>(this, anIO, aPrs3d);
1150 //----------------------------------------------------------------------------
1153 ::OnEditCutSegment()
1155 Handle(SALOME_InteractiveObject) anIO;
1156 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1157 EditPrs3d<VISU::CutSegment_i, VisuGUI_CutSegmentDlg, 0>(this, anIO, aPrs3d);
1160 //----------------------------------------------------------------------------
1163 ::OnEditIsoSurfaces()
1165 Handle(SALOME_InteractiveObject) anIO;
1166 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1167 EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg, 1>(this, anIO, aPrs3d);
1170 //----------------------------------------------------------------------------
1175 Handle(SALOME_InteractiveObject) anIO;
1176 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1177 EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg, 1>(this, anIO, aPrs3d);
1180 //----------------------------------------------------------------------------
1183 ::OnEditStreamLines()
1185 Handle(SALOME_InteractiveObject) anIO;
1186 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1187 EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg, 1>(this, anIO, aPrs3d);
1190 //----------------------------------------------------------------------------
1195 Handle(SALOME_InteractiveObject) anIO;
1196 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1197 EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg, 0>(this, anIO, aPrs3d);
1201 //----------------------------------------------------------------------------
1204 ::OnMakeSurfaceframe()
1206 ChangeRepresentation(this, VISU::SURFACEFRAME);
1209 //----------------------------------------------------------------------------
1212 ::OnMakeInsideframe()
1214 ChangeRepresentation(this, VISU::INSIDEFRAME);
1217 //----------------------------------------------------------------------------
1222 ChangeRepresentation(this, VISU::WIREFRAME);
1225 //----------------------------------------------------------------------------
1230 ChangeRepresentation(this, VISU::SHADED);
1233 //----------------------------------------------------------------------------
1238 ChangeRepresentation(this, VISU::POINT);
1241 //----------------------------------------------------------------------------
1246 ChangeRepresentation(this, VISU::SHRINK);
1249 //----------------------------------------------------------------------------
1252 ::OnMakeFeatureEdges()
1254 ChangeRepresentation(this, VISU::FEATURE_EDGES);
1257 //----------------------------------------------------------------------------
1262 SetShading(this, true);
1265 //----------------------------------------------------------------------------
1270 SetShading(this, false);
1274 //----------------------------------------------------------------------------
1279 VISU_Actor* anActor = NULL;
1280 VISU::Prs3d_i* aPrs3d = NULL;
1281 SVTK_ViewWindow* aViewWindow = NULL;
1282 if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
1285 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
1286 VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
1288 SALOMEDS::Color anOldColor, aNewColor;
1289 int aRepresent = anActor->GetRepresentation();
1291 switch (aRepresent) {
1293 anOldColor = aMesh->GetNodeColor();
1295 case VISU::WIREFRAME :
1296 case VISU::INSIDEFRAME :
1297 anOldColor = aMesh->GetLinkColor();
1300 case VISU::SURFACEFRAME :
1301 anOldColor = aMesh->GetCellColor();
1304 } else if (aDeformedShape) {
1305 anOldColor = aDeformedShape->GetColor();
1310 QColor aColor (int(255*anOldColor.R),
1311 int(255*anOldColor.G),
1312 int(255*anOldColor.B));
1313 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1314 if (aColorNew.isValid()) {
1315 aNewColor.R = aColorNew.red()/255.;
1316 aNewColor.G = aColorNew.green()/255.;
1317 aNewColor.B = aColorNew.blue()/255.;
1319 switch (aRepresent) {
1321 aMesh->SetNodeColor(aNewColor);
1323 case VISU::WIREFRAME :
1324 case VISU::INSIDEFRAME :
1325 aMesh->SetLinkColor(aNewColor);
1328 case VISU::SURFACEFRAME :
1329 aMesh->SetCellColor(aNewColor);
1333 aDeformedShape->SetColor(aNewColor);
1335 RecreateActor(this, aPrs3d);
1339 //----------------------------------------------------------------------------
1342 ::OnChangeWireframeColor()
1344 VISU_Actor* anActor = NULL;
1345 VISU::Prs3d_i* aPrs3d = NULL;
1346 SVTK_ViewWindow* aViewWindow = NULL;
1347 if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
1350 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
1351 VISU::ScalarMap_i* aScalarMap = dynamic_cast<VISU::ScalarMap_i*>(aPrs3d);
1352 if(!aMesh && !aScalarMap)
1355 SALOMEDS::Color anOldColor, aNewColor;
1357 anOldColor = aMesh->GetLinkColor();
1358 else if (aScalarMap)
1359 anOldColor = aScalarMap->GetLinkColor();
1362 QColor aColor (int(255*anOldColor.R),
1363 int(255*anOldColor.G),
1364 int(255*anOldColor.B));
1365 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1366 if (aColorNew.isValid()) {
1367 aNewColor.R = aColorNew.red()/255.;
1368 aNewColor.G = aColorNew.green()/255.;
1369 aNewColor.B = aColorNew.blue()/255.;
1371 aMesh->SetLinkColor(aNewColor);
1373 aScalarMap->SetLinkColor(aNewColor);
1374 RecreateActor(this, aPrs3d);
1378 //----------------------------------------------------------------------------
1383 VisuGUI_TransparencyDlg* aDialog = new VisuGUI_TransparencyDlg( this );
1387 //----------------------------------------------------------------------------
1392 VISU_Actor* anActor = NULL;
1393 VISU_ActorBase* anActorBase = NULL;
1394 VISU::Prs3d_i* aPrs3d = NULL;
1395 SVTK_ViewWindow* aViewWindow = NULL;
1397 bool isPrs3d = false;
1399 if (GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor)) {
1401 oldlwid = anActor->GetLineWidth();
1404 aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
1405 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1406 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1407 VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
1408 anActorBase = VISU::FindActorBase(aViewWindow, aTable);
1409 oldlwid = anActorBase->GetLineWidth();
1413 VisuGUI_CursorDlg* CursorDlg =
1414 new VisuGUI_CursorDlg (GetDesktop(this), (const char*)tr("DLG_LINEWIDTH_TITLE").toLatin1(), TRUE);
1416 CursorDlg->helpFileName = "viewing_3d_presentations_page.html#width_opacity_anchor";
1417 CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
1418 CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
1419 CursorDlg->SpinBox1->setMinimum(1);
1420 CursorDlg->SpinBox1->setMaximum(10);
1422 int intlwid = int(oldlwid);
1423 CursorDlg->SpinBox1->setValue(intlwid);
1425 int ret = CursorDlg->exec();
1427 intlwid = CursorDlg->SpinBox1->value();
1428 float newlwid = intlwid;
1430 anActor->SetLineWidth(newlwid);
1432 anActorBase->SetLineWidth(newlwid);
1437 //----------------------------------------------------------------------------
1440 ::OnChangePointMarker()
1442 SALOME_ListIO aListIO;
1443 GetSelectionMgr( this )->selectedObjects( aListIO );
1444 if( aListIO.Extent() < 1 )
1447 VISU::StudyId2MarkerMap& aMarkerMap = GetVisuGen( this )->GetMarkerMap();
1448 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
1449 int aStudyId = aCStudy->StudyId();
1451 bool update = false;
1452 for( SALOME_ListIteratorOfListIO It( aListIO ); It.More(); It.Next() )
1454 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1455 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList( this, anIO );
1456 for( int i = 0, n = aPrsList.size(); i < n; i++ )
1458 if( VISU::Prs3d_i* aPrs = aPrsList[i] )
1460 VTKViewer_MarkerDlg* aDlg = new VTKViewer_MarkerDlg( GetDesktop( this ) );
1461 aDlg->setHelpData( "VISU", "point_marker_page.html" );
1463 aDlg->setCustomMarkerMap( aMarkerMap[ aStudyId ] );
1465 VISU::MarkerType aMarkerTypeCurrent = aPrs->GetMarkerType();
1466 VISU::MarkerScale aMarkerScaleCurrent = aPrs->GetMarkerScale();
1467 int aMarkerTextureCurrent = aPrs->GetMarkerTexture();
1468 if( aMarkerTypeCurrent != VISU::MT_USER )
1469 aDlg->setStandardMarker( (VTK::MarkerType)aMarkerTypeCurrent, (VTK::MarkerScale)aMarkerScaleCurrent );
1471 aDlg->setCustomMarker( aMarkerTextureCurrent );
1475 aMarkerMap[ aStudyId ] = aDlg->getCustomMarkerMap();
1477 VISU::MarkerType aMarkerTypeNew = (VISU::MarkerType)aDlg->getMarkerType();
1478 VISU::MarkerScale aMarkerScaleNew = (VISU::MarkerScale)aDlg->getStandardMarkerScale();
1479 int aMarkerTextureNew = aDlg->getCustomMarkerID();
1480 if( aMarkerTypeNew != VISU::MT_USER )
1481 aPrs->SetMarkerStd( aMarkerTypeNew, aMarkerScaleNew );
1483 aPrs->SetMarkerTexture( aMarkerTextureNew );
1485 aPrs->UpdateActors();
1495 if( SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>( this ) )
1499 //----------------------------------------------------------------------------
1502 ::OnChangeShrinkFactor()
1504 VisuGUI_ShrinkFactorDlg* aDialog = new VisuGUI_ShrinkFactorDlg( this );
1508 //----------------------------------------------------------------------------
1513 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1514 if(aSelectionInfo.empty())
1517 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1518 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1519 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1520 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1521 if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)) {
1522 aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
1523 if( IsSObjectTable( aSObject ) ) {
1524 VISU_TableDlg* dlg = new VISU_TableDlg( GetDesktop( this ),
1525 GetCStudy( GetAppStudy( this ) ),
1528 //SAL2670 Orientation of show tables
1529 VISU_TableDlg::ttAuto,
1536 //----------------------------------------------------------------------------
1541 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1542 if(aSelectionInfo.empty())
1545 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1546 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1547 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1548 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1549 if(VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
1550 VisuGUI_Table3DDlg*aDlg = new VisuGUI_Table3DDlg( this );
1551 aDlg->initFromPrsObject( aTable );
1552 if ( runAndWait(aDlg, 0) > 0 ) {
1553 aDlg->storeToPrsObject(aTable);
1554 aTable->UpdateActors();
1560 //----------------------------------------------------------------------------
1565 SetScalarBarVisibility(true);
1572 SetScalarBarVisibility(false);
1577 ::SetScalarBarVisibility(bool theVisibility)
1579 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1580 SALOME_ListIO aListIO;
1581 aSelectionMgr->selectedObjects(aListIO);
1583 SALOME_ListIteratorOfListIO It (aListIO);
1585 bool update = false;
1586 for (; It.More(); It.Next()) {
1587 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1588 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO, true);
1589 if ( aPrsList.size()>0 ) {
1590 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1591 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1593 if (VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject)) {
1594 aScalar->SetBarVisible( theVisibility );
1595 RecreateActor(this, aScalar);
1597 } else if (VISU::GaussPoints_i* aGauss = dynamic_cast<VISU::GaussPoints_i*>(aPrsObject)) {
1598 aGauss->SetBarVisible( theVisibility );
1599 RecreateActor(this, aGauss);
1607 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this))
1612 //----------------------------------------------------------------------------
1617 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1618 if(aSelectionInfo.empty())
1621 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1622 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1623 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1626 (aBase->GetType() == VISU::TCUTLINES || aBase->GetType() == VISU::TCUTSEGMENT) ||
1627 IsSObjectTable(aSObject)) {
1628 GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
1629 UpdateObjBrowser(this);
1633 //----------------------------------------------------------------------------
1638 SalomeApp_Study* anAppStudy = GetAppStudy(this);
1639 _PTR(Study) aCStudy = GetCStudy(anAppStudy);
1640 if (CheckLock(aCStudy,GetDesktop(this)))
1643 SALOME_ListIO aList;
1644 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
1645 mgr->selectedObjects(aList,QString::null,false);
1646 int i = 0, nbSelected = aList.Extent();
1647 if (nbSelected < 1) return;
1649 std::vector<std::string> anEntries (nbSelected);
1651 Handle(SALOME_InteractiveObject) anIO;
1652 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1654 if (anIO->hasEntry()) {
1655 if (IsRemovable(anIO->getEntry(), this)) {
1656 aNameList.append("\n - ");
1657 // Get Name Of the Main Object if it's a referenced object
1658 VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
1659 if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
1660 _PTR(SObject) aRefSObject;
1661 if (aSObject->ReferencedObject(aRefSObject)) {
1662 QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
1663 aNameList.append( aRefName );
1666 aNameList.append(anIO->getName());
1668 anEntries[i++] = anIO->getEntry();
1673 if (nbSelected < 1) {
1674 SUIT_MessageBox::warning(GetDesktop(this),
1675 QObject::tr("WRN_VISU"),
1676 QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
1680 if ( SUIT_MessageBox::question( GetDesktop(this),
1681 QObject::tr( "WRN_VISU" ),
1682 QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
1683 SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
1686 // There is a transaction
1687 _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
1688 aStudyBuilder->NewCommand();
1690 for (i = 0; i < nbSelected; i++) {
1691 VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anEntries[i]);
1692 if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
1693 emit beforeObjectDelete(QString(aSObject->GetID().c_str()));
1694 _PTR(SObject) aRefSObject;
1695 if (aSObject->ReferencedObject(aRefSObject)) {
1696 // It can be a reference on curve, published under a container.
1697 // In this case the curve should be removed from the container.
1699 VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
1700 VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
1701 if(aRefBase && aRefBase->GetType() == VISU::TMESH){
1702 DeleteSObject(this, aCStudy, aRefSObject);
1703 UpdateObjBrowser(this, true, aRefSObject);
1704 }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
1705 CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
1706 VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
1707 _PTR(SObject) aParentSO = aSObject->GetFather();
1708 VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
1709 if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
1710 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
1711 if(aContainer->GetNbCurves() > 0){
1712 aContainer->RemoveCurve(aCurve);
1713 UpdateObjBrowser(this, true, aParentSO);
1720 DeleteSObject(this, aCStudy, aSObject);
1721 UpdateObjBrowser(this, true, aSObject);
1726 // Finish transaction
1727 aStudyBuilder->CommitCommand();
1728 mgr->clearSelected();
1731 //----------------------------------------------------------------------------
1736 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1737 if(aSelectionInfo.empty())
1740 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1741 if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
1742 if(aBase->GetType() == VISU::TTABLE || aBase->GetType() == VISU::TPOINTMAP3D) {
1743 if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)){
1744 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
1745 _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
1746 if(IsSObjectTable(aSObject)){
1747 VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
1748 if(aDlg->exec() == QDialog::Accepted){
1749 if(!IsStudyLocked(aStudy)){
1750 // if study is not locked - create new container, create curves and insert them
1751 // into container, then plot container if current viewer is of VIEW_PLOT2D type
1753 QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
1754 aDlg->getCurvesSource( horIndex, ver1Indices, ver2Indices, zIndices );
1755 verIndices = ver1Indices + ver2Indices;
1756 if( horIndex >= 0 && verIndices.count() > 0 ){
1757 CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
1758 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
1759 for( int i = 0; i < verIndices.count(); i++ ){
1760 bool isV2 = ver2Indices.contains(verIndices[i]);
1761 VISU::Curve_var aCurveObject =
1762 GetVisuGen(this)->CreateCurveWithZExt(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
1763 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
1765 int marker, line, lineWidth;
1767 if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
1768 line, lineWidth, color) && !isAuto )
1771 c.R = color.red() /255.;
1772 c.G = color.green()/255.;
1773 c.B = color.blue() /255.;
1774 aCurve->SetColor( c );
1775 aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
1776 aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1778 aContainer->AddCurve(aCurveObject);
1781 UpdateObjBrowser(this);
1782 PlotContainer( this, aContainer, VISU::eDisplay );
1786 // get name of SObject
1787 QString aSObjectName;
1788 _PTR(GenericAttribute) anAttr;
1789 if(aSObject->FindAttribute( anAttr, "AttributeName" )){
1790 _PTR(AttributeName) aName = anAttr;
1791 aSObjectName = QString( aName->Value().c_str() );
1793 // if study is locked just get curves info and plot them
1794 // if current viewer is of VIEW_PLOT2D type
1795 QList<Plot2d_Curve*> container;
1796 aDlg->getCurves( container );
1797 if ( !container.isEmpty() ) {
1798 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1799 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
1807 }else if(!aSelectionItem.myIO.IsNull()){
1808 // check if Table SObject is selected
1809 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1810 if(IsSObjectTable(aSObject)){
1811 VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
1812 if(aDlg->exec() == QDialog::Accepted){
1813 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
1814 if(!IsStudyLocked(aStudy)){
1815 // if study is not locked - create new table and container objects, create curves
1816 // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
1818 QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
1819 aDlg->getCurvesSource( horIndex, verIndices, ver2Indices, zIndices );
1820 verIndices = ver1Indices + ver2Indices;
1821 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1822 VISU::Table_var aTableObject = GetVisuGen(this)->CreateTable(aSObject->GetID().c_str());
1823 if(!CORBA::is_nil(aTableObject)){
1824 VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
1825 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObject).in());
1826 for ( int i = 0; i < verIndices.count(); i++ ) {
1827 bool isV2 = ver2Indices.contains(verIndices[i]);
1828 VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZExt
1829 ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
1830 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
1832 int marker, line, lineWidth;
1834 if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
1835 line, lineWidth, color) && !isAuto )
1838 c.R = color.red()/255.;
1839 c.G = color.green()/255.;
1840 c.B = color.blue()/255.;
1841 aCurve->SetColor( c );
1842 aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
1843 aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1845 aContainerObject->AddCurve(aCurveObject);
1848 UpdateObjBrowser(this);
1849 PlotContainer( this, aContainer, VISU::eDisplay );
1853 // get name of SObject
1854 QString aSObjectName;
1855 _PTR(GenericAttribute) anAttr;
1856 if(aSObject->FindAttribute(anAttr, "AttributeName")){
1857 _PTR(AttributeName) aName = anAttr;
1858 aSObjectName = QString( aName->Value().c_str() );
1860 // if study is locked just get curves info and plot them
1861 QList<Plot2d_Curve*> container;
1862 aDlg->getCurves( container );
1863 if ( !container.isEmpty() ) {
1864 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1865 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
1874 //----------------------------------------------------------------------------
1877 ::OnCurveProperties()
1879 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1880 if(aSelectionInfo.size() != 1)
1883 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1884 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1885 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1889 if(aBase->GetType() == VISU::TCURVE) {
1891 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase)){
1892 if(!IsStudyLocked(GetCStudy(GetAppStudy(this)))){
1893 Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
1895 aDlg.setLine( (Plot2d::LineType)aCurve->GetLine(), aCurve->GetLineWidth() );
1896 aDlg.setMarker( (Plot2d::MarkerType)aCurve->GetMarker() );
1897 SALOMEDS::Color aColor = aCurve->GetColor();
1898 aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
1899 if( aDlg.exec() == QDialog::Accepted ) {
1900 aCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
1901 aCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
1902 SALOMEDS::Color newColor;
1903 newColor.R = aDlg.getColor().red()/255.;
1904 newColor.G = aDlg.getColor().green()/255.;
1905 newColor.B = aDlg.getColor().blue()/255.;
1906 aCurve->SetColor( newColor );
1907 PlotCurve(this, aCurve, VISU::eDisplay);
1914 //----------------------------------------------------------------------------
1917 ::OnClearContainer()
1919 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1920 if (CheckLock(aCStudy,GetDesktop(this)))
1923 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1924 if(aSelectionInfo.empty())
1927 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1928 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1932 if(aBase->GetType() == VISU::TCONTAINER){
1934 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase)){
1935 if(aContainer && aContainer->GetNbCurves() > 0){
1936 aContainer->Clear();
1937 VISU::updateContainerVisibility(aContainer);
1938 UpdateObjBrowser(this);
1944 //----------------------------------------------------------------------------
1949 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1950 if(aSelectionInfo.empty())
1953 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1954 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1958 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase);
1962 VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
1963 aDlg->initFromPrsObject(aContainer);
1965 aDlg->storeToPrsObject(aContainer);
1966 UpdateObjBrowser(this, true);
1968 VISU::updateContainerVisibility(aContainer);
1972 //----------------------------------------------------------------------------
1975 ::OnSaveViewParams()
1977 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1978 if (CheckLock(aCStudy,GetDesktop(this)))
1981 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1982 if (aViewMgr->getType() != SVTK_Viewer::Type())
1985 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1986 SALOME_ListIO aListIO;
1987 aSelectionMgr->selectedObjects(aListIO);
1988 if (aListIO.Extent() > 1)
1991 if (aListIO.Extent() == 0) {
1992 VISU::View3D_i::SaveViewParams(aViewMgr, (const char*)VISU::View3D_i::GenerateViewParamsName().toLatin1());
1994 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1995 VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
1997 UpdateObjBrowser(this);
2000 //----------------------------------------------------------------------------
2003 ::OnRestoreViewParams()
2005 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
2006 if (aViewMgr->getType() != SVTK_Viewer::Type())
2009 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2010 SALOME_ListIO aListIO;
2011 aSelectionMgr->selectedObjects(aListIO);
2012 if (aListIO.Extent() != 1)
2015 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2016 //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
2017 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
2018 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
2020 VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
2023 //----------------------------------------------------------------------------
2028 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2029 if (CheckLock(aCStudy,GetDesktop(this)))
2032 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
2033 if (aSelectionInfo.empty())
2036 VisuGUI_Selection aSel (this);
2037 aSel.init("", getApp()->selectionMgr());
2038 if (aSel.count() < 1) return;
2040 bool isAny = false; // is there any appropriate object selected
2041 for (int i = 0; i < aSelectionInfo.size(); i++) {
2042 VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
2043 VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo;
2045 _PTR(SObject) aSObject = anObjectInfo.mySObject;
2049 // Check, if the selected object can be renamed
2050 QString aStr = aSel.parameter(i, "type" ).toString();
2051 if (aStr == "VISU::TSCALARMAP" || aStr == "VISU::TISOSURFACES" ||
2052 aStr == "VISU::TDEFORMEDSHAPE" || aStr == "VISU::TCUTPLANES" ||
2053 aStr == "VISU::TCUTLINES" || aStr == "VISU::TCUTSEGMENT" || aStr == "VISU::TVECTORS" ||
2054 aStr == "VISU::TSTREAMLINES" || aStr == "VISU::TPLOT3D" ||
2055 aStr == "VISU::TSCALARMAPONDEFORMEDSHAPE" || aStr == "VISU::TCOLOREDPRS3DHOLDER" ||
2056 aStr == "VISU::TTABLE" || aStr == "VISU::TCURVE" || aStr == "VISU::TCONTAINER" ||
2057 aStr == "VISU::POINTMAP3D" || aStr == "VISU::TVIEW3D" ||
2058 aStr == "VISU::TPOINTMAP3D" || aStr == "VISU::TGAUSSPOINTS")
2060 _PTR(GenericAttribute) anAttr;
2061 if (aSObject->FindAttribute(anAttr, "AttributeName")) {
2063 _PTR(AttributeName) aName (anAttr);
2064 QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
2065 if (!Name.isEmpty()) {
2066 QApplication::setOverrideCursor(Qt::WaitCursor);
2068 // rename specific objects
2069 if (VISU::Base_i* aBase = anObjectInfo.myBase) {
2070 switch (aBase->GetType()) {
2071 case VISU::TCURVE: { // Curve object
2072 if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase))
2073 aCurve->SetName(Name.toLatin1().constData(), true);
2076 case VISU::TTABLE: { // Table object
2077 if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
2078 aTable->SetName(Name.toLatin1().constData(), true);
2081 case VISU::TPOINTMAP3D: { // Table object
2082 if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
2083 aTable3d->SetTitle(Name.toLatin1().constData());
2084 aTable3d->UpdateActors();
2088 case VISU::TCONTAINER: { // Container object
2089 if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
2090 aContainer->SetName(Name.toLatin1().constData(), true);
2097 // rename the study object
2098 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
2099 aName->SetValue(Name.toLatin1().constData()); // rename the SObject
2100 anIO->setName(Name.toLatin1().constData()); // rename the InteractiveObject
2102 ViewManagerList aViewManagerList;
2103 getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
2104 SUIT_ViewManager* aViewManager;
2105 foreach( aViewManager, aViewManagerList ) {
2106 if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
2107 if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
2108 aViewer->renameAll( anIO, Name.toLatin1().constData() );
2112 UpdateObjBrowser(this, false);
2113 QApplication::restoreOverrideCursor();
2120 SUIT_MessageBox::warning(GetDesktop(this),
2121 QObject::tr("WRN_VISU"),
2122 QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
2126 //----------------------------------------------------------------------------
2129 ::OnClippingPlanes()
2131 new VisuGUI_ClippingDlg (this, false);
2134 //----------------------------------------------------------------------------
2140 if ( !mySweep->toggleViewAction()->isChecked() )
2141 mySweep->toggleViewAction()->trigger();
2142 mySweep->onSelectionChanged();
2144 mySweep->onPlay(true);
2147 //----------------------------------------------------------------------------
2150 ::OnTimeAnimation(VISU::Animation::AnimationMode theMode)
2152 if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
2155 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2156 VisuGUI_TimeAnimationDlg* aAnimationDlg =
2157 new VisuGUI_TimeAnimationDlg (this, aCStudy, theMode);
2159 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2160 SALOME_ListIO aListIO;
2161 aSelectionMgr->selectedObjects(aListIO);
2163 SALOME_ListIteratorOfListIO It (aListIO);
2164 for (; It.More(); It.Next()) {
2165 _PTR(SObject) aSObject = aCStudy->FindObjectID(It.Value()->getEntry());
2166 if ( !aAnimationDlg->addField(aSObject) ) {
2167 SUIT_MessageBox::warning(GetDesktop(this),
2169 tr("ERR_CANT_CREATE_ANIMATION") );
2170 delete aAnimationDlg;
2174 aAnimationDlg->show();
2177 //----------------------------------------------------------------------------
2180 OnParallelTimeAnimation()
2182 OnTimeAnimation(VISU::Animation::PARALLEL);
2187 OnSucccessiveTimeAnimation()
2189 OnTimeAnimation(VISU::Animation::SUCCESSIVE);
2192 //----------------------------------------------------------------------------
2197 if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
2200 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2201 SALOME_ListIO aListIO;
2202 aSelectionMgr->selectedObjects(aListIO);
2204 if (aListIO.Extent() != 1)
2207 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2209 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2211 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
2215 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
2216 if (aType != VISU::TANIMATION)
2219 VisuGUI_TimeAnimationDlg* aAnimationDlg =
2220 new VisuGUI_TimeAnimationDlg(this, aCStudy);
2221 aAnimationDlg->restoreFromStudy(aSObj);
2222 aAnimationDlg->show();
2225 //----------------------------------------------------------------------------
2228 ::OnPointEvolution()
2230 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
2231 VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
2233 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
2234 SALOME_ListIO aListIO;
2235 aSelectionMgr->selectedObjects( aListIO );
2237 SALOME_ListIteratorOfListIO It( aListIO );
2238 for( ; It.More(); It.Next() )
2240 _PTR(SObject) aSObject = aCStudy->FindObjectID( It.Value()->getEntry() );
2241 if( !aDlg->setField( aSObject ) )
2243 SUIT_MessageBox::warning( GetDesktop( this ),
2245 tr( "ERR_CANT_CREATE_EVOLUTION" ) );
2253 //----------------------------------------------------------------------------
2258 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
2259 SALOME_ListIO aListIO;
2260 aSelectionMgr->selectedObjects( aListIO );
2262 if( aListIO.Extent() != 1 )
2265 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2267 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
2268 _PTR(SObject) aSObj = aCStudy->FindObjectID( anIO->getEntry() );
2272 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
2273 if( aType != VISU::TEVOLUTION )
2276 VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
2277 aDlg->restoreFromStudy( aSObj );
2281 //----------------------------------------------------------------------------
2284 ::OnCopyPresentation()
2286 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2287 if (CheckLock(aCStudy,GetDesktop(this)))
2290 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
2291 if(aSelectionInfo.empty())
2294 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
2295 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
2299 VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dToModify(this, aBase);
2303 if(aBase->GetType() != VISU::TMESH){
2304 VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aBase);
2305 switch (aBase->GetType()) {
2306 case VISU::TSCALARMAP:
2307 TSameAsFactory<VISU::TSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2309 case VISU::TDEFORMEDSHAPE:
2310 TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2312 case VISU::TSCALARMAPONDEFORMEDSHAPE:
2313 case VISU::TDEFORMEDSHAPEANDSCALARMAP:
2314 TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2316 case VISU::TCUTPLANES:
2317 TSameAsFactory<VISU::TCUTPLANES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2319 case VISU::TCUTLINES:
2320 TSameAsFactory<VISU::TCUTLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2322 case VISU::TCUTSEGMENT:
2323 TSameAsFactory<VISU::TCUTSEGMENT>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2325 case VISU::TISOSURFACES:
2326 TSameAsFactory<VISU::TISOSURFACES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2328 case VISU::TSTREAMLINES:
2329 TSameAsFactory<VISU::TSTREAMLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2331 case VISU::TVECTORS:
2332 TSameAsFactory<VISU::TVECTORS>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2335 TSameAsFactory<VISU::TPLOT3D>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2338 UpdateObjBrowser(this);
2342 //----------------------------------------------------------------------------
2345 ::OnToggleSelectionPanel()
2347 if (GetActiveViewWindow<SVTK_ViewWindow>(this))
2349 if( myPanels.find( SelectionPanelId ) != myPanels.end() )
2351 if( VisuGUI_SelectionPanel* aSelectionPanel =
2352 dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
2354 if( aSelectionPanel->isVisible() )
2355 aSelectionPanel->hide();
2357 aSelectionPanel->show();
2362 SUIT_MessageBox::warning(GetDesktop(this),
2364 tr("ERR_ACTIVATE_VIEW3D") );
2367 //----------------------------------------------------------------------------
2370 ::OnSwitchSelectionMode()
2372 QAction* anAction = dynamic_cast<QAction*>( sender() );
2376 bool isAnyChecked = false;
2377 for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
2379 QAction* aRefAction = action( anId );
2380 isAnyChecked |= aRefAction->isChecked();
2381 if( anAction != aRefAction )
2382 aRefAction->setChecked( false );
2383 else if( myPanels.find( SelectionPanelId ) != myPanels.end() )
2385 if( VisuGUI_SelectionPanel* aSelectionPanel =
2386 dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
2387 aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
2390 // At least one action must be checked
2392 anAction->setChecked( true );
2395 //----------------------------------------------------------------------------
2398 ::OnSwitchSelectionMode( int theId )
2400 for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
2402 QAction* aRefAction = action( anId );
2403 aRefAction->setChecked( anId == VISU_ACTOR_SELECTION + theId );
2407 //----------------------------------------------------------------------------
2410 ::OnMergeScalarBars()
2412 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2413 SALOME_ListIO aListIO;
2414 aSelectionMgr->selectedObjects(aListIO);
2416 SALOME_ListIteratorOfListIO It (aListIO);
2418 // first find the bounds
2419 double aMin, aMax; bool first = true;
2420 for (; It.More(); It.Next()) {
2421 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2422 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2423 if (!aPrsList.empty()) {
2424 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2425 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2427 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2431 aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
2433 if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
2434 if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
2442 // set the computed range to every selected ScalarMap
2443 bool update = false;
2444 for (It.Initialize(aListIO); It.More(); It.Next() ) {
2445 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2446 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2447 if (!aPrsList.empty()) {
2448 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2449 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2451 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2453 aScalar->SetRange(aMin, aMax);
2454 RecreateActor(this, aScalar);
2462 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
2463 vw->getRenderer()->ResetCameraClippingRange();
2469 //----------------------------------------------------------------------------
2472 ::OnFreeScalarBars()
2474 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2475 SALOME_ListIO aListIO;
2476 aSelectionMgr->selectedObjects(aListIO);
2478 SALOME_ListIteratorOfListIO It (aListIO);
2480 // restore the source range for every ScalarMap
2481 bool update = false;
2482 for (; It.More(); It.Next()) {
2483 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2484 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2485 if (!aPrsList.empty()) {
2486 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2487 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2489 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2491 aScalar->SetSourceRange();
2492 RecreateActor(this, aScalar);
2500 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
2501 vw->getRenderer()->ResetCameraClippingRange();
2507 //----------------------------------------------------------------------------
2512 if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs");
2513 VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
2521 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
2522 ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), this, aViewWindow);
2531 ::initialize( CAM_Application* theApp )
2533 SalomeApp_Module::initialize( theApp );
2535 mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
2537 mySweep = new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
2546 action( VISU_ACTOR_SELECTION )->setChecked( true );
2554 QWidget* aParent = application()->desktop();
2555 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
2559 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_IMPORT_MED"));
2560 createAction( VISU_IMPORT_FROM_FILE, tr("IMPORT_FROM_FILE"), QIcon(aPixmap),
2561 tr("MEN_IMPORT_FROM_FILE"), "", (Qt::CTRL + Qt::Key_I), aParent, false,
2562 this, SLOT(OnImportFromFile()));
2564 createAction( VISU_IMPORT_TABLE, "", QIcon(),
2565 tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
2566 this, SLOT(OnImportTableFromFile()));
2568 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
2569 createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIcon(aPixmap),
2570 tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
2571 this, SLOT(OnCreateScalarMap()));
2573 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
2574 createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIcon(aPixmap),
2575 tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
2576 this, SLOT(OnCreateDeformedShape()));
2578 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"));
2579 createAction( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), QIcon(aPixmap),
2580 tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), "", 0, aParent, false,
2581 this, SLOT(OnCreateDeformedShapeAndScalarMap()));
2583 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
2584 createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIcon(aPixmap),
2585 tr("MEN_VECTORS"), "", 0, aParent, false,
2586 this, SLOT(OnCreateVectors()));
2588 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
2589 createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIcon(aPixmap),
2590 tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
2591 this, SLOT(OnCreateIsoSurfaces()));
2593 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
2594 createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIcon(aPixmap),
2595 tr("MEN_CUT_PLANES"), "", 0, aParent, false,
2596 this, SLOT(OnCreateCutPlanes()));
2598 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
2599 createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIcon(aPixmap),
2600 tr("MEN_STREAM_LINES"), "", 0, aParent, false,
2601 this, SLOT(OnCreateStreamLines()));
2603 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
2604 createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIcon(aPixmap),
2605 tr("MEN_CUT_LINES"), "", 0, aParent, false,
2606 this, SLOT(OnCreateCutLines()));
2608 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_SEGMENT"));
2609 createAction( VISU_CUT_SEGMENT, tr("MEN_CUT_SEGMENT"), QIcon(aPixmap),
2610 tr("MEN_CUT_SEGMENT"), "", 0, aParent, false,
2611 this, SLOT(OnCreateCutSegment()));
2613 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2614 createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIcon(aPixmap),
2615 tr("MEN_PLOT_3D"), "", 0, aParent, false,
2616 this, SLOT(OnCreatePlot3D()));
2618 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
2619 createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIcon(aPixmap),
2620 tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
2621 this, SLOT(OnCreatePlot2dView()));
2623 createAction( VISU_DELETE_OBJS, tr("MEN_DELETE_OBJS"), QIcon(),
2624 tr("MEN_DELETE_OBJS"), "", Qt::Key_Delete, aParent, false,
2625 this, SLOT(OnDeleteObjects()));
2627 createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIcon(),
2628 tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
2629 this, SLOT(OnShowTable()));
2631 createAction( VISU_EDIT_POINTMAP3D, tr("MEN_EDIT_PRS"), QIcon(),
2632 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2633 this, SLOT(OnShowTablePlot()));
2635 createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIcon(),
2636 tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
2637 this, SLOT(OnPlotData()));
2639 createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIcon(),
2640 tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
2641 this, SLOT(OnExportTableToFile()));
2643 createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIcon(),
2644 tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
2645 this, SLOT(OnImportMedField()));
2647 createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIcon(),
2648 tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
2649 this, SLOT(OnImportMedField()));
2651 createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIcon(),
2652 tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
2653 this, SLOT(OnImportMedField()));
2655 createAction( VISU_LOAD_COMPONENT_DATA, tr("MEN_LOAD_COMPONENT_DATA"), QIcon(),
2656 tr("MEN_LOAD_COMPONENT_DATA"), "", 0, aParent, false,
2657 this, SLOT(OnLoadComponentData()));
2659 createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIcon(),
2660 tr("MEN_CREATE_PRS"), "", 0, aParent, false,
2661 this, SLOT(OnCreateMesh()));
2663 createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIcon(),
2664 tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
2665 this, SLOT(OnCreateManyMesh()));
2667 createAction( VISU_TRANSLATE_PRS, tr("MEN_TRANSLATE_PRS"), QIcon(),
2668 tr("MEN_TRANSLATE_PRS"), "", 0, aParent, false,
2669 this, SLOT(OnTranslatePrs()));
2671 createAction( VISU_MERGE_SCALAR_BARS, tr("MEN_MERGE_SCALAR_BARS"), QIcon(),
2672 tr("MEN_MERGE_SCALAR_BARS"), "", 0, aParent, false,
2673 this, SLOT(OnMergeScalarBars()));
2675 createAction( VISU_FREE_SCALAR_BARS, tr("MEN_FREE_SCALAR_BARS"), QIcon(),
2676 tr("MEN_FREE_SCALAR_BARS"), "", 0, aParent, false,
2677 this, SLOT(OnFreeScalarBars()));
2679 createAction( VISU_ERASE, tr("MEN_HIDE"), QIcon(),
2680 tr("MEN_HIDE"), "", 0, aParent, false,
2681 this, SLOT(OnErasePrs()));
2683 createAction( VISU_DISPLAY, tr("MEN_SHOW"), QIcon(),
2684 tr("MEN_SHOW"), "", 0, aParent, false,
2685 this, SLOT(OnDisplayPrs()));
2687 createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIcon(),
2688 tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
2689 this, SLOT(OnDisplayOnlyPrs()));
2691 createAction( VISU_SHOW_SCALAR_BAR, tr("MEN_SHOW_SCALAR_BAR"), QIcon(),
2692 tr("MEN_SHOW_SCALAR_BAR"), "", 0, aParent, false,
2693 this, SLOT(OnShowScalarBar()));
2695 createAction( VISU_HIDE_SCALAR_BAR, tr("MEN_HIDE_SCALAR_BAR"), QIcon(),
2696 tr("MEN_HIDE_SCALAR_BAR"), "", 0, aParent, false,
2697 this, SLOT(OnHideScalarBar()));
2699 createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIcon(),
2700 tr("MEN_COPY_PRS"), "", 0, aParent, false,
2701 this, SLOT(OnCopyPresentation()));
2703 createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIcon(),
2704 tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
2705 this, SLOT(OnCurveProperties()));
2707 createAction( VISU_RENAME, tr("MEN_RENAME"), QIcon(),
2708 tr("MEN_RENAME"), "", Qt::Key_F2, aParent, false,
2709 this, SLOT(OnRename()));
2711 createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIcon(),
2712 tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
2713 this, SLOT(OnEditContainer()));
2715 createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIcon(),
2716 tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
2717 this, SLOT(OnClearContainer()));
2719 createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIcon(),
2720 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2721 this, SLOT(OnSaveViewParams()));
2722 createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIcon(),
2723 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2724 this, SLOT(OnSaveViewParams()));
2726 createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIcon(),
2727 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
2728 this, SLOT(OnRestoreViewParams()));
2730 //createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIcon(),
2731 // tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
2732 // this, SLOT(OnDeleteObjects()));
2734 createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIcon(),
2735 tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false,
2736 this, SLOT(OnArrangeActors()));
2738 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
2739 createAction( VISU_POINTS, tr("MEN_POINTS"), QIcon(aPixmap),
2740 tr("MEN_POINTS"), "", 0, aParent, false,
2741 this, SLOT(OnMakePoints()));
2743 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
2744 createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIcon(aPixmap),
2745 tr("MEN_WIREFRAME"), "", 0, aParent, false,
2746 this, SLOT(OnMakeWireframe()));
2748 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
2749 createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIcon(aPixmap),
2750 tr("MEN_SURFACE"), "", 0, aParent, false,
2751 this, SLOT(OnMakeSurface()));
2753 createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIcon(),
2754 tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
2755 this, SLOT(OnMakeInsideframe()));
2757 createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIcon(),
2758 tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
2759 this, SLOT(OnMakeSurfaceframe()));
2761 createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIcon(),
2762 tr("MEN_SHRINK"), "", 0, aParent, false,
2763 this, SLOT(OnMakeShrink()));
2765 createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIcon(),
2766 tr("MEN_UNSHRINK"), "", 0, aParent, false,
2767 this, SLOT(OnMakeShrink()));
2769 createAction( VISU_FEATURE_EDGES, tr("MEN_FEATURE_EDGES"), QIcon(),
2770 tr("MEN_FEATURE_EDGES"), "", 0, aParent, false,
2771 this, SLOT(OnMakeFeatureEdges()));
2773 createAction( VISU_SHADING, tr("MEN_SHADING"), QIcon(),
2774 tr("MEN_SHADING"), "", 0, aParent, false,
2775 this, SLOT(OnSetShadingOn()));
2777 createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIcon(),
2778 tr("MEN_NOSHADING"), "", 0, aParent, false,
2779 this, SLOT(OnSetShadingOff()));
2781 createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIcon(),
2782 tr("MEN_CELL_COLOR"), "", 0, aParent, false,
2783 this, SLOT(OnChangeColor()));
2785 createAction( VISU_COLOR, tr("MEN_COLOR"), QIcon(),
2786 tr("MEN_COLOR"), "", 0, aParent, false,
2787 this, SLOT(OnChangeColor()));
2789 createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIcon(),
2790 tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
2791 this, SLOT(OnChangeWireframeColor()));
2793 createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIcon(),
2794 tr("MEN_OPACITY"), "", 0, aParent, false,
2795 this, SLOT(OnChangeOpacity()));
2797 createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIcon(),
2798 tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
2799 this, SLOT(OnChangeLines()));
2801 createAction( VISU_POINT_MARKER, tr("MEN_POINT_MARKER"), QIcon(),
2802 tr("MEN_POINT_MARKER"), "", 0, aParent, false,
2803 this, SLOT(OnChangePointMarker()));
2805 createAction( VISU_SHRINK_FACTOR, tr("MEN_SHRINK_FACTOR"), QIcon(),
2806 tr("MEN_SHRINK_FACTOR"), "", 0, aParent, false,
2807 this, SLOT(OnChangeShrinkFactor()));
2810 createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
2811 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2812 this, SLOT(OnEditScalarMap()));
2814 createAction( VISU_EDIT_DEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIcon(),
2815 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2816 this, SLOT(OnEditDeformedShape()));
2818 createAction( VISU_EDIT_CUTPLANES, tr("MEN_EDIT_PRS"), QIcon(),
2819 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2820 this, SLOT(OnEditCutPlanes()));
2822 createAction( VISU_EDIT_CUTLINES, tr("MEN_EDIT_PRS"), QIcon(),
2823 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2824 this, SLOT(OnEditCutLines()));
2826 createAction( VISU_EDIT_CUTSEGMENT, tr("MEN_EDIT_PRS"), QIcon(),
2827 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2828 this, SLOT(OnEditCutSegment()));
2830 createAction( VISU_EDIT_ISOSURFACES, tr("MEN_EDIT_PRS"), QIcon(),
2831 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2832 this, SLOT(OnEditIsoSurfaces()));
2834 createAction( VISU_EDIT_VECTORS, tr("MEN_EDIT_PRS"), QIcon(),
2835 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2836 this, SLOT(OnEditVectors()));
2838 createAction( VISU_EDIT_STREAMLINES, tr("MEN_EDIT_PRS"), QIcon(),
2839 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2840 this, SLOT(OnEditStreamLines()));
2842 createAction( VISU_EDIT_PLOT3D, tr("MEN_EDIT_PRS"), QIcon(),
2843 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2844 this, SLOT(OnEditPlot3D()));
2846 createAction( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
2847 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2848 this, SLOT(OnEditDeformedShapeAndScalarMap()));
2850 createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIcon(),
2851 tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
2852 this, SLOT(OnCreateTable()));
2854 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP_PANEL"));
2855 createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIcon(aPixmap),
2856 tr("MEN_SWEEP"), "", 0, aParent, false,
2857 this, SLOT(OnSweep()));
2859 createAction( VISU_CLIPPING, tr("MEN_CLIPPING"), QIcon(),
2860 tr("MEN_CLIPPING"), "", 0, aParent, false,
2861 this, SLOT(OnClippingPlanes()));
2863 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2864 createAction( VISU_PARALLELANIMATION, tr("MEN_PARALLEL_ANIMATION"), QIcon(aPixmap),
2865 tr("MEN_PARALLEL_ANIMATION"), "", 0, aParent, false,
2866 this, SLOT(OnParallelTimeAnimation()));
2868 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2869 createAction( VISU_SUCCCESSIVEANIMATION, tr("MEN_SUCCCESSIVE_ANIMATION"), QIcon(aPixmap),
2870 tr("MEN_SUCCCESSIVE_ANIMATION"), "", 0, aParent, false,
2871 this, SLOT(OnSucccessiveTimeAnimation()));
2873 createAction( VISU_POINT_EVOLUTION, tr("MEN_POINT_EVOLUTION"), QIcon(),
2874 tr("MEN_POINT_EVOLUTION"), "", 0, aParent, false,
2875 this, SLOT(OnPointEvolution()));
2877 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
2878 createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIcon(aPixmap),
2879 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
2880 this, SLOT(OnEraseAll()));
2882 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SELECTION_PANEL"));
2883 createAction( VISU_SELECTION_PANEL, tr("MEN_SELECTION_PANEL"), QIcon(aPixmap),
2884 tr("MEN_SELECTION_PANEL"), "", 0, aParent, false,
2885 this, SLOT(OnToggleSelectionPanel()));
2887 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ACTOR_SELECTION"));
2888 createAction( VISU_ACTOR_SELECTION, tr("MEN_ACTOR_SELECTION"), QIcon(aPixmap),
2889 tr("MEN_ACTOR_SELECTION"), "", 0, aParent, true,
2890 this, SLOT(OnSwitchSelectionMode()));
2892 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CELL_SELECTION"));
2893 createAction( VISU_CELL_SELECTION, tr("MEN_CELL_SELECTION"), QIcon(aPixmap),
2894 tr("MEN_CELL_SELECTION"), "", 0, aParent, true,
2895 this, SLOT(OnSwitchSelectionMode()));
2897 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINT_SELECTION"));
2898 createAction( VISU_POINT_SELECTION, tr("MEN_POINT_SELECTION"), QIcon(aPixmap),
2899 tr("MEN_POINT_SELECTION"), "", 0, aParent, true,
2900 this, SLOT(OnSwitchSelectionMode()));
2902 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_POINT_SELECTION"));
2903 createAction( VISU_GAUSS_POINT_SELECTION, tr("MEN_GAUSS_POINT_SELECTION"), QIcon(aPixmap),
2904 tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
2905 this, SLOT(OnSwitchSelectionMode()));
2907 // Definition of the actions for the "Navigation" tool bar
2908 registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
2909 registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
2911 createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIcon(),
2912 tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
2913 this, SLOT(OnShowAnimation()));
2915 createAction( VISU_SHOW_EVOLUTION, tr("MEN_SHOW_EVOLUTION"), QIcon(),
2916 tr("MEN_SHOW_EVOLUTION"), "", 0, aParent, false,
2917 this, SLOT(OnShowEvolution()));
2919 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2920 createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIcon(aPixmap),
2921 tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
2922 this, SLOT(OnPlot3dFromCutPlane()));
2924 createAction( VISU_MANAGE_CACHE, tr("MEN_MANAGE_CACHE"), QIcon(),
2925 tr("MEN_MANAGE_CACHE"), "", 0, aParent, false,
2926 this, SLOT( OnManageCache() ) );
2928 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
2929 createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIcon(aPixmap),
2930 tr("MEN_MULTIPR_VIEW_FULL_RES"), "", 0, aParent, false,
2931 this, SLOT(OnMultiprViewFullRes()));
2933 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_MEDIUM"));
2934 createAction( VISU_MULTIPR_MED_RES, tr("MEN_MULTIPR_VIEW_MEDIUM_RES"), QIcon(aPixmap),
2935 tr("MEN_MULTIPR_VIEW_MEDIUM_RES"), "", 0, aParent, false,
2936 this, SLOT(OnMultiprViewMediumRes()));
2938 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_LOW"));
2939 createAction( VISU_MULTIPR_LOW_RES, tr("MEN_MULTIPR_VIEW_LOW_RES"), QIcon(aPixmap),
2940 tr("MEN_MULTIPR_VIEW_LOW_RES"), "", 0, aParent, false,
2941 this, SLOT(OnMultiprViewLowRes()));
2943 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_HIDE"));
2944 createAction( VISU_MULTIPR_HIDE, tr("MEN_MULTIPR_VIEW_HIDE"), QIcon(aPixmap),
2945 tr("MEN_MULTIPR_VIEW_HIDE"), "", 0, aParent, false,
2946 this, SLOT(OnMultiprViewHide()));
2948 createAction( VISU_FILE_INFO, tr("MEN_FILE_INFO"), QIcon(),
2949 tr("MEN_FILE_INFO"), "", 0, aParent, false,
2950 this, SLOT(OnFileInfo()));
2952 createAction( VISU_EXPORT_MED, tr("VISU_MEN_EXPORT_MED"), QIcon(),
2953 tr("VISU_MEN_EXPORT_MED"), "", 0, aParent, false,
2954 this, SLOT(OnExportMED()));
2956 createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(),
2957 tr("MEN_FILTER_SCALARS"), "", 0, aParent, false,
2958 this, SLOT(OnFilterScalars()));
2960 createAction( VISU_VALUES_LABELING, tr("MEN_VALUES_LABELING"), QIcon(),
2961 tr("MEN_VALUES_LABELING"), "", 0, aParent, true,
2962 this, SLOT(OnValuesLabeling()));
2964 createAction( VISU_VALUES_LABELING_PARAMS, tr("VISU_VALUES_LABELING_PARAMS"), QIcon(),
2965 tr("VISU_VALUES_LABELING_PARAMS"), "", 0, aParent, false,
2966 this, SLOT(OnValuesLabelingParams()));
2968 createAction(VISU_ARCQUAD_MODE, tr("MEN_VISU_ARCQUAD_MODE"), QIcon(),
2969 tr("MEN_VISU_ARCQUAD_MODE"), "",0, aParent, true,
2970 this, SLOT(OnArcQuadMode()));
2972 createAction(VISU_LINEQUAD_MODE, tr("MEN_VISU_LINEQUAD_MODE"),QIcon(),
2973 tr("MEN_VISU_LINEQUAD_MODE"), "",0, aParent, true,
2974 this, SLOT(OnLineQuadMode()));
2982 // Add actions to menus
2984 aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
2985 createMenu( separator(), aMenuId, -1, 10 );
2987 int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
2988 createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
2989 createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
2991 aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
2992 createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
2993 createMenu( VISU_DEFORMED_SHAPE, aMenuId, 10 ); // deformed shape
2994 createMenu( VISU_VECTORS, aMenuId, 10 ); // vectors
2995 createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
2996 createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
2997 createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
2998 createMenu( VISU_CUT_SEGMENT, aMenuId, 10 ); // cut segment
2999 createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
3000 createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
3001 createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aMenuId, 10 ); // scalar map on deformed shape
3003 aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
3005 createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
3006 createMenu( VISU_POINTS, parentId, 10 ); // points
3007 createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
3008 createMenu( VISU_SURFACE, parentId, 10 ); // surface
3009 createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
3011 parentId = createMenu( tr( "MEN_2D_QUADRATIC_MODE" ), aMenuId, 10 ); // 2D quadratic mode
3012 createMenu( VISU_LINEQUAD_MODE, parentId, 10 ); // lines
3013 createMenu( VISU_ARCQUAD_MODE, parentId, 10 ); // arcs
3021 int aToolId = createTool( tr("TOOL_IMPORT") );
3022 createTool( VISU_IMPORT_FROM_FILE, aToolId );
3024 aToolId = createTool(tr("TOOL_VISUALISATION"));
3025 createTool( VISU_SCALAR_MAP, aToolId );
3026 createTool( VISU_DEFORMED_SHAPE, aToolId );
3027 createTool( VISU_VECTORS, aToolId );
3028 createTool( VISU_ISO_SURFACES, aToolId );
3029 createTool( VISU_CUT_PLANES, aToolId );
3030 createTool( VISU_CUT_LINES, aToolId );
3031 createTool( VISU_CUT_SEGMENT, aToolId );
3032 createTool( VISU_STREAM_LINES, aToolId );
3033 createTool( VISU_PLOT_3D, aToolId );
3034 createTool( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aToolId );
3036 aToolId = createTool(tr("TOOL_REPRESENTATION"));
3037 createTool( VISU_POINTS, aToolId );
3038 createTool( VISU_WIREFRAME, aToolId );
3039 createTool( VISU_SURFACE, aToolId );
3040 createTool( VISU_ERASE_ALL, aToolId );
3042 aToolId = createTool(tr("TOOL_SELECTION"));
3043 createTool( VISU_SELECTION_PANEL, aToolId );
3044 createTool( separator(), aToolId );
3045 createTool( VISU_ACTOR_SELECTION, aToolId );
3046 createTool( VISU_CELL_SELECTION, aToolId );
3047 createTool( VISU_POINT_SELECTION, aToolId );
3048 createTool( VISU_GAUSS_POINT_SELECTION, aToolId );
3050 aToolId = createTool( tr( "TOOL_NAVIGATION" ) );
3051 createTool( VISU_SLIDER_PANEL, aToolId );
3052 createTool( separator(), aToolId );
3053 createTool( VISU_SWEEP_PANEL, aToolId );
3058 ::createPopupMenus()
3060 // Prepare popup menus
3061 QtxPopupMgr* mgr = popupMgr();
3063 // VISU root commands
3064 mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED file
3065 mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
3066 mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
3068 //mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
3071 mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
3072 mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
3073 mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
3074 mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
3075 mgr->insert( action( VISU_CUT_SEGMENT ), -1, -1, -1 ); // cut segment
3076 mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
3077 mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
3078 mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
3079 mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
3080 mgr->insert( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), -1, -1, -1 ); // scalar map on deformed shape
3082 mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
3083 mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
3085 mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
3088 mgr->insert( action( VISU_EDIT_SCALARMAP ), -1, -1, -1 );
3089 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
3090 mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
3091 mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
3092 mgr->insert( action( VISU_EDIT_CUTSEGMENT ), -1, -1, -1 );
3093 mgr->insert( action( VISU_EDIT_ISOSURFACES ), -1, -1, -1 );
3094 mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
3095 mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
3096 mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
3097 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ), -1, -1, -1 );
3098 mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
3099 mgr->insert( action( VISU_EDIT_POINTMAP3D ), -1, -1, -1 );
3101 mgr->insert( action( VISU_FILTERSCALARS ), -1, -1, -1 );
3104 mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
3107 mgr->insert( action( VISU_COPY_PRS ), -1, -1, -1 );
3110 mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
3113 mgr->insert( separator(), -1, -1, -1 );
3114 mgr->insert( action( VISU_VALUES_LABELING ), -1, -1, -1 );
3115 mgr->insert( action( VISU_VALUES_LABELING_PARAMS ), -1, -1, -1 );
3116 mgr->insert( separator(), -1, -1, -1 );
3119 mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
3120 mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
3121 mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
3123 mgr->insert( separator(), -1, -1, -1 );
3125 mgr->insert( action( VISU_ERASE ), -1, -1, -1 ); // erase
3126 mgr->insert( action( VISU_DISPLAY ), -1, -1, -1 ); // display
3127 mgr->insert( action( VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
3129 mgr->insert( action( VISU_HIDE_SCALAR_BAR ), -1, -1, -1 ); // hide scalar bar
3130 mgr->insert( action( VISU_SHOW_SCALAR_BAR ), -1, -1, -1 ); // show scalar bar
3132 // "Representation" submenu
3133 int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 );
3134 mgr->insert( action( VISU_POINTS ) , parentId, -1, -1 ); // points
3135 mgr->insert( action( VISU_WIREFRAME ) , parentId, -1, -1 ); // wireframe
3136 mgr->insert( action( VISU_SURFACE ) , parentId, -1, -1 ); // surface
3137 mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
3138 mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
3139 mgr->insert( action( VISU_FEATURE_EDGES ), parentId, -1, -1 ); // feature edges
3140 mgr->insert( action( VISU_SHRINK ) , parentId, -1, -1 ); // shrink
3141 mgr->insert( action( VISU_UNSHRINK ) , parentId, -1, -1 ); // unshrink
3142 mgr->insert( separator(), parentId, -1, -1 );
3143 mgr->insert( action( VISU_SHADING ) , parentId, -1, -1 ); // shading
3144 mgr->insert( action( VISU_NOSHADING ) , parentId, -1, -1 ); // noshading
3146 //"2D Quadratic" submenu
3147 parentId = mgr->insert( tr( "MEN_2D_QUADRATIC_MODE" ), -1, -1 );
3148 mgr->insert( action( VISU_LINEQUAD_MODE ), parentId, -1, -1 ); // line representation
3149 mgr->insert( action( VISU_ARCQUAD_MODE ), parentId, -1, -1 ); // arc representation
3151 // "Properties" submenu
3152 parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
3153 mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
3154 mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
3155 mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
3156 mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
3157 mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
3158 mgr->insert( action( VISU_POINT_MARKER ), parentId, -1, -1 ); // point marker
3159 mgr->insert( action( VISU_SHRINK_FACTOR ), parentId, -1, -1 ); // shrink factor
3161 mgr->insert( separator(), -1, -1, -1 );
3163 // Other presentations management
3164 mgr->insert( action( VISU_TRANSLATE_PRS ), -1, -1, -1 );
3165 mgr->insert( action( VISU_CLIPPING ), -1, -1, -1 );
3167 mgr->insert( action( VISU_MERGE_SCALAR_BARS ), -1, -1, -1 );
3168 mgr->insert( action( VISU_FREE_SCALAR_BARS ), -1, -1, -1 );
3170 mgr->insert( action( VISU_SWEEP ), -1, -1, -1 );
3171 mgr->insert( action( VISU_PARALLELANIMATION ), -1, -1, -1 );
3172 mgr->insert( action( VISU_SUCCCESSIVEANIMATION ), -1, -1, -1 );
3174 mgr->insert( separator(), -1, -1, -1 );
3176 mgr->insert( action( VISU_POINT_EVOLUTION ), -1, -1, -1 );
3178 mgr->insert( separator(), -1, -1, -1 );
3180 // view parameters commands
3181 mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
3182 mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
3183 mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
3184 //mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
3186 mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
3188 mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
3190 mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
3191 mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
3192 mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
3193 mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
3195 mgr->insert( action( VISU_FILE_INFO ), -1, -1, -1 );
3196 mgr->insert( action( VISU_EXPORT_MED ), -1, -1, -1 );
3200 QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3201 "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
3202 "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
3203 QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3204 "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
3205 "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
3207 // VISU root commands
3208 QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
3209 mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule );
3210 mgr->setRule( action( VISU_IMPORT_TABLE ), aRule );
3211 mgr->setRule( action( VISU_PLOT2D ), aRule );
3213 // timestamp commands
3214 aRule = "client='ObjectBrowser' and selcount=1 and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'}";
3215 mgr->setRule( action( VISU_SCALAR_MAP ), aRule );
3216 mgr->setRule( action( VISU_ISO_SURFACES ), aRule );
3217 mgr->setRule( action( VISU_CUT_PLANES ), aRule );
3218 mgr->setRule( action( VISU_CUT_LINES ), aRule );
3219 mgr->setRule( action( VISU_CUT_SEGMENT ), aRule );
3220 mgr->setRule( action( VISU_PLOT_3D ), aRule );
3221 aRule += " and nbComponents>1";
3222 mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule );
3223 mgr->setRule( action( VISU_VECTORS ), aRule );
3224 mgr->setRule( action( VISU_STREAM_LINES ), aRule );
3225 mgr->setRule( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), aRule );
3227 // display/erase commands
3228 QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
3229 QString aTableOrContHide = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreVisibleCurves)";
3230 QString aTableOrContShow = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreHiddenCurves)";
3231 QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
3232 QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
3233 QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
3234 QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
3235 QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
3237 QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsVisible +
3238 " or ( (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
3240 QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsInvisible +
3241 " or ( (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
3243 QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
3244 " or ( ((type='VISU::TTABLE' and nbChildren>0) or (type='VISU::TCONTAINER' and hasCurves) or"
3245 " (type='VISU::TCURVE')))) ) or" + aComponent;
3247 QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and (isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and isScalarBarVisible )";
3248 QString aScalarBarShowRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and ( isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and (not isScalarBarVisible) )";
3250 mgr->setRule( action( VISU_ERASE ), anEraseRule );
3251 mgr->setRule( action( VISU_DISPLAY ), aDisplayRule );
3252 mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule );
3254 mgr->setRule( action( VISU_HIDE_SCALAR_BAR ), aScalarBarHideRule );
3255 mgr->setRule( action( VISU_SHOW_SCALAR_BAR ), aScalarBarShowRule );
3257 aRule = "selcount>0 and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}";
3258 mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule );
3260 aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
3261 mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule );
3262 mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule );
3264 aRule = "selcount=1 and $type in { " + aSimplePrsAll + "}";
3265 mgr->setRule( action( VISU_FILTERSCALARS ), aRule );
3269 aRule = "hasActor=1 and selcount=1 and $type in { 'VISU::TGAUSSPOINTS'" + aPrsAll + " }";
3270 mgr->setRule( action( VISU_VALUES_LABELING ), aRule, QtxPopupMgr::VisibleRule );
3271 mgr->setRule( action( VISU_VALUES_LABELING ), "{true} in $isValuesLabeled", QtxPopupMgr::ToggleRule );
3272 mgr->setRule( action( VISU_VALUES_LABELING_PARAMS ), aRule, QtxPopupMgr::VisibleRule );
3275 aRule = "isVisible and hasActor=1 and selcount=1 and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3276 mgr->setRule (action(VISU_ARCQUAD_MODE), aRule , QtxPopupMgr::VisibleRule);
3277 mgr->setRule (action(VISU_LINEQUAD_MODE),aRule , QtxPopupMgr::VisibleRule);
3279 mgr->setRule (action(VISU_ARCQUAD_MODE), aRule + " and quadratic2DMode='VISU::ARCS'", QtxPopupMgr::ToggleRule);
3280 mgr->setRule (action(VISU_LINEQUAD_MODE),aRule + " and quadratic2DMode='VISU::LINES'", QtxPopupMgr::ToggleRule);
3284 aRule = "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'";
3285 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule );
3286 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0 and activeView='VTKViewer'" );
3287 mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'" );
3288 //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
3290 mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'SVTK'} and selcount=0" );
3292 // 3D presentations commands
3293 QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TGAUSSPOINTS' " + aPrsAll + "}";
3294 QString aPrsType2 = " and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
3295 QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3296 //QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3297 QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCUTPLANES' 'VISU::TISOSURFACES' 'VISU::TPLOT3D' }";
3298 //QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
3299 QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3300 " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3301 QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3302 QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
3303 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3305 QString aFeatureEdgesType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
3307 aRule = "selcount=1";
3308 mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
3309 aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
3311 // "Representation" submenu
3312 QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3313 QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3314 QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3315 QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3316 QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::FEATURE_EDGES'}";
3317 QString aNotFeatureEdges = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
3319 mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints );
3320 mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType2 + aNotWirefr );
3321 mgr->setRule( action( VISU_SURFACE ) , aRule + aSurfType + aNotSurfac );
3322 mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + anInsideType + aNotInside );
3323 mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr );
3324 mgr->setRule( action( VISU_FEATURE_EDGES ), aRule + aFeatureEdgesType + aNotFeatureEdges );
3326 mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0" );
3327 mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1" );
3329 mgr->setRule( action( VISU_SHADING ) , aRule + " and isScalarMapAct=1 and isShading=0" );
3330 mgr->setRule( action( VISU_NOSHADING ), aRule + " and isScalarMapAct=1 and isShading=1" );
3332 // "Properties" submenu
3333 mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'" );
3334 mgr->setRule( action( VISU_EDGE_COLOR ), aRule + aSurfFrameType + " and representation='VISU::SURFACEFRAME'" );
3335 mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
3336 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
3337 "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))" );
3338 mgr->setRule( action( VISU_OPACITY ), aRule + " and hasActor=1" );
3339 mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1" );
3340 mgr->setRule( action( VISU_POINT_MARKER ), aRule + aLineType + " and hasActor=1 and representation='VISU::POINT'" );
3341 mgr->setRule( action( VISU_SHRINK_FACTOR ), aRule + aShrinkType + " and isShrunk=1" );
3344 QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::POINTMAP3D'";
3346 aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TPOINTMAP3D' " + aCurveAll + " " + aPrsAll + "})";
3347 mgr->setRule( action( VISU_RENAME ), aRule );
3349 // copy presentation command
3350 aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
3351 mgr->setRule( action( VISU_COPY_PRS ), aRule );
3354 aRule = "selcount=1 and type='VISU::TCURVE'";
3355 mgr->setRule( action( VISU_CURVE_PROPS ), aRule );
3358 aRule = "selcount=1 and ( type='VISU::TPOINTMAP3D' or type='VISU::TTABLE')";
3359 mgr->setRule( action( VISU_SHOW_TABLE ), aRule );
3360 mgr->setRule( action( VISU_CREATE_CURVES ), aRule );
3361 mgr->setRule( action( VISU_EXPORT_TABLE ), aRule );
3363 // curve container commands
3364 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
3365 mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule );
3366 mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule );
3368 mgr->setRule( action( VISU_EDIT_SCALARMAP ),
3369 "selcount=1 and type='VISU::TSCALARMAP'" );
3370 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
3371 "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
3372 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
3373 "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
3374 mgr->setRule( action( VISU_EDIT_CUTPLANES ),
3375 "selcount=1 and type='VISU::TCUTPLANES'" );
3376 mgr->setRule( action( VISU_EDIT_CUTLINES ),
3377 "selcount=1 and type='VISU::TCUTLINES'" );
3378 mgr->setRule( action( VISU_EDIT_CUTSEGMENT ),
3379 "selcount=1 and type='VISU::TCUTSEGMENT'" );
3380 mgr->setRule( action( VISU_EDIT_ISOSURFACES ),
3381 "selcount=1 and type='VISU::TISOSURFACES'" );
3382 mgr->setRule( action( VISU_EDIT_VECTORS ),
3383 "selcount=1 and type='VISU::TVECTORS'" );
3384 mgr->setRule( action( VISU_EDIT_STREAMLINES ),
3385 "selcount=1 and type='VISU::TSTREAMLINES'" );
3386 mgr->setRule( action( VISU_EDIT_PLOT3D ),
3387 "selcount=1 and type='VISU::TPLOT3D'" );
3388 mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
3389 "selcount=1 and type='VISU::TPOINTMAP3D'" );
3391 aRule = "selcount=1 and $type in {'VISU::TCUTLINES' 'VISU::TCUTSEGMENT'} and nbNamedChildren=0";
3392 mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
3394 aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "}) and isFieldPrs=0";
3395 mgr->setRule( action( VISU_SWEEP ), aRule );
3397 aRule = "client='ObjectBrowser' and selcount>0";
3398 aRule += " and $type in {'VISU::TFIELD'}";
3399 aRule += " and nbTimeStamps>1";
3400 aRule += " and activeView in {'VTKViewer' 'SVTK'}";
3401 mgr->setRule( action( VISU_PARALLELANIMATION ), aRule );
3403 aRule = "client='ObjectBrowser'";
3404 aRule += " and (selcount=1 and nbTimeStamps>1 or selcount>1 and nbTimeStamps>0)";
3405 aRule += " and $type in {'VISU::TFIELD'}";
3406 aRule += " and activeView in {'VTKViewer' 'SVTK'}";
3407 mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule );
3409 aRule = "client='ObjectBrowser' and selcount>0";
3410 aRule += " and $type in {'VISU::TFIELD'}";
3411 aRule += " and medEntity='NODE_ENTITY'";
3412 aRule += " and nbTimeStamps>1";
3413 mgr->setRule( action( VISU_POINT_EVOLUTION ), aRule );
3415 aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
3416 mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1" );
3417 mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1" );
3418 mgr->setRule( action( VISU_EDIT_PLOT3D ),
3419 "selcount=1 and type='VISU::TPLOT3D'" );
3421 //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
3422 //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
3424 aRule = "client='ObjectBrowser' and selcount>=1 and $type in {'VISU::TPART'} and ";
3426 QString aCustomRule = aRule + "fullResolution=1 and resolutionState!='F'";
3427 mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aCustomRule );
3430 QString aCustomRule = aRule + "mediumResolution=1 and resolutionState!='M'";
3431 mgr->setRule( action( VISU_MULTIPR_MED_RES ), aCustomRule );
3434 QString aCustomRule = aRule + "lowResolution=1 and resolutionState!='L'";
3435 mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aCustomRule );
3438 QString aCustomRule = aRule + "resolutionState!='H'";
3439 mgr->setRule( action( VISU_MULTIPR_HIDE), aCustomRule );
3442 mgr->setRule( action( VISU_FILE_INFO ), "selcount=1 and type in {'VISU::TRESULT'}" );
3443 mgr->setRule( action( VISU_EXPORT_MED ), "selcount=1 and type in {'VISU::TRESULT'}" );
3446 void VisuGUI::createPanels()
3448 myPanels[SelectionPanelId] = new VisuGUI_SelectionPanel( this );
3449 myPanels[FeatureEdgesPanelId] = new VisuGUI_FeatureEdgesPanel( this );
3450 myPanels[ClippingPlanesPanelId] = new VisuGUI_ClippingPanel( this );
3452 VisuGUI_Panel* aPanel;
3453 foreach( aPanel, myPanels ) {
3454 getApp()->desktop()->addDockWidget( Qt::RightDockWidgetArea, aPanel );
3455 aPanel->setVisible( false );
3459 //***************************************************************************
3460 void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle )
3462 SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
3464 //TODO: object Browser DONE
3465 SUIT_DataBrowser* ob = getApp()->objectBrowser();
3466 bool isOBClient = (ob && theClient == ob->popupClientType());
3468 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
3469 SALOME_ListIO aListIO;
3470 aSelectionMgr->selectedObjects(aListIO);
3472 if (aListIO.Extent() < 1) return;
3474 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
3476 // Check if "Merge Scalar Range" can be applied
3478 SALOME_ListIteratorOfListIO It (aListIO);
3479 for (; It.More(); It.Next()) {
3480 Handle(SALOME_InteractiveObject)& anIO = It.Value();
3482 if (!anIO.IsNull() && anIO->hasEntry()) {
3483 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
3487 if ( !isOBClient ) {
3488 QString aName = QString( aSObject->GetName().c_str() );
3489 while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
3490 aName.remove( (aName.length() - 1), 1 );
3494 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
3495 if (CORBA::is_nil(aCORBAObject)) {
3496 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
3497 if (aType == VISU::TTIMESTAMP) {
3498 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
3500 for (; anIter->More(); anIter->Next()) {
3501 aPrs = anIter->Value();
3504 std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
3505 nbPrs += aSubList.size();
3512 theMenu->addSeparator();
3513 theMenu->addAction( action( VISU_MERGE_SCALAR_BARS ) );
3514 theMenu->addAction( action( VISU_FREE_SCALAR_BARS ) );
3517 // Check if some curves selected (for bug PAL10611)
3518 bool isCurves = false;
3519 bool isOneCutPlane = false;
3520 SALOME_ListIteratorOfListIO It1 (aListIO);
3521 for (; It1.More() && !isCurves; It1.Next()) {
3522 Handle(SALOME_InteractiveObject)& anIO = It1.Value();
3523 if (!anIO.IsNull() && anIO->hasEntry()) {
3524 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
3527 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
3528 if (aType == VISU::TCURVE) {
3531 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
3532 if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
3533 if (aPrsObject->GetType() == VISU::TCUTPLANES) {
3534 if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
3535 isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
3543 theMenu->addAction( action( VISU_PLOT3D_FROM_CUTPLANE ) );
3545 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
3546 if(aSelectionInfo.empty())
3549 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
3550 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
3551 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
3552 Storable::TRestoringMap aMap = Storable::GetStorableMap(aSObject);
3553 CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
3555 if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
3556 if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE)
3557 theMenu->addAction( action( VISU_MANAGE_CACHE ) );
3560 theMenu->addSeparator();
3562 // Check if some (nb > 0) removable objects selected
3563 if (isOBClient && IsRemovableSelected(this)) {
3564 theMenu->addAction( action( VISU_DELETE_OBJS ) );
3567 theMenu->removeAction( action( myDisplay ) );
3568 theMenu->removeAction( action( myErase ) );
3569 theMenu->removeAction( action( myDisplayOnly ) );
3570 theMenu->removeAction( action( myEraseAll ) );
3573 // Check single selection
3574 if (aListIO.Extent() != 1)
3577 // Check if the object's data is loaded
3578 _PTR(SComponent) aSComp = aSObject->GetFatherComponent();
3579 std::string aCompIOR;
3580 if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
3581 //std::string aCompDataType = aSComp->ComponentDataType();
3582 theMenu->addAction( action( VISU_LOAD_COMPONENT_DATA ) ); // "Load Component Data"
3585 VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aMap );
3586 if (aType == VISU::TANIMATION) {
3587 theMenu->addAction( action( VISU_SHOW_ANIMATION ) );
3588 } else if (aType == VISU::TEVOLUTION) {
3589 theMenu->addAction( action( VISU_SHOW_EVOLUTION ) );
3590 } else if (isOBClient) {
3591 if (IsSObjectTable(aSObject)) {
3592 /* action( VISU_SHOW_TABLE )->addTo(theMenu);
3593 theMenu->addAction( action( VISU_CREATE_CURVES ) );
3594 theMenu->addAction( action( VISU_EXPORT_TABLE ) );
3595 theMenu->addSeparator();
3596 action( VISU_DELETE_OBJS )->addTo(theMenu);*/// dmv - code was moved up
3598 if (!CORBA::is_nil(anObject)) {
3599 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
3600 if (!CORBA::is_nil(aMED.in())) {
3601 theMenu->addAction( action( VISU_IMPORT_MED_STRUCTURE ) ); // "Import Structure"
3604 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
3605 if (!CORBA::is_nil(aField)) {
3606 theMenu->addAction( action( VISU_IMPORT_MED_TIMESTAMP ) ); // "Import TimeStamp"
3609 _PTR(SObject) aSFather1 = aSObject->GetFather();
3611 std::string aValue = aSFather1->GetName();
3612 if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
3613 theMenu->addAction( action( VISU_IMPORT_MED_FIELD ) ); // "Import Field"
3622 //***************************************************************************
3625 ::windows( QMap<int, int>& theMap ) const
3628 theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
3629 theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
3635 ::viewManagers( QStringList& theList ) const
3638 // append SVTK viewer only if there is no opened VVTK
3639 // SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
3640 // if( vm && vm->getViewsCount()>0 )
3641 // theList.append( VVTK_Viewer::Type() );
3643 theList.append( SVTK_Viewer::Type() );
3651 CORBA::String_var anIOR = GetVisuGen(this)->GetID();
3652 return QString(anIOR.in());
3658 ::activateModule( SUIT_Study* theStudy )
3660 bool aResult = SalomeApp_Module::activateModule( theStudy );
3663 setMenuShown( true );
3664 setToolShown( true );
3666 // import Python module that manages VISU plugins (need to be here because SalomePyQt API uses active module)
3667 PyGILState_STATE gstate = PyGILState_Ensure();
3668 PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
3669 if(pluginsmanager==NULL)
3673 PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_PLUGINS_OTHER").toStdString().c_str());
3678 PyGILState_Release(gstate);
3679 // end of GEOM plugins loading
3681 // Reset actions accelerator keys
3682 QList<QKeySequence> shortcuts;
3683 shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );
3684 action(VISU_IMPORT_FROM_FILE)->setShortcuts(shortcuts);
3686 action(VISU_DELETE_OBJS)->setEnabled(true); // Delete: Key_Delete
3687 action(VISU_RENAME )->setEnabled(true); // Rename: Key_F2
3689 ((VisuGUI_ClippingPanel*) myPanels[ClippingPlanesPanelId])->init();
3691 emit moduleActivated();
3699 ::deactivateModule( SUIT_Study* theStudy )
3701 setMenuShown( false );
3702 setToolShown( false );
3704 // Unset actions accelerator keys
3705 action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); // Import: CTRL + Key_I
3707 action(VISU_DELETE_OBJS)->setEnabled(false); // Delete: Key_Delete
3708 action(VISU_RENAME )->setEnabled(false); // Rename: Key_F2
3710 bool aResult = SalomeApp_Module::deactivateModule( theStudy );
3712 emit moduleDeactivated();
3719 ::createSelection() const
3721 return new VisuGUI_Selection( (SalomeApp_Module*)this );
3724 //******************************************************************
3725 void VisuGUI::studyActivated()
3727 GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
3736 return new VisuGUI();
3741 void VisuGUI::createPreferences()
3743 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
3746 int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) );
3747 // Quantities with individual precision settings
3748 int precGroup = addPreference( tr( "VISU_PREF_GROUP_PRECISION" ), genTab );
3749 setPreferenceProperty( precGroup, "columns", 2 );
3751 // Default precision used by some input fieklds and data visualization code
3752 // Moved here from "Representation" tab to have all precisions in the same place
3753 int point_precision = addPreference( tr( "VISU_PREF_visual_data_precision" ), precGroup,
3754 LightApp_Preferences::IntSpin, "VISU", "visual_data_precision" );
3755 setPreferenceProperty( point_precision, "min", -16 );
3756 setPreferenceProperty( point_precision, "max", 16 );
3757 setPreferenceProperty( point_precision, "step", 1 );
3759 const int nbQuantities = 5;
3760 int precs[nbQuantities], ii = 0;
3761 precs[ii++] = addPreference( tr( "VISU_PREF_length_precision" ), precGroup,
3762 LightApp_Preferences::IntSpin, "VISU", "length_precision" );
3763 precs[ii++] = addPreference( tr( "VISU_PREF_angle_precision" ), precGroup,
3764 LightApp_Preferences::IntSpin, "VISU", "angle_precision" );
3765 precs[ii++] = addPreference( tr( "VISU_PREF_len_tol_precision" ), precGroup,
3766 LightApp_Preferences::IntSpin, "VISU", "len_tol_precision" );
3767 precs[ii++] = addPreference( tr( "VISU_PREF_parametric_precision" ), precGroup,
3768 LightApp_Preferences::IntSpin, "VISU", "parametric_precision" );
3769 precs[ii ] = addPreference( tr( "VISU_PREF_memory_precision" ), precGroup,
3770 LightApp_Preferences::IntSpin, "VISU", "memory_precision" );
3772 // Set property for precision value for spinboxes
3773 for ( ii = 0; ii < nbQuantities; ii++ ){
3774 setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -14 );
3775 setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 14 );
3776 setPreferenceProperty( precs[ii], "precision", 2 );
3780 // TAB: "MED import"
3781 int importTab = addPreference( tr( "MED import" ) );
3782 //printf( "++++++++++++++++++ Tab index %d\n", importTab );
3784 //int importFrame = addPreference( tr( "MED FRAME" ), importTab );
3785 //printf( "Frame index %d\n", importFrame );
3787 // group: "MED files import"
3788 int importGr = addPreference( tr( "MED files import" ), importTab );
3789 //printf( "Group index %d\n", importGr );
3790 setPreferenceProperty( importGr, "columns", 2 );
3792 addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" );
3793 addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
3794 addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
3795 addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
3796 addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" );
3797 addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" );
3798 addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" );
3800 // TAB: "Scalar Bar"
3801 int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
3803 int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), sbarTab );
3804 setPreferenceProperty( rangeGr, "columns", 2 );
3806 int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" );
3808 modes.append( tr( "VISU_MODULUS" ) );
3809 modes.append( tr( "VISU_COMPONENT" ) + tr("1") );
3810 modes.append( tr( "VISU_COMPONENT" ) + tr("2") );
3811 modes.append( tr( "VISU_COMPONENT" ) + tr("3") );
3812 QList<QVariant> indices;
3813 indices.append( 0 );
3814 indices.append( 1 );
3815 indices.append( 2 );
3816 indices.append( 3 );
3817 setPreferenceProperty( mode, "strings", modes );
3818 setPreferenceProperty( mode, "indexes", indices );
3820 addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
3822 int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" );
3824 types.append( tr( "VISU_FIELD_RANGE" ) );
3825 types.append( tr( "VISU_IMPOSED_RANGE" ) );
3827 indices.append( 0 );
3828 indices.append( 1 );
3829 setPreferenceProperty( rangetype, "strings", types );
3830 setPreferenceProperty( rangetype, "indexes", indices );
3832 int gaussMetric = addPreference( tr( "VISU_GAUSS_METRIC" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_gauss_metric" );
3833 QStringList metrics;
3834 metrics.append( tr( "VISU_GAUSS_METRIC_AVERAGE" ) );
3835 metrics.append( tr( "VISU_GAUSS_METRIC_MINIMUM" ) );
3836 metrics.append( tr( "VISU_GAUSS_METRIC_MAXIMUM" ) );
3838 indices.append( 0 );
3839 indices.append( 1 );
3840 indices.append( 2 );
3841 setPreferenceProperty( gaussMetric, "strings", metrics );
3842 setPreferenceProperty( gaussMetric, "indexes", indices );
3844 int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
3845 setPreferenceProperty( imposedGr, "columns", 4 );
3847 int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_min" );
3848 int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_max" );
3849 setPreferenceProperty( min, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
3850 setPreferenceProperty( max, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
3853 int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
3854 setPreferenceProperty( fontGr, "columns", 2 );
3856 addVtkFontPref( tr( "VISU_TITLE" ), fontGr, "scalar_bar_title_font", false );
3857 addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
3859 addVtkFontPref( tr( "VISU_LABELS" ), fontGr, "scalar_bar_label_font", false );
3860 addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
3862 // group: "Colors & Labels"
3863 int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
3864 setPreferenceProperty( colorsLabelsGr, "columns", 4 );
3866 int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr,
3867 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
3868 setPreferenceProperty( numcol, "min", 2 );
3869 setPreferenceProperty( numcol, "max", 256 );
3871 addPreference( tr( "VISU_IS_UNITS" ), colorsLabelsGr,
3872 LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
3874 int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
3875 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
3876 setPreferenceProperty( numlab, "min", 2 );
3877 setPreferenceProperty( numlab, "max", 65 );
3879 int lPrec = addPreference( tr( "PRECISION" ), colorsLabelsGr,
3880 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_label_precision" );
3882 setPreferenceProperty( lPrec, "min", 1 );
3883 setPreferenceProperty( lPrec, "max", 100 );
3885 int frame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
3886 //setPreferenceProperty( frame, "orientation", "vertical" );
3887 setPreferenceProperty( frame, "columns", "2" );
3889 // group: "Orientation"
3890 int orientGr = addPreference( tr( "VISU_ORIENTATION" ), frame, LightApp_Preferences::GroupBox );
3891 setPreferenceProperty( orientGr, "columns", 2 );
3892 int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr,
3893 LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
3894 QStringList orients;
3895 orients.append( tr( "VISU_VERTICAL" ) );
3896 orients.append( tr( "VISU_HORIZONTAL" ) );
3898 indices.append( 0 );
3899 indices.append( 1 );
3900 setPreferenceProperty( orient, "strings", orients );
3901 setPreferenceProperty( orient, "indexes", indices );
3903 // group: "Scalar bars default position"
3904 int scalarBarGr = addPreference( tr( "Scalar bars default position" ), frame, LightApp_Preferences::GroupBox );
3905 addPreference( tr( "Arrange Scalar Bars" ), scalarBarGr, LightApp_Preferences::Bool, "VISU", "scalar_bars_default_position" );
3908 // group: "Origin & Size Vertical"
3909 //int psSzFrame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
3910 //setPreferenceProperty( psSzFrame, "orientation", "horizontal" );
3911 //setPreferenceProperty( psSzFrame, "columns", "2" );
3913 int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ),
3914 frame, LightApp_Preferences::GroupBox );
3915 setPreferenceProperty( posVSizeGr, "columns", 2 );
3916 int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
3917 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
3918 int yv = addPreference( tr( "VISU_Y" ), posVSizeGr,
3919 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
3921 int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr,
3922 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
3923 int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr,
3924 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
3926 int twv = addPreference( tr( "VISU_TITLE_SIZE" ), posVSizeGr,
3927 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_size" );
3929 int lwv = addPreference( tr( "VISU_LABEL_SIZE" ), posVSizeGr,
3930 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_size" );
3932 int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
3933 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
3934 int bhv = addPreference( tr( "VISU_BAR_HEIGHT" ), posVSizeGr,
3935 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_height" );
3937 setPreferenceProperty( xv, "step", 0.1 );
3938 setPreferenceProperty( yv, "step", 0.1 );
3939 setPreferenceProperty( wv, "step", 0.1 );
3940 setPreferenceProperty( hv, "step", 0.1 );
3941 setPreferenceProperty( xv, "min", 0.0 );
3942 setPreferenceProperty( yv, "min", 0.0 );
3943 setPreferenceProperty( wv, "min", 0.0 );
3944 setPreferenceProperty( hv, "min", 0.0 );
3945 setPreferenceProperty( twv, "min", 0 );
3946 setPreferenceProperty( twv, "special", "auto" );
3947 setPreferenceProperty( lwv, "min", 0 );
3948 setPreferenceProperty( lwv, "special", "auto" );
3949 setPreferenceProperty( bwv, "min", 0 );
3950 setPreferenceProperty( bwv, "special", "auto" );
3951 setPreferenceProperty( bhv, "min", 0 );
3952 setPreferenceProperty( bhv, "special", "auto" );
3953 setPreferenceProperty( xv, "max", 1.0 );
3954 setPreferenceProperty( yv, "max", 1.0 );
3955 setPreferenceProperty( wv, "max", 1.0 );
3956 setPreferenceProperty( hv, "max", 1.0 );
3957 setPreferenceProperty( twv, "max", 100 );
3958 setPreferenceProperty( lwv, "max", 100 );
3959 setPreferenceProperty( bwv, "max", 100 );
3960 setPreferenceProperty( bhv, "max", 100 );
3962 // group: "Origin & Size Horizontal"
3963 int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ),
3964 frame, LightApp_Preferences::GroupBox );
3965 setPreferenceProperty( posHSizeGr, "columns", 2 );
3967 int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
3968 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
3969 int yh = addPreference( tr( "VISU_Y" ), posHSizeGr,
3970 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
3972 int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr,
3973 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
3974 int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr,
3975 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
3977 int twh = addPreference( tr( "VISU_TITLE_SIZE" ), posHSizeGr,
3978 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_size" );
3980 int lwh = addPreference( tr( "VISU_LABEL_SIZE" ), posHSizeGr,
3981 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_size" );
3983 int bwh = addPreference( tr( "VISU_BAR_WIDTH" ), posHSizeGr,
3984 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
3985 int bhh = addPreference( tr( "VISU_BAR_HEIGHT" ), posHSizeGr,
3986 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_height" );
3988 setPreferenceProperty( xh, "step", 0.1 );
3989 setPreferenceProperty( yh, "step", 0.1 );
3990 setPreferenceProperty( wh, "step", 0.1 );
3991 setPreferenceProperty( hh, "step", 0.1 );
3992 setPreferenceProperty( xh, "min", 0.0 );
3993 setPreferenceProperty( yh, "min", 0.0 );
3994 setPreferenceProperty( wh, "min", 0.0 );
3995 setPreferenceProperty( hh, "min", 0.0 );
3996 setPreferenceProperty( twh, "min", 0 );
3997 setPreferenceProperty( twh, "special", "auto" );
3998 setPreferenceProperty( lwh, "min", 0 );
3999 setPreferenceProperty( lwh, "special", "auto" );
4000 setPreferenceProperty( bwh, "min", 0 );
4001 setPreferenceProperty( bwh, "special", "auto" );
4002 setPreferenceProperty( bhh, "min", 0 );
4003 setPreferenceProperty( bhh, "special", "auto" );
4004 setPreferenceProperty( xh, "max", 1.0 );
4005 setPreferenceProperty( yh, "max", 1.0 );
4006 setPreferenceProperty( wh, "max", 1.0 );
4007 setPreferenceProperty( hh, "max", 1.0 );
4008 setPreferenceProperty( twh, "max", 100 );
4009 setPreferenceProperty( lwh, "max", 100 );
4010 setPreferenceProperty( bwh, "max", 100 );
4011 setPreferenceProperty( bhh, "max", 100 );
4014 int cutLineTab = addPreference( tr( "VISU_CUT_LINES_SEGMENT" ) );
4016 // group: "CutLines preferences"
4017 int cutLineGr = addPreference( tr( "VISU_CUT_LINES_SEGMENT_PREF" ), cutLineTab );
4018 setPreferenceProperty( cutLineGr, "columns", 1 );
4019 addPreference( tr( "Show preview" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "show_preview" );
4020 addPreference( tr( "Invert all curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "invert_all_curves" );
4021 addPreference( tr( "Use absolute length" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "use_absolute_length" );
4022 addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
4023 addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
4025 // TAB: "StreamLines"
4026 int streamLinesTab = addPreference( tr( "VISU_STREAM_LINES" ) );
4028 // group: "StreamLines preferences"
4029 int streamLinesGr = addPreference( tr( "VISU_STREAM_LINES_PREF" ), streamLinesTab );
4030 setPreferenceProperty( cutLineGr, "columns", 1 );
4031 int usedPoints = addPreference( tr( "VISU_STREAM_LINES_USED_POINTS" ), streamLinesGr,
4032 LightApp_Preferences::DblSpin, "VISU", "stream_lines_used_points" );
4033 setPreferenceProperty( usedPoints, "min", 0 );
4034 setPreferenceProperty( usedPoints, "max", 1 );
4035 setPreferenceProperty( usedPoints, "step", 0.1 );
4037 // TAB: "Sweep, Animation, 3D Cache"
4038 int animationTab = addPreference( tr( "Sweep, Animation" ) );
4040 // group: "3D Cache System prefereces"
4042 int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
4043 setPreferenceProperty( cacheGroup, "columns", 2 );
4045 int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
4046 LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
4049 modes.append( tr( "VISU_MINIMAL" ) );
4050 modes.append( tr( "VISU_LIMITED" ) );
4051 setPreferenceProperty( memory_mode, "strings", modes );
4054 indices.append( 0 );
4055 indices.append( 1 );
4056 setPreferenceProperty( memory_mode, "indexes", indices );
4058 int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
4059 LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
4060 setPreferenceProperty( memory_limit, "min", 1 );
4061 setPreferenceProperty( memory_limit, "max", 5000 );
4062 setPreferenceProperty( memory_limit, "step", 10 );
4065 // group: "Animation preferences"
4067 int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
4068 setPreferenceProperty( animationGroup, "columns", 1 );
4070 int speed = addPreference( tr( "Speed" ), animationGroup,
4071 LightApp_Preferences::IntSpin, "VISU", "speed" );
4072 addPreference( tr( "Cycled animation" ), animationGroup,
4073 LightApp_Preferences::Bool, "VISU", "cycled_animation" );
4074 addPreference( tr( "Use proportional timing" ), animationGroup,
4075 LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
4076 addPreference( tr( "Clean memory at each frame" ), animationGroup,
4077 LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
4079 setPreferenceProperty( speed, "min", 1 );
4080 setPreferenceProperty( speed, "max", 99 );
4082 int dump_mode = addPreference( tr( "VISU_DUMP_MODE" ), animationGroup,
4083 LightApp_Preferences::Selector, "VISU", "dump_mode" );
4086 modes.append( tr( "VISU_NO_DUMP" ) );
4087 modes.append( tr( "VISU_DUMP_PICTURES" ) );
4088 modes.append( tr( "VISU_DUMP_VIDEO" ) );
4089 setPreferenceProperty( dump_mode, "strings", modes );
4092 indices.append( 0 );
4093 indices.append( 1 );
4094 indices.append( 2 );
4095 setPreferenceProperty( dump_mode, "indexes", indices );
4097 int time_stamp_frequency = addPreference( tr( "VISU_TIME_STAMP_FREQUENCY" ), animationGroup,
4098 LightApp_Preferences::IntSpin, "VISU", "time_stamp_frequency" );
4099 setPreferenceProperty( time_stamp_frequency, "min", 1 );
4100 setPreferenceProperty( time_stamp_frequency, "max", 100 );
4103 // group: "Sweeping preferences"
4105 int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
4106 setPreferenceProperty( sweepGroup, "columns", 2 );
4108 int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup,
4109 LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
4110 QStringList sweep_modes;
4111 sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
4112 sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
4113 sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
4115 indices.append( 0 );
4116 indices.append( 1 );
4117 indices.append( 2 );
4118 setPreferenceProperty( modeSw, "strings", sweep_modes );
4119 setPreferenceProperty( modeSw, "indexes", indices );
4121 int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
4122 LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
4123 /* int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
4124 LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );*/
4125 int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGroup,
4126 LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
4127 int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
4129 ranges.append( tr( "PERIOD_PI" ) );
4130 ranges.append( tr( "PERIOD_2PI" ) );
4132 indices.append( 0 );
4133 indices.append( 1 );
4134 setPreferenceProperty( rangeSw, "strings", ranges );
4135 setPreferenceProperty( rangeSw, "indexes", indices );
4137 setPreferenceProperty( timestep, "min", 0.1 );
4138 setPreferenceProperty( timestep, "step", 0.1 );
4139 setPreferenceProperty( timestep, "max", 1000 );
4140 // setPreferenceProperty( nbcycles, "max", 100 );
4141 setPreferenceProperty( nbsteps, "max", 200 );
4145 // TAB: Representation ; group: "Representation properties"
4146 int representationTab = addPreference( tr( "Representation" ) );
4148 int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab );
4149 setPreferenceProperty( representGr, "columns", 2 );
4151 QStringList mesh_modes;
4152 mesh_modes.append( "Points" );
4153 mesh_modes.append( "Wireframe" );
4154 mesh_modes.append( "Insideframe" );
4155 mesh_modes.append( "Surfaceframe" );
4156 mesh_modes.append( "Surface" );
4157 mesh_modes.append( "Feature edges" );
4158 QList<QVariant> mesh_indices;
4159 mesh_indices.append( 0 );
4160 mesh_indices.append( 1 );
4161 mesh_indices.append( 3 );
4162 mesh_indices.append( 4 );
4163 mesh_indices.append( 2 );
4164 mesh_indices.append( 5 );
4166 QStringList modes0 = mesh_modes;
4167 modes0.removeAll( "Feature edges" );
4168 QList<QVariant> indices0 = mesh_indices;
4169 indices0.removeAll( 5 );
4171 QStringList modes1 = modes0;
4172 modes1.removeAll( "Insideframe" );
4173 QList<QVariant> indices1 = indices0;
4174 indices1.removeAll( 3 );
4176 QStringList modes2 = modes1;
4177 modes2.removeAll( "Surfaceframe" );
4178 QList<QVariant> indices2 = indices1;
4179 indices2.removeAll( 4 );
4181 QStringList modes3 = modes2;
4182 modes3.removeAll( "Surface" );
4183 QList<QVariant> indices3 = indices2;
4184 indices3.removeAll( 2 );
4187 int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" );
4188 setPreferenceProperty( mesh_represent, "strings", mesh_modes );
4189 setPreferenceProperty( mesh_represent, "indexes", mesh_indices );
4190 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "mesh_shrink" );
4192 int scalar_map_represent = addPreference( tr( "VISU_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_map_represent" );
4193 setPreferenceProperty( scalar_map_represent, "strings", modes0 );
4194 setPreferenceProperty( scalar_map_represent, "indexes", indices0 );
4195 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" );
4197 int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" );
4198 setPreferenceProperty( iso_surfaces_represent, "strings", modes1 );
4199 setPreferenceProperty( iso_surfaces_represent, "indexes", indices1 );
4200 int sp = addPreference( "", representGr, LightApp_Preferences::Space );
4201 setPreferenceProperty( sp, "hstretch", 0 );
4202 setPreferenceProperty( sp, "vstretch", 0 );
4204 int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" );
4205 setPreferenceProperty( cut_planes_represent, "strings", modes1 );
4206 setPreferenceProperty( cut_planes_represent, "indexes", indices1 );
4207 addPreference( "", representGr, LightApp_Preferences::Space );
4209 int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" );
4210 setPreferenceProperty( cut_lines_represent, "strings", modes3 );
4211 setPreferenceProperty( cut_lines_represent, "indexes", indices3 );
4212 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4213 setPreferenceProperty( sp, "hstretch", 0 );
4214 setPreferenceProperty( sp, "vstretch", 0 );
4216 int cut_segment_represent = addPreference( tr( "VISU_CUT_SEGMENT" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_segment_represent" );
4217 setPreferenceProperty( cut_segment_represent, "strings", modes3 );
4218 setPreferenceProperty( cut_segment_represent, "indexes", indices3 );
4219 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4220 setPreferenceProperty( sp, "hstretch", 0 );
4221 setPreferenceProperty( sp, "vstretch", 0 );
4223 int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
4224 setPreferenceProperty( deformed_shape_represent, "strings", modes0 );
4225 setPreferenceProperty( deformed_shape_represent, "indexes", indices0 );
4226 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "deformed_shape_shrink" );
4228 int vectors_represent = addPreference( tr( "VISU_VECTORS" ), representGr, LightApp_Preferences::Selector, "VISU", "vectors_represent" );
4229 setPreferenceProperty( vectors_represent, "strings", modes3 );
4230 setPreferenceProperty( vectors_represent, "indexes", indices3 );
4231 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4232 setPreferenceProperty( sp, "hstretch", 0 );
4233 setPreferenceProperty( sp, "vstretch", 0 );
4235 int stream_lines_represent = addPreference( tr( "VISU_STREAM_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "stream_lines_represent" );
4236 setPreferenceProperty( stream_lines_represent, "strings", modes3 );
4237 setPreferenceProperty( stream_lines_represent, "indexes", indices3 );
4238 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4239 setPreferenceProperty( sp, "hstretch", 0 );
4240 setPreferenceProperty( sp, "vstretch", 0 );
4242 int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" );
4243 setPreferenceProperty( plot3d_represent, "strings", modes1 );
4244 setPreferenceProperty( plot3d_represent, "indexes", indices1 );
4245 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4246 setPreferenceProperty( sp, "hstretch", 0 );
4247 setPreferenceProperty( sp, "vstretch", 0 );
4249 int scalar_def_represent = addPreference( tr( "VISU_DEFORMED_SHAPE_AND_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
4250 setPreferenceProperty( scalar_def_represent, "strings", modes1 );
4251 setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
4252 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
4254 int quadraticmode = addPreference( tr( "QUADRATIC_REPRESENT_MODE" ), representGr, LightApp_Preferences::Selector, "VISU", "quadratic_mode" );
4255 QStringList quadraticModes;
4256 quadraticModes.append("Lines");
4257 quadraticModes.append("Arcs");
4259 indices.append( 0 );
4260 indices.append( 1 );
4261 setPreferenceProperty( quadraticmode, "strings", quadraticModes );
4262 setPreferenceProperty( quadraticmode, "indexes", indices );
4264 int maxAngle = addPreference( tr( "MAX_ARC_ANGLE" ), representGr, LightApp_Preferences::IntSpin,
4265 "VISU", "max_angle" );
4266 setPreferenceProperty( maxAngle, "min", 1 );
4267 setPreferenceProperty( maxAngle, "max", 90 );
4269 int elem0DSize = addPreference( tr( "VISU_ELEM0D_SIZE" ), representGr, LightApp_Preferences::IntSpin, "VISU", "elem0d_size" );
4270 setPreferenceProperty( elem0DSize, "min", 1 );
4271 setPreferenceProperty( elem0DSize, "max", 10 );
4272 addPreference( "", representGr, LightApp_Preferences::Space );
4274 int shrFac = addPreference( tr( "VISU_SHRINK_FACTOR" ), representGr, LightApp_Preferences::IntSpin, "VISU", "shrink_factor" );
4275 setPreferenceProperty( shrFac, "min", 20 );
4276 setPreferenceProperty( shrFac, "max", 100 );
4277 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4278 setPreferenceProperty( sp, "hstretch", 0 );
4279 setPreferenceProperty( sp, "vstretch", 0 );
4281 addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
4282 addPreference( "", representGr, LightApp_Preferences::Space );
4284 int typeOfMarker = addPreference( tr( "VISU_TYPE_OF_MARKER" ), representGr, LightApp_Preferences::Selector, "VISU", "type_of_marker" );
4286 QList<QVariant> aMarkerTypeIndicesList;
4287 QList<QVariant> aMarkerTypeIconsList;
4288 for ( int i = VTK::MT_POINT; i <= VTK::MT_O_X; i++ ) {
4289 QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
4290 QPixmap pixmap = aResourceMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
4291 aMarkerTypeIndicesList << i;
4292 aMarkerTypeIconsList << pixmap;
4294 setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
4295 setPreferenceProperty( typeOfMarker, "icons", aMarkerTypeIconsList );
4297 int markerScale = addPreference( tr( "VISU_MARKER_SCALE" ), representGr, LightApp_Preferences::Selector, "VISU", "marker_scale" );
4299 QList<QVariant> aMarkerScaleIndicesList;
4300 QStringList aMarkerScaleValuesList;
4301 for ( int i = VISU::MS_10; i <= VISU::MS_70; i++ ) {
4302 aMarkerScaleIndicesList << i;
4303 aMarkerScaleValuesList << QString::number( (i-(int)VISU::MS_10)*0.5 + 1.0 );
4305 setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
4306 setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
4308 addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
4309 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4310 setPreferenceProperty( sp, "hstretch", 0 );
4311 setPreferenceProperty( sp, "vstretch", 0 );
4313 addPreference( tr( "VISU_DISP_ONLY" ), representGr, LightApp_Preferences::Bool, "VISU", "display_only" );
4314 addPreference( "", representGr, LightApp_Preferences::Space );
4316 addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr,
4317 LightApp_Preferences::Bool, "VISU", "automatic_fit_all" );
4319 // TAB: Tables ; group: "Tables editing properties"
4320 int tablesTab = addPreference( tr( "VISU_TABLES" ) );
4322 int tablesGr = addPreference( tr( "VISU_TABLES_EDITING_PROPS" ), tablesTab );
4323 setPreferenceProperty( tablesGr, "columns", 1 );
4325 addPreference( tr( "VISU_TABLES_ENABLE_EDITING" ), tablesGr, LightApp_Preferences::Bool, "VISU", "tables_enable_editing" );
4327 int sortPolicyPref = addPreference( tr( "VISU_TABLES_SORT_POLICY" ), tablesGr, LightApp_Preferences::Selector, "VISU", "tables_sort_policy" );
4328 QStringList policies;
4329 policies.append( tr( "VISU_TABLES_EMPTY_LOWEST" ) );
4330 policies.append( tr( "VISU_TABLES_EMPTY_HIGHEST" ) );
4331 policies.append( tr( "VISU_TABLES_EMPTY_FIRST" ) );
4332 policies.append( tr( "VISU_TABLES_EMPTY_LAST" ) );
4333 policies.append( tr( "VISU_TABLES_EMPTY_IGNORE" ) );
4335 indices.append( 0 );
4336 indices.append( 1 );
4337 indices.append( 2 );
4338 indices.append( 3 );
4339 indices.append( 4 );
4340 setPreferenceProperty( sortPolicyPref, "strings", policies );
4341 setPreferenceProperty( sortPolicyPref, "indexes", indices );
4343 // TAB: Feature edges ; group: "Feature edges properties"
4344 int featureEdgesTab = addPreference( tr( "VISU_FEATURE_EDGES" ) );
4346 int featureEdgesGr = addPreference( tr( "VISU_FEATURE_EDGES_PROPS" ), featureEdgesTab );
4347 setPreferenceProperty( featureEdgesGr, "columns", 2 );
4349 int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr,
4350 LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
4351 setPreferenceProperty( featureEdgesAnglePref, "step", 10.0 );
4352 setPreferenceProperty( featureEdgesAnglePref, "min", 0.0 );
4353 setPreferenceProperty( featureEdgesAnglePref, "max", 90.0 );
4355 addPreference( tr( "VISU_SHOW_FEATURE_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_feature_edges" );
4356 addPreference( tr( "VISU_SHOW_BOUNDARY_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_boundary_edges" );
4357 addPreference( tr( "VISU_SHOW_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_manifold_edges" );
4358 addPreference( tr( "VISU_SHOW_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_non_manifold_edges" );
4359 //addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
4361 // TAB: "Values labels"
4363 int valLblTab = addPreference( tr( "VALUES_LABELING" ) );
4366 int valLblFontGr = addPreference( tr( "VISU_FONT" ), valLblTab );
4367 setPreferenceProperty( valLblFontGr, "columns", 2 );
4370 addVtkFontPref( tr( "LABELS" ), valLblFontGr, "values_labeling_font", true );
4373 addPreference( tr( "COLOR" ), valLblFontGr,
4374 LightApp_Preferences::Color, "VISU", "values_labeling_color" );
4378 void VisuGUI::preferencesChanged( const QString& a, const QString& b)
4380 if (a != QString("VISU")) return;
4381 if (b == QString("scalar_bar_orientation")) return;
4382 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
4383 float sbX1,sbY1,sbW,sbH;
4384 float aTol = 1.00000009999999;
4386 if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
4387 sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", 0.01);
4388 sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", 0.05);
4389 if(sbX1+sbW > aTol){
4390 aWarning = "Origin and Size Vertical: X+Width > 1\n";
4393 aResourceMgr->setValue("VISU", "scalar_bar_vertical_x", sbX1);
4394 aResourceMgr->setValue("VISU", "scalar_bar_vertical_width", sbW);
4397 else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){
4398 sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", 0.01);
4399 sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",0.5);
4400 if(sbY1+sbH > aTol){
4401 aWarning = "Origin and Size Vertical: Y+Height > 1\n";
4404 aResourceMgr->setValue("VISU", "scalar_bar_vertical_y", sbY1);
4405 aResourceMgr->setValue("VISU", "scalar_bar_vertical_height",sbH);
4408 else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){
4409 sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", 0.2);
4410 sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", 0.6);
4411 if(sbX1+sbW > aTol){
4412 aWarning = "Origin and Size Horizontal: X+Width > 1\n";
4415 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_x", sbX1);
4416 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_width", sbW);
4419 else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){
4420 sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", 0.01);
4421 sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",0.12);
4422 if(sbY1+sbH > aTol){
4423 aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
4426 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1);
4427 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
4430 else if(b == "visual_data_precision") {
4431 LightApp_Preferences* pref = preferences();
4432 QtxPreferenceItem* min = pref->findItem( tr( "VISU_MIN" ), true );
4433 QtxPreferenceItem* max = pref->findItem( tr( "VISU_MAX" ), true );
4435 setPreferenceProperty( min->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
4437 setPreferenceProperty( max->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
4440 if ( !aWarning.isEmpty() ){
4441 aWarning += "The default values are applied instead.";
4442 SUIT_MessageBox::warning(GetDesktop(this),
4443 tr("ERR_SCALARBAR_PARAMS"),
4450 ::getViewManager(const QString& theType,
4451 const bool theIsCreate)
4453 return getApp()->getViewManager(theType,theIsCreate);
4458 ::getScalarBarsMap()
4460 return myScalarBarsMap;
4463 LightApp_Displayer* VisuGUI::displayer()
4466 myDisplayer = new VisuGUI_Displayer( getApp() );
4472 void VisuGUI::OnPlot3dFromCutPlane()
4474 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
4475 if (CheckLock(aCStudy, GetDesktop(this)))
4478 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
4479 SALOME_ListIO aListIO;
4480 aSelectionMgr->selectedObjects(aListIO);
4482 if (aListIO.Extent() < 1) return;
4485 VISU::CutPlanes_i* aCutPrs = 0;
4486 Handle(SALOME_InteractiveObject) anIO;
4487 _PTR(SObject) aSObject;
4488 SALOME_ListIteratorOfListIO It (aListIO);
4489 for (; It.More(); It.Next()) {
4492 if (!anIO.IsNull() && anIO->hasEntry()) {
4493 aSObject = aCStudy->FindObjectID(anIO->getEntry());
4496 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
4497 if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
4498 if (aPrsObject->GetType() == VISU::TCUTPLANES) {
4499 aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
4508 _PTR(SObject) aTimeStampSObj = aSObject->GetFather();
4509 if (SUIT_ViewManager* aViewManager = getApp()->activeViewManager()) {
4510 QString aViewType = aViewManager->getType();
4511 //bool anIsVVTK = (aViewType == VVTK_Viewer::Type());
4513 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj);
4514 VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
4515 if (aType != TTIMESTAMP )
4518 QString aMeshName = aRestoringMap["myMeshName"];
4519 QString anEntity = aRestoringMap["myEntityId"];
4520 QString aFieldName = aRestoringMap["myFieldName"];
4521 QString aTimeStampId = aRestoringMap["myTimeStampId"];
4524 SUIT_ViewWindow* aViewWindow = 0;
4526 // aViewWindow = GetViewWindow<VVTK_Viewer>(this);
4527 // aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
4529 aViewWindow = GetViewWindow<SVTK_Viewer>(this);
4530 aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
4532 GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
4534 VISU::Plot3D_i* aPrs3d =
4535 CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
4537 (const char*)aMeshName.toLatin1(),
4538 (Entity)anEntity.toInt(),
4539 (const char*)aFieldName.toLatin1(),
4540 aTimeStampId.toInt(),
4541 ColoredPrs3d_i::EPublishUnderTimeStamp);
4543 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
4544 int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
4546 VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
4547 aDlg->initFromPrsObject(aPrs3d, true);
4548 int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
4549 double aRotX = aCutPrs->GetRotateX();
4550 double aRotY = aCutPrs->GetRotateY();
4551 double aPlanePos = aCutPrs->GetPlanePosition(0);
4552 aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
4554 if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
4555 DeletePrs3d(this, aPrs3d);
4560 UpdateObjBrowser(this, true, aTimeStampSObj);
4562 SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
4563 if ( aSVtkWindow ) {
4564 PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
4565 aSVtkWindow->onFitAll();
4567 AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
4570 emit presentationCreated(aPrs3d);
4573 application()->putInfo(QObject::tr("INF_DONE"));
4577 void VisuGUI::OnManageCache()
4583 //---------------------------------------------------------------
4584 void VisuGUI::OnMultiprViewFullRes()
4586 OnMultiprChangeRes(VISU::Result::FULL);
4590 //---------------------------------------------------------------
4591 void VisuGUI::OnMultiprViewMediumRes()
4593 OnMultiprChangeRes(VISU::Result::MEDIUM);
4597 //---------------------------------------------------------------
4598 void VisuGUI::OnMultiprViewLowRes()
4600 OnMultiprChangeRes(VISU::Result::LOW);
4604 //---------------------------------------------------------------
4605 void VisuGUI::OnMultiprViewHide()
4607 OnMultiprChangeRes(VISU::Result::HIDDEN);
4611 //---------------------------------------------------------------
4612 void VisuGUI::OnMultiprChangeRes(VISU::Result::Resolution theResolution)
4614 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
4615 if (CheckLock(aCStudy,GetDesktop(this)))
4618 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
4619 if(aSelectionInfo.empty())
4622 QApplication::setOverrideCursor(Qt::WaitCursor);
4624 typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
4625 typedef std::map<TResultPtr, _PTR(SObject)> TResult2SObject;
4626 TResult2SObject aResult2SObject;
4628 for (int i=0; i < aSelectionInfo.size(); i++) {
4629 VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
4631 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
4635 VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
4636 if(CORBA::is_nil(aResult.in()))
4639 VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
4643 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSObject);
4644 bool anIsFound = false;
4645 QString aMeshName = Storable::FindValue(aRestoringMap, "myMeshName", &anIsFound);
4649 std::string aPartName = aSObject->GetName();
4651 aCResult->SetResolution(aMeshName.toLatin1().data(), aPartName.c_str(), theResolution);
4653 aResult2SObject[TResultPtr(aCResult)] = aSObject;
4656 // To update all result observers
4657 TResult2SObject::const_iterator anIter = aResult2SObject.begin();
4658 for(; anIter != aResult2SObject.end(); anIter++){
4659 const TResultPtr& aResultPtr = anIter->first;
4660 const _PTR(SObject)& aSObject = anIter->second;
4661 aResultPtr->UpdateObservers();
4662 VISU::UpdateObjBrowser(this, false, aSObject);
4665 QApplication::restoreOverrideCursor();
4668 //---------------------------------------------------------------
4669 void VisuGUI::OnFileInfo()
4671 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
4672 SUIT_DataOwnerPtrList lst;
4673 getApp()->selectionMgr()->selected( lst );
4674 LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( lst.first().get() );
4675 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( aStudy, owner->entry().toLatin1().constData() );
4676 VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>( anObjectInfo.myBase );
4679 VisuGUI_FileInfoDlg dlg( getApp()->desktop(), aCResult->GetMEDFileInfo() );
4683 //---------------------------------------------------------------
4684 void VisuGUI::OnExportMED()
4686 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
4687 SUIT_DataOwnerPtrList lst;
4688 getApp()->selectionMgr()->selected( lst );
4689 LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( lst.first().get() );
4690 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( aStudy, owner->entry().toLatin1().constData() );
4691 VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( anObjectInfo.myBase );
4694 // VisuGUI_FileInfoDlg dlg( getApp()->desktop(), aResult->GetMEDFileInfo() );
4697 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
4698 QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
4700 // get name for the file
4701 QStringList aFilter;
4702 aFilter.append("MED Files (*.med)");
4704 std::string anInitFileName = aResult->GetInitFileName();
4705 QFileInfo anInitFileInfo(anInitFileName.c_str());
4706 QString aBaseName = anInitFileInfo.fileName();
4708 QString aPath = Qtx::addSlash(aDir) + aBaseName;
4710 QFileInfo aFileInfo =
4711 SUIT_FileDlg::getFileName(GetDesktop(this),
4714 tr("VISU_MEN_EXPORT_MED"), // "Export To Med File"
4717 QString aFile = aFileInfo.filePath();
4718 if ( aFile.length() > 0 ) {
4719 aResult->ExportMED((const char*)aFile.toLatin1());
4723 void VisuGUI::OnFilterScalars()
4725 VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg( this );
4730 \brief SLOT called when "Labeling" popup menu item of presentation is clicked
4731 activates/deactivates labeling of results of the screen. This functionality works
4732 to numbering in SMESH module but is intended for showing results on the screen
4733 instead of elements numbers
4734 \sa OnValuesLabelingParams()
4736 void VisuGUI::OnValuesLabeling()
4738 // to do: rewrite for several actors if necessary
4740 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( this );
4741 if ( aSelectionInfo.empty() )
4744 TSelectionItem aSelectionItem = GetSelectedObjects(this).front();
4745 VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
4749 SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
4753 VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
4757 if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
4759 aScalarMapActor->SetValuesLabeled( !aScalarMapActor->GetValuesLabeled() );
4760 aViewWindow->Repaint();
4762 else if ( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
4764 aGaussPtsAct->SetValuesLabeled( !aGaussPtsAct->GetValuesLabeled() );
4765 aViewWindow->Repaint();
4770 \brief SLOT called when "Labeling parameters" popup menu item of presentation
4771 is clicked launch dialog box for changing parameters of labeling
4772 \sa OnValuesLabeling()
4774 void VisuGUI::OnValuesLabelingParams()
4776 Handle(SALOME_InteractiveObject) anIO;
4777 if ( VISU::Prs3d_i* aPrs3d = GetPrsToModify( this, anIO ) )
4778 EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
4781 \brief Adds preferences for dfont of VTK viewer
4783 \param pIf group identifier
4784 \param param parameter
4785 \return identifier of preferences
4787 int VisuGUI::addVtkFontPref(
4788 const QString& label,
4790 const QString& param,
4791 const bool useSize )
4793 int tfont = addPreference( label, pId, LightApp_Preferences::Font, "VISU", param );
4795 setPreferenceProperty( tfont, "mode", QtxFontEdit::Custom );
4798 fam.append( tr( "VISU_FONT_ARIAL" ) );
4799 fam.append( tr( "VISU_FONT_COURIER" ) );
4800 fam.append( tr( "VISU_FONT_TIMES" ) );
4802 setPreferenceProperty( tfont, "fonts", fam );
4804 int f = QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic | QtxFontEdit::Shadow;
4806 f |= QtxFontEdit::UserSize | QtxFontEdit::Size;
4808 setPreferenceProperty( tfont, "features", f );
4814 \brief SLOT called when "2D Quadratic -> Arcs" popup menu item
4815 \ of presentation is cliked
4817 void VisuGUI::OnArcQuadMode(){
4818 ChangeQuadratic2DRepresentation(this,VISU::ARCS);
4822 \brief SLOT called when "2D Quadratic -> Lines" popup menu item
4823 \ of presentation is cliked
4825 void VisuGUI::OnLineQuadMode(){
4826 ChangeQuadratic2DRepresentation(this,VISU::LINES);