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 displayer()->Display(anIO->getEntry());
935 VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(aBase);
937 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
938 displayer()->Display(anIO->getEntry());
939 aViewWindow->highlight(anIO, 1);
940 aViewWindow->getRenderer()->ResetCameraClippingRange();
941 aViewWindow->Repaint();
948 QApplication::restoreOverrideCursor();
955 /// to correct IMP 0016100
956 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
960 SALOME_ListIO aSel, aList;
961 aSelectionMgr->selectedObjects(aSel);
962 extractContainers(aSel, aList);
963 Handle(SALOME_InteractiveObject) anIO = aList.First();
964 activateAppropriateViewer(anIO);
969 void VisuGUI::activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO )
971 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), theIO->getEntry());
972 VISU::Base_i* aBase = anObjectInfo.myBase;
976 std::string anEntry = theIO->getEntry();
977 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
978 _PTR(SObject) SO = aCStudy->FindObjectID( theIO->getEntry() );
980 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(SO);
981 if(CORBA::is_nil(aCORBAObject))
984 VISU::VISUType aType = aBase->GetType();
986 if ( VISU::GetPrs3dFromBase(aBase) ) {
987 // activate SVTK Viewer
988 getApp()->getViewManager( SVTK_Viewer::Type(), true );
994 case VISU::TCONTAINER:
997 GetPlot2dViewer(this, true);
1000 case VISU::TCOLOREDPRS3DHOLDER :
1001 case VISU::TPOINTMAP3D : {
1002 //find curves under pointmap 3d
1003 bool hasCurvesChildren = false;
1005 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1006 QString aViewerType = aViewMgr->getType();
1008 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(SO);
1009 _PTR(SObject) aChild;
1010 for (; anIter->More(); anIter->Next()) {
1011 aChild = anIter->Value();
1012 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aChild);
1013 if(!CORBA::is_nil(aCORBAObject)){
1014 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
1015 if( dynamic_cast<VISU::Curve_i*>(aServant.in()))
1016 hasCurvesChildren = true;
1020 if (hasCurvesChildren && ( aViewerType == SPlot2d_Viewer::Type() || aViewerType == SVTK_Viewer::Type() ) ) {
1023 // activate SVTK Viewer
1024 getApp()->getViewManager( SVTK_Viewer::Type(), true );
1036 if(MYDEBUG) MESSAGE("OnErasePrs");
1037 QApplication::setOverrideCursor(Qt::WaitCursor);
1039 SALOME_ListIO aList, aSel;
1040 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1041 aSelectionMgr->selectedObjects(aSel);
1042 extractContainers(aSel, aList);
1044 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1045 Handle(SALOME_InteractiveObject) anIO = it.Value();
1046 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
1047 VISU::Base_i* aBase = anObjectInfo.myBase;
1048 ErasePrs(this, aBase, /*repaint_view_window = */true);
1051 QApplication::restoreOverrideCursor();
1054 //----------------------------------------------------------------------------
1059 startOperation( myEraseAll );
1060 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
1061 vw->unHighlightAll();
1062 if (vtkRenderer *aRen = vw->getRenderer()) {
1064 VTK::ActorCollectionCopy aCopy(aRen->GetActors());
1065 vtkActorCollection *anActColl = aCopy.GetActors();
1066 for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
1067 if (anActor->GetVisibility() > 0)
1068 if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
1069 RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
1070 anVISUActor->VisibilityOff();
1075 } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
1076 aPlot2d->EraseAll();
1083 //----------------------------------------------------------------------------
1085 GetPrsToModify(const SalomeApp_Module* theModule,
1086 Handle(SALOME_InteractiveObject)& theIO)
1088 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
1089 if(aSelectionInfo.empty())
1092 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1093 theIO = aSelectionItem.myIO;
1094 return VISU::GetPrs3dToModify(theModule, aSelectionItem.myObjectInfo.myBase);
1098 //----------------------------------------------------------------------------
1103 Handle(SALOME_InteractiveObject) anIO;
1104 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1105 EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
1108 //----------------------------------------------------------------------------
1111 ::OnEditDeformedShape()
1113 Handle(SALOME_InteractiveObject) anIO;
1114 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1115 VisuGUI_DeformedShapeDlg::EditPrs3d(this, aPrs3d, anIO);
1116 // EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg, 1>(this, anIO, aPrs3d);
1119 //----------------------------------------------------------------------------
1122 ::OnEditDeformedShapeAndScalarMap()
1124 Handle(SALOME_InteractiveObject) anIO;
1125 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1126 EditPrs3d<VISU::DeformedShapeAndScalarMap_i, VisuGUI_DeformedShapeAndScalarMapDlg, 1>(this, anIO, aPrs3d);
1129 //----------------------------------------------------------------------------
1134 Handle(SALOME_InteractiveObject) anIO;
1135 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1136 EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg, 0>(this, anIO, aPrs3d);
1139 //----------------------------------------------------------------------------
1144 Handle(SALOME_InteractiveObject) anIO;
1145 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1146 EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg, 0>(this, anIO, aPrs3d);
1149 //----------------------------------------------------------------------------
1152 ::OnEditCutSegment()
1154 Handle(SALOME_InteractiveObject) anIO;
1155 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1156 EditPrs3d<VISU::CutSegment_i, VisuGUI_CutSegmentDlg, 0>(this, anIO, aPrs3d);
1159 //----------------------------------------------------------------------------
1162 ::OnEditIsoSurfaces()
1164 Handle(SALOME_InteractiveObject) anIO;
1165 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1166 EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg, 1>(this, anIO, aPrs3d);
1169 //----------------------------------------------------------------------------
1174 Handle(SALOME_InteractiveObject) anIO;
1175 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1176 EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg, 1>(this, anIO, aPrs3d);
1179 //----------------------------------------------------------------------------
1182 ::OnEditStreamLines()
1184 Handle(SALOME_InteractiveObject) anIO;
1185 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1186 EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg, 1>(this, anIO, aPrs3d);
1189 //----------------------------------------------------------------------------
1194 Handle(SALOME_InteractiveObject) anIO;
1195 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1196 EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg, 0>(this, anIO, aPrs3d);
1200 //----------------------------------------------------------------------------
1203 ::OnMakeSurfaceframe()
1205 ChangeRepresentation(this, VISU::SURFACEFRAME);
1208 //----------------------------------------------------------------------------
1211 ::OnMakeInsideframe()
1213 ChangeRepresentation(this, VISU::INSIDEFRAME);
1216 //----------------------------------------------------------------------------
1221 ChangeRepresentation(this, VISU::WIREFRAME);
1224 //----------------------------------------------------------------------------
1229 ChangeRepresentation(this, VISU::SHADED);
1232 //----------------------------------------------------------------------------
1237 ChangeRepresentation(this, VISU::POINT);
1240 //----------------------------------------------------------------------------
1245 ChangeRepresentation(this, VISU::SHRINK);
1248 //----------------------------------------------------------------------------
1251 ::OnMakeFeatureEdges()
1253 ChangeRepresentation(this, VISU::FEATURE_EDGES);
1256 //----------------------------------------------------------------------------
1261 SetShading(this, true);
1264 //----------------------------------------------------------------------------
1269 SetShading(this, false);
1273 //----------------------------------------------------------------------------
1278 VISU_Actor* anActor = NULL;
1279 VISU::Prs3d_i* aPrs3d = NULL;
1280 SVTK_ViewWindow* aViewWindow = NULL;
1281 if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
1284 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
1285 VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
1287 SALOMEDS::Color anOldColor, aNewColor;
1288 int aRepresent = anActor->GetRepresentation();
1290 switch (aRepresent) {
1292 anOldColor = aMesh->GetNodeColor();
1294 case VISU::WIREFRAME :
1295 case VISU::INSIDEFRAME :
1296 anOldColor = aMesh->GetLinkColor();
1299 case VISU::SURFACEFRAME :
1300 anOldColor = aMesh->GetCellColor();
1303 } else if (aDeformedShape) {
1304 anOldColor = aDeformedShape->GetColor();
1309 QColor aColor (int(255*anOldColor.R),
1310 int(255*anOldColor.G),
1311 int(255*anOldColor.B));
1312 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1313 if (aColorNew.isValid()) {
1314 aNewColor.R = aColorNew.red()/255.;
1315 aNewColor.G = aColorNew.green()/255.;
1316 aNewColor.B = aColorNew.blue()/255.;
1318 switch (aRepresent) {
1320 aMesh->SetNodeColor(aNewColor);
1322 case VISU::WIREFRAME :
1323 case VISU::INSIDEFRAME :
1324 aMesh->SetLinkColor(aNewColor);
1327 case VISU::SURFACEFRAME :
1328 aMesh->SetCellColor(aNewColor);
1332 aDeformedShape->SetColor(aNewColor);
1334 RecreateActor(this, aPrs3d);
1338 //----------------------------------------------------------------------------
1341 ::OnChangeWireframeColor()
1343 VISU_Actor* anActor = NULL;
1344 VISU::Prs3d_i* aPrs3d = NULL;
1345 SVTK_ViewWindow* aViewWindow = NULL;
1346 if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
1349 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
1350 VISU::ScalarMap_i* aScalarMap = dynamic_cast<VISU::ScalarMap_i*>(aPrs3d);
1351 if(!aMesh && !aScalarMap)
1354 SALOMEDS::Color anOldColor, aNewColor;
1356 anOldColor = aMesh->GetLinkColor();
1357 else if (aScalarMap)
1358 anOldColor = aScalarMap->GetLinkColor();
1361 QColor aColor (int(255*anOldColor.R),
1362 int(255*anOldColor.G),
1363 int(255*anOldColor.B));
1364 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1365 if (aColorNew.isValid()) {
1366 aNewColor.R = aColorNew.red()/255.;
1367 aNewColor.G = aColorNew.green()/255.;
1368 aNewColor.B = aColorNew.blue()/255.;
1370 aMesh->SetLinkColor(aNewColor);
1372 aScalarMap->SetLinkColor(aNewColor);
1373 RecreateActor(this, aPrs3d);
1377 //----------------------------------------------------------------------------
1382 VisuGUI_TransparencyDlg* aDialog = new VisuGUI_TransparencyDlg( this );
1386 //----------------------------------------------------------------------------
1391 VISU_Actor* anActor = NULL;
1392 VISU_ActorBase* anActorBase = NULL;
1393 VISU::Prs3d_i* aPrs3d = NULL;
1394 SVTK_ViewWindow* aViewWindow = NULL;
1396 bool isPrs3d = false;
1398 if (GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor)) {
1400 oldlwid = anActor->GetLineWidth();
1403 aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
1404 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1405 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1406 VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
1407 anActorBase = VISU::FindActorBase(aViewWindow, aTable);
1408 oldlwid = anActorBase->GetLineWidth();
1412 VisuGUI_CursorDlg* CursorDlg =
1413 new VisuGUI_CursorDlg (GetDesktop(this), (const char*)tr("DLG_LINEWIDTH_TITLE").toLatin1(), TRUE);
1415 CursorDlg->helpFileName = "viewing_3d_presentations_page.html#width_opacity_anchor";
1416 CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
1417 CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
1418 CursorDlg->SpinBox1->setMinimum(1);
1419 CursorDlg->SpinBox1->setMaximum(10);
1421 int intlwid = int(oldlwid);
1422 CursorDlg->SpinBox1->setValue(intlwid);
1424 int ret = CursorDlg->exec();
1426 intlwid = CursorDlg->SpinBox1->value();
1427 float newlwid = intlwid;
1429 anActor->SetLineWidth(newlwid);
1431 anActorBase->SetLineWidth(newlwid);
1436 //----------------------------------------------------------------------------
1439 ::OnChangePointMarker()
1441 SALOME_ListIO aListIO;
1442 GetSelectionMgr( this )->selectedObjects( aListIO );
1443 if( aListIO.Extent() < 1 )
1446 VISU::StudyId2MarkerMap& aMarkerMap = GetVisuGen( this )->GetMarkerMap();
1447 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
1448 int aStudyId = aCStudy->StudyId();
1450 bool update = false;
1451 for( SALOME_ListIteratorOfListIO It( aListIO ); It.More(); It.Next() )
1453 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1454 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList( this, anIO );
1455 for( int i = 0, n = aPrsList.size(); i < n; i++ )
1457 if( VISU::Prs3d_i* aPrs = aPrsList[i] )
1459 VTKViewer_MarkerDlg* aDlg = new VTKViewer_MarkerDlg( GetDesktop( this ) );
1460 aDlg->setHelpData( "VISU", "point_marker_page.html" );
1462 aDlg->setCustomMarkerMap( aMarkerMap[ aStudyId ] );
1464 VISU::MarkerType aMarkerTypeCurrent = aPrs->GetMarkerType();
1465 VISU::MarkerScale aMarkerScaleCurrent = aPrs->GetMarkerScale();
1466 int aMarkerTextureCurrent = aPrs->GetMarkerTexture();
1467 if( aMarkerTypeCurrent != VISU::MT_USER )
1468 aDlg->setStandardMarker( (VTK::MarkerType)aMarkerTypeCurrent, (VTK::MarkerScale)aMarkerScaleCurrent );
1470 aDlg->setCustomMarker( aMarkerTextureCurrent );
1474 aMarkerMap[ aStudyId ] = aDlg->getCustomMarkerMap();
1476 VISU::MarkerType aMarkerTypeNew = (VISU::MarkerType)aDlg->getMarkerType();
1477 VISU::MarkerScale aMarkerScaleNew = (VISU::MarkerScale)aDlg->getStandardMarkerScale();
1478 int aMarkerTextureNew = aDlg->getCustomMarkerID();
1479 if( aMarkerTypeNew != VISU::MT_USER )
1480 aPrs->SetMarkerStd( aMarkerTypeNew, aMarkerScaleNew );
1482 aPrs->SetMarkerTexture( aMarkerTextureNew );
1484 aPrs->UpdateActors();
1494 if( SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>( this ) )
1498 //----------------------------------------------------------------------------
1501 ::OnChangeShrinkFactor()
1503 VisuGUI_ShrinkFactorDlg* aDialog = new VisuGUI_ShrinkFactorDlg( this );
1507 //----------------------------------------------------------------------------
1512 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1513 if(aSelectionInfo.empty())
1516 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1517 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1518 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1519 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1520 if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)) {
1521 aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
1522 if( IsSObjectTable( aSObject ) ) {
1523 VISU_TableDlg* dlg = new VISU_TableDlg( GetDesktop( this ),
1524 GetCStudy( GetAppStudy( this ) ),
1527 //SAL2670 Orientation of show tables
1528 VISU_TableDlg::ttAuto,
1535 //----------------------------------------------------------------------------
1540 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1541 if(aSelectionInfo.empty())
1544 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1545 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1546 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1547 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1548 if(VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
1549 VisuGUI_Table3DDlg*aDlg = new VisuGUI_Table3DDlg( this );
1550 aDlg->initFromPrsObject( aTable );
1551 if ( runAndWait(aDlg, 0) > 0 ) {
1552 aDlg->storeToPrsObject(aTable);
1553 aTable->UpdateActors();
1559 //----------------------------------------------------------------------------
1564 SetScalarBarVisibility(true);
1571 SetScalarBarVisibility(false);
1576 ::SetScalarBarVisibility(bool theVisibility)
1578 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1579 SALOME_ListIO aListIO;
1580 aSelectionMgr->selectedObjects(aListIO);
1582 SALOME_ListIteratorOfListIO It (aListIO);
1584 bool update = false;
1585 for (; It.More(); It.Next()) {
1586 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1587 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO, true);
1588 if ( aPrsList.size()>0 ) {
1589 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1590 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1592 if (VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject)) {
1593 aScalar->SetBarVisible( theVisibility );
1594 RecreateActor(this, aScalar);
1596 } else if (VISU::GaussPoints_i* aGauss = dynamic_cast<VISU::GaussPoints_i*>(aPrsObject)) {
1597 aGauss->SetBarVisible( theVisibility );
1598 RecreateActor(this, aGauss);
1606 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this))
1611 //----------------------------------------------------------------------------
1616 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1617 if(aSelectionInfo.empty())
1620 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1621 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1622 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1625 (aBase->GetType() == VISU::TCUTLINES || aBase->GetType() == VISU::TCUTSEGMENT) ||
1626 IsSObjectTable(aSObject)) {
1627 GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
1628 UpdateObjBrowser(this);
1632 //----------------------------------------------------------------------------
1637 SalomeApp_Study* anAppStudy = GetAppStudy(this);
1638 _PTR(Study) aCStudy = GetCStudy(anAppStudy);
1639 if (CheckLock(aCStudy,GetDesktop(this)))
1642 SALOME_ListIO aList;
1643 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
1644 mgr->selectedObjects(aList,QString::null,false);
1645 int i = 0, nbSelected = aList.Extent();
1646 if (nbSelected < 1) return;
1648 std::vector<std::string> anEntries (nbSelected);
1650 Handle(SALOME_InteractiveObject) anIO;
1651 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1653 if (anIO->hasEntry()) {
1654 if (IsRemovable(anIO->getEntry(), this)) {
1655 aNameList.append("\n - ");
1656 // Get Name Of the Main Object if it's a referenced object
1657 VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
1658 if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
1659 _PTR(SObject) aRefSObject;
1660 if (aSObject->ReferencedObject(aRefSObject)) {
1661 QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
1662 aNameList.append( aRefName );
1665 aNameList.append(anIO->getName());
1667 anEntries[i++] = anIO->getEntry();
1672 if (nbSelected < 1) {
1673 SUIT_MessageBox::warning(GetDesktop(this),
1674 QObject::tr("WRN_VISU"),
1675 QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
1679 if ( SUIT_MessageBox::question( GetDesktop(this),
1680 QObject::tr( "WRN_VISU" ),
1681 QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
1682 SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
1685 // There is a transaction
1686 _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
1687 aStudyBuilder->NewCommand();
1689 for (i = 0; i < nbSelected; i++) {
1690 VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anEntries[i]);
1691 if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
1692 emit beforeObjectDelete(QString(aSObject->GetID().c_str()));
1693 _PTR(SObject) aRefSObject;
1694 if (aSObject->ReferencedObject(aRefSObject)) {
1695 // It can be a reference on curve, published under a container.
1696 // In this case the curve should be removed from the container.
1698 VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
1699 VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
1700 if(aRefBase && aRefBase->GetType() == VISU::TMESH){
1701 DeleteSObject(this, aCStudy, aRefSObject);
1702 UpdateObjBrowser(this, true, aRefSObject);
1703 }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
1704 CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
1705 VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
1706 _PTR(SObject) aParentSO = aSObject->GetFather();
1707 VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
1708 if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
1709 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
1710 if(aContainer->GetNbCurves() > 0){
1711 aContainer->RemoveCurve(aCurve);
1712 UpdateObjBrowser(this, true, aParentSO);
1719 DeleteSObject(this, aCStudy, aSObject);
1720 UpdateObjBrowser(this, true, aSObject);
1725 // Finish transaction
1726 aStudyBuilder->CommitCommand();
1727 mgr->clearSelected();
1730 //----------------------------------------------------------------------------
1735 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1736 if(aSelectionInfo.empty())
1739 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1740 if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
1741 if(aBase->GetType() == VISU::TTABLE || aBase->GetType() == VISU::TPOINTMAP3D) {
1742 if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)){
1743 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
1744 _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
1745 if(IsSObjectTable(aSObject)){
1746 VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
1747 if(aDlg->exec() == QDialog::Accepted){
1748 if(!IsStudyLocked(aStudy)){
1749 // if study is not locked - create new container, create curves and insert them
1750 // into container, then plot container if current viewer is of VIEW_PLOT2D type
1752 QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
1753 aDlg->getCurvesSource( horIndex, ver1Indices, ver2Indices, zIndices );
1754 verIndices = ver1Indices + ver2Indices;
1755 if( horIndex >= 0 && verIndices.count() > 0 ){
1756 CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
1757 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
1758 for( int i = 0; i < verIndices.count(); i++ ){
1759 bool isV2 = ver2Indices.contains(verIndices[i]);
1760 VISU::Curve_var aCurveObject =
1761 GetVisuGen(this)->CreateCurveWithZExt(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
1762 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
1764 int marker, line, lineWidth;
1766 if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
1767 line, lineWidth, color) && !isAuto )
1770 c.R = color.red() /255.;
1771 c.G = color.green()/255.;
1772 c.B = color.blue() /255.;
1773 aCurve->SetColor( c );
1774 aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
1775 aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1777 aContainer->AddCurve(aCurveObject);
1780 UpdateObjBrowser(this);
1781 PlotContainer( this, aContainer, VISU::eDisplay );
1785 // get name of SObject
1786 QString aSObjectName;
1787 _PTR(GenericAttribute) anAttr;
1788 if(aSObject->FindAttribute( anAttr, "AttributeName" )){
1789 _PTR(AttributeName) aName = anAttr;
1790 aSObjectName = QString( aName->Value().c_str() );
1792 // if study is locked just get curves info and plot them
1793 // if current viewer is of VIEW_PLOT2D type
1794 QList<Plot2d_Curve*> container;
1795 aDlg->getCurves( container );
1796 if ( !container.isEmpty() ) {
1797 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1798 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
1806 }else if(!aSelectionItem.myIO.IsNull()){
1807 // check if Table SObject is selected
1808 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1809 if(IsSObjectTable(aSObject)){
1810 VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
1811 if(aDlg->exec() == QDialog::Accepted){
1812 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
1813 if(!IsStudyLocked(aStudy)){
1814 // if study is not locked - create new table and container objects, create curves
1815 // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
1817 QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
1818 aDlg->getCurvesSource( horIndex, verIndices, ver2Indices, zIndices );
1819 verIndices = ver1Indices + ver2Indices;
1820 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1821 VISU::Table_var aTableObject = GetVisuGen(this)->CreateTable(aSObject->GetID().c_str());
1822 if(!CORBA::is_nil(aTableObject)){
1823 VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
1824 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObject).in());
1825 for ( int i = 0; i < verIndices.count(); i++ ) {
1826 bool isV2 = ver2Indices.contains(verIndices[i]);
1827 VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZExt
1828 ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
1829 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
1831 int marker, line, lineWidth;
1833 if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
1834 line, lineWidth, color) && !isAuto )
1837 c.R = color.red()/255.;
1838 c.G = color.green()/255.;
1839 c.B = color.blue()/255.;
1840 aCurve->SetColor( c );
1841 aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
1842 aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1844 aContainerObject->AddCurve(aCurveObject);
1847 UpdateObjBrowser(this);
1848 PlotContainer( this, aContainer, VISU::eDisplay );
1852 // get name of SObject
1853 QString aSObjectName;
1854 _PTR(GenericAttribute) anAttr;
1855 if(aSObject->FindAttribute(anAttr, "AttributeName")){
1856 _PTR(AttributeName) aName = anAttr;
1857 aSObjectName = QString( aName->Value().c_str() );
1859 // if study is locked just get curves info and plot them
1860 QList<Plot2d_Curve*> container;
1861 aDlg->getCurves( container );
1862 if ( !container.isEmpty() ) {
1863 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1864 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
1873 //----------------------------------------------------------------------------
1876 ::OnCurveProperties()
1878 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1879 if(aSelectionInfo.size() != 1)
1882 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1883 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1884 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1888 if(aBase->GetType() == VISU::TCURVE) {
1890 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase)){
1891 if(!IsStudyLocked(GetCStudy(GetAppStudy(this)))){
1892 Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
1894 aDlg.setLine( (Plot2d::LineType)aCurve->GetLine(), aCurve->GetLineWidth() );
1895 aDlg.setMarker( (Plot2d::MarkerType)aCurve->GetMarker() );
1896 SALOMEDS::Color aColor = aCurve->GetColor();
1897 aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
1898 if( aDlg.exec() == QDialog::Accepted ) {
1899 aCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
1900 aCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
1901 SALOMEDS::Color newColor;
1902 newColor.R = aDlg.getColor().red()/255.;
1903 newColor.G = aDlg.getColor().green()/255.;
1904 newColor.B = aDlg.getColor().blue()/255.;
1905 aCurve->SetColor( newColor );
1906 PlotCurve(this, aCurve, VISU::eDisplay);
1913 //----------------------------------------------------------------------------
1916 ::OnClearContainer()
1918 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1919 if (CheckLock(aCStudy,GetDesktop(this)))
1922 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1923 if(aSelectionInfo.empty())
1926 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1927 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1931 if(aBase->GetType() == VISU::TCONTAINER){
1933 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase)){
1934 if(aContainer && aContainer->GetNbCurves() > 0){
1935 aContainer->Clear();
1936 UpdateObjBrowser(this);
1942 //----------------------------------------------------------------------------
1947 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1948 if(aSelectionInfo.empty())
1951 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1952 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1956 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase);
1960 VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
1961 aDlg->initFromPrsObject(aContainer);
1963 aDlg->storeToPrsObject(aContainer);
1964 UpdateObjBrowser(this, true);
1969 //----------------------------------------------------------------------------
1972 ::OnSaveViewParams()
1974 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1975 if (CheckLock(aCStudy,GetDesktop(this)))
1978 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1979 if (aViewMgr->getType() != SVTK_Viewer::Type())
1982 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1983 SALOME_ListIO aListIO;
1984 aSelectionMgr->selectedObjects(aListIO);
1985 if (aListIO.Extent() > 1)
1988 if (aListIO.Extent() == 0) {
1989 VISU::View3D_i::SaveViewParams(aViewMgr, (const char*)VISU::View3D_i::GenerateViewParamsName().toLatin1());
1991 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1992 VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
1994 UpdateObjBrowser(this);
1997 //----------------------------------------------------------------------------
2000 ::OnRestoreViewParams()
2002 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
2003 if (aViewMgr->getType() != SVTK_Viewer::Type())
2006 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2007 SALOME_ListIO aListIO;
2008 aSelectionMgr->selectedObjects(aListIO);
2009 if (aListIO.Extent() != 1)
2012 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2013 //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
2014 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
2015 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
2017 VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
2020 //----------------------------------------------------------------------------
2025 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2026 if (CheckLock(aCStudy,GetDesktop(this)))
2029 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
2030 if (aSelectionInfo.empty())
2033 VisuGUI_Selection aSel (this);
2034 aSel.init("", getApp()->selectionMgr());
2035 if (aSel.count() < 1) return;
2037 bool isAny = false; // is there any appropriate object selected
2038 for (int i = 0; i < aSelectionInfo.size(); i++) {
2039 VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
2040 VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo;
2042 _PTR(SObject) aSObject = anObjectInfo.mySObject;
2046 // Check, if the selected object can be renamed
2047 QString aStr = aSel.parameter(i, "type" ).toString();
2048 if (aStr == "VISU::TSCALARMAP" || aStr == "VISU::TISOSURFACES" ||
2049 aStr == "VISU::TDEFORMEDSHAPE" || aStr == "VISU::TCUTPLANES" ||
2050 aStr == "VISU::TCUTLINES" || aStr == "VISU::TCUTSEGMENT" || aStr == "VISU::TVECTORS" ||
2051 aStr == "VISU::TSTREAMLINES" || aStr == "VISU::TPLOT3D" ||
2052 aStr == "VISU::TSCALARMAPONDEFORMEDSHAPE" || aStr == "VISU::TCOLOREDPRS3DHOLDER" ||
2053 aStr == "VISU::TTABLE" || aStr == "VISU::TCURVE" || aStr == "VISU::TCONTAINER" ||
2054 aStr == "VISU::POINTMAP3D" || aStr == "VISU::TVIEW3D" ||
2055 aStr == "VISU::TPOINTMAP3D" || aStr == "VISU::TGAUSSPOINTS")
2057 _PTR(GenericAttribute) anAttr;
2058 if (aSObject->FindAttribute(anAttr, "AttributeName")) {
2060 _PTR(AttributeName) aName (anAttr);
2061 QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
2062 if (!Name.isEmpty()) {
2063 QApplication::setOverrideCursor(Qt::WaitCursor);
2065 // rename specific objects
2066 if (VISU::Base_i* aBase = anObjectInfo.myBase) {
2067 switch (aBase->GetType()) {
2068 case VISU::TCURVE: { // Curve object
2069 if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase))
2070 aCurve->SetName(Name.toLatin1().constData(), true);
2073 case VISU::TTABLE: { // Table object
2074 if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
2075 aTable->SetName(Name.toLatin1().constData(), true);
2078 case VISU::TPOINTMAP3D: { // Table object
2079 if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
2080 aTable3d->SetTitle(Name.toLatin1().constData());
2081 aTable3d->UpdateActors();
2085 case VISU::TCONTAINER: { // Container object
2086 if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
2087 aContainer->SetName(Name.toLatin1().constData(), true);
2094 // rename the study object
2095 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
2096 aName->SetValue(Name.toLatin1().constData()); // rename the SObject
2097 anIO->setName(Name.toLatin1().constData()); // rename the InteractiveObject
2099 ViewManagerList aViewManagerList;
2100 getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
2101 SUIT_ViewManager* aViewManager;
2102 foreach( aViewManager, aViewManagerList ) {
2103 if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
2104 if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
2105 aViewer->renameAll( anIO, Name.toLatin1().constData() );
2109 UpdateObjBrowser(this, false);
2110 QApplication::restoreOverrideCursor();
2117 SUIT_MessageBox::warning(GetDesktop(this),
2118 QObject::tr("WRN_VISU"),
2119 QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
2123 //----------------------------------------------------------------------------
2126 ::OnClippingPlanes()
2128 new VisuGUI_ClippingDlg (this, false);
2131 //----------------------------------------------------------------------------
2137 if ( !mySweep->toggleViewAction()->isChecked() )
2138 mySweep->toggleViewAction()->trigger();
2139 mySweep->onSelectionChanged();
2141 mySweep->onPlay(true);
2144 //----------------------------------------------------------------------------
2147 ::OnTimeAnimation(VISU::Animation::AnimationMode theMode)
2149 if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
2152 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2153 VisuGUI_TimeAnimationDlg* aAnimationDlg =
2154 new VisuGUI_TimeAnimationDlg (this, aCStudy, theMode);
2156 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2157 SALOME_ListIO aListIO;
2158 aSelectionMgr->selectedObjects(aListIO);
2160 SALOME_ListIteratorOfListIO It (aListIO);
2161 for (; It.More(); It.Next()) {
2162 _PTR(SObject) aSObject = aCStudy->FindObjectID(It.Value()->getEntry());
2163 if ( !aAnimationDlg->addField(aSObject) ) {
2164 SUIT_MessageBox::warning(GetDesktop(this),
2166 tr("ERR_CANT_CREATE_ANIMATION") );
2167 delete aAnimationDlg;
2171 aAnimationDlg->show();
2174 //----------------------------------------------------------------------------
2177 OnParallelTimeAnimation()
2179 OnTimeAnimation(VISU::Animation::PARALLEL);
2184 OnSucccessiveTimeAnimation()
2186 OnTimeAnimation(VISU::Animation::SUCCESSIVE);
2189 //----------------------------------------------------------------------------
2194 if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
2197 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2198 SALOME_ListIO aListIO;
2199 aSelectionMgr->selectedObjects(aListIO);
2201 if (aListIO.Extent() != 1)
2204 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2206 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2208 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
2212 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
2213 if (aType != VISU::TANIMATION)
2216 VisuGUI_TimeAnimationDlg* aAnimationDlg =
2217 new VisuGUI_TimeAnimationDlg(this, aCStudy);
2218 aAnimationDlg->restoreFromStudy(aSObj);
2219 aAnimationDlg->show();
2222 //----------------------------------------------------------------------------
2225 ::OnPointEvolution()
2227 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
2228 VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
2230 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
2231 SALOME_ListIO aListIO;
2232 aSelectionMgr->selectedObjects( aListIO );
2234 SALOME_ListIteratorOfListIO It( aListIO );
2235 for( ; It.More(); It.Next() )
2237 _PTR(SObject) aSObject = aCStudy->FindObjectID( It.Value()->getEntry() );
2238 if( !aDlg->setField( aSObject ) )
2240 SUIT_MessageBox::warning( GetDesktop( this ),
2242 tr( "ERR_CANT_CREATE_EVOLUTION" ) );
2250 //----------------------------------------------------------------------------
2255 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
2256 SALOME_ListIO aListIO;
2257 aSelectionMgr->selectedObjects( aListIO );
2259 if( aListIO.Extent() != 1 )
2262 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2264 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
2265 _PTR(SObject) aSObj = aCStudy->FindObjectID( anIO->getEntry() );
2269 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
2270 if( aType != VISU::TEVOLUTION )
2273 VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
2274 aDlg->restoreFromStudy( aSObj );
2278 //----------------------------------------------------------------------------
2281 ::OnCopyPresentation()
2283 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2284 if (CheckLock(aCStudy,GetDesktop(this)))
2287 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
2288 if(aSelectionInfo.empty())
2291 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
2292 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
2296 VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dToModify(this, aBase);
2300 if(aBase->GetType() != VISU::TMESH){
2301 VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aBase);
2302 switch (aBase->GetType()) {
2303 case VISU::TSCALARMAP:
2304 TSameAsFactory<VISU::TSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2306 case VISU::TDEFORMEDSHAPE:
2307 TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2309 case VISU::TSCALARMAPONDEFORMEDSHAPE:
2310 case VISU::TDEFORMEDSHAPEANDSCALARMAP:
2311 TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2313 case VISU::TCUTPLANES:
2314 TSameAsFactory<VISU::TCUTPLANES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2316 case VISU::TCUTLINES:
2317 TSameAsFactory<VISU::TCUTLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2319 case VISU::TCUTSEGMENT:
2320 TSameAsFactory<VISU::TCUTSEGMENT>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2322 case VISU::TISOSURFACES:
2323 TSameAsFactory<VISU::TISOSURFACES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2325 case VISU::TSTREAMLINES:
2326 TSameAsFactory<VISU::TSTREAMLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2328 case VISU::TVECTORS:
2329 TSameAsFactory<VISU::TVECTORS>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2332 TSameAsFactory<VISU::TPLOT3D>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2335 UpdateObjBrowser(this);
2339 //----------------------------------------------------------------------------
2342 ::OnToggleSelectionPanel()
2344 if (GetActiveViewWindow<SVTK_ViewWindow>(this))
2346 if( myPanels.find( SelectionPanelId ) != myPanels.end() )
2348 if( VisuGUI_SelectionPanel* aSelectionPanel =
2349 dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
2351 if( aSelectionPanel->isVisible() )
2352 aSelectionPanel->hide();
2354 aSelectionPanel->show();
2359 SUIT_MessageBox::warning(GetDesktop(this),
2361 tr("ERR_ACTIVATE_VIEW3D") );
2364 //----------------------------------------------------------------------------
2367 ::OnSwitchSelectionMode()
2369 QAction* anAction = dynamic_cast<QAction*>( sender() );
2373 bool isAnyChecked = false;
2374 for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
2376 QAction* aRefAction = action( anId );
2377 isAnyChecked |= aRefAction->isChecked();
2378 if( anAction != aRefAction )
2379 aRefAction->setChecked( false );
2380 else if( myPanels.find( SelectionPanelId ) != myPanels.end() )
2382 if( VisuGUI_SelectionPanel* aSelectionPanel =
2383 dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
2384 aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
2387 // At least one action must be checked
2389 anAction->setChecked( true );
2392 //----------------------------------------------------------------------------
2395 ::OnSwitchSelectionMode( int theId )
2397 for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
2399 QAction* aRefAction = action( anId );
2400 aRefAction->setChecked( anId == VISU_ACTOR_SELECTION + theId );
2404 //----------------------------------------------------------------------------
2407 ::OnMergeScalarBars()
2409 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2410 SALOME_ListIO aListIO;
2411 aSelectionMgr->selectedObjects(aListIO);
2413 SALOME_ListIteratorOfListIO It (aListIO);
2415 // first find the bounds
2416 double aMin, aMax; bool first = true;
2417 for (; It.More(); It.Next()) {
2418 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2419 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2420 if (!aPrsList.empty()) {
2421 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2422 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2424 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2428 aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
2430 if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
2431 if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
2439 // set the computed range to every selected ScalarMap
2440 bool update = false;
2441 for (It.Initialize(aListIO); It.More(); It.Next() ) {
2442 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2443 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2444 if (!aPrsList.empty()) {
2445 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2446 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2448 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2450 aScalar->SetRange(aMin, aMax);
2451 RecreateActor(this, aScalar);
2459 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
2460 vw->getRenderer()->ResetCameraClippingRange();
2466 //----------------------------------------------------------------------------
2469 ::OnFreeScalarBars()
2471 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2472 SALOME_ListIO aListIO;
2473 aSelectionMgr->selectedObjects(aListIO);
2475 SALOME_ListIteratorOfListIO It (aListIO);
2477 // restore the source range for every ScalarMap
2478 bool update = false;
2479 for (; It.More(); It.Next()) {
2480 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2481 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2482 if (!aPrsList.empty()) {
2483 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2484 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2486 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2488 aScalar->SetSourceRange();
2489 RecreateActor(this, aScalar);
2497 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
2498 vw->getRenderer()->ResetCameraClippingRange();
2504 //----------------------------------------------------------------------------
2509 if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs");
2510 VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
2518 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
2519 ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), this, aViewWindow);
2528 ::initialize( CAM_Application* theApp )
2530 SalomeApp_Module::initialize( theApp );
2532 mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
2534 mySweep = new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
2543 action( VISU_ACTOR_SELECTION )->setChecked( true );
2551 QWidget* aParent = application()->desktop();
2552 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
2556 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_IMPORT_MED"));
2557 createAction( VISU_IMPORT_FROM_FILE, tr("IMPORT_FROM_FILE"), QIcon(aPixmap),
2558 tr("MEN_IMPORT_FROM_FILE"), "", (Qt::CTRL + Qt::Key_I), aParent, false,
2559 this, SLOT(OnImportFromFile()));
2561 createAction( VISU_IMPORT_TABLE, "", QIcon(),
2562 tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
2563 this, SLOT(OnImportTableFromFile()));
2565 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
2566 createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIcon(aPixmap),
2567 tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
2568 this, SLOT(OnCreateScalarMap()));
2570 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
2571 createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIcon(aPixmap),
2572 tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
2573 this, SLOT(OnCreateDeformedShape()));
2575 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"));
2576 createAction( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), QIcon(aPixmap),
2577 tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), "", 0, aParent, false,
2578 this, SLOT(OnCreateDeformedShapeAndScalarMap()));
2580 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
2581 createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIcon(aPixmap),
2582 tr("MEN_VECTORS"), "", 0, aParent, false,
2583 this, SLOT(OnCreateVectors()));
2585 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
2586 createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIcon(aPixmap),
2587 tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
2588 this, SLOT(OnCreateIsoSurfaces()));
2590 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
2591 createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIcon(aPixmap),
2592 tr("MEN_CUT_PLANES"), "", 0, aParent, false,
2593 this, SLOT(OnCreateCutPlanes()));
2595 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
2596 createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIcon(aPixmap),
2597 tr("MEN_STREAM_LINES"), "", 0, aParent, false,
2598 this, SLOT(OnCreateStreamLines()));
2600 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
2601 createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIcon(aPixmap),
2602 tr("MEN_CUT_LINES"), "", 0, aParent, false,
2603 this, SLOT(OnCreateCutLines()));
2605 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_SEGMENT"));
2606 createAction( VISU_CUT_SEGMENT, tr("MEN_CUT_SEGMENT"), QIcon(aPixmap),
2607 tr("MEN_CUT_SEGMENT"), "", 0, aParent, false,
2608 this, SLOT(OnCreateCutSegment()));
2610 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2611 createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIcon(aPixmap),
2612 tr("MEN_PLOT_3D"), "", 0, aParent, false,
2613 this, SLOT(OnCreatePlot3D()));
2615 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
2616 createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIcon(aPixmap),
2617 tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
2618 this, SLOT(OnCreatePlot2dView()));
2620 createAction( VISU_DELETE_OBJS, tr("MEN_DELETE_OBJS"), QIcon(),
2621 tr("MEN_DELETE_OBJS"), "", Qt::Key_Delete, aParent, false,
2622 this, SLOT(OnDeleteObjects()));
2624 createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIcon(),
2625 tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
2626 this, SLOT(OnShowTable()));
2628 createAction( VISU_EDIT_POINTMAP3D, tr("MEN_EDIT_PRS"), QIcon(),
2629 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2630 this, SLOT(OnShowTablePlot()));
2632 createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIcon(),
2633 tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
2634 this, SLOT(OnPlotData()));
2636 createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIcon(),
2637 tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
2638 this, SLOT(OnExportTableToFile()));
2640 createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIcon(),
2641 tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
2642 this, SLOT(OnImportMedField()));
2644 createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIcon(),
2645 tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
2646 this, SLOT(OnImportMedField()));
2648 createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIcon(),
2649 tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
2650 this, SLOT(OnImportMedField()));
2652 createAction( VISU_LOAD_COMPONENT_DATA, tr("MEN_LOAD_COMPONENT_DATA"), QIcon(),
2653 tr("MEN_LOAD_COMPONENT_DATA"), "", 0, aParent, false,
2654 this, SLOT(OnLoadComponentData()));
2656 createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIcon(),
2657 tr("MEN_CREATE_PRS"), "", 0, aParent, false,
2658 this, SLOT(OnCreateMesh()));
2660 createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIcon(),
2661 tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
2662 this, SLOT(OnCreateManyMesh()));
2664 createAction( VISU_TRANSLATE_PRS, tr("MEN_TRANSLATE_PRS"), QIcon(),
2665 tr("MEN_TRANSLATE_PRS"), "", 0, aParent, false,
2666 this, SLOT(OnTranslatePrs()));
2668 createAction( VISU_MERGE_SCALAR_BARS, tr("MEN_MERGE_SCALAR_BARS"), QIcon(),
2669 tr("MEN_MERGE_SCALAR_BARS"), "", 0, aParent, false,
2670 this, SLOT(OnMergeScalarBars()));
2672 createAction( VISU_FREE_SCALAR_BARS, tr("MEN_FREE_SCALAR_BARS"), QIcon(),
2673 tr("MEN_FREE_SCALAR_BARS"), "", 0, aParent, false,
2674 this, SLOT(OnFreeScalarBars()));
2676 createAction( VISU_ERASE, tr("MEN_HIDE"), QIcon(),
2677 tr("MEN_HIDE"), "", 0, aParent, false,
2678 this, SLOT(OnErasePrs()));
2680 createAction( VISU_DISPLAY, tr("MEN_SHOW"), QIcon(),
2681 tr("MEN_SHOW"), "", 0, aParent, false,
2682 this, SLOT(OnDisplayPrs()));
2684 createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIcon(),
2685 tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
2686 this, SLOT(OnDisplayOnlyPrs()));
2688 createAction( VISU_SHOW_SCALAR_BAR, tr("MEN_SHOW_SCALAR_BAR"), QIcon(),
2689 tr("MEN_SHOW_SCALAR_BAR"), "", 0, aParent, false,
2690 this, SLOT(OnShowScalarBar()));
2692 createAction( VISU_HIDE_SCALAR_BAR, tr("MEN_HIDE_SCALAR_BAR"), QIcon(),
2693 tr("MEN_HIDE_SCALAR_BAR"), "", 0, aParent, false,
2694 this, SLOT(OnHideScalarBar()));
2696 createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIcon(),
2697 tr("MEN_COPY_PRS"), "", 0, aParent, false,
2698 this, SLOT(OnCopyPresentation()));
2700 createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIcon(),
2701 tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
2702 this, SLOT(OnCurveProperties()));
2704 createAction( VISU_RENAME, tr("MEN_RENAME"), QIcon(),
2705 tr("MEN_RENAME"), "", Qt::Key_F2, aParent, false,
2706 this, SLOT(OnRename()));
2708 createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIcon(),
2709 tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
2710 this, SLOT(OnEditContainer()));
2712 createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIcon(),
2713 tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
2714 this, SLOT(OnClearContainer()));
2716 createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIcon(),
2717 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2718 this, SLOT(OnSaveViewParams()));
2719 createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIcon(),
2720 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2721 this, SLOT(OnSaveViewParams()));
2723 createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIcon(),
2724 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
2725 this, SLOT(OnRestoreViewParams()));
2727 //createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIcon(),
2728 // tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
2729 // this, SLOT(OnDeleteObjects()));
2731 createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIcon(),
2732 tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false,
2733 this, SLOT(OnArrangeActors()));
2735 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
2736 createAction( VISU_POINTS, tr("MEN_POINTS"), QIcon(aPixmap),
2737 tr("MEN_POINTS"), "", 0, aParent, false,
2738 this, SLOT(OnMakePoints()));
2740 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
2741 createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIcon(aPixmap),
2742 tr("MEN_WIREFRAME"), "", 0, aParent, false,
2743 this, SLOT(OnMakeWireframe()));
2745 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
2746 createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIcon(aPixmap),
2747 tr("MEN_SURFACE"), "", 0, aParent, false,
2748 this, SLOT(OnMakeSurface()));
2750 createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIcon(),
2751 tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
2752 this, SLOT(OnMakeInsideframe()));
2754 createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIcon(),
2755 tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
2756 this, SLOT(OnMakeSurfaceframe()));
2758 createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIcon(),
2759 tr("MEN_SHRINK"), "", 0, aParent, false,
2760 this, SLOT(OnMakeShrink()));
2762 createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIcon(),
2763 tr("MEN_UNSHRINK"), "", 0, aParent, false,
2764 this, SLOT(OnMakeShrink()));
2766 createAction( VISU_FEATURE_EDGES, tr("MEN_FEATURE_EDGES"), QIcon(),
2767 tr("MEN_FEATURE_EDGES"), "", 0, aParent, false,
2768 this, SLOT(OnMakeFeatureEdges()));
2770 createAction( VISU_SHADING, tr("MEN_SHADING"), QIcon(),
2771 tr("MEN_SHADING"), "", 0, aParent, false,
2772 this, SLOT(OnSetShadingOn()));
2774 createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIcon(),
2775 tr("MEN_NOSHADING"), "", 0, aParent, false,
2776 this, SLOT(OnSetShadingOff()));
2778 createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIcon(),
2779 tr("MEN_CELL_COLOR"), "", 0, aParent, false,
2780 this, SLOT(OnChangeColor()));
2782 createAction( VISU_COLOR, tr("MEN_COLOR"), QIcon(),
2783 tr("MEN_COLOR"), "", 0, aParent, false,
2784 this, SLOT(OnChangeColor()));
2786 createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIcon(),
2787 tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
2788 this, SLOT(OnChangeWireframeColor()));
2790 createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIcon(),
2791 tr("MEN_OPACITY"), "", 0, aParent, false,
2792 this, SLOT(OnChangeOpacity()));
2794 createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIcon(),
2795 tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
2796 this, SLOT(OnChangeLines()));
2798 createAction( VISU_POINT_MARKER, tr("MEN_POINT_MARKER"), QIcon(),
2799 tr("MEN_POINT_MARKER"), "", 0, aParent, false,
2800 this, SLOT(OnChangePointMarker()));
2802 createAction( VISU_SHRINK_FACTOR, tr("MEN_SHRINK_FACTOR"), QIcon(),
2803 tr("MEN_SHRINK_FACTOR"), "", 0, aParent, false,
2804 this, SLOT(OnChangeShrinkFactor()));
2807 createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
2808 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2809 this, SLOT(OnEditScalarMap()));
2811 createAction( VISU_EDIT_DEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIcon(),
2812 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2813 this, SLOT(OnEditDeformedShape()));
2815 createAction( VISU_EDIT_CUTPLANES, tr("MEN_EDIT_PRS"), QIcon(),
2816 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2817 this, SLOT(OnEditCutPlanes()));
2819 createAction( VISU_EDIT_CUTLINES, tr("MEN_EDIT_PRS"), QIcon(),
2820 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2821 this, SLOT(OnEditCutLines()));
2823 createAction( VISU_EDIT_CUTSEGMENT, tr("MEN_EDIT_PRS"), QIcon(),
2824 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2825 this, SLOT(OnEditCutSegment()));
2827 createAction( VISU_EDIT_ISOSURFACES, tr("MEN_EDIT_PRS"), QIcon(),
2828 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2829 this, SLOT(OnEditIsoSurfaces()));
2831 createAction( VISU_EDIT_VECTORS, tr("MEN_EDIT_PRS"), QIcon(),
2832 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2833 this, SLOT(OnEditVectors()));
2835 createAction( VISU_EDIT_STREAMLINES, tr("MEN_EDIT_PRS"), QIcon(),
2836 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2837 this, SLOT(OnEditStreamLines()));
2839 createAction( VISU_EDIT_PLOT3D, tr("MEN_EDIT_PRS"), QIcon(),
2840 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2841 this, SLOT(OnEditPlot3D()));
2843 createAction( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
2844 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2845 this, SLOT(OnEditDeformedShapeAndScalarMap()));
2847 createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIcon(),
2848 tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
2849 this, SLOT(OnCreateTable()));
2851 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP_PANEL"));
2852 createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIcon(aPixmap),
2853 tr("MEN_SWEEP"), "", 0, aParent, false,
2854 this, SLOT(OnSweep()));
2856 createAction( VISU_CLIPPING, tr("MEN_CLIPPING"), QIcon(),
2857 tr("MEN_CLIPPING"), "", 0, aParent, false,
2858 this, SLOT(OnClippingPlanes()));
2860 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2861 createAction( VISU_PARALLELANIMATION, tr("MEN_PARALLEL_ANIMATION"), QIcon(aPixmap),
2862 tr("MEN_PARALLEL_ANIMATION"), "", 0, aParent, false,
2863 this, SLOT(OnParallelTimeAnimation()));
2865 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2866 createAction( VISU_SUCCCESSIVEANIMATION, tr("MEN_SUCCCESSIVE_ANIMATION"), QIcon(aPixmap),
2867 tr("MEN_SUCCCESSIVE_ANIMATION"), "", 0, aParent, false,
2868 this, SLOT(OnSucccessiveTimeAnimation()));
2870 createAction( VISU_POINT_EVOLUTION, tr("MEN_POINT_EVOLUTION"), QIcon(),
2871 tr("MEN_POINT_EVOLUTION"), "", 0, aParent, false,
2872 this, SLOT(OnPointEvolution()));
2874 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
2875 createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIcon(aPixmap),
2876 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
2877 this, SLOT(OnEraseAll()));
2879 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SELECTION_PANEL"));
2880 createAction( VISU_SELECTION_PANEL, tr("MEN_SELECTION_PANEL"), QIcon(aPixmap),
2881 tr("MEN_SELECTION_PANEL"), "", 0, aParent, false,
2882 this, SLOT(OnToggleSelectionPanel()));
2884 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ACTOR_SELECTION"));
2885 createAction( VISU_ACTOR_SELECTION, tr("MEN_ACTOR_SELECTION"), QIcon(aPixmap),
2886 tr("MEN_ACTOR_SELECTION"), "", 0, aParent, true,
2887 this, SLOT(OnSwitchSelectionMode()));
2889 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CELL_SELECTION"));
2890 createAction( VISU_CELL_SELECTION, tr("MEN_CELL_SELECTION"), QIcon(aPixmap),
2891 tr("MEN_CELL_SELECTION"), "", 0, aParent, true,
2892 this, SLOT(OnSwitchSelectionMode()));
2894 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINT_SELECTION"));
2895 createAction( VISU_POINT_SELECTION, tr("MEN_POINT_SELECTION"), QIcon(aPixmap),
2896 tr("MEN_POINT_SELECTION"), "", 0, aParent, true,
2897 this, SLOT(OnSwitchSelectionMode()));
2899 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_POINT_SELECTION"));
2900 createAction( VISU_GAUSS_POINT_SELECTION, tr("MEN_GAUSS_POINT_SELECTION"), QIcon(aPixmap),
2901 tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
2902 this, SLOT(OnSwitchSelectionMode()));
2904 // Definition of the actions for the "Navigation" tool bar
2905 registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
2906 registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
2908 createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIcon(),
2909 tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
2910 this, SLOT(OnShowAnimation()));
2912 createAction( VISU_SHOW_EVOLUTION, tr("MEN_SHOW_EVOLUTION"), QIcon(),
2913 tr("MEN_SHOW_EVOLUTION"), "", 0, aParent, false,
2914 this, SLOT(OnShowEvolution()));
2916 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2917 createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIcon(aPixmap),
2918 tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
2919 this, SLOT(OnPlot3dFromCutPlane()));
2921 createAction( VISU_MANAGE_CACHE, tr("MEN_MANAGE_CACHE"), QIcon(),
2922 tr("MEN_MANAGE_CACHE"), "", 0, aParent, false,
2923 this, SLOT( OnManageCache() ) );
2925 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
2926 createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIcon(aPixmap),
2927 tr("MEN_MULTIPR_VIEW_FULL_RES"), "", 0, aParent, false,
2928 this, SLOT(OnMultiprViewFullRes()));
2930 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_MEDIUM"));
2931 createAction( VISU_MULTIPR_MED_RES, tr("MEN_MULTIPR_VIEW_MEDIUM_RES"), QIcon(aPixmap),
2932 tr("MEN_MULTIPR_VIEW_MEDIUM_RES"), "", 0, aParent, false,
2933 this, SLOT(OnMultiprViewMediumRes()));
2935 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_LOW"));
2936 createAction( VISU_MULTIPR_LOW_RES, tr("MEN_MULTIPR_VIEW_LOW_RES"), QIcon(aPixmap),
2937 tr("MEN_MULTIPR_VIEW_LOW_RES"), "", 0, aParent, false,
2938 this, SLOT(OnMultiprViewLowRes()));
2940 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_HIDE"));
2941 createAction( VISU_MULTIPR_HIDE, tr("MEN_MULTIPR_VIEW_HIDE"), QIcon(aPixmap),
2942 tr("MEN_MULTIPR_VIEW_HIDE"), "", 0, aParent, false,
2943 this, SLOT(OnMultiprViewHide()));
2945 createAction( VISU_FILE_INFO, tr("MEN_FILE_INFO"), QIcon(),
2946 tr("MEN_FILE_INFO"), "", 0, aParent, false,
2947 this, SLOT(OnFileInfo()));
2949 createAction( VISU_EXPORT_MED, tr("VISU_MEN_EXPORT_MED"), QIcon(),
2950 tr("VISU_MEN_EXPORT_MED"), "", 0, aParent, false,
2951 this, SLOT(OnExportMED()));
2953 createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(),
2954 tr("MEN_FILTER_SCALARS"), "", 0, aParent, false,
2955 this, SLOT(OnFilterScalars()));
2957 createAction( VISU_VALUES_LABELING, tr("MEN_VALUES_LABELING"), QIcon(),
2958 tr("MEN_VALUES_LABELING"), "", 0, aParent, true,
2959 this, SLOT(OnValuesLabeling()));
2961 createAction( VISU_VALUES_LABELING_PARAMS, tr("VISU_VALUES_LABELING_PARAMS"), QIcon(),
2962 tr("VISU_VALUES_LABELING_PARAMS"), "", 0, aParent, false,
2963 this, SLOT(OnValuesLabelingParams()));
2965 createAction(VISU_ARCQUAD_MODE, tr("MEN_VISU_ARCQUAD_MODE"), QIcon(),
2966 tr("MEN_VISU_ARCQUAD_MODE"), "",0, aParent, true,
2967 this, SLOT(OnArcQuadMode()));
2969 createAction(VISU_LINEQUAD_MODE, tr("MEN_VISU_LINEQUAD_MODE"),QIcon(),
2970 tr("MEN_VISU_LINEQUAD_MODE"), "",0, aParent, true,
2971 this, SLOT(OnLineQuadMode()));
2979 // Add actions to menus
2981 aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
2982 createMenu( separator(), aMenuId, -1, 10 );
2984 int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
2985 createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
2986 createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
2988 aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
2989 createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
2990 createMenu( VISU_DEFORMED_SHAPE, aMenuId, 10 ); // deformed shape
2991 createMenu( VISU_VECTORS, aMenuId, 10 ); // vectors
2992 createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
2993 createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
2994 createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
2995 createMenu( VISU_CUT_SEGMENT, aMenuId, 10 ); // cut segment
2996 createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
2997 createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
2998 createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aMenuId, 10 ); // scalar map on deformed shape
3000 aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
3002 createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
3003 createMenu( VISU_POINTS, parentId, 10 ); // points
3004 createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
3005 createMenu( VISU_SURFACE, parentId, 10 ); // surface
3006 createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
3008 parentId = createMenu( tr( "MEN_2D_QUADRATIC_MODE" ), aMenuId, 10 ); // 2D quadratic mode
3009 createMenu( VISU_LINEQUAD_MODE, parentId, 10 ); // lines
3010 createMenu( VISU_ARCQUAD_MODE, parentId, 10 ); // arcs
3018 int aToolId = createTool( tr("TOOL_IMPORT") );
3019 createTool( VISU_IMPORT_FROM_FILE, aToolId );
3021 aToolId = createTool(tr("TOOL_VISUALISATION"));
3022 createTool( VISU_SCALAR_MAP, aToolId );
3023 createTool( VISU_DEFORMED_SHAPE, aToolId );
3024 createTool( VISU_VECTORS, aToolId );
3025 createTool( VISU_ISO_SURFACES, aToolId );
3026 createTool( VISU_CUT_PLANES, aToolId );
3027 createTool( VISU_CUT_LINES, aToolId );
3028 createTool( VISU_CUT_SEGMENT, aToolId );
3029 createTool( VISU_STREAM_LINES, aToolId );
3030 createTool( VISU_PLOT_3D, aToolId );
3031 createTool( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aToolId );
3033 aToolId = createTool(tr("TOOL_REPRESENTATION"));
3034 createTool( VISU_POINTS, aToolId );
3035 createTool( VISU_WIREFRAME, aToolId );
3036 createTool( VISU_SURFACE, aToolId );
3037 createTool( VISU_ERASE_ALL, aToolId );
3039 aToolId = createTool(tr("TOOL_SELECTION"));
3040 createTool( VISU_SELECTION_PANEL, aToolId );
3041 createTool( separator(), aToolId );
3042 createTool( VISU_ACTOR_SELECTION, aToolId );
3043 createTool( VISU_CELL_SELECTION, aToolId );
3044 createTool( VISU_POINT_SELECTION, aToolId );
3045 createTool( VISU_GAUSS_POINT_SELECTION, aToolId );
3047 aToolId = createTool( tr( "TOOL_NAVIGATION" ) );
3048 createTool( VISU_SLIDER_PANEL, aToolId );
3049 createTool( separator(), aToolId );
3050 createTool( VISU_SWEEP_PANEL, aToolId );
3055 ::createPopupMenus()
3057 // Prepare popup menus
3058 QtxPopupMgr* mgr = popupMgr();
3060 // VISU root commands
3061 mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED file
3062 mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
3063 mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
3065 //mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
3068 mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
3069 mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
3070 mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
3071 mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
3072 mgr->insert( action( VISU_CUT_SEGMENT ), -1, -1, -1 ); // cut segment
3073 mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
3074 mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
3075 mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
3076 mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
3077 mgr->insert( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), -1, -1, -1 ); // scalar map on deformed shape
3079 mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
3080 mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
3082 mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
3085 mgr->insert( action( VISU_EDIT_SCALARMAP ), -1, -1, -1 );
3086 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
3087 mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
3088 mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
3089 mgr->insert( action( VISU_EDIT_CUTSEGMENT ), -1, -1, -1 );
3090 mgr->insert( action( VISU_EDIT_ISOSURFACES ), -1, -1, -1 );
3091 mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
3092 mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
3093 mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
3094 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ), -1, -1, -1 );
3095 mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
3096 mgr->insert( action( VISU_EDIT_POINTMAP3D ), -1, -1, -1 );
3098 mgr->insert( action( VISU_FILTERSCALARS ), -1, -1, -1 );
3101 mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
3104 mgr->insert( action( VISU_COPY_PRS ), -1, -1, -1 );
3107 mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
3110 mgr->insert( separator(), -1, -1, -1 );
3111 mgr->insert( action( VISU_VALUES_LABELING ), -1, -1, -1 );
3112 mgr->insert( action( VISU_VALUES_LABELING_PARAMS ), -1, -1, -1 );
3113 mgr->insert( separator(), -1, -1, -1 );
3116 mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
3117 mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
3118 mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
3120 mgr->insert( separator(), -1, -1, -1 );
3122 mgr->insert( action( VISU_ERASE ), -1, -1, -1 ); // erase
3123 mgr->insert( action( VISU_DISPLAY ), -1, -1, -1 ); // display
3124 mgr->insert( action( VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
3126 mgr->insert( action( VISU_HIDE_SCALAR_BAR ), -1, -1, -1 ); // hide scalar bar
3127 mgr->insert( action( VISU_SHOW_SCALAR_BAR ), -1, -1, -1 ); // show scalar bar
3129 // "Representation" submenu
3130 int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 );
3131 mgr->insert( action( VISU_POINTS ) , parentId, -1, -1 ); // points
3132 mgr->insert( action( VISU_WIREFRAME ) , parentId, -1, -1 ); // wireframe
3133 mgr->insert( action( VISU_SURFACE ) , parentId, -1, -1 ); // surface
3134 mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
3135 mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
3136 mgr->insert( action( VISU_FEATURE_EDGES ), parentId, -1, -1 ); // feature edges
3137 mgr->insert( action( VISU_SHRINK ) , parentId, -1, -1 ); // shrink
3138 mgr->insert( action( VISU_UNSHRINK ) , parentId, -1, -1 ); // unshrink
3139 mgr->insert( separator(), parentId, -1, -1 );
3140 mgr->insert( action( VISU_SHADING ) , parentId, -1, -1 ); // shading
3141 mgr->insert( action( VISU_NOSHADING ) , parentId, -1, -1 ); // noshading
3143 //"2D Quadratic" submenu
3144 parentId = mgr->insert( tr( "MEN_2D_QUADRATIC_MODE" ), -1, -1 );
3145 mgr->insert( action( VISU_LINEQUAD_MODE ), parentId, -1, -1 ); // line representation
3146 mgr->insert( action( VISU_ARCQUAD_MODE ), parentId, -1, -1 ); // arc representation
3148 // "Properties" submenu
3149 parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
3150 mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
3151 mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
3152 mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
3153 mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
3154 mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
3155 mgr->insert( action( VISU_POINT_MARKER ), parentId, -1, -1 ); // point marker
3156 mgr->insert( action( VISU_SHRINK_FACTOR ), parentId, -1, -1 ); // shrink factor
3158 mgr->insert( separator(), -1, -1, -1 );
3160 // Other presentations management
3161 mgr->insert( action( VISU_TRANSLATE_PRS ), -1, -1, -1 );
3162 mgr->insert( action( VISU_CLIPPING ), -1, -1, -1 );
3164 mgr->insert( action( VISU_MERGE_SCALAR_BARS ), -1, -1, -1 );
3165 mgr->insert( action( VISU_FREE_SCALAR_BARS ), -1, -1, -1 );
3167 mgr->insert( action( VISU_SWEEP ), -1, -1, -1 );
3168 mgr->insert( action( VISU_PARALLELANIMATION ), -1, -1, -1 );
3169 mgr->insert( action( VISU_SUCCCESSIVEANIMATION ), -1, -1, -1 );
3171 mgr->insert( separator(), -1, -1, -1 );
3173 mgr->insert( action( VISU_POINT_EVOLUTION ), -1, -1, -1 );
3175 mgr->insert( separator(), -1, -1, -1 );
3177 // view parameters commands
3178 mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
3179 mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
3180 mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
3181 //mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
3183 mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
3185 mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
3187 mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
3188 mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
3189 mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
3190 mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
3192 mgr->insert( action( VISU_FILE_INFO ), -1, -1, -1 );
3193 mgr->insert( action( VISU_EXPORT_MED ), -1, -1, -1 );
3197 QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3198 "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
3199 "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
3200 QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3201 "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
3202 "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
3204 // VISU root commands
3205 QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
3206 mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule );
3207 mgr->setRule( action( VISU_IMPORT_TABLE ), aRule );
3208 mgr->setRule( action( VISU_PLOT2D ), aRule );
3210 // timestamp commands
3211 aRule = "client='ObjectBrowser' and selcount=1 and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'}";
3212 mgr->setRule( action( VISU_SCALAR_MAP ), aRule );
3213 mgr->setRule( action( VISU_ISO_SURFACES ), aRule );
3214 mgr->setRule( action( VISU_CUT_PLANES ), aRule );
3215 mgr->setRule( action( VISU_CUT_LINES ), aRule );
3216 mgr->setRule( action( VISU_CUT_SEGMENT ), aRule );
3217 mgr->setRule( action( VISU_PLOT_3D ), aRule );
3218 aRule += " and nbComponents>1";
3219 mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule );
3220 mgr->setRule( action( VISU_VECTORS ), aRule );
3221 mgr->setRule( action( VISU_STREAM_LINES ), aRule );
3222 mgr->setRule( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), aRule );
3224 // display/erase commands
3225 QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
3226 QString aTableOrContHide = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreVisibleCurves)";
3227 QString aTableOrContShow = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreHiddenCurves)";
3228 QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
3229 QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
3230 QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
3231 QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
3232 QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
3234 QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
3235 " or ( (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
3237 QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
3238 " or ( (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
3240 QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
3241 " or ( ((type='VISU::TTABLE' and nbChildren>0) or (type='VISU::TCONTAINER' and hasCurves) or"
3242 " (type='VISU::TCURVE')))) ) or" + aComponent;
3244 QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and (isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and isScalarBarVisible )";
3245 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) )";
3247 mgr->setRule( action( VISU_ERASE ), anEraseRule );
3248 mgr->setRule( action( VISU_DISPLAY ), aDisplayRule );
3249 mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule );
3251 mgr->setRule( action( VISU_HIDE_SCALAR_BAR ), aScalarBarHideRule );
3252 mgr->setRule( action( VISU_SHOW_SCALAR_BAR ), aScalarBarShowRule );
3254 aRule = "selcount>0 and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}";
3255 mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule );
3257 aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
3258 mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule );
3259 mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule );
3261 aRule = "selcount=1 and $type in { " + aSimplePrsAll + "}";
3262 mgr->setRule( action( VISU_FILTERSCALARS ), aRule );
3266 aRule = "hasActor=1 and selcount=1 and $type in { 'VISU::TGAUSSPOINTS'" + aPrsAll + " }";
3267 mgr->setRule( action( VISU_VALUES_LABELING ), aRule, QtxPopupMgr::VisibleRule );
3268 mgr->setRule( action( VISU_VALUES_LABELING ), "{true} in $isValuesLabeled", QtxPopupMgr::ToggleRule );
3269 mgr->setRule( action( VISU_VALUES_LABELING_PARAMS ), aRule, QtxPopupMgr::VisibleRule );
3272 aRule = "isVisible and hasActor=1 and selcount=1 and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3273 mgr->setRule (action(VISU_ARCQUAD_MODE), aRule , QtxPopupMgr::VisibleRule);
3274 mgr->setRule (action(VISU_LINEQUAD_MODE),aRule , QtxPopupMgr::VisibleRule);
3276 mgr->setRule (action(VISU_ARCQUAD_MODE), aRule + " and quadratic2DMode='VISU::ARCS'", QtxPopupMgr::ToggleRule);
3277 mgr->setRule (action(VISU_LINEQUAD_MODE),aRule + " and quadratic2DMode='VISU::LINES'", QtxPopupMgr::ToggleRule);
3281 aRule = "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'";
3282 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule );
3283 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0 and activeView='VTKViewer'" );
3284 mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'" );
3285 //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
3287 mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'SVTK'} and selcount=0" );
3289 // 3D presentations commands
3290 QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TGAUSSPOINTS' " + aPrsAll + "}";
3291 QString aPrsType2 = " and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
3292 QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3293 //QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3294 QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCUTPLANES' 'VISU::TISOSURFACES' 'VISU::TPLOT3D' }";
3295 //QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
3296 QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3297 " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3298 QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3299 QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
3300 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3302 QString aFeatureEdgesType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
3304 aRule = "selcount=1";
3305 mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
3306 aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
3308 // "Representation" submenu
3309 QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3310 QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3311 QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3312 QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3313 QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::FEATURE_EDGES'}";
3314 QString aNotFeatureEdges = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
3316 mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints );
3317 mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType2 + aNotWirefr );
3318 mgr->setRule( action( VISU_SURFACE ) , aRule + aSurfType + aNotSurfac );
3319 mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + anInsideType + aNotInside );
3320 mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr );
3321 mgr->setRule( action( VISU_FEATURE_EDGES ), aRule + aFeatureEdgesType + aNotFeatureEdges );
3323 mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0" );
3324 mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1" );
3326 mgr->setRule( action( VISU_SHADING ) , aRule + " and isScalarMapAct=1 and isShading=0" );
3327 mgr->setRule( action( VISU_NOSHADING ), aRule + " and isScalarMapAct=1 and isShading=1" );
3329 // "Properties" submenu
3330 mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'" );
3331 mgr->setRule( action( VISU_EDGE_COLOR ), aRule + aSurfFrameType + " and representation='VISU::SURFACEFRAME'" );
3332 mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
3333 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
3334 "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))" );
3335 mgr->setRule( action( VISU_OPACITY ), aRule + " and hasActor=1" );
3336 mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1" );
3337 mgr->setRule( action( VISU_POINT_MARKER ), aRule + aLineType + " and hasActor=1 and representation='VISU::POINT'" );
3338 mgr->setRule( action( VISU_SHRINK_FACTOR ), aRule + aShrinkType + " and isShrunk=1" );
3341 QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::POINTMAP3D'";
3343 aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TPOINTMAP3D' " + aCurveAll + " " + aPrsAll + "})";
3344 mgr->setRule( action( VISU_RENAME ), aRule );
3346 // copy presentation command
3347 aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
3348 mgr->setRule( action( VISU_COPY_PRS ), aRule );
3351 aRule = "selcount=1 and type='VISU::TCURVE'";
3352 mgr->setRule( action( VISU_CURVE_PROPS ), aRule );
3355 aRule = "selcount=1 and ( type='VISU::TPOINTMAP3D' or type='VISU::TTABLE')";
3356 mgr->setRule( action( VISU_SHOW_TABLE ), aRule );
3357 mgr->setRule( action( VISU_CREATE_CURVES ), aRule );
3358 mgr->setRule( action( VISU_EXPORT_TABLE ), aRule );
3360 // curve container commands
3361 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
3362 mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule );
3363 mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule );
3365 mgr->setRule( action( VISU_EDIT_SCALARMAP ),
3366 "selcount=1 and type='VISU::TSCALARMAP'" );
3367 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
3368 "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
3369 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
3370 "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
3371 mgr->setRule( action( VISU_EDIT_CUTPLANES ),
3372 "selcount=1 and type='VISU::TCUTPLANES'" );
3373 mgr->setRule( action( VISU_EDIT_CUTLINES ),
3374 "selcount=1 and type='VISU::TCUTLINES'" );
3375 mgr->setRule( action( VISU_EDIT_CUTSEGMENT ),
3376 "selcount=1 and type='VISU::TCUTSEGMENT'" );
3377 mgr->setRule( action( VISU_EDIT_ISOSURFACES ),
3378 "selcount=1 and type='VISU::TISOSURFACES'" );
3379 mgr->setRule( action( VISU_EDIT_VECTORS ),
3380 "selcount=1 and type='VISU::TVECTORS'" );
3381 mgr->setRule( action( VISU_EDIT_STREAMLINES ),
3382 "selcount=1 and type='VISU::TSTREAMLINES'" );
3383 mgr->setRule( action( VISU_EDIT_PLOT3D ),
3384 "selcount=1 and type='VISU::TPLOT3D'" );
3385 mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
3386 "selcount=1 and type='VISU::TPOINTMAP3D'" );
3388 aRule = "selcount=1 and $type in {'VISU::TCUTLINES' 'VISU::TCUTSEGMENT'} and nbNamedChildren=0";
3389 mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
3391 aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "}) and isFieldPrs=0";
3392 mgr->setRule( action( VISU_SWEEP ), aRule );
3394 aRule = "client='ObjectBrowser' and selcount>0";
3395 aRule += " and $type in {'VISU::TFIELD'}";
3396 aRule += " and nbTimeStamps>1";
3397 aRule += " and activeView in {'VTKViewer' 'SVTK'}";
3398 mgr->setRule( action( VISU_PARALLELANIMATION ), aRule );
3400 aRule = "client='ObjectBrowser'";
3401 aRule += " and (selcount=1 and nbTimeStamps>1 or selcount>1 and nbTimeStamps>0)";
3402 aRule += " and $type in {'VISU::TFIELD'}";
3403 aRule += " and activeView in {'VTKViewer' 'SVTK'}";
3404 mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule );
3406 aRule = "client='ObjectBrowser' and selcount>0";
3407 aRule += " and $type in {'VISU::TFIELD'}";
3408 aRule += " and medEntity='NODE_ENTITY'";
3409 aRule += " and nbTimeStamps>1";
3410 mgr->setRule( action( VISU_POINT_EVOLUTION ), aRule );
3412 aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
3413 mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1" );
3414 mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1" );
3415 mgr->setRule( action( VISU_EDIT_PLOT3D ),
3416 "selcount=1 and type='VISU::TPLOT3D'" );
3418 //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
3419 //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
3421 aRule = "client='ObjectBrowser' and selcount>=1 and $type in {'VISU::TPART'} and ";
3423 QString aCustomRule = aRule + "fullResolution=1 and resolutionState!='F'";
3424 mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aCustomRule );
3427 QString aCustomRule = aRule + "mediumResolution=1 and resolutionState!='M'";
3428 mgr->setRule( action( VISU_MULTIPR_MED_RES ), aCustomRule );
3431 QString aCustomRule = aRule + "lowResolution=1 and resolutionState!='L'";
3432 mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aCustomRule );
3435 QString aCustomRule = aRule + "resolutionState!='H'";
3436 mgr->setRule( action( VISU_MULTIPR_HIDE), aCustomRule );
3439 mgr->setRule( action( VISU_FILE_INFO ), "selcount=1 and type in {'VISU::TRESULT'}" );
3440 mgr->setRule( action( VISU_EXPORT_MED ), "selcount=1 and type in {'VISU::TRESULT'}" );
3443 void VisuGUI::createPanels()
3445 myPanels[SelectionPanelId] = new VisuGUI_SelectionPanel( this );
3446 myPanels[FeatureEdgesPanelId] = new VisuGUI_FeatureEdgesPanel( this );
3447 myPanels[ClippingPlanesPanelId] = new VisuGUI_ClippingPanel( this );
3449 VisuGUI_Panel* aPanel;
3450 foreach( aPanel, myPanels ) {
3451 getApp()->desktop()->addDockWidget( Qt::RightDockWidgetArea, aPanel );
3452 aPanel->setVisible( false );
3456 //***************************************************************************
3457 void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle )
3459 SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
3461 //TODO: object Browser DONE
3462 SUIT_DataBrowser* ob = getApp()->objectBrowser();
3463 bool isOBClient = (ob && theClient == ob->popupClientType());
3465 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
3466 SALOME_ListIO aListIO;
3467 aSelectionMgr->selectedObjects(aListIO);
3469 if (aListIO.Extent() < 1) return;
3471 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
3473 // Check if "Merge Scalar Range" can be applied
3475 SALOME_ListIteratorOfListIO It (aListIO);
3476 for (; It.More(); It.Next()) {
3477 Handle(SALOME_InteractiveObject)& anIO = It.Value();
3479 if (!anIO.IsNull() && anIO->hasEntry()) {
3480 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
3484 if ( !isOBClient ) {
3485 QString aName = QString( aSObject->GetName().c_str() );
3486 while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
3487 aName.remove( (aName.length() - 1), 1 );
3491 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
3492 if (CORBA::is_nil(aCORBAObject)) {
3493 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
3494 if (aType == VISU::TTIMESTAMP) {
3495 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
3497 for (; anIter->More(); anIter->Next()) {
3498 aPrs = anIter->Value();
3501 std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
3502 nbPrs += aSubList.size();
3509 theMenu->addSeparator();
3510 theMenu->addAction( action( VISU_MERGE_SCALAR_BARS ) );
3511 theMenu->addAction( action( VISU_FREE_SCALAR_BARS ) );
3514 // Check if some curves selected (for bug PAL10611)
3515 bool isCurves = false;
3516 bool isOneCutPlane = false;
3517 SALOME_ListIteratorOfListIO It1 (aListIO);
3518 for (; It1.More() && !isCurves; It1.Next()) {
3519 Handle(SALOME_InteractiveObject)& anIO = It1.Value();
3520 if (!anIO.IsNull() && anIO->hasEntry()) {
3521 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
3524 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
3525 if (aType == VISU::TCURVE) {
3528 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
3529 if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
3530 if (aPrsObject->GetType() == VISU::TCUTPLANES) {
3531 if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
3532 isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
3540 theMenu->addAction( action( VISU_PLOT3D_FROM_CUTPLANE ) );
3542 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
3543 if(aSelectionInfo.empty())
3546 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
3547 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
3548 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
3549 Storable::TRestoringMap aMap = Storable::GetStorableMap(aSObject);
3550 CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
3552 if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
3553 if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE)
3554 theMenu->addAction( action( VISU_MANAGE_CACHE ) );
3557 theMenu->addSeparator();
3559 // Check if some (nb > 0) removable objects selected
3560 if (isOBClient && IsRemovableSelected(this)) {
3561 theMenu->addAction( action( VISU_DELETE_OBJS ) );
3564 theMenu->removeAction( action( myDisplay ) );
3565 theMenu->removeAction( action( myErase ) );
3566 theMenu->removeAction( action( myDisplayOnly ) );
3567 theMenu->removeAction( action( myEraseAll ) );
3570 // Check single selection
3571 if (aListIO.Extent() != 1)
3574 // Check if the object's data is loaded
3575 _PTR(SComponent) aSComp = aSObject->GetFatherComponent();
3576 std::string aCompIOR;
3577 if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
3578 //std::string aCompDataType = aSComp->ComponentDataType();
3579 theMenu->addAction( action( VISU_LOAD_COMPONENT_DATA ) ); // "Load Component Data"
3582 VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aMap );
3583 if (aType == VISU::TANIMATION) {
3584 theMenu->addAction( action( VISU_SHOW_ANIMATION ) );
3585 } else if (aType == VISU::TEVOLUTION) {
3586 theMenu->addAction( action( VISU_SHOW_EVOLUTION ) );
3587 } else if (isOBClient) {
3588 if (IsSObjectTable(aSObject)) {
3589 /* action( VISU_SHOW_TABLE )->addTo(theMenu);
3590 theMenu->addAction( action( VISU_CREATE_CURVES ) );
3591 theMenu->addAction( action( VISU_EXPORT_TABLE ) );
3592 theMenu->addSeparator();
3593 action( VISU_DELETE_OBJS )->addTo(theMenu);*/// dmv - code was moved up
3595 if (!CORBA::is_nil(anObject)) {
3596 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
3597 if (!CORBA::is_nil(aMED.in())) {
3598 theMenu->addAction( action( VISU_IMPORT_MED_STRUCTURE ) ); // "Import Structure"
3601 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
3602 if (!CORBA::is_nil(aField)) {
3603 theMenu->addAction( action( VISU_IMPORT_MED_TIMESTAMP ) ); // "Import TimeStamp"
3606 _PTR(SObject) aSFather1 = aSObject->GetFather();
3608 std::string aValue = aSFather1->GetName();
3609 if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
3610 theMenu->addAction( action( VISU_IMPORT_MED_FIELD ) ); // "Import Field"
3619 //***************************************************************************
3622 ::windows( QMap<int, int>& theMap ) const
3625 theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
3626 theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
3632 ::viewManagers( QStringList& theList ) const
3635 // append SVTK viewer only if there is no opened VVTK
3636 // SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
3637 // if( vm && vm->getViewsCount()>0 )
3638 // theList.append( VVTK_Viewer::Type() );
3640 theList.append( SVTK_Viewer::Type() );
3648 CORBA::String_var anIOR = GetVisuGen(this)->GetID();
3649 return QString(anIOR.in());
3655 ::activateModule( SUIT_Study* theStudy )
3657 bool aResult = SalomeApp_Module::activateModule( theStudy );
3660 setMenuShown( true );
3661 setToolShown( true );
3663 // import Python module that manages VISU plugins (need to be here because SalomePyQt API uses active module)
3664 PyGILState_STATE gstate = PyGILState_Ensure();
3665 PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
3666 if(pluginsmanager==NULL)
3670 PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_PLUGINS_OTHER").toStdString().c_str());
3675 PyGILState_Release(gstate);
3676 // end of GEOM plugins loading
3678 // Reset actions accelerator keys
3679 QList<QKeySequence> shortcuts;
3680 shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );
3681 action(VISU_IMPORT_FROM_FILE)->setShortcuts(shortcuts);
3683 action(VISU_DELETE_OBJS)->setEnabled(true); // Delete: Key_Delete
3684 action(VISU_RENAME )->setEnabled(true); // Rename: Key_F2
3686 ((VisuGUI_ClippingPanel*) myPanels[ClippingPlanesPanelId])->init();
3688 emit moduleActivated();
3696 ::deactivateModule( SUIT_Study* theStudy )
3698 setMenuShown( false );
3699 setToolShown( false );
3701 // Unset actions accelerator keys
3702 action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); // Import: CTRL + Key_I
3704 action(VISU_DELETE_OBJS)->setEnabled(false); // Delete: Key_Delete
3705 action(VISU_RENAME )->setEnabled(false); // Rename: Key_F2
3707 bool aResult = SalomeApp_Module::deactivateModule( theStudy );
3709 emit moduleDeactivated();
3716 ::createSelection() const
3718 return new VisuGUI_Selection( (SalomeApp_Module*)this );
3721 //******************************************************************
3722 void VisuGUI::studyActivated()
3724 GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
3733 return new VisuGUI();
3738 void VisuGUI::createPreferences()
3740 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
3743 int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) );
3744 // Quantities with individual precision settings
3745 int precGroup = addPreference( tr( "VISU_PREF_GROUP_PRECISION" ), genTab );
3746 setPreferenceProperty( precGroup, "columns", 2 );
3748 // Default precision used by some input fieklds and data visualization code
3749 // Moved here from "Representation" tab to have all precisions in the same place
3750 int point_precision = addPreference( tr( "VISU_PREF_visual_data_precision" ), precGroup,
3751 LightApp_Preferences::IntSpin, "VISU", "visual_data_precision" );
3752 setPreferenceProperty( point_precision, "min", -16 );
3753 setPreferenceProperty( point_precision, "max", 16 );
3754 setPreferenceProperty( point_precision, "step", 1 );
3756 const int nbQuantities = 5;
3757 int precs[nbQuantities], ii = 0;
3758 precs[ii++] = addPreference( tr( "VISU_PREF_length_precision" ), precGroup,
3759 LightApp_Preferences::IntSpin, "VISU", "length_precision" );
3760 precs[ii++] = addPreference( tr( "VISU_PREF_angle_precision" ), precGroup,
3761 LightApp_Preferences::IntSpin, "VISU", "angle_precision" );
3762 precs[ii++] = addPreference( tr( "VISU_PREF_len_tol_precision" ), precGroup,
3763 LightApp_Preferences::IntSpin, "VISU", "len_tol_precision" );
3764 precs[ii++] = addPreference( tr( "VISU_PREF_parametric_precision" ), precGroup,
3765 LightApp_Preferences::IntSpin, "VISU", "parametric_precision" );
3766 precs[ii ] = addPreference( tr( "VISU_PREF_memory_precision" ), precGroup,
3767 LightApp_Preferences::IntSpin, "VISU", "memory_precision" );
3769 // Set property for precision value for spinboxes
3770 for ( ii = 0; ii < nbQuantities; ii++ ){
3771 setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -14 );
3772 setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 14 );
3773 setPreferenceProperty( precs[ii], "precision", 2 );
3777 // TAB: "MED import"
3778 int importTab = addPreference( tr( "MED import" ) );
3779 //printf( "++++++++++++++++++ Tab index %d\n", importTab );
3781 //int importFrame = addPreference( tr( "MED FRAME" ), importTab );
3782 //printf( "Frame index %d\n", importFrame );
3784 // group: "MED files import"
3785 int importGr = addPreference( tr( "MED files import" ), importTab );
3786 //printf( "Group index %d\n", importGr );
3787 setPreferenceProperty( importGr, "columns", 2 );
3789 addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" );
3790 addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
3791 addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
3792 addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
3793 addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" );
3794 addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" );
3795 addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" );
3797 // TAB: "Scalar Bar"
3798 int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
3800 int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), sbarTab );
3801 setPreferenceProperty( rangeGr, "columns", 2 );
3803 int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" );
3805 modes.append( tr( "VISU_MODULUS" ) );
3806 modes.append( tr( "VISU_COMPONENT" ) + tr("1") );
3807 modes.append( tr( "VISU_COMPONENT" ) + tr("2") );
3808 modes.append( tr( "VISU_COMPONENT" ) + tr("3") );
3809 QList<QVariant> indices;
3810 indices.append( 0 );
3811 indices.append( 1 );
3812 indices.append( 2 );
3813 indices.append( 3 );
3814 setPreferenceProperty( mode, "strings", modes );
3815 setPreferenceProperty( mode, "indexes", indices );
3817 addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
3819 int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" );
3821 types.append( tr( "VISU_FIELD_RANGE" ) );
3822 types.append( tr( "VISU_IMPOSED_RANGE" ) );
3824 indices.append( 0 );
3825 indices.append( 1 );
3826 setPreferenceProperty( rangetype, "strings", types );
3827 setPreferenceProperty( rangetype, "indexes", indices );
3829 int gaussMetric = addPreference( tr( "VISU_GAUSS_METRIC" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_gauss_metric" );
3830 QStringList metrics;
3831 metrics.append( tr( "VISU_GAUSS_METRIC_AVERAGE" ) );
3832 metrics.append( tr( "VISU_GAUSS_METRIC_MINIMUM" ) );
3833 metrics.append( tr( "VISU_GAUSS_METRIC_MAXIMUM" ) );
3835 indices.append( 0 );
3836 indices.append( 1 );
3837 indices.append( 2 );
3838 setPreferenceProperty( gaussMetric, "strings", metrics );
3839 setPreferenceProperty( gaussMetric, "indexes", indices );
3841 int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
3842 setPreferenceProperty( imposedGr, "columns", 4 );
3844 int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_min" );
3845 int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_max" );
3846 setPreferenceProperty( min, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
3847 setPreferenceProperty( max, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
3850 int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
3851 setPreferenceProperty( fontGr, "columns", 2 );
3853 addVtkFontPref( tr( "VISU_TITLE" ), fontGr, "scalar_bar_title_font", false );
3854 addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
3856 addVtkFontPref( tr( "VISU_LABELS" ), fontGr, "scalar_bar_label_font", false );
3857 addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
3859 // group: "Colors & Labels"
3860 int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
3861 setPreferenceProperty( colorsLabelsGr, "columns", 4 );
3863 int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr,
3864 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
3865 setPreferenceProperty( numcol, "min", 2 );
3866 setPreferenceProperty( numcol, "max", 256 );
3868 addPreference( tr( "VISU_IS_UNITS" ), colorsLabelsGr,
3869 LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
3871 int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
3872 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
3873 setPreferenceProperty( numlab, "min", 2 );
3874 setPreferenceProperty( numlab, "max", 65 );
3876 int lPrec = addPreference( tr( "PRECISION" ), colorsLabelsGr,
3877 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_label_precision" );
3879 setPreferenceProperty( lPrec, "min", 1 );
3880 setPreferenceProperty( lPrec, "max", 100 );
3882 int frame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
3883 //setPreferenceProperty( frame, "orientation", "vertical" );
3884 setPreferenceProperty( frame, "columns", "2" );
3886 // group: "Orientation"
3887 int orientGr = addPreference( tr( "VISU_ORIENTATION" ), frame, LightApp_Preferences::GroupBox );
3888 setPreferenceProperty( orientGr, "columns", 2 );
3889 int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr,
3890 LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
3891 QStringList orients;
3892 orients.append( tr( "VISU_VERTICAL" ) );
3893 orients.append( tr( "VISU_HORIZONTAL" ) );
3895 indices.append( 0 );
3896 indices.append( 1 );
3897 setPreferenceProperty( orient, "strings", orients );
3898 setPreferenceProperty( orient, "indexes", indices );
3900 // group: "Scalar bars default position"
3901 int scalarBarGr = addPreference( tr( "Scalar bars default position" ), frame, LightApp_Preferences::GroupBox );
3902 addPreference( tr( "Arrange Scalar Bars" ), scalarBarGr, LightApp_Preferences::Bool, "VISU", "scalar_bars_default_position" );
3905 // group: "Origin & Size Vertical"
3906 //int psSzFrame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
3907 //setPreferenceProperty( psSzFrame, "orientation", "horizontal" );
3908 //setPreferenceProperty( psSzFrame, "columns", "2" );
3910 int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ),
3911 frame, LightApp_Preferences::GroupBox );
3912 setPreferenceProperty( posVSizeGr, "columns", 2 );
3913 int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
3914 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
3915 int yv = addPreference( tr( "VISU_Y" ), posVSizeGr,
3916 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
3918 int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr,
3919 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
3920 int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr,
3921 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
3923 int twv = addPreference( tr( "VISU_TITLE_SIZE" ), posVSizeGr,
3924 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_size" );
3926 int lwv = addPreference( tr( "VISU_LABEL_SIZE" ), posVSizeGr,
3927 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_size" );
3929 int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
3930 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
3931 int bhv = addPreference( tr( "VISU_BAR_HEIGHT" ), posVSizeGr,
3932 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_height" );
3934 setPreferenceProperty( xv, "step", 0.1 );
3935 setPreferenceProperty( yv, "step", 0.1 );
3936 setPreferenceProperty( wv, "step", 0.1 );
3937 setPreferenceProperty( hv, "step", 0.1 );
3938 setPreferenceProperty( xv, "min", 0.0 );
3939 setPreferenceProperty( yv, "min", 0.0 );
3940 setPreferenceProperty( wv, "min", 0.0 );
3941 setPreferenceProperty( hv, "min", 0.0 );
3942 setPreferenceProperty( twv, "min", 0 );
3943 setPreferenceProperty( twv, "special", "auto" );
3944 setPreferenceProperty( lwv, "min", 0 );
3945 setPreferenceProperty( lwv, "special", "auto" );
3946 setPreferenceProperty( bwv, "min", 0 );
3947 setPreferenceProperty( bwv, "special", "auto" );
3948 setPreferenceProperty( bhv, "min", 0 );
3949 setPreferenceProperty( bhv, "special", "auto" );
3950 setPreferenceProperty( xv, "max", 1.0 );
3951 setPreferenceProperty( yv, "max", 1.0 );
3952 setPreferenceProperty( wv, "max", 1.0 );
3953 setPreferenceProperty( hv, "max", 1.0 );
3954 setPreferenceProperty( twv, "max", 100 );
3955 setPreferenceProperty( lwv, "max", 100 );
3956 setPreferenceProperty( bwv, "max", 100 );
3957 setPreferenceProperty( bhv, "max", 100 );
3959 // group: "Origin & Size Horizontal"
3960 int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ),
3961 frame, LightApp_Preferences::GroupBox );
3962 setPreferenceProperty( posHSizeGr, "columns", 2 );
3964 int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
3965 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
3966 int yh = addPreference( tr( "VISU_Y" ), posHSizeGr,
3967 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
3969 int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr,
3970 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
3971 int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr,
3972 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
3974 int twh = addPreference( tr( "VISU_TITLE_SIZE" ), posHSizeGr,
3975 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_size" );
3977 int lwh = addPreference( tr( "VISU_LABEL_SIZE" ), posHSizeGr,
3978 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_size" );
3980 int bwh = addPreference( tr( "VISU_BAR_WIDTH" ), posHSizeGr,
3981 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
3982 int bhh = addPreference( tr( "VISU_BAR_HEIGHT" ), posHSizeGr,
3983 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_height" );
3985 setPreferenceProperty( xh, "step", 0.1 );
3986 setPreferenceProperty( yh, "step", 0.1 );
3987 setPreferenceProperty( wh, "step", 0.1 );
3988 setPreferenceProperty( hh, "step", 0.1 );
3989 setPreferenceProperty( xh, "min", 0.0 );
3990 setPreferenceProperty( yh, "min", 0.0 );
3991 setPreferenceProperty( wh, "min", 0.0 );
3992 setPreferenceProperty( hh, "min", 0.0 );
3993 setPreferenceProperty( twh, "min", 0 );
3994 setPreferenceProperty( twh, "special", "auto" );
3995 setPreferenceProperty( lwh, "min", 0 );
3996 setPreferenceProperty( lwh, "special", "auto" );
3997 setPreferenceProperty( bwh, "min", 0 );
3998 setPreferenceProperty( bwh, "special", "auto" );
3999 setPreferenceProperty( bhh, "min", 0 );
4000 setPreferenceProperty( bhh, "special", "auto" );
4001 setPreferenceProperty( xh, "max", 1.0 );
4002 setPreferenceProperty( yh, "max", 1.0 );
4003 setPreferenceProperty( wh, "max", 1.0 );
4004 setPreferenceProperty( hh, "max", 1.0 );
4005 setPreferenceProperty( twh, "max", 100 );
4006 setPreferenceProperty( lwh, "max", 100 );
4007 setPreferenceProperty( bwh, "max", 100 );
4008 setPreferenceProperty( bhh, "max", 100 );
4011 int cutLineTab = addPreference( tr( "VISU_CUT_LINES_SEGMENT" ) );
4013 // group: "CutLines preferences"
4014 int cutLineGr = addPreference( tr( "VISU_CUT_LINES_SEGMENT_PREF" ), cutLineTab );
4015 setPreferenceProperty( cutLineGr, "columns", 1 );
4016 addPreference( tr( "Show preview" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "show_preview" );
4017 addPreference( tr( "Invert all curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "invert_all_curves" );
4018 addPreference( tr( "Use absolute length" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "use_absolute_length" );
4019 addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
4020 addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
4022 // TAB: "StreamLines"
4023 int streamLinesTab = addPreference( tr( "VISU_STREAM_LINES" ) );
4025 // group: "StreamLines preferences"
4026 int streamLinesGr = addPreference( tr( "VISU_STREAM_LINES_PREF" ), streamLinesTab );
4027 setPreferenceProperty( cutLineGr, "columns", 1 );
4028 int usedPoints = addPreference( tr( "VISU_STREAM_LINES_USED_POINTS" ), streamLinesGr,
4029 LightApp_Preferences::DblSpin, "VISU", "stream_lines_used_points" );
4030 setPreferenceProperty( usedPoints, "min", 0 );
4031 setPreferenceProperty( usedPoints, "max", 1 );
4032 setPreferenceProperty( usedPoints, "step", 0.1 );
4034 // TAB: "Sweep, Animation, 3D Cache"
4035 int animationTab = addPreference( tr( "Sweep, Animation" ) );
4037 // group: "3D Cache System prefereces"
4039 int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
4040 setPreferenceProperty( cacheGroup, "columns", 2 );
4042 int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
4043 LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
4046 modes.append( tr( "VISU_MINIMAL" ) );
4047 modes.append( tr( "VISU_LIMITED" ) );
4048 setPreferenceProperty( memory_mode, "strings", modes );
4051 indices.append( 0 );
4052 indices.append( 1 );
4053 setPreferenceProperty( memory_mode, "indexes", indices );
4055 int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
4056 LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
4057 setPreferenceProperty( memory_limit, "min", 1 );
4058 setPreferenceProperty( memory_limit, "max", 5000 );
4059 setPreferenceProperty( memory_limit, "step", 10 );
4062 // group: "Animation preferences"
4064 int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
4065 setPreferenceProperty( animationGroup, "columns", 1 );
4067 int speed = addPreference( tr( "Speed" ), animationGroup,
4068 LightApp_Preferences::IntSpin, "VISU", "speed" );
4069 addPreference( tr( "Cycled animation" ), animationGroup,
4070 LightApp_Preferences::Bool, "VISU", "cycled_animation" );
4071 addPreference( tr( "Use proportional timing" ), animationGroup,
4072 LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
4073 addPreference( tr( "Clean memory at each frame" ), animationGroup,
4074 LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
4076 setPreferenceProperty( speed, "min", 1 );
4077 setPreferenceProperty( speed, "max", 99 );
4079 int dump_mode = addPreference( tr( "VISU_DUMP_MODE" ), animationGroup,
4080 LightApp_Preferences::Selector, "VISU", "dump_mode" );
4083 modes.append( tr( "VISU_NO_DUMP" ) );
4084 modes.append( tr( "VISU_DUMP_PICTURES" ) );
4085 modes.append( tr( "VISU_DUMP_VIDEO" ) );
4086 setPreferenceProperty( dump_mode, "strings", modes );
4089 indices.append( 0 );
4090 indices.append( 1 );
4091 indices.append( 2 );
4092 setPreferenceProperty( dump_mode, "indexes", indices );
4094 int time_stamp_frequency = addPreference( tr( "VISU_TIME_STAMP_FREQUENCY" ), animationGroup,
4095 LightApp_Preferences::IntSpin, "VISU", "time_stamp_frequency" );
4096 setPreferenceProperty( time_stamp_frequency, "min", 1 );
4097 setPreferenceProperty( time_stamp_frequency, "max", 100 );
4100 // group: "Sweeping preferences"
4102 int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
4103 setPreferenceProperty( sweepGroup, "columns", 2 );
4105 int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup,
4106 LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
4107 QStringList sweep_modes;
4108 sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
4109 sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
4110 sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
4112 indices.append( 0 );
4113 indices.append( 1 );
4114 indices.append( 2 );
4115 setPreferenceProperty( modeSw, "strings", sweep_modes );
4116 setPreferenceProperty( modeSw, "indexes", indices );
4118 int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
4119 LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
4120 /* int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
4121 LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );*/
4122 int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGroup,
4123 LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
4124 int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
4126 ranges.append( tr( "PERIOD_PI" ) );
4127 ranges.append( tr( "PERIOD_2PI" ) );
4129 indices.append( 0 );
4130 indices.append( 1 );
4131 setPreferenceProperty( rangeSw, "strings", ranges );
4132 setPreferenceProperty( rangeSw, "indexes", indices );
4134 setPreferenceProperty( timestep, "min", 0.1 );
4135 setPreferenceProperty( timestep, "step", 0.1 );
4136 setPreferenceProperty( timestep, "max", 1000 );
4137 // setPreferenceProperty( nbcycles, "max", 100 );
4138 setPreferenceProperty( nbsteps, "max", 200 );
4142 // TAB: Representation ; group: "Representation properties"
4143 int representationTab = addPreference( tr( "Representation" ) );
4145 int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab );
4146 setPreferenceProperty( representGr, "columns", 2 );
4148 QStringList mesh_modes;
4149 mesh_modes.append( "Points" );
4150 mesh_modes.append( "Wireframe" );
4151 mesh_modes.append( "Insideframe" );
4152 mesh_modes.append( "Surfaceframe" );
4153 mesh_modes.append( "Surface" );
4154 mesh_modes.append( "Feature edges" );
4155 QList<QVariant> mesh_indices;
4156 mesh_indices.append( 0 );
4157 mesh_indices.append( 1 );
4158 mesh_indices.append( 3 );
4159 mesh_indices.append( 4 );
4160 mesh_indices.append( 2 );
4161 mesh_indices.append( 5 );
4163 QStringList modes0 = mesh_modes;
4164 modes0.removeAll( "Feature edges" );
4165 QList<QVariant> indices0 = mesh_indices;
4166 indices0.removeAll( 5 );
4168 QStringList modes1 = modes0;
4169 modes1.removeAll( "Insideframe" );
4170 QList<QVariant> indices1 = indices0;
4171 indices1.removeAll( 3 );
4173 QStringList modes2 = modes1;
4174 modes2.removeAll( "Surfaceframe" );
4175 QList<QVariant> indices2 = indices1;
4176 indices2.removeAll( 4 );
4178 QStringList modes3 = modes2;
4179 modes3.removeAll( "Surface" );
4180 QList<QVariant> indices3 = indices2;
4181 indices3.removeAll( 2 );
4184 int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" );
4185 setPreferenceProperty( mesh_represent, "strings", mesh_modes );
4186 setPreferenceProperty( mesh_represent, "indexes", mesh_indices );
4187 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "mesh_shrink" );
4189 int scalar_map_represent = addPreference( tr( "VISU_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_map_represent" );
4190 setPreferenceProperty( scalar_map_represent, "strings", modes0 );
4191 setPreferenceProperty( scalar_map_represent, "indexes", indices0 );
4192 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" );
4194 int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" );
4195 setPreferenceProperty( iso_surfaces_represent, "strings", modes1 );
4196 setPreferenceProperty( iso_surfaces_represent, "indexes", indices1 );
4197 int sp = addPreference( "", representGr, LightApp_Preferences::Space );
4198 setPreferenceProperty( sp, "hstretch", 0 );
4199 setPreferenceProperty( sp, "vstretch", 0 );
4201 int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" );
4202 setPreferenceProperty( cut_planes_represent, "strings", modes1 );
4203 setPreferenceProperty( cut_planes_represent, "indexes", indices1 );
4204 addPreference( "", representGr, LightApp_Preferences::Space );
4206 int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" );
4207 setPreferenceProperty( cut_lines_represent, "strings", modes3 );
4208 setPreferenceProperty( cut_lines_represent, "indexes", indices3 );
4209 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4210 setPreferenceProperty( sp, "hstretch", 0 );
4211 setPreferenceProperty( sp, "vstretch", 0 );
4213 int cut_segment_represent = addPreference( tr( "VISU_CUT_SEGMENT" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_segment_represent" );
4214 setPreferenceProperty( cut_segment_represent, "strings", modes3 );
4215 setPreferenceProperty( cut_segment_represent, "indexes", indices3 );
4216 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4217 setPreferenceProperty( sp, "hstretch", 0 );
4218 setPreferenceProperty( sp, "vstretch", 0 );
4220 int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
4221 setPreferenceProperty( deformed_shape_represent, "strings", modes0 );
4222 setPreferenceProperty( deformed_shape_represent, "indexes", indices0 );
4223 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "deformed_shape_shrink" );
4225 int vectors_represent = addPreference( tr( "VISU_VECTORS" ), representGr, LightApp_Preferences::Selector, "VISU", "vectors_represent" );
4226 setPreferenceProperty( vectors_represent, "strings", modes3 );
4227 setPreferenceProperty( vectors_represent, "indexes", indices3 );
4228 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4229 setPreferenceProperty( sp, "hstretch", 0 );
4230 setPreferenceProperty( sp, "vstretch", 0 );
4232 int stream_lines_represent = addPreference( tr( "VISU_STREAM_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "stream_lines_represent" );
4233 setPreferenceProperty( stream_lines_represent, "strings", modes3 );
4234 setPreferenceProperty( stream_lines_represent, "indexes", indices3 );
4235 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4236 setPreferenceProperty( sp, "hstretch", 0 );
4237 setPreferenceProperty( sp, "vstretch", 0 );
4239 int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" );
4240 setPreferenceProperty( plot3d_represent, "strings", modes1 );
4241 setPreferenceProperty( plot3d_represent, "indexes", indices1 );
4242 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4243 setPreferenceProperty( sp, "hstretch", 0 );
4244 setPreferenceProperty( sp, "vstretch", 0 );
4246 int scalar_def_represent = addPreference( tr( "VISU_DEFORMED_SHAPE_AND_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
4247 setPreferenceProperty( scalar_def_represent, "strings", modes1 );
4248 setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
4249 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
4251 int quadraticmode = addPreference( tr( "QUADRATIC_REPRESENT_MODE" ), representGr, LightApp_Preferences::Selector, "VISU", "quadratic_mode" );
4252 QStringList quadraticModes;
4253 quadraticModes.append("Lines");
4254 quadraticModes.append("Arcs");
4256 indices.append( 0 );
4257 indices.append( 1 );
4258 setPreferenceProperty( quadraticmode, "strings", quadraticModes );
4259 setPreferenceProperty( quadraticmode, "indexes", indices );
4261 int maxAngle = addPreference( tr( "MAX_ARC_ANGLE" ), representGr, LightApp_Preferences::IntSpin,
4262 "VISU", "max_angle" );
4263 setPreferenceProperty( maxAngle, "min", 1 );
4264 setPreferenceProperty( maxAngle, "max", 90 );
4266 int elem0DSize = addPreference( tr( "VISU_ELEM0D_SIZE" ), representGr, LightApp_Preferences::IntSpin, "VISU", "elem0d_size" );
4267 setPreferenceProperty( elem0DSize, "min", 1 );
4268 setPreferenceProperty( elem0DSize, "max", 10 );
4269 addPreference( "", representGr, LightApp_Preferences::Space );
4271 int shrFac = addPreference( tr( "VISU_SHRINK_FACTOR" ), representGr, LightApp_Preferences::IntSpin, "VISU", "shrink_factor" );
4272 setPreferenceProperty( shrFac, "min", 20 );
4273 setPreferenceProperty( shrFac, "max", 100 );
4274 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4275 setPreferenceProperty( sp, "hstretch", 0 );
4276 setPreferenceProperty( sp, "vstretch", 0 );
4278 addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
4279 addPreference( "", representGr, LightApp_Preferences::Space );
4281 int typeOfMarker = addPreference( tr( "VISU_TYPE_OF_MARKER" ), representGr, LightApp_Preferences::Selector, "VISU", "type_of_marker" );
4283 QList<QVariant> aMarkerTypeIndicesList;
4284 QList<QVariant> aMarkerTypeIconsList;
4285 for ( int i = VTK::MT_POINT; i <= VTK::MT_O_X; i++ ) {
4286 QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
4287 QPixmap pixmap = aResourceMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
4288 aMarkerTypeIndicesList << i;
4289 aMarkerTypeIconsList << pixmap;
4291 setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
4292 setPreferenceProperty( typeOfMarker, "icons", aMarkerTypeIconsList );
4294 int markerScale = addPreference( tr( "VISU_MARKER_SCALE" ), representGr, LightApp_Preferences::Selector, "VISU", "marker_scale" );
4296 QList<QVariant> aMarkerScaleIndicesList;
4297 QStringList aMarkerScaleValuesList;
4298 for ( int i = VISU::MS_10; i <= VISU::MS_70; i++ ) {
4299 aMarkerScaleIndicesList << i;
4300 aMarkerScaleValuesList << QString::number( (i-(int)VISU::MS_10)*0.5 + 1.0 );
4302 setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
4303 setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
4305 addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
4306 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4307 setPreferenceProperty( sp, "hstretch", 0 );
4308 setPreferenceProperty( sp, "vstretch", 0 );
4310 addPreference( tr( "VISU_DISP_ONLY" ), representGr, LightApp_Preferences::Bool, "VISU", "display_only" );
4311 addPreference( "", representGr, LightApp_Preferences::Space );
4313 addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr,
4314 LightApp_Preferences::Bool, "VISU", "automatic_fit_all" );
4316 // TAB: Tables ; group: "Tables editing properties"
4317 int tablesTab = addPreference( tr( "VISU_TABLES" ) );
4319 int tablesGr = addPreference( tr( "VISU_TABLES_EDITING_PROPS" ), tablesTab );
4320 setPreferenceProperty( tablesGr, "columns", 1 );
4322 addPreference( tr( "VISU_TABLES_ENABLE_EDITING" ), tablesGr, LightApp_Preferences::Bool, "VISU", "tables_enable_editing" );
4324 int sortPolicyPref = addPreference( tr( "VISU_TABLES_SORT_POLICY" ), tablesGr, LightApp_Preferences::Selector, "VISU", "tables_sort_policy" );
4325 QStringList policies;
4326 policies.append( tr( "VISU_TABLES_EMPTY_LOWEST" ) );
4327 policies.append( tr( "VISU_TABLES_EMPTY_HIGHEST" ) );
4328 policies.append( tr( "VISU_TABLES_EMPTY_FIRST" ) );
4329 policies.append( tr( "VISU_TABLES_EMPTY_LAST" ) );
4330 policies.append( tr( "VISU_TABLES_EMPTY_IGNORE" ) );
4332 indices.append( 0 );
4333 indices.append( 1 );
4334 indices.append( 2 );
4335 indices.append( 3 );
4336 indices.append( 4 );
4337 setPreferenceProperty( sortPolicyPref, "strings", policies );
4338 setPreferenceProperty( sortPolicyPref, "indexes", indices );
4340 // TAB: Feature edges ; group: "Feature edges properties"
4341 int featureEdgesTab = addPreference( tr( "VISU_FEATURE_EDGES" ) );
4343 int featureEdgesGr = addPreference( tr( "VISU_FEATURE_EDGES_PROPS" ), featureEdgesTab );
4344 setPreferenceProperty( featureEdgesGr, "columns", 2 );
4346 int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr,
4347 LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
4348 setPreferenceProperty( featureEdgesAnglePref, "step", 10.0 );
4349 setPreferenceProperty( featureEdgesAnglePref, "min", 0.0 );
4350 setPreferenceProperty( featureEdgesAnglePref, "max", 90.0 );
4352 addPreference( tr( "VISU_SHOW_FEATURE_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_feature_edges" );
4353 addPreference( tr( "VISU_SHOW_BOUNDARY_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_boundary_edges" );
4354 addPreference( tr( "VISU_SHOW_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_manifold_edges" );
4355 addPreference( tr( "VISU_SHOW_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_non_manifold_edges" );
4356 //addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
4358 // TAB: "Values labels"
4360 int valLblTab = addPreference( tr( "VALUES_LABELING" ) );
4363 int valLblFontGr = addPreference( tr( "VISU_FONT" ), valLblTab );
4364 setPreferenceProperty( valLblFontGr, "columns", 2 );
4367 addVtkFontPref( tr( "LABELS" ), valLblFontGr, "values_labeling_font", true );
4370 addPreference( tr( "COLOR" ), valLblFontGr,
4371 LightApp_Preferences::Color, "VISU", "values_labeling_color" );
4375 void VisuGUI::preferencesChanged( const QString& a, const QString& b)
4377 if (a != QString("VISU")) return;
4378 if (b == QString("scalar_bar_orientation")) return;
4379 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
4380 float sbX1,sbY1,sbW,sbH;
4381 float aTol = 1.00000009999999;
4383 if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
4384 sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", 0.01);
4385 sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", 0.05);
4386 if(sbX1+sbW > aTol){
4387 aWarning = "Origin and Size Vertical: X+Width > 1\n";
4390 aResourceMgr->setValue("VISU", "scalar_bar_vertical_x", sbX1);
4391 aResourceMgr->setValue("VISU", "scalar_bar_vertical_width", sbW);
4394 else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){
4395 sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", 0.01);
4396 sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",0.5);
4397 if(sbY1+sbH > aTol){
4398 aWarning = "Origin and Size Vertical: Y+Height > 1\n";
4401 aResourceMgr->setValue("VISU", "scalar_bar_vertical_y", sbY1);
4402 aResourceMgr->setValue("VISU", "scalar_bar_vertical_height",sbH);
4405 else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){
4406 sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", 0.2);
4407 sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", 0.6);
4408 if(sbX1+sbW > aTol){
4409 aWarning = "Origin and Size Horizontal: X+Width > 1\n";
4412 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_x", sbX1);
4413 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_width", sbW);
4416 else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){
4417 sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", 0.01);
4418 sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",0.12);
4419 if(sbY1+sbH > aTol){
4420 aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
4423 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1);
4424 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
4427 else if(b == "visual_data_precision") {
4428 LightApp_Preferences* pref = preferences();
4429 QtxPreferenceItem* min = pref->findItem( tr( "VISU_MIN" ), true );
4430 QtxPreferenceItem* max = pref->findItem( tr( "VISU_MAX" ), true );
4432 setPreferenceProperty( min->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
4434 setPreferenceProperty( max->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
4437 if ( !aWarning.isEmpty() ){
4438 aWarning += "The default values are applied instead.";
4439 SUIT_MessageBox::warning(GetDesktop(this),
4440 tr("ERR_SCALARBAR_PARAMS"),
4447 ::getViewManager(const QString& theType,
4448 const bool theIsCreate)
4450 return getApp()->getViewManager(theType,theIsCreate);
4455 ::getScalarBarsMap()
4457 return myScalarBarsMap;
4460 LightApp_Displayer* VisuGUI::displayer()
4463 myDisplayer = new VisuGUI_Displayer( getApp() );
4469 void VisuGUI::OnPlot3dFromCutPlane()
4471 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
4472 if (CheckLock(aCStudy, GetDesktop(this)))
4475 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
4476 SALOME_ListIO aListIO;
4477 aSelectionMgr->selectedObjects(aListIO);
4479 if (aListIO.Extent() < 1) return;
4482 VISU::CutPlanes_i* aCutPrs = 0;
4483 Handle(SALOME_InteractiveObject) anIO;
4484 _PTR(SObject) aSObject;
4485 SALOME_ListIteratorOfListIO It (aListIO);
4486 for (; It.More(); It.Next()) {
4489 if (!anIO.IsNull() && anIO->hasEntry()) {
4490 aSObject = aCStudy->FindObjectID(anIO->getEntry());
4493 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
4494 if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
4495 if (aPrsObject->GetType() == VISU::TCUTPLANES) {
4496 aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
4505 _PTR(SObject) aTimeStampSObj = aSObject->GetFather();
4506 if (SUIT_ViewManager* aViewManager = getApp()->activeViewManager()) {
4507 QString aViewType = aViewManager->getType();
4508 //bool anIsVVTK = (aViewType == VVTK_Viewer::Type());
4510 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj);
4511 VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
4512 if (aType != TTIMESTAMP )
4515 QString aMeshName = aRestoringMap["myMeshName"];
4516 QString anEntity = aRestoringMap["myEntityId"];
4517 QString aFieldName = aRestoringMap["myFieldName"];
4518 QString aTimeStampId = aRestoringMap["myTimeStampId"];
4521 SUIT_ViewWindow* aViewWindow = 0;
4523 // aViewWindow = GetViewWindow<VVTK_Viewer>(this);
4524 // aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
4526 aViewWindow = GetViewWindow<SVTK_Viewer>(this);
4527 aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
4529 GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
4531 VISU::Plot3D_i* aPrs3d =
4532 CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
4534 (const char*)aMeshName.toLatin1(),
4535 (Entity)anEntity.toInt(),
4536 (const char*)aFieldName.toLatin1(),
4537 aTimeStampId.toInt(),
4538 ColoredPrs3d_i::EPublishUnderTimeStamp);
4540 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
4541 int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
4543 VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
4544 aDlg->initFromPrsObject(aPrs3d, true);
4545 int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
4546 double aRotX = aCutPrs->GetRotateX();
4547 double aRotY = aCutPrs->GetRotateY();
4548 double aPlanePos = aCutPrs->GetPlanePosition(0);
4549 aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
4551 if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
4552 DeletePrs3d(this, aPrs3d);
4557 UpdateObjBrowser(this, true, aTimeStampSObj);
4559 SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
4560 if ( aSVtkWindow ) {
4561 PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
4562 aSVtkWindow->onFitAll();
4564 AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
4567 emit presentationCreated(aPrs3d);
4570 application()->putInfo(QObject::tr("INF_DONE"));
4574 void VisuGUI::OnManageCache()
4580 //---------------------------------------------------------------
4581 void VisuGUI::OnMultiprViewFullRes()
4583 OnMultiprChangeRes(VISU::Result::FULL);
4587 //---------------------------------------------------------------
4588 void VisuGUI::OnMultiprViewMediumRes()
4590 OnMultiprChangeRes(VISU::Result::MEDIUM);
4594 //---------------------------------------------------------------
4595 void VisuGUI::OnMultiprViewLowRes()
4597 OnMultiprChangeRes(VISU::Result::LOW);
4601 //---------------------------------------------------------------
4602 void VisuGUI::OnMultiprViewHide()
4604 OnMultiprChangeRes(VISU::Result::HIDDEN);
4608 //---------------------------------------------------------------
4609 void VisuGUI::OnMultiprChangeRes(VISU::Result::Resolution theResolution)
4611 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
4612 if (CheckLock(aCStudy,GetDesktop(this)))
4615 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
4616 if(aSelectionInfo.empty())
4619 QApplication::setOverrideCursor(Qt::WaitCursor);
4621 typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
4622 typedef std::map<TResultPtr, _PTR(SObject)> TResult2SObject;
4623 TResult2SObject aResult2SObject;
4625 for (int i=0; i < aSelectionInfo.size(); i++) {
4626 VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
4628 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
4632 VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
4633 if(CORBA::is_nil(aResult.in()))
4636 VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
4640 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSObject);
4641 bool anIsFound = false;
4642 QString aMeshName = Storable::FindValue(aRestoringMap, "myMeshName", &anIsFound);
4646 std::string aPartName = aSObject->GetName();
4648 aCResult->SetResolution(aMeshName.toLatin1().data(), aPartName.c_str(), theResolution);
4650 aResult2SObject[TResultPtr(aCResult)] = aSObject;
4653 // To update all result observers
4654 TResult2SObject::const_iterator anIter = aResult2SObject.begin();
4655 for(; anIter != aResult2SObject.end(); anIter++){
4656 const TResultPtr& aResultPtr = anIter->first;
4657 const _PTR(SObject)& aSObject = anIter->second;
4658 aResultPtr->UpdateObservers();
4659 VISU::UpdateObjBrowser(this, false, aSObject);
4662 QApplication::restoreOverrideCursor();
4665 //---------------------------------------------------------------
4666 void VisuGUI::OnFileInfo()
4668 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
4669 SUIT_DataOwnerPtrList lst;
4670 getApp()->selectionMgr()->selected( lst );
4671 LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( lst.first().get() );
4672 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( aStudy, owner->entry().toLatin1().constData() );
4673 VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>( anObjectInfo.myBase );
4676 VisuGUI_FileInfoDlg dlg( getApp()->desktop(), aCResult->GetMEDFileInfo() );
4680 //---------------------------------------------------------------
4681 void VisuGUI::OnExportMED()
4683 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
4684 SUIT_DataOwnerPtrList lst;
4685 getApp()->selectionMgr()->selected( lst );
4686 LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( lst.first().get() );
4687 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( aStudy, owner->entry().toLatin1().constData() );
4688 VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( anObjectInfo.myBase );
4691 // VisuGUI_FileInfoDlg dlg( getApp()->desktop(), aResult->GetMEDFileInfo() );
4694 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
4695 QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
4697 // get name for the file
4698 QStringList aFilter;
4699 aFilter.append("MED Files (*.med)");
4701 std::string anInitFileName = aResult->GetInitFileName();
4702 QFileInfo anInitFileInfo(anInitFileName.c_str());
4703 QString aBaseName = anInitFileInfo.fileName();
4705 QString aPath = Qtx::addSlash(aDir) + aBaseName;
4707 QFileInfo aFileInfo =
4708 SUIT_FileDlg::getFileName(GetDesktop(this),
4711 tr("VISU_MEN_EXPORT_MED"), // "Export To Med File"
4714 QString aFile = aFileInfo.filePath();
4715 if ( aFile.length() > 0 ) {
4716 aResult->ExportMED((const char*)aFile.toLatin1());
4720 void VisuGUI::OnFilterScalars()
4722 VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg( this );
4727 \brief SLOT called when "Labeling" popup menu item of presentation is clicked
4728 activates/deactivates labeling of results of the screen. This functionality works
4729 to numbering in SMESH module but is intended for showing results on the screen
4730 instead of elements numbers
4731 \sa OnValuesLabelingParams()
4733 void VisuGUI::OnValuesLabeling()
4735 // to do: rewrite for several actors if necessary
4737 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( this );
4738 if ( aSelectionInfo.empty() )
4741 TSelectionItem aSelectionItem = GetSelectedObjects(this).front();
4742 VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
4746 SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
4750 VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
4754 if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
4756 aScalarMapActor->SetValuesLabeled( !aScalarMapActor->GetValuesLabeled() );
4757 aViewWindow->Repaint();
4759 else if ( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
4761 aGaussPtsAct->SetValuesLabeled( !aGaussPtsAct->GetValuesLabeled() );
4762 aViewWindow->Repaint();
4767 \brief SLOT called when "Labeling parameters" popup menu item of presentation
4768 is clicked launch dialog box for changing parameters of labeling
4769 \sa OnValuesLabeling()
4771 void VisuGUI::OnValuesLabelingParams()
4773 Handle(SALOME_InteractiveObject) anIO;
4774 if ( VISU::Prs3d_i* aPrs3d = GetPrsToModify( this, anIO ) )
4775 EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
4778 \brief Adds preferences for dfont of VTK viewer
4780 \param pIf group identifier
4781 \param param parameter
4782 \return identifier of preferences
4784 int VisuGUI::addVtkFontPref(
4785 const QString& label,
4787 const QString& param,
4788 const bool useSize )
4790 int tfont = addPreference( label, pId, LightApp_Preferences::Font, "VISU", param );
4792 setPreferenceProperty( tfont, "mode", QtxFontEdit::Custom );
4795 fam.append( tr( "VISU_FONT_ARIAL" ) );
4796 fam.append( tr( "VISU_FONT_COURIER" ) );
4797 fam.append( tr( "VISU_FONT_TIMES" ) );
4799 setPreferenceProperty( tfont, "fonts", fam );
4801 int f = QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic | QtxFontEdit::Shadow;
4803 f |= QtxFontEdit::UserSize | QtxFontEdit::Size;
4805 setPreferenceProperty( tfont, "features", f );
4811 \brief SLOT called when "2D Quadratic -> Arcs" popup menu item
4812 \ of presentation is cliked
4814 void VisuGUI::OnArcQuadMode(){
4815 ChangeQuadratic2DRepresentation(this,VISU::ARCS);
4819 \brief SLOT called when "2D Quadratic -> Lines" popup menu item
4820 \ of presentation is cliked
4822 void VisuGUI::OnLineQuadMode(){
4823 ChangeQuadratic2DRepresentation(this,VISU::LINES);