1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // VISU VISUGUI : GUI of VISU component
28 #include <Standard_math.hxx> // E.A. must be included before Python.h to fix compilation on windows
41 #include <QColorDialog>
46 #include <vtkRenderer.h>
47 #include <vtkRenderWindow.h>
48 #include <vtkActorCollection.h>
49 #include <vtkTimerLog.h>
52 #include "SALOME_LifeCycleCORBA.hxx"
54 #include "SUIT_ResourceMgr.h"
55 #include "SUIT_MessageBox.h"
57 #include "SUIT_ViewWindow.h"
58 #include "SUIT_ViewManager.h"
59 #include "SUIT_Desktop.h"
60 #include "SUIT_DataBrowser.h"
61 #include "SUIT_OverrideCursor.h"
63 #include "CAM_Module.h"
65 #include "SVTK_ViewWindow.h"
66 #include "SVTK_ViewModel.h"
67 #include "SVTK_Functor.h"
68 //#include "SVTK_MainWindow.h"
70 #include "VTKViewer_Algorithm.h"
71 #include "VTKViewer_MarkerDlg.h"
73 #include "SPlot2d_ViewModel.h"
74 #include "VisuGUI_SetupPlot2dDlg.h"
75 #include "Plot2d_SetupCurveDlg.h"
76 #include "Plot2d_ViewManager.h"
78 #include "QtxPagePrefMgr.h"
79 #include "OB_Browser.h"
81 #include "SALOME_ListIteratorOfListIO.hxx"
83 #include "SalomeApp_Application.h"
84 #include "SalomeApp_DataModel.h"
85 #include "SalomeApp_Study.h"
86 #include "SalomeApp_CheckFileDlg.h"
88 #include "LightApp_SelectionMgr.h"
89 #include "LightApp_Selection.h"
90 #include "LightApp_Preferences.h"
91 #include "LightApp_DataOwner.h"
93 #include "QtxAction.h"
94 #include "QtxFontEdit.h"
96 #include "VISUConfig.hh"
97 #include "VISU_Gen_i.hh"
98 #include "VISU_Mesh_i.hh"
99 #include "VISU_Table_i.hh"
100 #include "VISU_PointMap3d_i.hh"
101 #include "VISU_Result_i.hh"
102 #include "VISU_View_i.hh"
103 #include "VISU_ViewManager_i.hh"
104 #include "VISU_Plot3D_i.hh"
106 #include "VISU_Actor.h"
108 #include "VisuGUI_Prs3dTools.h"
109 #include "VisuGUI_Tools.h"
111 #include "VisuGUI_SelectionPanel.h"
112 #include "VisuGUI_FeatureEdgesPanel.h"
113 #include "VisuGUI_NameDlg.h"
114 #include "VisuGUI_CursorDlg.h"
115 #include "VisuGUI_Selection.h"
116 #include "VisuGUI_TimeAnimation.h"
117 #include "VisuGUI_EvolutionDlg.h"
118 #include "VisuGUI_EditContainerDlg.h"
119 #include "VisuGUI_ClippingDlg.h"
120 #include "VisuGUI_Plot3DDlg.h"
121 #include "VisuGUI_OffsetDlg.h"
122 #include "VisuGUI_Displayer.h"
123 #include "VisuGUI_BuildProgressDlg.h"
124 #include "VisuGUI_TransparencyDlg.h"
125 #include "VisuGUI_ShrinkFactorDlg.h"
126 //#include "VisuGUI_CacheDlg.h"
127 #include "VisuGUI_Table3dDlg.h"
128 #include "VisuGUI_ClippingPanel.h"
129 #include "VisuGUI_FilterScalarsDlg.h"
131 #include "VISU_ScalarMap_i.hh"
132 #include "VisuGUI_ScalarBarDlg.h"
134 #include "VISU_DeformedShape_i.hh"
135 #include "VisuGUI_DeformedShapeDlg.h"
137 #include "VISU_DeformedShapeAndScalarMap_i.hh"
138 #include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
140 #include "VISU_IsoSurfaces_i.hh"
141 #include "VisuGUI_IsoSurfacesDlg.h"
143 #include "VISU_CutPlanes_i.hh"
144 #include "VisuGUI_CutPlanesDlg.h"
146 #include "VISU_CutLines_i.hh"
147 #include "VisuGUI_CutLinesDlg.h"
149 #include "VISU_CutSegment_i.hh"
150 #include "VisuGUI_CutSegmentDlg.h"
152 #include "VISU_StreamLines_i.hh"
153 #include "VisuGUI_StreamLinesDlg.h"
155 #include "VISU_Vectors_i.hh"
156 #include "VisuGUI_VectorsDlg.h"
158 #include "VISU_TableDlg.h"
159 #include "VisuGUI_FileInfoDlg.h"
161 #include "SALOMEconfig.h"
162 #include CORBA_SERVER_HEADER(MED_Gen)
164 #include "utilities.h"
166 #include "VisuGUI_ActionsDef.h"
168 #include "VisuGUI_Timer.h"
170 //#include "VVTK_ViewModel.h"
172 #include "VisuGUI_Slider.h"
173 #include "VisuGUI_Sweep.h"
174 #include <VISU_ScalarMapAct.h>
175 #include <VISU_GaussPtsAct.h>
176 #include "VisuGUI_ValuesLabelingDlg.h"
178 using namespace VISU;
181 static int MYDEBUG = 0;
183 static int MYDEBUG = 0;
187 #define usleep(A) _sleep(A/1000)
190 //////////////////////////////////////////////////
192 //////////////////////////////////////////////////
196 SalomeApp_Module( "VISU" ),
197 LightApp_Module("VISU"),
227 if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
229 if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
232 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
236 aFilter.append( tr( "FLT_MED_FILES" ) );
237 aFilter.append( tr( "FLT_DISTRIBUTED_MED_FILES" ) );
238 aFilter.append( tr( "FLT_ALL_FILES" ) );
240 bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
242 SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
243 fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
244 fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
245 fd.setFilters( aFilter );
246 fd.SetChecked( toUseBuildProgress );
247 if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
248 fd.setDirectory( QDir::currentPath() );
250 QStringList fileNames;
252 return; // cancelled, return
254 fileNames = fd.selectedFiles();
255 toUseBuildProgress = fd.IsChecked();
257 if ( fileNames.count() == 0 )
258 return; // nothing selected, return
260 SUIT_OverrideCursor wc;
263 for ( QStringList::ConstIterator it = fileNames.begin(); it != fileNames.end(); ++it ) {
264 QFileInfo aFileInfo( *it );
266 if ( !aFileInfo.exists() ) {
268 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
269 arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
273 if ( !toUseBuildProgress ) {
274 // build progress is not used, use build flags from settings
275 bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
276 bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
277 bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
278 bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
279 bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
281 QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
282 application()->putInfo( anInfo );
284 VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
286 if ( CORBA::is_nil( aResult.in() ) ) {
287 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
288 arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
291 aResult->SetBuildFields( toBuildFields, toBuildMinMax );
292 aResult->SetBuildGroups( toBuildGroups );
293 aResult->Build( toBuildAll, toBuildAtOnce );
294 application()->putInfo( anInfo + tr("INF_DONE") );
296 } // if ( !toUseBuildProgress )
298 // use build progress
300 VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
301 aBuildProgressDlg->setFileName( aFileInfo.filePath() );
302 aBuildProgressDlg->setGenerator( GetVisuGen(this) );
303 aBuildProgressDlg->exec();
308 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
310 } // else // if ( !aFileInfo.exists() )
313 if ( errors.count() > 0 ) {
314 SUIT_MessageBox::critical( GetDesktop(this),
316 tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
319 UpdateObjBrowser(this);
325 ::OnImportTableFromFile()
327 if(MYDEBUG) MESSAGE("VisuGUI::OnImportTableFromFile()");
328 if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
332 aFilter.append( tr("FLT_TABLE_FILES") );
333 aFilter.append( tr("FLT_ALL_FILES") );
335 //QString anInitialPath = "";
336 //if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
337 // anInitialPath = QDir::currentPath();
339 //QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
342 // tr("TLT_IMPORT_TABLE"));
344 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
345 bool aFirstStrAsTitle = aResourceMgr->booleanValue("VISU", "first_str_as_title", false);
347 SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("FIRST_STR_AS_TITLE") );
348 fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
349 fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
350 fd.setFilters( aFilter );
351 fd.SetChecked( aFirstStrAsTitle );
352 if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
353 fd.setDirectory( QDir::currentPath() );
357 return; // cancelled, return
358 aFiles = fd.selectedFiles();
359 aFirstStrAsTitle = fd.IsChecked();
361 if ( aFiles.count() == 0 )
362 return; // nothing selected
365 for ( QStringList::ConstIterator it = aFiles.begin(); it != aFiles.end(); ++it ) {
366 QFileInfo aFileInfo( *it );
368 if ( !aFileInfo.exists() ) {
369 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
370 arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
374 QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
375 application()->putInfo( anInfo );
377 CORBA::Object_var anObject =
378 GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData(),
381 if (CORBA::is_nil(anObject.in())) {
382 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
383 arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
386 application()->putInfo( anInfo + tr("INF_DONE") );
390 errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
395 if ( errors.count() > 0 ) {
396 SUIT_MessageBox::critical( GetDesktop(this),
398 tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
401 UpdateObjBrowser(this);
407 ::OnExportTableToFile()
409 if(MYDEBUG) MESSAGE("VisuGUI::OnExportTableToFile()");
411 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
413 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
414 SALOME_ListIO aListIO;
415 aSelectionMgr->selectedObjects(aListIO);
417 if (aListIO.Extent() > 0) {
418 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
419 if (anIO->hasEntry()) {
420 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
423 // find table attribute
425 _PTR(GenericAttribute) anAttr;
427 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
429 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
430 // if the current SObject is a table title
431 // we take a father contaning the table
432 aSObj = aSObj->GetFather();
434 if (aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
437 if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
444 // get table title in order to have default name of the file
447 _PTR(AttributeTableOfReal) aTabAttr (anAttr);
448 if (!aTabAttr) return;
449 aTitle = aTabAttr->GetTitle().c_str();
451 _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
452 if (!aTabAttr) return;
453 aTitle = aTabAttr->GetTitle().c_str();
456 aTitle = aTitle.replace(QRegExp(" "), "_").replace(QRegExp("\\*"), "" );
458 // get default path for the file
459 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
460 QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
461 if (aDir.isEmpty()) {
462 aDir = aResourceMgr->stringValue("VISU","InputDir","");
463 if (aDir.isEmpty()) {
464 aDir = getenv("CSF_PATHData");
467 QString aPath = Qtx::addSlash(aDir) + aTitle;
469 // get name for the file
471 aFilter.append("Table Files (*.txt *.tab)");
472 aFilter.append("CSV Table Files (*.csv)");
474 QFileInfo aFileInfo =
475 SUIT_FileDlg::getFileName(GetDesktop(this),
478 tr("MEN_EXPORT_TABLE"), // "Export Table To File"
482 QString aFile = aFileInfo.filePath();
483 if (!aFile.isEmpty()) {
484 application()->putInfo(tr("MEN_EXPORT_TABLE") + " " + aFile + " ...");
485 aDir = Qtx::dir(aFile, true);
486 aResourceMgr->setValue("VISU", "OutputDir", aDir);
489 GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), (const char*)aFile.toLatin1());
490 application()->putInfo(aFile + " " + tr("INF_DONE"));
491 } catch(std::exception& exc) {
493 SUIT_MessageBox::warning(GetDesktop(this),
495 tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()) );
498 INFOS((const char*)tr("ERR_ERROR_DURING_EXPORT").toLatin1());
499 SUIT_MessageBox::warning( GetDesktop(this),
501 tr("ERR_ERROR_DURING_EXPORT") );
513 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
514 if (CheckLock(aCStudy,GetDesktop(this)))
516 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
518 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
519 SALOME_ListIO aListIO;
520 aSelectionMgr->selectedObjects(aListIO);
522 SALOME_ListIteratorOfListIO It (aListIO);
523 QApplication::setOverrideCursor(Qt::WaitCursor);
524 for (; It.More(); It.Next()) {
525 Handle(SALOME_InteractiveObject) anIO = It.Value();
526 SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
527 if (!aSObject->_is_nil()) {
529 // try to load a component data from an opened (presumably) study
530 // The same in SUPERVISION: NPAL14522
532 SALOMEDS::SComponent_ptr aSComp = aSObject->GetFatherComponent();
533 CORBA::String_var aCompIOR;
534 if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
535 CORBA::String_var aCompDataType = aSComp->ComponentDataType();
537 // obtain a driver by a component data type
538 // like it is done in SALOMEDS_DriverFactory_i::GetDriverByType
539 SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_nil();
540 SALOME_LifeCycleCORBA * LCC = getApp()->lcc();
543 anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType);
544 if (CORBA::is_nil(anEngineObj))
545 anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType);
547 if (!CORBA::is_nil(anEngineObj))
548 anEngine = SALOMEDS::Driver::_narrow(anEngineObj);
550 if (!CORBA::is_nil(anEngine)) {
552 SALOMEDS::StudyBuilder_ptr aStudyBuilder = aStudy->NewBuilder();
553 aStudyBuilder->LoadWith(aSComp, anEngine);
561 CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
562 if (!CORBA::is_nil(anObject)) {
563 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
564 if (!CORBA::is_nil(aMED.in()))
565 GetVisuGen(this)->ImportMed(aSObject);
566 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
567 if (!CORBA::is_nil(aField.in()))
568 GetVisuGen(this)->ImportMedField(aField);
570 SALOMEDS::SObject_var aSFather = aSObject->GetFather();
571 SALOMEDS::GenericAttribute_var anAttr;
572 aSFather->FindAttribute(anAttr, "AttributeName");
573 SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
574 CORBA::String_var aValue = aName->Value();
575 if (strcmp(aValue.in(), "MEDFIELD") == 0)
576 GetVisuGen(this)->ImportMed(aSObject);
580 UpdateObjBrowser(this, true);
581 QApplication::restoreOverrideCursor();
584 void VisuGUI::OnLoadComponentData()
586 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
587 if (CheckLock(aCStudy,GetDesktop(this)))
589 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
591 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
592 SALOME_ListIO aListIO;
593 aSelectionMgr->selectedObjects(aListIO);
595 SALOME_ListIteratorOfListIO It (aListIO);
596 QApplication::setOverrideCursor(Qt::WaitCursor);
597 for (; It.More(); It.Next()) {
598 Handle(SALOME_InteractiveObject) anIO = It.Value();
599 SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
600 if (!aSObject->_is_nil()) {
602 // try to load a component data from an opened (presumably) study
603 // The same in SUPERVISION: NPAL14522
605 SALOMEDS::SComponent_ptr aSComp = aSObject->GetFatherComponent();
606 CORBA::String_var aCompIOR;
607 if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
608 CORBA::String_var aCompDataType = aSComp->ComponentDataType();
610 QString anInfo ("Loading ");
611 anInfo = anInfo + aCompDataType.in() + " Component Data ...";
612 application()->putInfo( anInfo );
614 // obtain a driver by a component data type
615 // like it is done in SALOMEDS_DriverFactory_i::GetDriverByType
616 SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_nil();
617 SALOME_LifeCycleCORBA * LCC = getApp()->lcc();
620 anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType);
621 if (CORBA::is_nil(anEngineObj))
622 anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType);
624 if (!CORBA::is_nil(anEngineObj))
625 anEngine = SALOMEDS::Driver::_narrow(anEngineObj);
627 if (!CORBA::is_nil(anEngine)) {
629 SALOMEDS::StudyBuilder_ptr aStudyBuilder = aStudy->NewBuilder();
630 aStudyBuilder->LoadWith(aSComp, anEngine);
633 application()->putInfo( anInfo + tr("INF_DONE"));
636 application()->putInfo( anInfo + tr("INF_FAILED"));
642 QApplication::restoreOverrideCursor();
646 CreateCurves( SalomeApp_Module* theModule,
647 VISU::CutLinesBase_i* thePrs,
649 const bool theCreate = true )
654 // temporary code, to be revised (VisuGUI_CutLinesDlg and VisuGUI_CutSegmentDlg classes
655 // should have common intermediate interface with at least two methods called below)
656 bool isGenerateTable = false;
657 bool isGenerateCurves = false;
658 if ( VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg ) ) {
659 isGenerateTable = aCutDlg->isGenerateTable();
660 isGenerateCurves = aCutDlg->isGenerateCurves();
662 else if ( VisuGUI_CutSegmentDlg* aCutDlg = dynamic_cast<VisuGUI_CutSegmentDlg*>( theDlg ) ) {
663 isGenerateTable = aCutDlg->isGenerateTable();
664 isGenerateCurves = aCutDlg->isGenerateCurves();
669 _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
670 _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry() );
672 if ( !theCreate && aSObject ) {
674 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
675 _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
676 for (; aIter->More(); aIter->Next()) {
677 _PTR(SObject) aTblObj = aIter->Value();
679 _PTR(GenericAttribute) anAttr;
680 if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
681 _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
682 SalomeApp_Study* salome_study = GetAppStudy( theModule );
683 for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
684 salome_study->deleteReferencesTo( aChildIter->Value() );
685 _PTR(SObject) aSO = aChildIter->Value();
687 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
688 if (aRestoringMap["myComment"] == "CURVE") {
689 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
690 if(!CORBA::is_nil(aCORBAObject)){
691 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
692 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
693 PlotRemoveCurve(theModule, aCurve);
701 aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
703 //UpdateObjBrowser(theModule,true,aTblObj);
710 if ( isGenerateTable ) {
711 GetVisuGen( theModule )->CreateTable( thePrs->GetEntry().c_str() );
712 if ( isGenerateCurves ) {
714 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
715 _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
716 for (; aIter->More(); aIter->Next()) {
717 _PTR(SObject) aTblObj = aIter->Value();
719 _PTR(GenericAttribute) anAttr;
720 if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
721 CreatePlot( theModule, aTblObj );
729 if (!theCreate && aSObject) {
730 UpdateObjBrowser(theModule);
738 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
739 if (CheckLock(aStudy,GetDesktop(this)))
742 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
743 if(aSelectionInfo.empty())
746 // Get selected SObject
747 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
748 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
749 if (anIO.IsNull() || !anIO->hasEntry())
752 // create a VTK view window if it does not exist
753 SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
755 // create mesh presentation and display it in aViewWindow
756 VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
757 aViewWindow->highlight(anIO, 1);
759 emit presentationCreated(aPrs);
766 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
767 if (CheckLock(aStudy,GetDesktop(this)))
770 // create a VTK view window if it does not exist
771 SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
773 // Get selected SObject
774 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
775 SALOME_ListIO aListIO;
776 aSelectionMgr->selectedObjects(aListIO);
777 SALOME_ListIteratorOfListIO anIter (aListIO);
778 for (; anIter.More(); anIter.Next()) {
779 Handle(SALOME_InteractiveObject) anIO = anIter.Value();
780 if (anIO.IsNull() || !anIO->hasEntry())
783 // create mesh presentation and display it in aViewWindow
784 VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
785 aViewWindow->highlight(anIO, 1);
787 emit presentationCreated(aPrs);
793 ::OnCreateScalarMap()
795 Prs3d_i* aPrs = CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
797 emit presentationCreated(aPrs);
803 ::OnCreateDeformedShape()
805 Prs3d_i* aPrs = CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
807 emit presentationCreated(aPrs);
812 ::OnCreateDeformedShapeAndScalarMap()
814 Prs3d_i* aPrs = CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
816 emit presentationCreated(aPrs);
823 Prs3d_i* aPrs = CreatePrs3d<VISU::Vectors_i,VisuGUI_VectorsDlg,1>(this);
825 emit presentationCreated(aPrs);
830 ::OnCreateIsoSurfaces()
832 Prs3d_i* aPrs = CreatePrs3d<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg,1>(this);
834 emit presentationCreated(aPrs);
839 ::OnCreateCutPlanes()
841 Prs3d_i* aPrs = CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,0>(this);
843 emit presentationCreated(aPrs);
850 Prs3d_i* aPrs = CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,0>(this);
852 emit presentationCreated(aPrs);
857 ::OnCreateCutSegment()
859 Prs3d_i* aPrs = CreatePrs3d<VISU::CutSegment_i,VisuGUI_CutSegmentDlg,0>(this);
861 emit presentationCreated(aPrs);
866 ::OnCreateStreamLines()
868 Prs3d_i* aPrs = CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
870 emit presentationCreated(aPrs);
877 Prs3d_i* aPrs = CreatePrs3d<VISU::Plot3D_i,VisuGUI_Plot3DDlg,0>(this);
879 emit presentationCreated(aPrs);
884 ::OnCreatePlot2dView()
886 CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this));
887 GetVisuGen( this )->CreateContainer();
888 UpdateObjBrowser(this);
895 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
897 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
901 QApplication::setOverrideCursor(Qt::WaitCursor);
903 SALOME_ListIO aSel, aList;
904 aSelectionMgr->selectedObjects(aSel);
905 extractContainers(aSel, aList);
907 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
908 Handle(SALOME_InteractiveObject) anIO = it.Value();
909 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
910 VISU::Base_i* aBase = anObjectInfo.myBase;
914 VISU::VISUType aType = aBase->GetType();
916 case VISU::TPOINTMAP3D:
917 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
918 displayer()->Display(anIO->getEntry());
919 aViewWindow->highlight(anIO, 1);
920 aViewWindow->getRenderer()->ResetCameraClippingRange();
921 aViewWindow->Repaint();
925 if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false))
927 displayer()->Display(anIO->getEntry());
930 case VISU::TCONTAINER:
932 getViewManager(SPlot2d_Viewer::Type(), true);
933 displayer()->Display(anIO->getEntry());
936 VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(aBase);
938 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
939 displayer()->Display(anIO->getEntry());
940 aViewWindow->highlight(anIO, 1);
941 aViewWindow->getRenderer()->ResetCameraClippingRange();
942 aViewWindow->Repaint();
949 QApplication::restoreOverrideCursor();
956 /// to correct IMP 0016100
957 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
961 SALOME_ListIO aSel, aList;
962 aSelectionMgr->selectedObjects(aSel);
963 extractContainers(aSel, aList);
964 Handle(SALOME_InteractiveObject) anIO = aList.First();
965 activateAppropriateViewer(anIO);
970 void VisuGUI::activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO )
972 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), theIO->getEntry());
973 VISU::Base_i* aBase = anObjectInfo.myBase;
977 std::string anEntry = theIO->getEntry();
978 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
979 _PTR(SObject) SO = aCStudy->FindObjectID( theIO->getEntry() );
981 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(SO);
982 if(CORBA::is_nil(aCORBAObject))
985 VISU::VISUType aType = aBase->GetType();
987 if ( VISU::GetPrs3dFromBase(aBase) ) {
988 // activate SVTK Viewer
989 getApp()->getViewManager( SVTK_Viewer::Type(), true );
995 case VISU::TCONTAINER:
998 GetPlot2dViewer(this, true);
1001 case VISU::TCOLOREDPRS3DHOLDER :
1002 case VISU::TPOINTMAP3D : {
1003 //find curves under pointmap 3d
1004 bool hasCurvesChildren = false;
1006 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1007 QString aViewerType = aViewMgr->getType();
1009 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(SO);
1010 _PTR(SObject) aChild;
1011 for (; anIter->More(); anIter->Next()) {
1012 aChild = anIter->Value();
1013 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aChild);
1014 if(!CORBA::is_nil(aCORBAObject)){
1015 PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
1016 if( dynamic_cast<VISU::Curve_i*>(aServant.in()))
1017 hasCurvesChildren = true;
1021 if (hasCurvesChildren && ( aViewerType == SPlot2d_Viewer::Type() || aViewerType == SVTK_Viewer::Type() ) ) {
1024 // activate SVTK Viewer
1025 getApp()->getViewManager( SVTK_Viewer::Type(), true );
1037 if(MYDEBUG) MESSAGE("OnErasePrs");
1038 QApplication::setOverrideCursor(Qt::WaitCursor);
1040 SALOME_ListIO aList, aSel;
1041 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1042 aSelectionMgr->selectedObjects(aSel);
1043 extractContainers(aSel, aList);
1045 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1046 Handle(SALOME_InteractiveObject) anIO = it.Value();
1047 TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
1048 VISU::Base_i* aBase = anObjectInfo.myBase;
1049 ErasePrs(this, aBase, /*repaint_view_window = */true);
1052 QApplication::restoreOverrideCursor();
1055 //----------------------------------------------------------------------------
1060 startOperation( myEraseAll );
1061 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
1062 vw->unHighlightAll();
1063 if (vtkRenderer *aRen = vw->getRenderer()) {
1065 VTK::ActorCollectionCopy aCopy(aRen->GetActors());
1066 vtkActorCollection *anActColl = aCopy.GetActors();
1067 for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
1068 if (anActor->GetVisibility() > 0)
1069 if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
1070 RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
1071 anVISUActor->VisibilityOff();
1076 } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
1077 aPlot2d->EraseAll();
1084 //----------------------------------------------------------------------------
1086 GetPrsToModify(const SalomeApp_Module* theModule,
1087 Handle(SALOME_InteractiveObject)& theIO)
1089 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
1090 if(aSelectionInfo.empty())
1093 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1094 theIO = aSelectionItem.myIO;
1095 return VISU::GetPrs3dToModify(theModule, aSelectionItem.myObjectInfo.myBase);
1099 //----------------------------------------------------------------------------
1104 Handle(SALOME_InteractiveObject) anIO;
1105 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1106 EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg, 1>(this, anIO, aPrs3d);
1109 //----------------------------------------------------------------------------
1112 ::OnEditDeformedShape()
1114 Handle(SALOME_InteractiveObject) anIO;
1115 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1116 VisuGUI_DeformedShapeDlg::EditPrs3d(this, aPrs3d, anIO);
1117 // EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg, 1>(this, anIO, aPrs3d);
1120 //----------------------------------------------------------------------------
1123 ::OnEditDeformedShapeAndScalarMap()
1125 Handle(SALOME_InteractiveObject) anIO;
1126 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1127 EditPrs3d<VISU::DeformedShapeAndScalarMap_i, VisuGUI_DeformedShapeAndScalarMapDlg, 1>(this, anIO, aPrs3d);
1130 //----------------------------------------------------------------------------
1135 Handle(SALOME_InteractiveObject) anIO;
1136 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1137 EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg, 0>(this, anIO, aPrs3d);
1140 //----------------------------------------------------------------------------
1145 Handle(SALOME_InteractiveObject) anIO;
1146 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1147 EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg, 0>(this, anIO, aPrs3d);
1150 //----------------------------------------------------------------------------
1153 ::OnEditCutSegment()
1155 Handle(SALOME_InteractiveObject) anIO;
1156 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1157 EditPrs3d<VISU::CutSegment_i, VisuGUI_CutSegmentDlg, 0>(this, anIO, aPrs3d);
1160 //----------------------------------------------------------------------------
1163 ::OnEditIsoSurfaces()
1165 Handle(SALOME_InteractiveObject) anIO;
1166 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1167 EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg, 1>(this, anIO, aPrs3d);
1170 //----------------------------------------------------------------------------
1175 Handle(SALOME_InteractiveObject) anIO;
1176 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1177 EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg, 1>(this, anIO, aPrs3d);
1180 //----------------------------------------------------------------------------
1183 ::OnEditStreamLines()
1185 Handle(SALOME_InteractiveObject) anIO;
1186 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1187 EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg, 1>(this, anIO, aPrs3d);
1190 //----------------------------------------------------------------------------
1195 Handle(SALOME_InteractiveObject) anIO;
1196 if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
1197 EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg, 0>(this, anIO, aPrs3d);
1201 //----------------------------------------------------------------------------
1204 ::OnMakeSurfaceframe()
1206 ChangeRepresentation(this, VISU::SURFACEFRAME);
1209 //----------------------------------------------------------------------------
1212 ::OnMakeInsideframe()
1214 ChangeRepresentation(this, VISU::INSIDEFRAME);
1217 //----------------------------------------------------------------------------
1222 ChangeRepresentation(this, VISU::WIREFRAME);
1225 //----------------------------------------------------------------------------
1230 ChangeRepresentation(this, VISU::SHADED);
1233 //----------------------------------------------------------------------------
1238 ChangeRepresentation(this, VISU::POINT);
1241 //----------------------------------------------------------------------------
1246 ChangeRepresentation(this, VISU::SHRINK);
1249 //----------------------------------------------------------------------------
1252 ::OnMakeFeatureEdges()
1254 ChangeRepresentation(this, VISU::FEATURE_EDGES);
1257 //----------------------------------------------------------------------------
1262 SetShading(this, true);
1265 //----------------------------------------------------------------------------
1270 SetShading(this, false);
1274 //----------------------------------------------------------------------------
1279 VISU_Actor* anActor = NULL;
1280 VISU::Prs3d_i* aPrs3d = NULL;
1281 SVTK_ViewWindow* aViewWindow = NULL;
1282 if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
1285 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
1286 VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
1288 SALOMEDS::Color anOldColor, aNewColor;
1289 int aRepresent = anActor->GetRepresentation();
1291 switch (aRepresent) {
1293 anOldColor = aMesh->GetNodeColor();
1295 case VISU::WIREFRAME :
1296 case VISU::INSIDEFRAME :
1297 anOldColor = aMesh->GetLinkColor();
1300 case VISU::SURFACEFRAME :
1301 anOldColor = aMesh->GetCellColor();
1304 } else if (aDeformedShape) {
1305 anOldColor = aDeformedShape->GetColor();
1310 QColor aColor (int(255*anOldColor.R),
1311 int(255*anOldColor.G),
1312 int(255*anOldColor.B));
1313 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1314 if (aColorNew.isValid()) {
1315 aNewColor.R = aColorNew.red()/255.;
1316 aNewColor.G = aColorNew.green()/255.;
1317 aNewColor.B = aColorNew.blue()/255.;
1319 switch (aRepresent) {
1321 aMesh->SetNodeColor(aNewColor);
1323 case VISU::WIREFRAME :
1324 case VISU::INSIDEFRAME :
1325 aMesh->SetLinkColor(aNewColor);
1328 case VISU::SURFACEFRAME :
1329 aMesh->SetCellColor(aNewColor);
1333 aDeformedShape->SetColor(aNewColor);
1335 RecreateActor(this, aPrs3d);
1339 //----------------------------------------------------------------------------
1342 ::OnChangeWireframeColor()
1344 VISU_Actor* anActor = NULL;
1345 VISU::Prs3d_i* aPrs3d = NULL;
1346 SVTK_ViewWindow* aViewWindow = NULL;
1347 if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
1350 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
1351 VISU::ScalarMap_i* aScalarMap = dynamic_cast<VISU::ScalarMap_i*>(aPrs3d);
1352 if(!aMesh && !aScalarMap)
1355 SALOMEDS::Color anOldColor, aNewColor;
1357 anOldColor = aMesh->GetLinkColor();
1358 else if (aScalarMap)
1359 anOldColor = aScalarMap->GetLinkColor();
1362 QColor aColor (int(255*anOldColor.R),
1363 int(255*anOldColor.G),
1364 int(255*anOldColor.B));
1365 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1366 if (aColorNew.isValid()) {
1367 aNewColor.R = aColorNew.red()/255.;
1368 aNewColor.G = aColorNew.green()/255.;
1369 aNewColor.B = aColorNew.blue()/255.;
1371 aMesh->SetLinkColor(aNewColor);
1373 aScalarMap->SetLinkColor(aNewColor);
1374 RecreateActor(this, aPrs3d);
1378 //----------------------------------------------------------------------------
1383 VisuGUI_TransparencyDlg* aDialog = new VisuGUI_TransparencyDlg( this );
1387 //----------------------------------------------------------------------------
1392 VISU_Actor* anActor = NULL;
1393 VISU_ActorBase* anActorBase = NULL;
1394 VISU::Prs3d_i* aPrs3d = NULL;
1395 SVTK_ViewWindow* aViewWindow = NULL;
1397 bool isPrs3d = false;
1399 if (GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor)) {
1401 oldlwid = anActor->GetLineWidth();
1404 aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
1405 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1406 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1407 VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
1408 anActorBase = VISU::FindActorBase(aViewWindow, aTable);
1409 oldlwid = anActorBase->GetLineWidth();
1413 VisuGUI_CursorDlg* CursorDlg =
1414 new VisuGUI_CursorDlg (GetDesktop(this), (const char*)tr("DLG_LINEWIDTH_TITLE").toLatin1(), TRUE);
1416 CursorDlg->helpFileName = "viewing_3d_presentations_page.html#width_opacity_anchor";
1417 CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
1418 CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
1419 CursorDlg->SpinBox1->setMinimum(1);
1420 CursorDlg->SpinBox1->setMaximum(10);
1422 int intlwid = int(oldlwid);
1423 CursorDlg->SpinBox1->setValue(intlwid);
1425 int ret = CursorDlg->exec();
1427 intlwid = CursorDlg->SpinBox1->value();
1428 float newlwid = intlwid;
1430 anActor->SetLineWidth(newlwid);
1432 anActorBase->SetLineWidth(newlwid);
1437 //----------------------------------------------------------------------------
1440 ::OnChangePointMarker()
1442 SALOME_ListIO aListIO;
1443 GetSelectionMgr( this )->selectedObjects( aListIO );
1444 if( aListIO.Extent() < 1 )
1447 VISU::StudyId2MarkerMap& aMarkerMap = GetVisuGen( this )->GetMarkerMap();
1448 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
1449 int aStudyId = aCStudy->StudyId();
1451 QPixmap aPointSpritePixmap;
1452 if( SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr() )
1453 aPointSpritePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_POINT_SPRITE" ) );
1455 bool update = false;
1456 for( SALOME_ListIteratorOfListIO It( aListIO ); It.More(); It.Next() )
1458 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1459 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList( this, anIO );
1460 for( int i = 0, n = aPrsList.size(); i < n; i++ )
1462 if( VISU::Prs3d_i* aPrs = aPrsList[i] )
1464 VTKViewer_MarkerDlg* aDlg = new VTKViewer_MarkerDlg( GetDesktop( this ) );
1465 aDlg->setHelpData( "VISU", "point_marker_page.html" );
1467 aDlg->setCustomMarkerMap( aMarkerMap[ aStudyId ] );
1469 aDlg->addExtraStdMarker( VTK::MT_POINT_SPRITE, aPointSpritePixmap );
1471 VISU::MarkerType aMarkerTypeCurrent = aPrs->GetMarkerType();
1472 VISU::MarkerScale aMarkerScaleCurrent = aPrs->GetMarkerScale();
1473 int aMarkerTextureCurrent = aPrs->GetMarkerTexture();
1474 if( aMarkerTypeCurrent != VISU::MT_USER )
1475 aDlg->setStandardMarker( (VTK::MarkerType)aMarkerTypeCurrent, (VTK::MarkerScale)aMarkerScaleCurrent );
1477 aDlg->setCustomMarker( aMarkerTextureCurrent );
1481 aMarkerMap[ aStudyId ] = aDlg->getCustomMarkerMap();
1483 VISU::MarkerType aMarkerTypeNew = (VISU::MarkerType)aDlg->getMarkerType();
1484 VISU::MarkerScale aMarkerScaleNew = (VISU::MarkerScale)aDlg->getStandardMarkerScale();
1485 int aMarkerTextureNew = aDlg->getCustomMarkerID();
1486 if( aMarkerTypeNew != VISU::MT_USER )
1487 aPrs->SetMarkerStd( aMarkerTypeNew, aMarkerScaleNew );
1489 aPrs->SetMarkerTexture( aMarkerTextureNew );
1491 aPrs->UpdateActors();
1501 if( SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>( this ) )
1505 //----------------------------------------------------------------------------
1508 ::OnChangeShrinkFactor()
1510 VisuGUI_ShrinkFactorDlg* aDialog = new VisuGUI_ShrinkFactorDlg( this );
1514 //----------------------------------------------------------------------------
1519 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1520 if(aSelectionInfo.empty())
1523 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1524 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1525 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1526 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1527 if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)) {
1528 aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
1529 if( IsSObjectTable( aSObject ) ) {
1530 VISU_TableDlg* dlg = new VISU_TableDlg( GetDesktop( this ),
1531 GetCStudy( GetAppStudy( this ) ),
1534 //SAL2670 Orientation of show tables
1535 VISU_TableDlg::ttAuto,
1542 //----------------------------------------------------------------------------
1547 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1548 if(aSelectionInfo.empty())
1551 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1552 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1553 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1554 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1555 if(VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
1556 VisuGUI_Table3DDlg*aDlg = new VisuGUI_Table3DDlg( this );
1557 aDlg->initFromPrsObject( aTable );
1558 if ( runAndWait(aDlg, 0) > 0 ) {
1559 aDlg->storeToPrsObject(aTable);
1560 aTable->UpdateActors();
1566 //----------------------------------------------------------------------------
1571 SetScalarBarVisibility(true);
1578 SetScalarBarVisibility(false);
1583 ::SetScalarBarVisibility(bool theVisibility)
1585 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1586 SALOME_ListIO aListIO;
1587 aSelectionMgr->selectedObjects(aListIO);
1589 SALOME_ListIteratorOfListIO It (aListIO);
1591 bool update = false;
1592 for (; It.More(); It.Next()) {
1593 Handle(SALOME_InteractiveObject)& anIO = It.Value();
1594 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO, true);
1595 if ( aPrsList.size()>0 ) {
1596 for (int i = 0, n = aPrsList.size(); i < n; i++) {
1597 VISU::Prs3d_i* aPrsObject = aPrsList[i];
1599 if (VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject)) {
1600 aScalar->SetBarVisible( theVisibility );
1601 RecreateActor(this, aScalar);
1603 } else if (VISU::GaussPoints_i* aGauss = dynamic_cast<VISU::GaussPoints_i*>(aPrsObject)) {
1604 aGauss->SetBarVisible( theVisibility );
1605 RecreateActor(this, aGauss);
1613 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this))
1618 //----------------------------------------------------------------------------
1623 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1624 if(aSelectionInfo.empty())
1627 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1628 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1629 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1632 (aBase->GetType() == VISU::TCUTLINES || aBase->GetType() == VISU::TCUTSEGMENT) ||
1633 IsSObjectTable(aSObject)) {
1634 GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
1635 UpdateObjBrowser(this);
1639 //----------------------------------------------------------------------------
1644 SalomeApp_Study* anAppStudy = GetAppStudy(this);
1645 _PTR(Study) aCStudy = GetCStudy(anAppStudy);
1646 if (CheckLock(aCStudy,GetDesktop(this)))
1649 SALOME_ListIO aList;
1650 LightApp_SelectionMgr* mgr = GetSelectionMgr(this);
1651 mgr->selectedObjects(aList,QString::null,false);
1652 int i = 0, nbSelected = aList.Extent();
1653 if (nbSelected < 1) return;
1655 std::vector<std::string> anEntries (nbSelected);
1657 Handle(SALOME_InteractiveObject) anIO;
1658 for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
1660 if (anIO->hasEntry()) {
1661 if (IsRemovable(anIO->getEntry(), this)) {
1662 aNameList.append("\n - ");
1663 // Get Name Of the Main Object if it's a referenced object
1664 VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
1665 if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
1666 _PTR(SObject) aRefSObject;
1667 if (aSObject->ReferencedObject(aRefSObject)) {
1668 QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
1669 aNameList.append( aRefName );
1672 aNameList.append(anIO->getName());
1674 anEntries[i++] = anIO->getEntry();
1679 if (nbSelected < 1) {
1680 SUIT_MessageBox::warning(GetDesktop(this),
1681 QObject::tr("WRN_VISU"),
1682 QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
1686 if ( SUIT_MessageBox::question( GetDesktop(this),
1687 QObject::tr( "WRN_VISU" ),
1688 QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
1689 SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
1692 // There is a transaction
1693 _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
1694 aStudyBuilder->NewCommand();
1696 for (i = 0; i < nbSelected; i++) {
1697 VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anEntries[i]);
1698 if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
1699 emit beforeObjectDelete(QString(aSObject->GetID().c_str()));
1700 _PTR(SObject) aRefSObject;
1701 if (aSObject->ReferencedObject(aRefSObject)) {
1702 // It can be a reference on curve, published under a container.
1703 // In this case the curve should be removed from the container.
1705 VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
1706 VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
1707 if(aRefBase && aRefBase->GetType() == VISU::TMESH){
1708 DeleteSObject(this, aCStudy, aRefSObject);
1709 UpdateObjBrowser(this, true, aRefSObject);
1710 }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
1711 CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
1712 VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
1713 _PTR(SObject) aParentSO = aSObject->GetFather();
1714 VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
1715 if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
1716 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
1717 if(aContainer->GetNbCurves() > 0){
1718 aContainer->RemoveCurve(aCurve);
1719 UpdateObjBrowser(this, true, aParentSO);
1726 DeleteSObject(this, aCStudy, aSObject);
1727 UpdateObjBrowser(this, true, aSObject);
1732 // Finish transaction
1733 aStudyBuilder->CommitCommand();
1734 mgr->clearSelected();
1737 //----------------------------------------------------------------------------
1742 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1743 if(aSelectionInfo.empty())
1746 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1747 if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
1748 if(aBase->GetType() == VISU::TTABLE || aBase->GetType() == VISU::TPOINTMAP3D) {
1749 if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)){
1750 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
1751 _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
1752 if(IsSObjectTable(aSObject)){
1753 VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
1754 if(aDlg->exec() == QDialog::Accepted){
1755 if(!IsStudyLocked(aStudy)){
1756 // if study is not locked - create new container, create curves and insert them
1757 // into container, then plot container if current viewer is of VIEW_PLOT2D type
1759 QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
1760 aDlg->getCurvesSource( horIndex, ver1Indices, ver2Indices, zIndices );
1761 verIndices = ver1Indices + ver2Indices;
1762 if( horIndex >= 0 && verIndices.count() > 0 ){
1763 CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
1764 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
1765 for( int i = 0; i < verIndices.count(); i++ ){
1766 bool isV2 = ver2Indices.contains(verIndices[i]);
1767 VISU::Curve_var aCurveObject =
1768 GetVisuGen(this)->CreateCurveWithZExt(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
1769 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
1771 int marker, line, lineWidth;
1773 if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
1774 line, lineWidth, color) && !isAuto )
1777 c.R = color.red() /255.;
1778 c.G = color.green()/255.;
1779 c.B = color.blue() /255.;
1780 aCurve->SetColor( c );
1781 aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
1782 aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1784 aContainer->AddCurve(aCurveObject);
1787 UpdateObjBrowser(this);
1788 PlotContainer( this, aContainer, VISU::eDisplay );
1792 // get name of SObject
1793 QString aSObjectName;
1794 _PTR(GenericAttribute) anAttr;
1795 if(aSObject->FindAttribute( anAttr, "AttributeName" )){
1796 _PTR(AttributeName) aName = anAttr;
1797 aSObjectName = QString( aName->Value().c_str() );
1799 // if study is locked just get curves info and plot them
1800 // if current viewer is of VIEW_PLOT2D type
1801 QList<Plot2d_Curve*> container;
1802 aDlg->getCurves( container );
1803 if ( !container.isEmpty() ) {
1804 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1805 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
1813 }else if(!aSelectionItem.myIO.IsNull()){
1814 // check if Table SObject is selected
1815 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
1816 if(IsSObjectTable(aSObject)){
1817 VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
1818 if(aDlg->exec() == QDialog::Accepted){
1819 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
1820 if(!IsStudyLocked(aStudy)){
1821 // if study is not locked - create new table and container objects, create curves
1822 // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
1824 QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
1825 aDlg->getCurvesSource( horIndex, verIndices, ver2Indices, zIndices );
1826 verIndices = ver1Indices + ver2Indices;
1827 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1828 VISU::Table_var aTableObject = GetVisuGen(this)->CreateTable(aSObject->GetID().c_str());
1829 if(!CORBA::is_nil(aTableObject)){
1830 VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
1831 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObject).in());
1832 for ( int i = 0; i < verIndices.count(); i++ ) {
1833 bool isV2 = ver2Indices.contains(verIndices[i]);
1834 VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZExt
1835 ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
1836 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
1838 int marker, line, lineWidth;
1840 if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
1841 line, lineWidth, color) && !isAuto )
1844 c.R = color.red()/255.;
1845 c.G = color.green()/255.;
1846 c.B = color.blue()/255.;
1847 aCurve->SetColor( c );
1848 aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
1849 aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1851 aContainerObject->AddCurve(aCurveObject);
1854 UpdateObjBrowser(this);
1855 PlotContainer( this, aContainer, VISU::eDisplay );
1859 // get name of SObject
1860 QString aSObjectName;
1861 _PTR(GenericAttribute) anAttr;
1862 if(aSObject->FindAttribute(anAttr, "AttributeName")){
1863 _PTR(AttributeName) aName = anAttr;
1864 aSObjectName = QString( aName->Value().c_str() );
1866 // if study is locked just get curves info and plot them
1867 QList<Plot2d_Curve*> container;
1868 aDlg->getCurves( container );
1869 if ( !container.isEmpty() ) {
1870 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1871 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
1880 //----------------------------------------------------------------------------
1883 ::OnCurveProperties()
1885 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1886 if(aSelectionInfo.size() != 1)
1889 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1890 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
1891 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1895 if(aBase->GetType() == VISU::TCURVE) {
1897 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase)){
1898 if(!IsStudyLocked(GetCStudy(GetAppStudy(this)))){
1899 Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
1901 aDlg.setLine( (Plot2d::LineType)aCurve->GetLine(), aCurve->GetLineWidth() );
1902 aDlg.setMarker( (Plot2d::MarkerType)aCurve->GetMarker() );
1903 SALOMEDS::Color aColor = aCurve->GetColor();
1904 aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
1905 if( aDlg.exec() == QDialog::Accepted ) {
1906 aCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
1907 aCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
1908 SALOMEDS::Color newColor;
1909 newColor.R = aDlg.getColor().red()/255.;
1910 newColor.G = aDlg.getColor().green()/255.;
1911 newColor.B = aDlg.getColor().blue()/255.;
1912 aCurve->SetColor( newColor );
1913 PlotCurve(this, aCurve, VISU::eDisplay);
1920 //----------------------------------------------------------------------------
1923 ::OnClearContainer()
1925 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1926 if (CheckLock(aCStudy,GetDesktop(this)))
1929 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1930 if(aSelectionInfo.empty())
1933 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1934 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1938 if(aBase->GetType() == VISU::TCONTAINER){
1940 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase)){
1941 if(aContainer && aContainer->GetNbCurves() > 0){
1942 aContainer->Clear();
1943 VISU::updateContainerVisibility(aContainer);
1944 UpdateObjBrowser(this);
1950 //----------------------------------------------------------------------------
1955 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
1956 if(aSelectionInfo.empty())
1959 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
1960 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
1964 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase);
1968 VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
1969 aDlg->initFromPrsObject(aContainer);
1971 aDlg->storeToPrsObject(aContainer);
1972 UpdateObjBrowser(this, true);
1974 VISU::updateContainerVisibility(aContainer);
1978 //----------------------------------------------------------------------------
1981 ::OnSaveViewParams()
1983 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1984 if (CheckLock(aCStudy,GetDesktop(this)))
1987 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1988 if (aViewMgr->getType() != SVTK_Viewer::Type())
1991 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1992 SALOME_ListIO aListIO;
1993 aSelectionMgr->selectedObjects(aListIO);
1994 if (aListIO.Extent() > 1)
1997 if (aListIO.Extent() == 0) {
1998 VISU::View3D_i::SaveViewParams(aViewMgr, (const char*)VISU::View3D_i::GenerateViewParamsName().toLatin1());
2000 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2001 VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
2003 UpdateObjBrowser(this);
2006 //----------------------------------------------------------------------------
2009 ::OnRestoreViewParams()
2011 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
2012 if (aViewMgr->getType() != SVTK_Viewer::Type())
2015 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2016 SALOME_ListIO aListIO;
2017 aSelectionMgr->selectedObjects(aListIO);
2018 if (aListIO.Extent() != 1)
2021 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2022 //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
2023 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
2024 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
2026 VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
2029 //----------------------------------------------------------------------------
2034 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2035 if (CheckLock(aCStudy,GetDesktop(this)))
2038 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
2039 if (aSelectionInfo.empty())
2042 VisuGUI_Selection aSel (this);
2043 aSel.init("", getApp()->selectionMgr());
2044 if (aSel.count() < 1) return;
2046 bool isAny = false; // is there any appropriate object selected
2047 for (int i = 0; i < aSelectionInfo.size(); i++) {
2048 VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
2049 VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo;
2051 _PTR(SObject) aSObject = anObjectInfo.mySObject;
2055 // Check, if the selected object can be renamed
2056 QString aStr = aSel.parameter(i, "type" ).toString();
2057 if (aStr == "VISU::TSCALARMAP" || aStr == "VISU::TISOSURFACES" ||
2058 aStr == "VISU::TDEFORMEDSHAPE" || aStr == "VISU::TCUTPLANES" ||
2059 aStr == "VISU::TCUTLINES" || aStr == "VISU::TCUTSEGMENT" || aStr == "VISU::TVECTORS" ||
2060 aStr == "VISU::TSTREAMLINES" || aStr == "VISU::TPLOT3D" ||
2061 aStr == "VISU::TSCALARMAPONDEFORMEDSHAPE" || aStr == "VISU::TCOLOREDPRS3DHOLDER" ||
2062 aStr == "VISU::TTABLE" || aStr == "VISU::TCURVE" || aStr == "VISU::TCONTAINER" ||
2063 aStr == "VISU::POINTMAP3D" || aStr == "VISU::TVIEW3D" ||
2064 aStr == "VISU::TPOINTMAP3D" || aStr == "VISU::TGAUSSPOINTS")
2066 _PTR(GenericAttribute) anAttr;
2067 if (aSObject->FindAttribute(anAttr, "AttributeName")) {
2069 _PTR(AttributeName) aName (anAttr);
2070 QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
2071 if (!Name.isEmpty()) {
2072 QApplication::setOverrideCursor(Qt::WaitCursor);
2074 // rename specific objects
2075 if (VISU::Base_i* aBase = anObjectInfo.myBase) {
2076 switch (aBase->GetType()) {
2077 case VISU::TCURVE: { // Curve object
2078 if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase))
2079 aCurve->SetName(Name.toLatin1().constData(), true);
2082 case VISU::TTABLE: { // Table object
2083 if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
2084 aTable->SetName(Name.toLatin1().constData(), true);
2087 case VISU::TPOINTMAP3D: { // Table object
2088 if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
2089 aTable3d->SetTitle(Name.toLatin1().constData());
2090 aTable3d->UpdateActors();
2094 case VISU::TCONTAINER: { // Container object
2095 if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
2096 aContainer->SetName(Name.toLatin1().constData(), true);
2103 // rename the study object
2104 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
2105 aName->SetValue(Name.toLatin1().constData()); // rename the SObject
2106 anIO->setName(Name.toLatin1().constData()); // rename the InteractiveObject
2108 ViewManagerList aViewManagerList;
2109 getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
2110 SUIT_ViewManager* aViewManager;
2111 foreach( aViewManager, aViewManagerList ) {
2112 if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
2113 if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
2114 aViewer->renameAll( anIO, Name.toLatin1().constData() );
2118 UpdateObjBrowser(this, false);
2119 QApplication::restoreOverrideCursor();
2126 SUIT_MessageBox::warning(GetDesktop(this),
2127 QObject::tr("WRN_VISU"),
2128 QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
2132 //----------------------------------------------------------------------------
2135 ::OnClippingPlanes()
2137 new VisuGUI_ClippingDlg (this, false);
2140 //----------------------------------------------------------------------------
2146 if ( !mySweep->toggleViewAction()->isChecked() )
2147 mySweep->toggleViewAction()->trigger();
2148 mySweep->onSelectionChanged();
2150 mySweep->onPlay(true);
2153 //----------------------------------------------------------------------------
2156 ::OnTimeAnimation(VISU::Animation::AnimationMode theMode)
2158 if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
2161 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2162 VisuGUI_TimeAnimationDlg* aAnimationDlg =
2163 new VisuGUI_TimeAnimationDlg (this, aCStudy, theMode);
2165 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2166 SALOME_ListIO aListIO;
2167 aSelectionMgr->selectedObjects(aListIO);
2169 SALOME_ListIteratorOfListIO It (aListIO);
2170 for (; It.More(); It.Next()) {
2171 _PTR(SObject) aSObject = aCStudy->FindObjectID(It.Value()->getEntry());
2172 if ( !aAnimationDlg->addField(aSObject) ) {
2173 SUIT_MessageBox::warning(GetDesktop(this),
2175 tr("ERR_CANT_CREATE_ANIMATION") );
2176 delete aAnimationDlg;
2180 aAnimationDlg->show();
2183 //----------------------------------------------------------------------------
2186 OnParallelTimeAnimation()
2188 OnTimeAnimation(VISU::Animation::PARALLEL);
2193 OnSucccessiveTimeAnimation()
2195 OnTimeAnimation(VISU::Animation::SUCCESSIVE);
2198 //----------------------------------------------------------------------------
2203 if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
2206 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2207 SALOME_ListIO aListIO;
2208 aSelectionMgr->selectedObjects(aListIO);
2210 if (aListIO.Extent() != 1)
2213 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2215 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2217 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
2221 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
2222 if (aType != VISU::TANIMATION)
2225 VisuGUI_TimeAnimationDlg* aAnimationDlg =
2226 new VisuGUI_TimeAnimationDlg(this, aCStudy);
2227 aAnimationDlg->restoreFromStudy(aSObj);
2228 aAnimationDlg->show();
2231 //----------------------------------------------------------------------------
2234 ::OnPointEvolution()
2236 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
2237 VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
2239 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
2240 SALOME_ListIO aListIO;
2241 aSelectionMgr->selectedObjects( aListIO );
2243 SALOME_ListIteratorOfListIO It( aListIO );
2244 for( ; It.More(); It.Next() )
2246 _PTR(SObject) aSObject = aCStudy->FindObjectID( It.Value()->getEntry() );
2247 if( !aDlg->setField( aSObject ) )
2249 SUIT_MessageBox::warning( GetDesktop( this ),
2251 tr( "ERR_CANT_CREATE_EVOLUTION" ) );
2259 //----------------------------------------------------------------------------
2264 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
2265 SALOME_ListIO aListIO;
2266 aSelectionMgr->selectedObjects( aListIO );
2268 if( aListIO.Extent() != 1 )
2271 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
2273 _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
2274 _PTR(SObject) aSObj = aCStudy->FindObjectID( anIO->getEntry() );
2278 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
2279 if( aType != VISU::TEVOLUTION )
2282 VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
2283 aDlg->restoreFromStudy( aSObj );
2287 //----------------------------------------------------------------------------
2290 ::OnCopyPresentation()
2292 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
2293 if (CheckLock(aCStudy,GetDesktop(this)))
2296 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
2297 if(aSelectionInfo.empty())
2300 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
2301 VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
2305 VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dToModify(this, aBase);
2309 if(aBase->GetType() != VISU::TMESH){
2310 VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aBase);
2311 switch (aBase->GetType()) {
2312 case VISU::TSCALARMAP:
2313 TSameAsFactory<VISU::TSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2315 case VISU::TDEFORMEDSHAPE:
2316 TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2318 case VISU::TSCALARMAPONDEFORMEDSHAPE:
2319 case VISU::TDEFORMEDSHAPEANDSCALARMAP:
2320 TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2322 case VISU::TCUTPLANES:
2323 TSameAsFactory<VISU::TCUTPLANES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2325 case VISU::TCUTLINES:
2326 TSameAsFactory<VISU::TCUTLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2328 case VISU::TCUTSEGMENT:
2329 TSameAsFactory<VISU::TCUTSEGMENT>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2331 case VISU::TISOSURFACES:
2332 TSameAsFactory<VISU::TISOSURFACES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2334 case VISU::TSTREAMLINES:
2335 TSameAsFactory<VISU::TSTREAMLINES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2337 case VISU::TVECTORS:
2338 TSameAsFactory<VISU::TVECTORS>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2341 TSameAsFactory<VISU::TPLOT3D>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
2344 UpdateObjBrowser(this);
2348 //----------------------------------------------------------------------------
2351 ::OnToggleSelectionPanel()
2353 if (GetActiveViewWindow<SVTK_ViewWindow>(this))
2355 if( myPanels.find( SelectionPanelId ) != myPanels.end() )
2357 if( VisuGUI_SelectionPanel* aSelectionPanel =
2358 dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
2360 if( aSelectionPanel->isVisible() )
2361 aSelectionPanel->hide();
2363 aSelectionPanel->show();
2368 SUIT_MessageBox::warning(GetDesktop(this),
2370 tr("ERR_ACTIVATE_VIEW3D") );
2373 //----------------------------------------------------------------------------
2376 ::OnSwitchSelectionMode()
2378 QAction* anAction = dynamic_cast<QAction*>( sender() );
2382 bool isAnyChecked = false;
2383 for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
2385 QAction* aRefAction = action( anId );
2386 isAnyChecked |= aRefAction->isChecked();
2387 if( anAction != aRefAction )
2388 aRefAction->setChecked( false );
2389 else if( myPanels.find( SelectionPanelId ) != myPanels.end() )
2391 if( VisuGUI_SelectionPanel* aSelectionPanel =
2392 dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
2393 aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
2396 // At least one action must be checked
2398 anAction->setChecked( true );
2401 //----------------------------------------------------------------------------
2404 ::OnSwitchSelectionMode( int theId )
2406 for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
2408 QAction* aRefAction = action( anId );
2409 aRefAction->setChecked( anId == VISU_ACTOR_SELECTION + theId );
2413 //----------------------------------------------------------------------------
2416 ::OnMergeScalarBars()
2418 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2419 SALOME_ListIO aListIO;
2420 aSelectionMgr->selectedObjects(aListIO);
2422 SALOME_ListIteratorOfListIO It (aListIO);
2424 // first find the bounds
2425 double aMin, aMax; bool first = true;
2426 for (; It.More(); It.Next()) {
2427 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2428 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2429 if (!aPrsList.empty()) {
2430 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2431 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2433 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2437 aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
2439 if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
2440 if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
2448 // set the computed range to every selected ScalarMap
2449 bool update = false;
2450 for (It.Initialize(aListIO); It.More(); It.Next() ) {
2451 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2452 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2453 if (!aPrsList.empty()) {
2454 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2455 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2457 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2459 aScalar->SetRange(aMin, aMax);
2460 RecreateActor(this, aScalar);
2468 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
2469 vw->getRenderer()->ResetCameraClippingRange();
2475 //----------------------------------------------------------------------------
2478 ::OnFreeScalarBars()
2480 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
2481 SALOME_ListIO aListIO;
2482 aSelectionMgr->selectedObjects(aListIO);
2484 SALOME_ListIteratorOfListIO It (aListIO);
2486 // restore the source range for every ScalarMap
2487 bool update = false;
2488 for (; It.More(); It.Next()) {
2489 Handle(SALOME_InteractiveObject)& anIO = It.Value();
2490 std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
2491 if (!aPrsList.empty()) {
2492 for (int i = 0, n = aPrsList.size(); i < n; i++) {
2493 VISU::Prs3d_i* aPrsObject = aPrsList[i];
2495 VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
2497 aScalar->SetSourceRange();
2498 RecreateActor(this, aScalar);
2506 if (SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this)) {
2507 vw->getRenderer()->ResetCameraClippingRange();
2513 //----------------------------------------------------------------------------
2518 if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs");
2519 VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
2527 if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
2528 ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), this, aViewWindow);
2537 ::initialize( CAM_Application* theApp )
2539 SalomeApp_Module::initialize( theApp );
2541 mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
2543 mySweep = new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
2552 action( VISU_ACTOR_SELECTION )->setChecked( true );
2560 QWidget* aParent = application()->desktop();
2561 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
2565 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_IMPORT_MED"));
2566 createAction( VISU_IMPORT_FROM_FILE, tr("IMPORT_FROM_FILE"), QIcon(aPixmap),
2567 tr("MEN_IMPORT_FROM_FILE"), "", (Qt::CTRL + Qt::Key_I), aParent, false,
2568 this, SLOT(OnImportFromFile()));
2570 createAction( VISU_IMPORT_TABLE, "", QIcon(),
2571 tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
2572 this, SLOT(OnImportTableFromFile()));
2574 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
2575 createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIcon(aPixmap),
2576 tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
2577 this, SLOT(OnCreateScalarMap()));
2579 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
2580 createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIcon(aPixmap),
2581 tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
2582 this, SLOT(OnCreateDeformedShape()));
2584 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"));
2585 createAction( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), QIcon(aPixmap),
2586 tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), "", 0, aParent, false,
2587 this, SLOT(OnCreateDeformedShapeAndScalarMap()));
2589 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
2590 createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIcon(aPixmap),
2591 tr("MEN_VECTORS"), "", 0, aParent, false,
2592 this, SLOT(OnCreateVectors()));
2594 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
2595 createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIcon(aPixmap),
2596 tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
2597 this, SLOT(OnCreateIsoSurfaces()));
2599 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
2600 createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIcon(aPixmap),
2601 tr("MEN_CUT_PLANES"), "", 0, aParent, false,
2602 this, SLOT(OnCreateCutPlanes()));
2604 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
2605 createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIcon(aPixmap),
2606 tr("MEN_STREAM_LINES"), "", 0, aParent, false,
2607 this, SLOT(OnCreateStreamLines()));
2609 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
2610 createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIcon(aPixmap),
2611 tr("MEN_CUT_LINES"), "", 0, aParent, false,
2612 this, SLOT(OnCreateCutLines()));
2614 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_SEGMENT"));
2615 createAction( VISU_CUT_SEGMENT, tr("MEN_CUT_SEGMENT"), QIcon(aPixmap),
2616 tr("MEN_CUT_SEGMENT"), "", 0, aParent, false,
2617 this, SLOT(OnCreateCutSegment()));
2619 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2620 createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIcon(aPixmap),
2621 tr("MEN_PLOT_3D"), "", 0, aParent, false,
2622 this, SLOT(OnCreatePlot3D()));
2624 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
2625 createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIcon(aPixmap),
2626 tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
2627 this, SLOT(OnCreatePlot2dView()));
2629 createAction( VISU_DELETE_OBJS, tr("MEN_DELETE_OBJS"), QIcon(),
2630 tr("MEN_DELETE_OBJS"), "", Qt::Key_Delete, aParent, false,
2631 this, SLOT(OnDeleteObjects()));
2633 createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIcon(),
2634 tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
2635 this, SLOT(OnShowTable()));
2637 createAction( VISU_EDIT_POINTMAP3D, tr("MEN_EDIT_PRS"), QIcon(),
2638 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2639 this, SLOT(OnShowTablePlot()));
2641 createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIcon(),
2642 tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
2643 this, SLOT(OnPlotData()));
2645 createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIcon(),
2646 tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
2647 this, SLOT(OnExportTableToFile()));
2649 createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIcon(),
2650 tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
2651 this, SLOT(OnImportMedField()));
2653 createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIcon(),
2654 tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
2655 this, SLOT(OnImportMedField()));
2657 createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIcon(),
2658 tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
2659 this, SLOT(OnImportMedField()));
2661 createAction( VISU_LOAD_COMPONENT_DATA, tr("MEN_LOAD_COMPONENT_DATA"), QIcon(),
2662 tr("MEN_LOAD_COMPONENT_DATA"), "", 0, aParent, false,
2663 this, SLOT(OnLoadComponentData()));
2665 createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIcon(),
2666 tr("MEN_CREATE_PRS"), "", 0, aParent, false,
2667 this, SLOT(OnCreateMesh()));
2669 createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIcon(),
2670 tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
2671 this, SLOT(OnCreateManyMesh()));
2673 createAction( VISU_TRANSLATE_PRS, tr("MEN_TRANSLATE_PRS"), QIcon(),
2674 tr("MEN_TRANSLATE_PRS"), "", 0, aParent, false,
2675 this, SLOT(OnTranslatePrs()));
2677 createAction( VISU_MERGE_SCALAR_BARS, tr("MEN_MERGE_SCALAR_BARS"), QIcon(),
2678 tr("MEN_MERGE_SCALAR_BARS"), "", 0, aParent, false,
2679 this, SLOT(OnMergeScalarBars()));
2681 createAction( VISU_FREE_SCALAR_BARS, tr("MEN_FREE_SCALAR_BARS"), QIcon(),
2682 tr("MEN_FREE_SCALAR_BARS"), "", 0, aParent, false,
2683 this, SLOT(OnFreeScalarBars()));
2685 createAction( VISU_ERASE, tr("MEN_HIDE"), QIcon(),
2686 tr("MEN_HIDE"), "", 0, aParent, false,
2687 this, SLOT(OnErasePrs()));
2689 createAction( VISU_DISPLAY, tr("MEN_SHOW"), QIcon(),
2690 tr("MEN_SHOW"), "", 0, aParent, false,
2691 this, SLOT(OnDisplayPrs()));
2693 createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIcon(),
2694 tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
2695 this, SLOT(OnDisplayOnlyPrs()));
2697 createAction( VISU_SHOW_SCALAR_BAR, tr("MEN_SHOW_SCALAR_BAR"), QIcon(),
2698 tr("MEN_SHOW_SCALAR_BAR"), "", 0, aParent, false,
2699 this, SLOT(OnShowScalarBar()));
2701 createAction( VISU_HIDE_SCALAR_BAR, tr("MEN_HIDE_SCALAR_BAR"), QIcon(),
2702 tr("MEN_HIDE_SCALAR_BAR"), "", 0, aParent, false,
2703 this, SLOT(OnHideScalarBar()));
2705 createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIcon(),
2706 tr("MEN_COPY_PRS"), "", 0, aParent, false,
2707 this, SLOT(OnCopyPresentation()));
2709 createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIcon(),
2710 tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
2711 this, SLOT(OnCurveProperties()));
2713 createAction( VISU_RENAME, tr("MEN_RENAME"), QIcon(),
2714 tr("MEN_RENAME"), "", Qt::Key_F2, aParent, false,
2715 this, SLOT(OnRename()));
2717 createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIcon(),
2718 tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
2719 this, SLOT(OnEditContainer()));
2721 createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIcon(),
2722 tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
2723 this, SLOT(OnClearContainer()));
2725 createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIcon(),
2726 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2727 this, SLOT(OnSaveViewParams()));
2728 createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIcon(),
2729 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
2730 this, SLOT(OnSaveViewParams()));
2732 createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIcon(),
2733 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
2734 this, SLOT(OnRestoreViewParams()));
2736 //createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIcon(),
2737 // tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
2738 // this, SLOT(OnDeleteObjects()));
2740 createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIcon(),
2741 tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false,
2742 this, SLOT(OnArrangeActors()));
2744 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
2745 createAction( VISU_POINTS, tr("MEN_POINTS"), QIcon(aPixmap),
2746 tr("MEN_POINTS"), "", 0, aParent, false,
2747 this, SLOT(OnMakePoints()));
2749 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
2750 createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIcon(aPixmap),
2751 tr("MEN_WIREFRAME"), "", 0, aParent, false,
2752 this, SLOT(OnMakeWireframe()));
2754 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
2755 createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIcon(aPixmap),
2756 tr("MEN_SURFACE"), "", 0, aParent, false,
2757 this, SLOT(OnMakeSurface()));
2759 createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIcon(),
2760 tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
2761 this, SLOT(OnMakeInsideframe()));
2763 createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIcon(),
2764 tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
2765 this, SLOT(OnMakeSurfaceframe()));
2767 createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIcon(),
2768 tr("MEN_SHRINK"), "", 0, aParent, false,
2769 this, SLOT(OnMakeShrink()));
2771 createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIcon(),
2772 tr("MEN_UNSHRINK"), "", 0, aParent, false,
2773 this, SLOT(OnMakeShrink()));
2775 createAction( VISU_FEATURE_EDGES, tr("MEN_FEATURE_EDGES"), QIcon(),
2776 tr("MEN_FEATURE_EDGES"), "", 0, aParent, false,
2777 this, SLOT(OnMakeFeatureEdges()));
2779 createAction( VISU_SHADING, tr("MEN_SHADING"), QIcon(),
2780 tr("MEN_SHADING"), "", 0, aParent, false,
2781 this, SLOT(OnSetShadingOn()));
2783 createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIcon(),
2784 tr("MEN_NOSHADING"), "", 0, aParent, false,
2785 this, SLOT(OnSetShadingOff()));
2787 createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIcon(),
2788 tr("MEN_CELL_COLOR"), "", 0, aParent, false,
2789 this, SLOT(OnChangeColor()));
2791 createAction( VISU_COLOR, tr("MEN_COLOR"), QIcon(),
2792 tr("MEN_COLOR"), "", 0, aParent, false,
2793 this, SLOT(OnChangeColor()));
2795 createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIcon(),
2796 tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
2797 this, SLOT(OnChangeWireframeColor()));
2799 createAction( VISU_OPACITY, tr("MEN_TRANSPARENCY"), QIcon(),
2800 tr("MEN_TRANSPARENCY"), "", 0, aParent, false,
2801 this, SLOT(OnChangeOpacity()));
2803 createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIcon(),
2804 tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
2805 this, SLOT(OnChangeLines()));
2807 createAction( VISU_POINT_MARKER, tr("MEN_POINT_MARKER"), QIcon(),
2808 tr("MEN_POINT_MARKER"), "", 0, aParent, false,
2809 this, SLOT(OnChangePointMarker()));
2811 createAction( VISU_SHRINK_FACTOR, tr("MEN_SHRINK_FACTOR"), QIcon(),
2812 tr("MEN_SHRINK_FACTOR"), "", 0, aParent, false,
2813 this, SLOT(OnChangeShrinkFactor()));
2816 createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
2817 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2818 this, SLOT(OnEditScalarMap()));
2820 createAction( VISU_EDIT_DEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIcon(),
2821 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2822 this, SLOT(OnEditDeformedShape()));
2824 createAction( VISU_EDIT_CUTPLANES, tr("MEN_EDIT_PRS"), QIcon(),
2825 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2826 this, SLOT(OnEditCutPlanes()));
2828 createAction( VISU_EDIT_CUTLINES, tr("MEN_EDIT_PRS"), QIcon(),
2829 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2830 this, SLOT(OnEditCutLines()));
2832 createAction( VISU_EDIT_CUTSEGMENT, tr("MEN_EDIT_PRS"), QIcon(),
2833 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2834 this, SLOT(OnEditCutSegment()));
2836 createAction( VISU_EDIT_ISOSURFACES, tr("MEN_EDIT_PRS"), QIcon(),
2837 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2838 this, SLOT(OnEditIsoSurfaces()));
2840 createAction( VISU_EDIT_VECTORS, tr("MEN_EDIT_PRS"), QIcon(),
2841 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2842 this, SLOT(OnEditVectors()));
2844 createAction( VISU_EDIT_STREAMLINES, tr("MEN_EDIT_PRS"), QIcon(),
2845 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2846 this, SLOT(OnEditStreamLines()));
2848 createAction( VISU_EDIT_PLOT3D, tr("MEN_EDIT_PRS"), QIcon(),
2849 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2850 this, SLOT(OnEditPlot3D()));
2852 createAction( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
2853 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2854 this, SLOT(OnEditDeformedShapeAndScalarMap()));
2856 createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIcon(),
2857 tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
2858 this, SLOT(OnCreateTable()));
2860 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP_PANEL"));
2861 createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIcon(aPixmap),
2862 tr("MEN_SWEEP"), "", 0, aParent, false,
2863 this, SLOT(OnSweep()));
2865 createAction( VISU_CLIPPING, tr("MEN_CLIPPING"), QIcon(),
2866 tr("MEN_CLIPPING"), "", 0, aParent, false,
2867 this, SLOT(OnClippingPlanes()));
2869 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2870 createAction( VISU_PARALLELANIMATION, tr("MEN_PARALLEL_ANIMATION"), QIcon(aPixmap),
2871 tr("MEN_PARALLEL_ANIMATION"), "", 0, aParent, false,
2872 this, SLOT(OnParallelTimeAnimation()));
2874 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2875 createAction( VISU_SUCCCESSIVEANIMATION, tr("MEN_SUCCCESSIVE_ANIMATION"), QIcon(aPixmap),
2876 tr("MEN_SUCCCESSIVE_ANIMATION"), "", 0, aParent, false,
2877 this, SLOT(OnSucccessiveTimeAnimation()));
2879 createAction( VISU_POINT_EVOLUTION, tr("MEN_POINT_EVOLUTION"), QIcon(),
2880 tr("MEN_POINT_EVOLUTION"), "", 0, aParent, false,
2881 this, SLOT(OnPointEvolution()));
2883 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
2884 createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIcon(aPixmap),
2885 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
2886 this, SLOT(OnEraseAll()));
2888 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SELECTION_PANEL"));
2889 createAction( VISU_SELECTION_PANEL, tr("MEN_SELECTION_PANEL"), QIcon(aPixmap),
2890 tr("MEN_SELECTION_PANEL"), "", 0, aParent, false,
2891 this, SLOT(OnToggleSelectionPanel()));
2893 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ACTOR_SELECTION"));
2894 createAction( VISU_ACTOR_SELECTION, tr("MEN_ACTOR_SELECTION"), QIcon(aPixmap),
2895 tr("MEN_ACTOR_SELECTION"), "", 0, aParent, true,
2896 this, SLOT(OnSwitchSelectionMode()));
2898 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CELL_SELECTION"));
2899 createAction( VISU_CELL_SELECTION, tr("MEN_CELL_SELECTION"), QIcon(aPixmap),
2900 tr("MEN_CELL_SELECTION"), "", 0, aParent, true,
2901 this, SLOT(OnSwitchSelectionMode()));
2903 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINT_SELECTION"));
2904 createAction( VISU_POINT_SELECTION, tr("MEN_POINT_SELECTION"), QIcon(aPixmap),
2905 tr("MEN_POINT_SELECTION"), "", 0, aParent, true,
2906 this, SLOT(OnSwitchSelectionMode()));
2908 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_POINT_SELECTION"));
2909 createAction( VISU_GAUSS_POINT_SELECTION, tr("MEN_GAUSS_POINT_SELECTION"), QIcon(aPixmap),
2910 tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
2911 this, SLOT(OnSwitchSelectionMode()));
2913 // Definition of the actions for the "Navigation" tool bar
2914 registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
2915 registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
2917 createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIcon(),
2918 tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
2919 this, SLOT(OnShowAnimation()));
2921 createAction( VISU_SHOW_EVOLUTION, tr("MEN_SHOW_EVOLUTION"), QIcon(),
2922 tr("MEN_SHOW_EVOLUTION"), "", 0, aParent, false,
2923 this, SLOT(OnShowEvolution()));
2925 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
2926 createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIcon(aPixmap),
2927 tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
2928 this, SLOT(OnPlot3dFromCutPlane()));
2930 createAction( VISU_MANAGE_CACHE, tr("MEN_MANAGE_CACHE"), QIcon(),
2931 tr("MEN_MANAGE_CACHE"), "", 0, aParent, false,
2932 this, SLOT( OnManageCache() ) );
2934 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
2935 createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIcon(aPixmap),
2936 tr("MEN_MULTIPR_VIEW_FULL_RES"), "", 0, aParent, false,
2937 this, SLOT(OnMultiprViewFullRes()));
2939 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_MEDIUM"));
2940 createAction( VISU_MULTIPR_MED_RES, tr("MEN_MULTIPR_VIEW_MEDIUM_RES"), QIcon(aPixmap),
2941 tr("MEN_MULTIPR_VIEW_MEDIUM_RES"), "", 0, aParent, false,
2942 this, SLOT(OnMultiprViewMediumRes()));
2944 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_LOW"));
2945 createAction( VISU_MULTIPR_LOW_RES, tr("MEN_MULTIPR_VIEW_LOW_RES"), QIcon(aPixmap),
2946 tr("MEN_MULTIPR_VIEW_LOW_RES"), "", 0, aParent, false,
2947 this, SLOT(OnMultiprViewLowRes()));
2949 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_HIDE"));
2950 createAction( VISU_MULTIPR_HIDE, tr("MEN_MULTIPR_VIEW_HIDE"), QIcon(aPixmap),
2951 tr("MEN_MULTIPR_VIEW_HIDE"), "", 0, aParent, false,
2952 this, SLOT(OnMultiprViewHide()));
2954 createAction( VISU_FILE_INFO, tr("MEN_FILE_INFO"), QIcon(),
2955 tr("MEN_FILE_INFO"), "", 0, aParent, false,
2956 this, SLOT(OnFileInfo()));
2958 createAction( VISU_EXPORT_MED, tr("VISU_MEN_EXPORT_MED"), QIcon(),
2959 tr("VISU_MEN_EXPORT_MED"), "", 0, aParent, false,
2960 this, SLOT(OnExportMED()));
2962 createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(),
2963 tr("MEN_FILTER_SCALARS"), "", 0, aParent, false,
2964 this, SLOT(OnFilterScalars()));
2966 createAction( VISU_VALUES_LABELING, tr("MEN_VALUES_LABELING"), QIcon(),
2967 tr("MEN_VALUES_LABELING"), "", 0, aParent, true,
2968 this, SLOT(OnValuesLabeling()));
2970 createAction( VISU_VALUES_LABELING_PARAMS, tr("VISU_VALUES_LABELING_PARAMS"), QIcon(),
2971 tr("VISU_VALUES_LABELING_PARAMS"), "", 0, aParent, false,
2972 this, SLOT(OnValuesLabelingParams()));
2974 createAction(VISU_ARCQUAD_MODE, tr("MEN_VISU_ARCQUAD_MODE"), QIcon(),
2975 tr("MEN_VISU_ARCQUAD_MODE"), "",0, aParent, true,
2976 this, SLOT(OnArcQuadMode()));
2978 createAction(VISU_LINEQUAD_MODE, tr("MEN_VISU_LINEQUAD_MODE"),QIcon(),
2979 tr("MEN_VISU_LINEQUAD_MODE"), "",0, aParent, true,
2980 this, SLOT(OnLineQuadMode()));
2988 // Add actions to menus
2990 aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
2991 createMenu( separator(), aMenuId, -1, 10 );
2993 int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
2994 createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
2995 createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
2997 aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
2998 createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
2999 createMenu( VISU_DEFORMED_SHAPE, aMenuId, 10 ); // deformed shape
3000 createMenu( VISU_VECTORS, aMenuId, 10 ); // vectors
3001 createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
3002 createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
3003 createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
3004 createMenu( VISU_CUT_SEGMENT, aMenuId, 10 ); // cut segment
3005 createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
3006 createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
3007 createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aMenuId, 10 ); // scalar map on deformed shape
3009 aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
3011 createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
3012 createMenu( VISU_POINTS, parentId, 10 ); // points
3013 createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
3014 createMenu( VISU_SURFACE, parentId, 10 ); // surface
3015 createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
3017 parentId = createMenu( tr( "MEN_2D_QUADRATIC_MODE" ), aMenuId, 10 ); // 2D quadratic mode
3018 createMenu( VISU_LINEQUAD_MODE, parentId, 10 ); // lines
3019 createMenu( VISU_ARCQUAD_MODE, parentId, 10 ); // arcs
3027 int aToolId = createTool( tr("TOOL_IMPORT") );
3028 createTool( VISU_IMPORT_FROM_FILE, aToolId );
3030 aToolId = createTool(tr("TOOL_VISUALISATION"));
3031 createTool( VISU_SCALAR_MAP, aToolId );
3032 createTool( VISU_DEFORMED_SHAPE, aToolId );
3033 createTool( VISU_VECTORS, aToolId );
3034 createTool( VISU_ISO_SURFACES, aToolId );
3035 createTool( VISU_CUT_PLANES, aToolId );
3036 createTool( VISU_CUT_LINES, aToolId );
3037 createTool( VISU_CUT_SEGMENT, aToolId );
3038 createTool( VISU_STREAM_LINES, aToolId );
3039 createTool( VISU_PLOT_3D, aToolId );
3040 createTool( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aToolId );
3042 aToolId = createTool(tr("TOOL_REPRESENTATION"));
3043 createTool( VISU_POINTS, aToolId );
3044 createTool( VISU_WIREFRAME, aToolId );
3045 createTool( VISU_SURFACE, aToolId );
3046 createTool( VISU_ERASE_ALL, aToolId );
3048 aToolId = createTool(tr("TOOL_SELECTION"));
3049 createTool( VISU_SELECTION_PANEL, aToolId );
3050 createTool( separator(), aToolId );
3051 createTool( VISU_ACTOR_SELECTION, aToolId );
3052 createTool( VISU_CELL_SELECTION, aToolId );
3053 createTool( VISU_POINT_SELECTION, aToolId );
3054 createTool( VISU_GAUSS_POINT_SELECTION, aToolId );
3056 aToolId = createTool( tr( "TOOL_NAVIGATION" ) );
3057 createTool( VISU_SLIDER_PANEL, aToolId );
3058 createTool( separator(), aToolId );
3059 createTool( VISU_SWEEP_PANEL, aToolId );
3064 ::createPopupMenus()
3066 // Prepare popup menus
3067 QtxPopupMgr* mgr = popupMgr();
3069 // VISU root commands
3070 mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED file
3071 mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
3072 mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
3074 //mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
3077 mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
3078 mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
3079 mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
3080 mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
3081 mgr->insert( action( VISU_CUT_SEGMENT ), -1, -1, -1 ); // cut segment
3082 mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
3083 mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
3084 mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
3085 mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
3086 mgr->insert( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), -1, -1, -1 ); // scalar map on deformed shape
3088 mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
3089 mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
3091 mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
3094 mgr->insert( action( VISU_EDIT_SCALARMAP ), -1, -1, -1 );
3095 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
3096 mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
3097 mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
3098 mgr->insert( action( VISU_EDIT_CUTSEGMENT ), -1, -1, -1 );
3099 mgr->insert( action( VISU_EDIT_ISOSURFACES ), -1, -1, -1 );
3100 mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
3101 mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
3102 mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
3103 mgr->insert( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ), -1, -1, -1 );
3104 mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
3105 mgr->insert( action( VISU_EDIT_POINTMAP3D ), -1, -1, -1 );
3107 mgr->insert( action( VISU_FILTERSCALARS ), -1, -1, -1 );
3110 mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
3113 mgr->insert( action( VISU_COPY_PRS ), -1, -1, -1 );
3116 mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
3119 mgr->insert( separator(), -1, -1, -1 );
3120 mgr->insert( action( VISU_VALUES_LABELING ), -1, -1, -1 );
3121 mgr->insert( action( VISU_VALUES_LABELING_PARAMS ), -1, -1, -1 );
3122 mgr->insert( separator(), -1, -1, -1 );
3125 mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
3126 mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
3127 mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
3129 mgr->insert( separator(), -1, -1, -1 );
3131 mgr->insert( action( VISU_ERASE ), -1, -1, -1 ); // erase
3132 mgr->insert( action( VISU_DISPLAY ), -1, -1, -1 ); // display
3133 mgr->insert( action( VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
3135 mgr->insert( action( VISU_HIDE_SCALAR_BAR ), -1, -1, -1 ); // hide scalar bar
3136 mgr->insert( action( VISU_SHOW_SCALAR_BAR ), -1, -1, -1 ); // show scalar bar
3138 // "Representation" submenu
3139 int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 );
3140 mgr->insert( action( VISU_POINTS ) , parentId, -1, -1 ); // points
3141 mgr->insert( action( VISU_WIREFRAME ) , parentId, -1, -1 ); // wireframe
3142 mgr->insert( action( VISU_SURFACE ) , parentId, -1, -1 ); // surface
3143 mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
3144 mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
3145 mgr->insert( action( VISU_FEATURE_EDGES ), parentId, -1, -1 ); // feature edges
3146 mgr->insert( action( VISU_SHRINK ) , parentId, -1, -1 ); // shrink
3147 mgr->insert( action( VISU_UNSHRINK ) , parentId, -1, -1 ); // unshrink
3148 mgr->insert( separator(), parentId, -1, -1 );
3149 mgr->insert( action( VISU_SHADING ) , parentId, -1, -1 ); // shading
3150 mgr->insert( action( VISU_NOSHADING ) , parentId, -1, -1 ); // noshading
3152 //"2D Quadratic" submenu
3153 parentId = mgr->insert( tr( "MEN_2D_QUADRATIC_MODE" ), -1, -1 );
3154 mgr->insert( action( VISU_LINEQUAD_MODE ), parentId, -1, -1 ); // line representation
3155 mgr->insert( action( VISU_ARCQUAD_MODE ), parentId, -1, -1 ); // arc representation
3157 // "Properties" submenu
3158 parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
3159 mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
3160 mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
3161 mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
3162 mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
3163 mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
3164 mgr->insert( action( VISU_POINT_MARKER ), parentId, -1, -1 ); // point marker
3165 mgr->insert( action( VISU_SHRINK_FACTOR ), parentId, -1, -1 ); // shrink factor
3167 mgr->insert( separator(), -1, -1, -1 );
3169 // Other presentations management
3170 mgr->insert( action( VISU_TRANSLATE_PRS ), -1, -1, -1 );
3171 mgr->insert( action( VISU_CLIPPING ), -1, -1, -1 );
3173 mgr->insert( action( VISU_MERGE_SCALAR_BARS ), -1, -1, -1 );
3174 mgr->insert( action( VISU_FREE_SCALAR_BARS ), -1, -1, -1 );
3176 mgr->insert( action( VISU_SWEEP ), -1, -1, -1 );
3177 mgr->insert( action( VISU_PARALLELANIMATION ), -1, -1, -1 );
3178 mgr->insert( action( VISU_SUCCCESSIVEANIMATION ), -1, -1, -1 );
3180 mgr->insert( separator(), -1, -1, -1 );
3182 mgr->insert( action( VISU_POINT_EVOLUTION ), -1, -1, -1 );
3184 mgr->insert( separator(), -1, -1, -1 );
3186 // view parameters commands
3187 mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
3188 mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
3189 mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
3190 //mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
3192 mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
3194 mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
3196 mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
3197 mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
3198 mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
3199 mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
3201 mgr->insert( action( VISU_FILE_INFO ), -1, -1, -1 );
3202 mgr->insert( action( VISU_EXPORT_MED ), -1, -1, -1 );
3206 QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3207 "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
3208 "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
3209 QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3210 "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
3211 "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
3213 // VISU root commands
3214 QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
3215 mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule );
3216 mgr->setRule( action( VISU_IMPORT_TABLE ), aRule );
3217 mgr->setRule( action( VISU_PLOT2D ), aRule );
3219 // timestamp commands
3220 aRule = "client='ObjectBrowser' and selcount=1 and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'}";
3221 mgr->setRule( action( VISU_SCALAR_MAP ), aRule );
3222 mgr->setRule( action( VISU_ISO_SURFACES ), aRule );
3223 mgr->setRule( action( VISU_CUT_PLANES ), aRule );
3224 mgr->setRule( action( VISU_CUT_LINES ), aRule );
3225 mgr->setRule( action( VISU_CUT_SEGMENT ), aRule );
3226 mgr->setRule( action( VISU_PLOT_3D ), aRule );
3227 aRule += " and nbComponents>1";
3228 mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule );
3229 mgr->setRule( action( VISU_VECTORS ), aRule );
3230 mgr->setRule( action( VISU_STREAM_LINES ), aRule );
3231 mgr->setRule( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), aRule );
3233 // display/erase commands
3234 QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
3235 QString aTableOrContHide = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreVisibleCurves)";
3236 QString aTableOrContShow = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreHiddenCurves)";
3237 QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
3238 QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
3239 QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
3240 QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
3241 QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
3243 QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsVisible +
3244 " or ( (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
3246 QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsInvisible +
3247 " or ( (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
3249 QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
3250 " or ( ((type='VISU::TTABLE' and nbChildren>0) or (type='VISU::TCONTAINER' and hasCurves) or"
3251 " (type='VISU::TCURVE')))) ) or" + aComponent;
3253 QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and (isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and isScalarBarVisible )";
3254 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) )";
3256 mgr->setRule( action( VISU_ERASE ), anEraseRule );
3257 mgr->setRule( action( VISU_DISPLAY ), aDisplayRule );
3258 mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule );
3260 mgr->setRule( action( VISU_HIDE_SCALAR_BAR ), aScalarBarHideRule );
3261 mgr->setRule( action( VISU_SHOW_SCALAR_BAR ), aScalarBarShowRule );
3263 aRule = "selcount>0 and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}";
3264 mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule );
3266 aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
3267 mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule );
3268 mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule );
3270 aRule = "selcount=1 and $type in { " + aSimplePrsAll + "}";
3271 mgr->setRule( action( VISU_FILTERSCALARS ), aRule );
3275 aRule = "hasActor=1 and selcount=1 and $type in { 'VISU::TGAUSSPOINTS'" + aPrsAll + " }";
3276 mgr->setRule( action( VISU_VALUES_LABELING ), aRule, QtxPopupMgr::VisibleRule );
3277 mgr->setRule( action( VISU_VALUES_LABELING ), "{true} in $isValuesLabeled", QtxPopupMgr::ToggleRule );
3278 mgr->setRule( action( VISU_VALUES_LABELING_PARAMS ), aRule, QtxPopupMgr::VisibleRule );
3281 aRule = "isVisible and hasActor=1 and selcount=1 and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3282 mgr->setRule (action(VISU_ARCQUAD_MODE), aRule , QtxPopupMgr::VisibleRule);
3283 mgr->setRule (action(VISU_LINEQUAD_MODE),aRule , QtxPopupMgr::VisibleRule);
3285 mgr->setRule (action(VISU_ARCQUAD_MODE), aRule + " and quadratic2DMode='VISU::ARCS'", QtxPopupMgr::ToggleRule);
3286 mgr->setRule (action(VISU_LINEQUAD_MODE),aRule + " and quadratic2DMode='VISU::LINES'", QtxPopupMgr::ToggleRule);
3290 aRule = "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'";
3291 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule );
3292 mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0 and activeView='VTKViewer'" );
3293 mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'" );
3294 //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
3296 mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'SVTK'} and selcount=0" );
3298 // 3D presentations commands
3299 QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TGAUSSPOINTS' " + aPrsAll + "}";
3300 QString aPrsType2 = " and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
3301 QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3302 //QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
3303 QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCUTPLANES' 'VISU::TISOSURFACES' 'VISU::TPLOT3D' }";
3304 //QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
3305 QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
3306 " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3307 QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3308 QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
3309 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
3311 QString aFeatureEdgesType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
3313 aRule = "selcount=1";
3314 mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
3315 aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
3317 // "Representation" submenu
3318 QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3319 QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3320 QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3321 QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
3322 QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::FEATURE_EDGES'}";
3323 QString aNotFeatureEdges = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
3325 mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints );
3326 mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType2 + aNotWirefr );
3327 mgr->setRule( action( VISU_SURFACE ) , aRule + aSurfType + aNotSurfac );
3328 mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + anInsideType + aNotInside );
3329 mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr );
3330 mgr->setRule( action( VISU_FEATURE_EDGES ), aRule + aFeatureEdgesType + aNotFeatureEdges );
3332 mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0" );
3333 mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1" );
3335 mgr->setRule( action( VISU_SHADING ) , aRule + " and isScalarMapAct=1 and isShading=0" );
3336 mgr->setRule( action( VISU_NOSHADING ), aRule + " and isScalarMapAct=1 and isShading=1" );
3338 // "Properties" submenu
3339 mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'" );
3340 mgr->setRule( action( VISU_EDGE_COLOR ), aRule + aSurfFrameType + " and representation='VISU::SURFACEFRAME'" );
3341 mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
3342 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
3343 "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))" );
3344 mgr->setRule( action( VISU_OPACITY ), aRule + " and hasActor=1" );
3345 mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1" );
3346 mgr->setRule( action( VISU_POINT_MARKER ), aRule + aLineType + " and hasActor=1 and representation='VISU::POINT'" );
3347 mgr->setRule( action( VISU_SHRINK_FACTOR ), aRule + aShrinkType + " and isShrunk=1" );
3350 QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::POINTMAP3D'";
3352 aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TPOINTMAP3D' " + aCurveAll + " " + aPrsAll + "})";
3353 mgr->setRule( action( VISU_RENAME ), aRule );
3355 // copy presentation command
3356 aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
3357 mgr->setRule( action( VISU_COPY_PRS ), aRule );
3360 aRule = "selcount=1 and type='VISU::TCURVE'";
3361 mgr->setRule( action( VISU_CURVE_PROPS ), aRule );
3364 aRule = "selcount=1 and ( type='VISU::TPOINTMAP3D' or type='VISU::TTABLE')";
3365 mgr->setRule( action( VISU_SHOW_TABLE ), aRule );
3366 mgr->setRule( action( VISU_CREATE_CURVES ), aRule );
3367 mgr->setRule( action( VISU_EXPORT_TABLE ), aRule );
3369 // curve container commands
3370 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
3371 mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule );
3372 mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule );
3374 mgr->setRule( action( VISU_EDIT_SCALARMAP ),
3375 "selcount=1 and type='VISU::TSCALARMAP'" );
3376 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
3377 "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
3378 mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
3379 "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
3380 mgr->setRule( action( VISU_EDIT_CUTPLANES ),
3381 "selcount=1 and type='VISU::TCUTPLANES'" );
3382 mgr->setRule( action( VISU_EDIT_CUTLINES ),
3383 "selcount=1 and type='VISU::TCUTLINES'" );
3384 mgr->setRule( action( VISU_EDIT_CUTSEGMENT ),
3385 "selcount=1 and type='VISU::TCUTSEGMENT'" );
3386 mgr->setRule( action( VISU_EDIT_ISOSURFACES ),
3387 "selcount=1 and type='VISU::TISOSURFACES'" );
3388 mgr->setRule( action( VISU_EDIT_VECTORS ),
3389 "selcount=1 and type='VISU::TVECTORS'" );
3390 mgr->setRule( action( VISU_EDIT_STREAMLINES ),
3391 "selcount=1 and type='VISU::TSTREAMLINES'" );
3392 mgr->setRule( action( VISU_EDIT_PLOT3D ),
3393 "selcount=1 and type='VISU::TPLOT3D'" );
3394 mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
3395 "selcount=1 and type='VISU::TPOINTMAP3D'" );
3397 aRule = "selcount=1 and $type in {'VISU::TCUTLINES' 'VISU::TCUTSEGMENT'} and nbNamedChildren=0";
3398 mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
3400 aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "}) and isFieldPrs=0";
3401 mgr->setRule( action( VISU_SWEEP ), aRule );
3403 aRule = "client='ObjectBrowser' and selcount>0";
3404 aRule += " and $type in {'VISU::TFIELD'}";
3405 aRule += " and nbTimeStamps>1";
3406 aRule += " and activeView in {'VTKViewer' 'SVTK'}";
3407 mgr->setRule( action( VISU_PARALLELANIMATION ), aRule );
3409 aRule = "client='ObjectBrowser'";
3410 aRule += " and (selcount=1 and nbTimeStamps>1 or selcount>1 and nbTimeStamps>0)";
3411 aRule += " and $type in {'VISU::TFIELD'}";
3412 aRule += " and activeView in {'VTKViewer' 'SVTK'}";
3413 mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule );
3415 aRule = "client='ObjectBrowser' and selcount>0";
3416 aRule += " and $type in {'VISU::TFIELD'}";
3417 aRule += " and medEntity='NODE_ENTITY'";
3418 aRule += " and nbTimeStamps>1";
3419 mgr->setRule( action( VISU_POINT_EVOLUTION ), aRule );
3421 aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
3422 mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1" );
3423 mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1" );
3424 mgr->setRule( action( VISU_EDIT_PLOT3D ),
3425 "selcount=1 and type='VISU::TPLOT3D'" );
3427 //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
3428 //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
3430 aRule = "client='ObjectBrowser' and selcount>=1 and $type in {'VISU::TPART'} and ";
3432 QString aCustomRule = aRule + "fullResolution=1 and resolutionState!='F'";
3433 mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aCustomRule );
3436 QString aCustomRule = aRule + "mediumResolution=1 and resolutionState!='M'";
3437 mgr->setRule( action( VISU_MULTIPR_MED_RES ), aCustomRule );
3440 QString aCustomRule = aRule + "lowResolution=1 and resolutionState!='L'";
3441 mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aCustomRule );
3444 QString aCustomRule = aRule + "resolutionState!='H'";
3445 mgr->setRule( action( VISU_MULTIPR_HIDE), aCustomRule );
3448 mgr->setRule( action( VISU_FILE_INFO ), "selcount=1 and type in {'VISU::TRESULT'}" );
3449 mgr->setRule( action( VISU_EXPORT_MED ), "selcount=1 and type in {'VISU::TRESULT'}" );
3452 void VisuGUI::createPanels()
3454 myPanels[SelectionPanelId] = new VisuGUI_SelectionPanel( this );
3455 myPanels[FeatureEdgesPanelId] = new VisuGUI_FeatureEdgesPanel( this );
3456 myPanels[ClippingPlanesPanelId] = new VisuGUI_ClippingPanel( this );
3458 VisuGUI_Panel* aPanel;
3459 foreach( aPanel, myPanels ) {
3460 getApp()->desktop()->addDockWidget( Qt::RightDockWidgetArea, aPanel );
3461 aPanel->setVisible( false );
3465 //***************************************************************************
3466 void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle )
3468 SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
3470 //TODO: object Browser DONE
3471 SUIT_DataBrowser* ob = getApp()->objectBrowser();
3472 bool isOBClient = (ob && theClient == ob->popupClientType());
3474 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
3475 SALOME_ListIO aListIO;
3476 aSelectionMgr->selectedObjects(aListIO);
3478 if (aListIO.Extent() < 1) return;
3480 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
3482 // Check if "Merge Scalar Range" can be applied
3484 SALOME_ListIteratorOfListIO It (aListIO);
3485 for (; It.More(); It.Next()) {
3486 Handle(SALOME_InteractiveObject)& anIO = It.Value();
3488 if (!anIO.IsNull() && anIO->hasEntry()) {
3489 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
3493 if ( !isOBClient ) {
3494 QString aName = QString( aSObject->GetName().c_str() );
3495 while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
3496 aName.remove( (aName.length() - 1), 1 );
3500 CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
3501 if (CORBA::is_nil(aCORBAObject)) {
3502 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
3503 if (aType == VISU::TTIMESTAMP) {
3504 _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
3506 for (; anIter->More(); anIter->Next()) {
3507 aPrs = anIter->Value();
3510 std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
3511 nbPrs += aSubList.size();
3518 theMenu->addSeparator();
3519 theMenu->addAction( action( VISU_MERGE_SCALAR_BARS ) );
3520 theMenu->addAction( action( VISU_FREE_SCALAR_BARS ) );
3523 // Check if some curves selected (for bug PAL10611)
3524 bool isCurves = false;
3525 bool isOneCutPlane = false;
3526 SALOME_ListIteratorOfListIO It1 (aListIO);
3527 for (; It1.More() && !isCurves; It1.Next()) {
3528 Handle(SALOME_InteractiveObject)& anIO = It1.Value();
3529 if (!anIO.IsNull() && anIO->hasEntry()) {
3530 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
3533 VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
3534 if (aType == VISU::TCURVE) {
3537 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
3538 if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
3539 if (aPrsObject->GetType() == VISU::TCUTPLANES) {
3540 if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
3541 isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
3549 theMenu->addAction( action( VISU_PLOT3D_FROM_CUTPLANE ) );
3551 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
3552 if(aSelectionInfo.empty())
3555 VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
3556 Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
3557 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
3558 Storable::TRestoringMap aMap = Storable::GetStorableMap(aSObject);
3559 CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
3561 if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
3562 if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE)
3563 theMenu->addAction( action( VISU_MANAGE_CACHE ) );
3566 theMenu->addSeparator();
3568 // Check if some (nb > 0) removable objects selected
3569 if (isOBClient && IsRemovableSelected(this)) {
3570 theMenu->addAction( action( VISU_DELETE_OBJS ) );
3573 theMenu->removeAction( action( myDisplay ) );
3574 theMenu->removeAction( action( myErase ) );
3575 theMenu->removeAction( action( myDisplayOnly ) );
3576 theMenu->removeAction( action( myEraseAll ) );
3579 // Check single selection
3580 if (aListIO.Extent() != 1)
3583 // Check if the object's data is loaded
3584 _PTR(SComponent) aSComp = aSObject->GetFatherComponent();
3585 std::string aCompIOR;
3586 if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
3587 //std::string aCompDataType = aSComp->ComponentDataType();
3588 theMenu->addAction( action( VISU_LOAD_COMPONENT_DATA ) ); // "Load Component Data"
3591 VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aMap );
3592 if (aType == VISU::TANIMATION) {
3593 theMenu->addAction( action( VISU_SHOW_ANIMATION ) );
3594 } else if (aType == VISU::TEVOLUTION) {
3595 theMenu->addAction( action( VISU_SHOW_EVOLUTION ) );
3596 } else if (isOBClient) {
3597 if (IsSObjectTable(aSObject)) {
3598 /* action( VISU_SHOW_TABLE )->addTo(theMenu);
3599 theMenu->addAction( action( VISU_CREATE_CURVES ) );
3600 theMenu->addAction( action( VISU_EXPORT_TABLE ) );
3601 theMenu->addSeparator();
3602 action( VISU_DELETE_OBJS )->addTo(theMenu);*/// dmv - code was moved up
3604 if (!CORBA::is_nil(anObject)) {
3605 SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
3606 if (!CORBA::is_nil(aMED.in())) {
3607 theMenu->addAction( action( VISU_IMPORT_MED_STRUCTURE ) ); // "Import Structure"
3610 SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
3611 if (!CORBA::is_nil(aField)) {
3612 theMenu->addAction( action( VISU_IMPORT_MED_TIMESTAMP ) ); // "Import TimeStamp"
3615 _PTR(SObject) aSFather1 = aSObject->GetFather();
3617 std::string aValue = aSFather1->GetName();
3618 if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
3619 theMenu->addAction( action( VISU_IMPORT_MED_FIELD ) ); // "Import Field"
3628 //***************************************************************************
3631 ::windows( QMap<int, int>& theMap ) const
3634 theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
3635 theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
3641 ::viewManagers( QStringList& theList ) const
3644 // append SVTK viewer only if there is no opened VVTK
3645 // SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
3646 // if( vm && vm->getViewsCount()>0 )
3647 // theList.append( VVTK_Viewer::Type() );
3649 theList.append( SVTK_Viewer::Type() );
3657 CORBA::String_var anIOR = GetVisuGen(this)->GetID();
3658 return QString(anIOR.in());
3664 ::activateModule( SUIT_Study* theStudy )
3666 bool aResult = SalomeApp_Module::activateModule( theStudy );
3669 setMenuShown( true );
3670 setToolShown( true );
3672 // import Python module that manages VISU plugins (need to be here because SalomePyQt API uses active module)
3673 PyGILState_STATE gstate = PyGILState_Ensure();
3674 PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
3675 if(pluginsmanager==NULL)
3679 PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_PLUGINS_OTHER").toStdString().c_str());
3684 PyGILState_Release(gstate);
3685 // end of GEOM plugins loading
3687 // Reset actions accelerator keys
3688 QList<QKeySequence> shortcuts;
3689 shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );
3690 action(VISU_IMPORT_FROM_FILE)->setShortcuts(shortcuts);
3692 action(VISU_DELETE_OBJS)->setEnabled(true); // Delete: Key_Delete
3693 action(VISU_RENAME )->setEnabled(true); // Rename: Key_F2
3695 ((VisuGUI_ClippingPanel*) myPanels[ClippingPlanesPanelId])->init();
3696 GetVisuGen( this )->GetClippingPlaneMgr().SetStudy(GetCStudy(dynamic_cast<SalomeApp_Study*>(theStudy)),true);
3697 emit moduleActivated();
3705 ::deactivateModule( SUIT_Study* theStudy )
3707 setMenuShown( false );
3708 setToolShown( false );
3710 // Unset actions accelerator keys
3711 action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); // Import: CTRL + Key_I
3713 action(VISU_DELETE_OBJS)->setEnabled(false); // Delete: Key_Delete
3714 action(VISU_RENAME )->setEnabled(false); // Rename: Key_F2
3716 bool aResult = SalomeApp_Module::deactivateModule( theStudy );
3718 emit moduleDeactivated();
3725 ::createSelection() const
3727 return new VisuGUI_Selection( (SalomeApp_Module*)this );
3730 //******************************************************************
3731 void VisuGUI::studyActivated()
3733 GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
3742 return new VisuGUI();
3747 void VisuGUI::createPreferences()
3749 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
3752 int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) );
3753 // Quantities with individual precision settings
3754 int precGroup = addPreference( tr( "VISU_PREF_GROUP_PRECISION" ), genTab );
3755 setPreferenceProperty( precGroup, "columns", 2 );
3757 // Default precision used by some input fieklds and data visualization code
3758 // Moved here from "Representation" tab to have all precisions in the same place
3759 int point_precision = addPreference( tr( "VISU_PREF_visual_data_precision" ), precGroup,
3760 LightApp_Preferences::IntSpin, "VISU", "visual_data_precision" );
3761 setPreferenceProperty( point_precision, "min", -16 );
3762 setPreferenceProperty( point_precision, "max", 16 );
3763 setPreferenceProperty( point_precision, "step", 1 );
3765 const int nbQuantities = 5;
3766 int precs[nbQuantities], ii = 0;
3767 precs[ii++] = addPreference( tr( "VISU_PREF_length_precision" ), precGroup,
3768 LightApp_Preferences::IntSpin, "VISU", "length_precision" );
3769 precs[ii++] = addPreference( tr( "VISU_PREF_angle_precision" ), precGroup,
3770 LightApp_Preferences::IntSpin, "VISU", "angle_precision" );
3771 precs[ii++] = addPreference( tr( "VISU_PREF_len_tol_precision" ), precGroup,
3772 LightApp_Preferences::IntSpin, "VISU", "len_tol_precision" );
3773 precs[ii++] = addPreference( tr( "VISU_PREF_parametric_precision" ), precGroup,
3774 LightApp_Preferences::IntSpin, "VISU", "parametric_precision" );
3775 precs[ii ] = addPreference( tr( "VISU_PREF_memory_precision" ), precGroup,
3776 LightApp_Preferences::IntSpin, "VISU", "memory_precision" );
3778 // Set property for precision value for spinboxes
3779 for ( ii = 0; ii < nbQuantities; ii++ ){
3780 setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -14 );
3781 setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 14 );
3782 setPreferenceProperty( precs[ii], "precision", 2 );
3786 // TAB: "MED import"
3787 int importTab = addPreference( tr( "MED import" ) );
3788 //printf( "++++++++++++++++++ Tab index %d\n", importTab );
3790 //int importFrame = addPreference( tr( "MED FRAME" ), importTab );
3791 //printf( "Frame index %d\n", importFrame );
3793 // group: "MED files import"
3794 int importGr = addPreference( tr( "MED files import" ), importTab );
3795 //printf( "Group index %d\n", importGr );
3796 setPreferenceProperty( importGr, "columns", 2 );
3798 addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" );
3799 addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
3800 addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
3801 addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
3802 addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" );
3803 addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" );
3804 addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" );
3806 // TAB: "Scalar Bar"
3807 int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
3809 int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), sbarTab );
3810 setPreferenceProperty( rangeGr, "columns", 2 );
3812 int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" );
3814 modes.append( tr( "VISU_MODULUS" ) );
3815 modes.append( tr( "VISU_COMPONENT" ) + tr("1") );
3816 modes.append( tr( "VISU_COMPONENT" ) + tr("2") );
3817 modes.append( tr( "VISU_COMPONENT" ) + tr("3") );
3818 QList<QVariant> indices;
3819 indices.append( 0 );
3820 indices.append( 1 );
3821 indices.append( 2 );
3822 indices.append( 3 );
3823 setPreferenceProperty( mode, "strings", modes );
3824 setPreferenceProperty( mode, "indexes", indices );
3826 addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
3828 int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" );
3830 types.append( tr( "VISU_FIELD_RANGE" ) );
3831 types.append( tr( "VISU_IMPOSED_RANGE" ) );
3833 indices.append( 0 );
3834 indices.append( 1 );
3835 setPreferenceProperty( rangetype, "strings", types );
3836 setPreferenceProperty( rangetype, "indexes", indices );
3838 int gaussMetric = addPreference( tr( "VISU_GAUSS_METRIC" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_gauss_metric" );
3839 QStringList metrics;
3840 metrics.append( tr( "VISU_GAUSS_METRIC_AVERAGE" ) );
3841 metrics.append( tr( "VISU_GAUSS_METRIC_MINIMUM" ) );
3842 metrics.append( tr( "VISU_GAUSS_METRIC_MAXIMUM" ) );
3844 indices.append( 0 );
3845 indices.append( 1 );
3846 indices.append( 2 );
3847 setPreferenceProperty( gaussMetric, "strings", metrics );
3848 setPreferenceProperty( gaussMetric, "indexes", indices );
3850 int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
3851 setPreferenceProperty( imposedGr, "columns", 4 );
3853 int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_min" );
3854 int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_max" );
3855 setPreferenceProperty( min, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
3856 setPreferenceProperty( max, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
3859 int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
3860 setPreferenceProperty( fontGr, "columns", 2 );
3862 addVtkFontPref( tr( "VISU_TITLE" ), fontGr, "scalar_bar_title_font", false );
3863 addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
3865 addVtkFontPref( tr( "VISU_LABELS" ), fontGr, "scalar_bar_label_font", false );
3866 addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
3868 // group: "Colors & Labels"
3869 int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
3870 setPreferenceProperty( colorsLabelsGr, "columns", 4 );
3872 int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr,
3873 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
3874 setPreferenceProperty( numcol, "min", 2 );
3875 setPreferenceProperty( numcol, "max", 256 );
3877 addPreference( tr( "VISU_IS_UNITS" ), colorsLabelsGr,
3878 LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
3880 int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
3881 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
3882 setPreferenceProperty( numlab, "min", 2 );
3883 setPreferenceProperty( numlab, "max", 65 );
3885 int lPrec = addPreference( tr( "PRECISION" ), colorsLabelsGr,
3886 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_label_precision" );
3888 setPreferenceProperty( lPrec, "min", 1 );
3889 setPreferenceProperty( lPrec, "max", 100 );
3891 int frame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
3892 //setPreferenceProperty( frame, "orientation", "vertical" );
3893 setPreferenceProperty( frame, "columns", "2" );
3895 // group: "Orientation"
3896 int orientGr = addPreference( tr( "VISU_ORIENTATION" ), frame, LightApp_Preferences::GroupBox );
3897 setPreferenceProperty( orientGr, "columns", 2 );
3898 int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr,
3899 LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
3900 QStringList orients;
3901 orients.append( tr( "VISU_VERTICAL" ) );
3902 orients.append( tr( "VISU_HORIZONTAL" ) );
3904 indices.append( 0 );
3905 indices.append( 1 );
3906 setPreferenceProperty( orient, "strings", orients );
3907 setPreferenceProperty( orient, "indexes", indices );
3909 // group: "Scalar bars default position"
3910 int scalarBarGr = addPreference( tr( "Scalar bars default position" ), frame, LightApp_Preferences::GroupBox );
3911 addPreference( tr( "Arrange Scalar Bars" ), scalarBarGr, LightApp_Preferences::Bool, "VISU", "scalar_bars_default_position" );
3914 // group: "Origin & Size Vertical"
3915 //int psSzFrame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
3916 //setPreferenceProperty( psSzFrame, "orientation", "horizontal" );
3917 //setPreferenceProperty( psSzFrame, "columns", "2" );
3919 int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ),
3920 frame, LightApp_Preferences::GroupBox );
3921 setPreferenceProperty( posVSizeGr, "columns", 2 );
3922 int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
3923 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
3924 int yv = addPreference( tr( "VISU_Y" ), posVSizeGr,
3925 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
3927 int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr,
3928 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
3929 int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr,
3930 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
3932 int twv = addPreference( tr( "VISU_TITLE_SIZE" ), posVSizeGr,
3933 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_size" );
3935 int lwv = addPreference( tr( "VISU_LABEL_SIZE" ), posVSizeGr,
3936 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_size" );
3938 int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
3939 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
3940 int bhv = addPreference( tr( "VISU_BAR_HEIGHT" ), posVSizeGr,
3941 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_height" );
3943 setPreferenceProperty( xv, "step", 0.1 );
3944 setPreferenceProperty( yv, "step", 0.1 );
3945 setPreferenceProperty( wv, "step", 0.1 );
3946 setPreferenceProperty( hv, "step", 0.1 );
3947 setPreferenceProperty( xv, "min", 0.0 );
3948 setPreferenceProperty( yv, "min", 0.0 );
3949 setPreferenceProperty( wv, "min", 0.0 );
3950 setPreferenceProperty( hv, "min", 0.0 );
3951 setPreferenceProperty( twv, "min", 0 );
3952 setPreferenceProperty( twv, "special", "auto" );
3953 setPreferenceProperty( lwv, "min", 0 );
3954 setPreferenceProperty( lwv, "special", "auto" );
3955 setPreferenceProperty( bwv, "min", 0 );
3956 setPreferenceProperty( bwv, "special", "auto" );
3957 setPreferenceProperty( bhv, "min", 0 );
3958 setPreferenceProperty( bhv, "special", "auto" );
3959 setPreferenceProperty( xv, "max", 1.0 );
3960 setPreferenceProperty( yv, "max", 1.0 );
3961 setPreferenceProperty( wv, "max", 1.0 );
3962 setPreferenceProperty( hv, "max", 1.0 );
3963 setPreferenceProperty( twv, "max", 100 );
3964 setPreferenceProperty( lwv, "max", 100 );
3965 setPreferenceProperty( bwv, "max", 100 );
3966 setPreferenceProperty( bhv, "max", 100 );
3968 // group: "Origin & Size Horizontal"
3969 int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ),
3970 frame, LightApp_Preferences::GroupBox );
3971 setPreferenceProperty( posHSizeGr, "columns", 2 );
3973 int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
3974 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
3975 int yh = addPreference( tr( "VISU_Y" ), posHSizeGr,
3976 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
3978 int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr,
3979 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
3980 int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr,
3981 LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
3983 int twh = addPreference( tr( "VISU_TITLE_SIZE" ), posHSizeGr,
3984 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_size" );
3986 int lwh = addPreference( tr( "VISU_LABEL_SIZE" ), posHSizeGr,
3987 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_size" );
3989 int bwh = addPreference( tr( "VISU_BAR_WIDTH" ), posHSizeGr,
3990 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
3991 int bhh = addPreference( tr( "VISU_BAR_HEIGHT" ), posHSizeGr,
3992 LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_height" );
3994 setPreferenceProperty( xh, "step", 0.1 );
3995 setPreferenceProperty( yh, "step", 0.1 );
3996 setPreferenceProperty( wh, "step", 0.1 );
3997 setPreferenceProperty( hh, "step", 0.1 );
3998 setPreferenceProperty( xh, "min", 0.0 );
3999 setPreferenceProperty( yh, "min", 0.0 );
4000 setPreferenceProperty( wh, "min", 0.0 );
4001 setPreferenceProperty( hh, "min", 0.0 );
4002 setPreferenceProperty( twh, "min", 0 );
4003 setPreferenceProperty( twh, "special", "auto" );
4004 setPreferenceProperty( lwh, "min", 0 );
4005 setPreferenceProperty( lwh, "special", "auto" );
4006 setPreferenceProperty( bwh, "min", 0 );
4007 setPreferenceProperty( bwh, "special", "auto" );
4008 setPreferenceProperty( bhh, "min", 0 );
4009 setPreferenceProperty( bhh, "special", "auto" );
4010 setPreferenceProperty( xh, "max", 1.0 );
4011 setPreferenceProperty( yh, "max", 1.0 );
4012 setPreferenceProperty( wh, "max", 1.0 );
4013 setPreferenceProperty( hh, "max", 1.0 );
4014 setPreferenceProperty( twh, "max", 100 );
4015 setPreferenceProperty( lwh, "max", 100 );
4016 setPreferenceProperty( bwh, "max", 100 );
4017 setPreferenceProperty( bhh, "max", 100 );
4020 int cutLineTab = addPreference( tr( "VISU_CUT_LINES_SEGMENT" ) );
4022 // group: "CutLines preferences"
4023 int cutLineGr = addPreference( tr( "VISU_CUT_LINES_SEGMENT_PREF" ), cutLineTab );
4024 setPreferenceProperty( cutLineGr, "columns", 1 );
4025 addPreference( tr( "Show preview" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "show_preview" );
4026 addPreference( tr( "Invert all curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "invert_all_curves" );
4027 addPreference( tr( "Use absolute length" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "use_absolute_length" );
4028 addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
4029 addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
4031 // TAB: "StreamLines"
4032 int streamLinesTab = addPreference( tr( "VISU_STREAM_LINES" ) );
4034 // group: "StreamLines preferences"
4035 int streamLinesGr = addPreference( tr( "VISU_STREAM_LINES_PREF" ), streamLinesTab );
4036 setPreferenceProperty( cutLineGr, "columns", 1 );
4037 int usedPoints = addPreference( tr( "VISU_STREAM_LINES_USED_POINTS" ), streamLinesGr,
4038 LightApp_Preferences::DblSpin, "VISU", "stream_lines_used_points" );
4039 setPreferenceProperty( usedPoints, "min", 0 );
4040 setPreferenceProperty( usedPoints, "max", 1 );
4041 setPreferenceProperty( usedPoints, "step", 0.1 );
4043 // TAB: "Sweep, Animation, 3D Cache"
4044 int animationTab = addPreference( tr( "Sweep, Animation" ) );
4046 // group: "3D Cache System prefereces"
4048 int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
4049 setPreferenceProperty( cacheGroup, "columns", 2 );
4051 int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
4052 LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
4055 modes.append( tr( "VISU_MINIMAL" ) );
4056 modes.append( tr( "VISU_LIMITED" ) );
4057 setPreferenceProperty( memory_mode, "strings", modes );
4060 indices.append( 0 );
4061 indices.append( 1 );
4062 setPreferenceProperty( memory_mode, "indexes", indices );
4064 int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
4065 LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
4066 setPreferenceProperty( memory_limit, "min", 1 );
4067 setPreferenceProperty( memory_limit, "max", 5000 );
4068 setPreferenceProperty( memory_limit, "step", 10 );
4071 // group: "Animation preferences"
4073 int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
4074 setPreferenceProperty( animationGroup, "columns", 1 );
4076 int speed = addPreference( tr( "Speed" ), animationGroup,
4077 LightApp_Preferences::IntSpin, "VISU", "speed" );
4078 addPreference( tr( "Cycled animation" ), animationGroup,
4079 LightApp_Preferences::Bool, "VISU", "cycled_animation" );
4080 addPreference( tr( "Use proportional timing" ), animationGroup,
4081 LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
4082 addPreference( tr( "Clean memory at each frame" ), animationGroup,
4083 LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
4085 setPreferenceProperty( speed, "min", 1 );
4086 setPreferenceProperty( speed, "max", 99 );
4088 int dump_mode = addPreference( tr( "VISU_DUMP_MODE" ), animationGroup,
4089 LightApp_Preferences::Selector, "VISU", "dump_mode" );
4092 modes.append( tr( "VISU_NO_DUMP" ) );
4093 modes.append( tr( "VISU_DUMP_PICTURES" ) );
4094 modes.append( tr( "VISU_DUMP_VIDEO" ) );
4095 setPreferenceProperty( dump_mode, "strings", modes );
4098 indices.append( 0 );
4099 indices.append( 1 );
4100 indices.append( 2 );
4101 setPreferenceProperty( dump_mode, "indexes", indices );
4103 int time_stamp_frequency = addPreference( tr( "VISU_TIME_STAMP_FREQUENCY" ), animationGroup,
4104 LightApp_Preferences::IntSpin, "VISU", "time_stamp_frequency" );
4105 setPreferenceProperty( time_stamp_frequency, "min", 1 );
4106 setPreferenceProperty( time_stamp_frequency, "max", 100 );
4109 // group: "Sweeping preferences"
4111 int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
4112 setPreferenceProperty( sweepGroup, "columns", 2 );
4114 int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup,
4115 LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
4116 QStringList sweep_modes;
4117 sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
4118 sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
4119 sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
4121 indices.append( 0 );
4122 indices.append( 1 );
4123 indices.append( 2 );
4124 setPreferenceProperty( modeSw, "strings", sweep_modes );
4125 setPreferenceProperty( modeSw, "indexes", indices );
4127 int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
4128 LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
4129 /* int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
4130 LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );*/
4131 int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGroup,
4132 LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
4133 int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
4135 ranges.append( tr( "PERIOD_PI" ) );
4136 ranges.append( tr( "PERIOD_2PI" ) );
4138 indices.append( 0 );
4139 indices.append( 1 );
4140 setPreferenceProperty( rangeSw, "strings", ranges );
4141 setPreferenceProperty( rangeSw, "indexes", indices );
4143 setPreferenceProperty( timestep, "min", 0.1 );
4144 setPreferenceProperty( timestep, "step", 0.1 );
4145 setPreferenceProperty( timestep, "max", 1000 );
4146 // setPreferenceProperty( nbcycles, "max", 100 );
4147 setPreferenceProperty( nbsteps, "max", 200 );
4151 // TAB: Representation ; group: "Representation properties"
4152 int representationTab = addPreference( tr( "Representation" ) );
4154 int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab );
4155 setPreferenceProperty( representGr, "columns", 2 );
4157 QStringList mesh_modes;
4158 mesh_modes.append( "Points" );
4159 mesh_modes.append( "Wireframe" );
4160 mesh_modes.append( "Insideframe" );
4161 mesh_modes.append( "Surfaceframe" );
4162 mesh_modes.append( "Surface" );
4163 mesh_modes.append( "Feature edges" );
4164 QList<QVariant> mesh_indices;
4165 mesh_indices.append( 0 );
4166 mesh_indices.append( 1 );
4167 mesh_indices.append( 3 );
4168 mesh_indices.append( 4 );
4169 mesh_indices.append( 2 );
4170 mesh_indices.append( 5 );
4172 QStringList modes0 = mesh_modes;
4173 modes0.removeAll( "Feature edges" );
4174 QList<QVariant> indices0 = mesh_indices;
4175 indices0.removeAll( 5 );
4177 QStringList modes1 = modes0;
4178 modes1.removeAll( "Insideframe" );
4179 QList<QVariant> indices1 = indices0;
4180 indices1.removeAll( 3 );
4182 QStringList modes2 = modes1;
4183 modes2.removeAll( "Surfaceframe" );
4184 QList<QVariant> indices2 = indices1;
4185 indices2.removeAll( 4 );
4187 QStringList modes3 = modes2;
4188 modes3.removeAll( "Surface" );
4189 QList<QVariant> indices3 = indices2;
4190 indices3.removeAll( 2 );
4193 int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" );
4194 setPreferenceProperty( mesh_represent, "strings", mesh_modes );
4195 setPreferenceProperty( mesh_represent, "indexes", mesh_indices );
4196 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "mesh_shrink" );
4198 int scalar_map_represent = addPreference( tr( "VISU_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_map_represent" );
4199 setPreferenceProperty( scalar_map_represent, "strings", modes0 );
4200 setPreferenceProperty( scalar_map_represent, "indexes", indices0 );
4201 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" );
4203 int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" );
4204 setPreferenceProperty( iso_surfaces_represent, "strings", modes1 );
4205 setPreferenceProperty( iso_surfaces_represent, "indexes", indices1 );
4206 int sp = addPreference( "", representGr, LightApp_Preferences::Space );
4207 setPreferenceProperty( sp, "hstretch", 0 );
4208 setPreferenceProperty( sp, "vstretch", 0 );
4210 int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" );
4211 setPreferenceProperty( cut_planes_represent, "strings", modes1 );
4212 setPreferenceProperty( cut_planes_represent, "indexes", indices1 );
4213 addPreference( "", representGr, LightApp_Preferences::Space );
4215 int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" );
4216 setPreferenceProperty( cut_lines_represent, "strings", modes3 );
4217 setPreferenceProperty( cut_lines_represent, "indexes", indices3 );
4218 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4219 setPreferenceProperty( sp, "hstretch", 0 );
4220 setPreferenceProperty( sp, "vstretch", 0 );
4222 int cut_segment_represent = addPreference( tr( "VISU_CUT_SEGMENT" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_segment_represent" );
4223 setPreferenceProperty( cut_segment_represent, "strings", modes3 );
4224 setPreferenceProperty( cut_segment_represent, "indexes", indices3 );
4225 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4226 setPreferenceProperty( sp, "hstretch", 0 );
4227 setPreferenceProperty( sp, "vstretch", 0 );
4229 int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
4230 setPreferenceProperty( deformed_shape_represent, "strings", modes0 );
4231 setPreferenceProperty( deformed_shape_represent, "indexes", indices0 );
4232 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "deformed_shape_shrink" );
4234 int vectors_represent = addPreference( tr( "VISU_VECTORS" ), representGr, LightApp_Preferences::Selector, "VISU", "vectors_represent" );
4235 setPreferenceProperty( vectors_represent, "strings", modes3 );
4236 setPreferenceProperty( vectors_represent, "indexes", indices3 );
4237 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4238 setPreferenceProperty( sp, "hstretch", 0 );
4239 setPreferenceProperty( sp, "vstretch", 0 );
4241 int stream_lines_represent = addPreference( tr( "VISU_STREAM_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "stream_lines_represent" );
4242 setPreferenceProperty( stream_lines_represent, "strings", modes3 );
4243 setPreferenceProperty( stream_lines_represent, "indexes", indices3 );
4244 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4245 setPreferenceProperty( sp, "hstretch", 0 );
4246 setPreferenceProperty( sp, "vstretch", 0 );
4248 int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" );
4249 setPreferenceProperty( plot3d_represent, "strings", modes1 );
4250 setPreferenceProperty( plot3d_represent, "indexes", indices1 );
4251 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4252 setPreferenceProperty( sp, "hstretch", 0 );
4253 setPreferenceProperty( sp, "vstretch", 0 );
4255 int scalar_def_represent = addPreference( tr( "VISU_DEFORMED_SHAPE_AND_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
4256 setPreferenceProperty( scalar_def_represent, "strings", modes1 );
4257 setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
4258 addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
4260 int quadraticmode = addPreference( tr( "QUADRATIC_REPRESENT_MODE" ), representGr, LightApp_Preferences::Selector, "VISU", "quadratic_mode" );
4261 QStringList quadraticModes;
4262 quadraticModes.append("Lines");
4263 quadraticModes.append("Arcs");
4265 indices.append( 0 );
4266 indices.append( 1 );
4267 setPreferenceProperty( quadraticmode, "strings", quadraticModes );
4268 setPreferenceProperty( quadraticmode, "indexes", indices );
4270 int maxAngle = addPreference( tr( "MAX_ARC_ANGLE" ), representGr, LightApp_Preferences::IntSpin,
4271 "VISU", "max_angle" );
4272 setPreferenceProperty( maxAngle, "min", 1 );
4273 setPreferenceProperty( maxAngle, "max", 90 );
4275 int elem0DSize = addPreference( tr( "VISU_ELEM0D_SIZE" ), representGr, LightApp_Preferences::IntSpin, "VISU", "elem0d_size" );
4276 setPreferenceProperty( elem0DSize, "min", 1 );
4277 setPreferenceProperty( elem0DSize, "max", 10 );
4278 addPreference( "", representGr, LightApp_Preferences::Space );
4280 int shrFac = addPreference( tr( "VISU_SHRINK_FACTOR" ), representGr, LightApp_Preferences::IntSpin, "VISU", "shrink_factor" );
4281 setPreferenceProperty( shrFac, "min", 20 );
4282 setPreferenceProperty( shrFac, "max", 100 );
4283 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4284 setPreferenceProperty( sp, "hstretch", 0 );
4285 setPreferenceProperty( sp, "vstretch", 0 );
4287 addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
4288 addPreference( "", representGr, LightApp_Preferences::Space );
4290 int typeOfMarker = addPreference( tr( "VISU_TYPE_OF_MARKER" ), representGr, LightApp_Preferences::Selector, "VISU", "type_of_marker" );
4292 QList<QVariant> aMarkerTypeIndicesList;
4293 QList<QVariant> aMarkerTypeIconsList;
4294 for ( int i = VTK::MT_POINT; i <= VTK::MT_O_X; i++ ) {
4295 QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
4296 QPixmap pixmap = aResourceMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
4297 aMarkerTypeIndicesList << i;
4298 aMarkerTypeIconsList << pixmap;
4300 aMarkerTypeIndicesList << VTK::MT_POINT_SPRITE;
4301 aMarkerTypeIconsList << aResourceMgr->loadPixmap( "VISU", tr( "ICON_POINT_SPRITE" ) );
4302 setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
4303 setPreferenceProperty( typeOfMarker, "icons", aMarkerTypeIconsList );
4305 int markerScale = addPreference( tr( "VISU_MARKER_SCALE" ), representGr, LightApp_Preferences::Selector, "VISU", "marker_scale" );
4307 QList<QVariant> aMarkerScaleIndicesList;
4308 QStringList aMarkerScaleValuesList;
4309 for ( int i = VISU::MS_10; i <= VISU::MS_70; i++ ) {
4310 aMarkerScaleIndicesList << i;
4311 aMarkerScaleValuesList << QString::number( (i-(int)VISU::MS_10)*0.5 + 1.0 );
4313 setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
4314 setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
4316 addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
4317 sp = addPreference( "", representGr, LightApp_Preferences::Space );
4318 setPreferenceProperty( sp, "hstretch", 0 );
4319 setPreferenceProperty( sp, "vstretch", 0 );
4321 addPreference( tr( "VISU_DISP_ONLY" ), representGr, LightApp_Preferences::Bool, "VISU", "display_only" );
4322 addPreference( "", representGr, LightApp_Preferences::Space );
4324 addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr,
4325 LightApp_Preferences::Bool, "VISU", "automatic_fit_all" );
4327 // TAB: Tables ; group: "Tables editing properties"
4328 int tablesTab = addPreference( tr( "VISU_TABLES" ) );
4330 int tablesGr = addPreference( tr( "VISU_TABLES_EDITING_PROPS" ), tablesTab );
4331 setPreferenceProperty( tablesGr, "columns", 1 );
4333 addPreference( tr( "VISU_TABLES_ENABLE_EDITING" ), tablesGr, LightApp_Preferences::Bool, "VISU", "tables_enable_editing" );
4335 int sortPolicyPref = addPreference( tr( "VISU_TABLES_SORT_POLICY" ), tablesGr, LightApp_Preferences::Selector, "VISU", "tables_sort_policy" );
4336 QStringList policies;
4337 policies.append( tr( "VISU_TABLES_EMPTY_LOWEST" ) );
4338 policies.append( tr( "VISU_TABLES_EMPTY_HIGHEST" ) );
4339 policies.append( tr( "VISU_TABLES_EMPTY_FIRST" ) );
4340 policies.append( tr( "VISU_TABLES_EMPTY_LAST" ) );
4341 policies.append( tr( "VISU_TABLES_EMPTY_IGNORE" ) );
4343 indices.append( 0 );
4344 indices.append( 1 );
4345 indices.append( 2 );
4346 indices.append( 3 );
4347 indices.append( 4 );
4348 setPreferenceProperty( sortPolicyPref, "strings", policies );
4349 setPreferenceProperty( sortPolicyPref, "indexes", indices );
4351 // TAB: Feature edges ; group: "Feature edges properties"
4352 int featureEdgesTab = addPreference( tr( "VISU_FEATURE_EDGES" ) );
4354 int featureEdgesGr = addPreference( tr( "VISU_FEATURE_EDGES_PROPS" ), featureEdgesTab );
4355 setPreferenceProperty( featureEdgesGr, "columns", 2 );
4357 int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr,
4358 LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
4359 setPreferenceProperty( featureEdgesAnglePref, "step", 10.0 );
4360 setPreferenceProperty( featureEdgesAnglePref, "min", 0.0 );
4361 setPreferenceProperty( featureEdgesAnglePref, "max", 90.0 );
4363 addPreference( tr( "VISU_SHOW_FEATURE_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_feature_edges" );
4364 addPreference( tr( "VISU_SHOW_BOUNDARY_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_boundary_edges" );
4365 addPreference( tr( "VISU_SHOW_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_manifold_edges" );
4366 addPreference( tr( "VISU_SHOW_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_non_manifold_edges" );
4367 //addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
4369 // TAB: "Values labels"
4371 int valLblTab = addPreference( tr( "VALUES_LABELING" ) );
4374 int valLblFontGr = addPreference( tr( "VISU_FONT" ), valLblTab );
4375 setPreferenceProperty( valLblFontGr, "columns", 2 );
4378 addVtkFontPref( tr( "LABELS" ), valLblFontGr, "values_labeling_font", true );
4381 addPreference( tr( "COLOR" ), valLblFontGr,
4382 LightApp_Preferences::Color, "VISU", "values_labeling_color" );
4386 void VisuGUI::preferencesChanged( const QString& a, const QString& b)
4388 if (a != QString("VISU")) return;
4389 if (b == QString("scalar_bar_orientation")) return;
4390 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
4391 float sbX1,sbY1,sbW,sbH;
4392 float aTol = 1.00000009999999;
4394 if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
4395 sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", 0.01);
4396 sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", 0.05);
4397 if(sbX1+sbW > aTol){
4398 aWarning = "Origin and Size Vertical: X+Width > 1\n";
4401 aResourceMgr->setValue("VISU", "scalar_bar_vertical_x", sbX1);
4402 aResourceMgr->setValue("VISU", "scalar_bar_vertical_width", sbW);
4405 else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){
4406 sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", 0.01);
4407 sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",0.5);
4408 if(sbY1+sbH > aTol){
4409 aWarning = "Origin and Size Vertical: Y+Height > 1\n";
4412 aResourceMgr->setValue("VISU", "scalar_bar_vertical_y", sbY1);
4413 aResourceMgr->setValue("VISU", "scalar_bar_vertical_height",sbH);
4416 else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){
4417 sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", 0.2);
4418 sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", 0.6);
4419 if(sbX1+sbW > aTol){
4420 aWarning = "Origin and Size Horizontal: X+Width > 1\n";
4423 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_x", sbX1);
4424 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_width", sbW);
4427 else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){
4428 sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", 0.01);
4429 sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",0.12);
4430 if(sbY1+sbH > aTol){
4431 aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
4434 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1);
4435 aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
4438 else if(b == "visual_data_precision") {
4439 LightApp_Preferences* pref = preferences();
4440 QtxPreferenceItem* min = pref->findItem( tr( "VISU_MIN" ), true );
4441 QtxPreferenceItem* max = pref->findItem( tr( "VISU_MAX" ), true );
4443 setPreferenceProperty( min->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
4445 setPreferenceProperty( max->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
4448 if ( !aWarning.isEmpty() ){
4449 aWarning += "The default values are applied instead.";
4450 SUIT_MessageBox::warning(GetDesktop(this),
4451 tr("ERR_SCALARBAR_PARAMS"),
4458 ::getViewManager(const QString& theType,
4459 const bool theIsCreate)
4461 return getApp()->getViewManager(theType,theIsCreate);
4466 ::getScalarBarsMap()
4468 return myScalarBarsMap;
4471 LightApp_Displayer* VisuGUI::displayer()
4474 myDisplayer = new VisuGUI_Displayer( getApp() );
4480 void VisuGUI::OnPlot3dFromCutPlane()
4482 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
4483 if (CheckLock(aCStudy, GetDesktop(this)))
4486 LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
4487 SALOME_ListIO aListIO;
4488 aSelectionMgr->selectedObjects(aListIO);
4490 if (aListIO.Extent() < 1) return;
4493 VISU::CutPlanes_i* aCutPrs = 0;
4494 Handle(SALOME_InteractiveObject) anIO;
4495 _PTR(SObject) aSObject;
4496 SALOME_ListIteratorOfListIO It (aListIO);
4497 for (; It.More(); It.Next()) {
4500 if (!anIO.IsNull() && anIO->hasEntry()) {
4501 aSObject = aCStudy->FindObjectID(anIO->getEntry());
4504 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
4505 if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
4506 if (aPrsObject->GetType() == VISU::TCUTPLANES) {
4507 aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
4516 _PTR(SObject) aTimeStampSObj = aSObject->GetFather();
4517 if (SUIT_ViewManager* aViewManager = getApp()->activeViewManager()) {
4518 QString aViewType = aViewManager->getType();
4519 //bool anIsVVTK = (aViewType == VVTK_Viewer::Type());
4521 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj);
4522 VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
4523 if (aType != TTIMESTAMP )
4526 QString aMeshName = aRestoringMap["myMeshName"];
4527 QString anEntity = aRestoringMap["myEntityId"];
4528 QString aFieldName = aRestoringMap["myFieldName"];
4529 QString aTimeStampId = aRestoringMap["myTimeStampId"];
4532 SUIT_ViewWindow* aViewWindow = 0;
4534 // aViewWindow = GetViewWindow<VVTK_Viewer>(this);
4535 // aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
4537 aViewWindow = GetViewWindow<SVTK_Viewer>(this);
4538 aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
4540 GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
4542 VISU::Plot3D_i* aPrs3d =
4543 CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
4545 (const char*)aMeshName.toLatin1(),
4546 (Entity)anEntity.toInt(),
4547 (const char*)aFieldName.toLatin1(),
4548 aTimeStampId.toInt(),
4549 ColoredPrs3d_i::EPublishUnderTimeStamp);
4551 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
4552 int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
4554 VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
4555 aDlg->initFromPrsObject(aPrs3d, true);
4556 int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
4557 double aRotX = aCutPrs->GetRotateX();
4558 double aRotY = aCutPrs->GetRotateY();
4559 double aPlanePos = aCutPrs->GetPlanePosition(0);
4560 aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
4562 if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
4563 DeletePrs3d(this, aPrs3d);
4568 UpdateObjBrowser(this, true, aTimeStampSObj);
4570 SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
4571 if ( aSVtkWindow ) {
4572 PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
4573 aSVtkWindow->onFitAll();
4575 AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
4578 emit presentationCreated(aPrs3d);
4581 application()->putInfo(QObject::tr("INF_DONE"));
4585 void VisuGUI::OnManageCache()
4591 //---------------------------------------------------------------
4592 void VisuGUI::OnMultiprViewFullRes()
4594 OnMultiprChangeRes(VISU::Result::FULL);
4598 //---------------------------------------------------------------
4599 void VisuGUI::OnMultiprViewMediumRes()
4601 OnMultiprChangeRes(VISU::Result::MEDIUM);
4605 //---------------------------------------------------------------
4606 void VisuGUI::OnMultiprViewLowRes()
4608 OnMultiprChangeRes(VISU::Result::LOW);
4612 //---------------------------------------------------------------
4613 void VisuGUI::OnMultiprViewHide()
4615 OnMultiprChangeRes(VISU::Result::HIDDEN);
4619 //---------------------------------------------------------------
4620 void VisuGUI::OnMultiprChangeRes(VISU::Result::Resolution theResolution)
4622 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
4623 if (CheckLock(aCStudy,GetDesktop(this)))
4626 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
4627 if(aSelectionInfo.empty())
4630 QApplication::setOverrideCursor(Qt::WaitCursor);
4632 typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
4633 typedef std::map<TResultPtr, _PTR(SObject)> TResult2SObject;
4634 TResult2SObject aResult2SObject;
4636 for (int i=0; i < aSelectionInfo.size(); i++) {
4637 VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
4639 _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
4643 VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
4644 if(CORBA::is_nil(aResult.in()))
4647 VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
4651 Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSObject);
4652 bool anIsFound = false;
4653 QString aMeshName = Storable::FindValue(aRestoringMap, "myMeshName", &anIsFound);
4657 std::string aPartName = aSObject->GetName();
4659 aCResult->SetResolution(aMeshName.toLatin1().data(), aPartName.c_str(), theResolution);
4661 aResult2SObject[TResultPtr(aCResult)] = aSObject;
4664 // To update all result observers
4665 TResult2SObject::const_iterator anIter = aResult2SObject.begin();
4666 for(; anIter != aResult2SObject.end(); anIter++){
4667 const TResultPtr& aResultPtr = anIter->first;
4668 const _PTR(SObject)& aSObject = anIter->second;
4669 aResultPtr->UpdateObservers();
4670 VISU::UpdateObjBrowser(this, false, aSObject);
4673 QApplication::restoreOverrideCursor();
4676 //---------------------------------------------------------------
4677 void VisuGUI::OnFileInfo()
4679 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
4680 SUIT_DataOwnerPtrList lst;
4681 getApp()->selectionMgr()->selected( lst );
4682 LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( lst.first().get() );
4683 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( aStudy, owner->entry().toLatin1().constData() );
4684 VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>( anObjectInfo.myBase );
4687 VisuGUI_FileInfoDlg dlg( getApp()->desktop(), aCResult->GetMEDFileInfo() );
4691 //---------------------------------------------------------------
4692 void VisuGUI::OnExportMED()
4694 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() );
4695 SUIT_DataOwnerPtrList lst;
4696 getApp()->selectionMgr()->selected( lst );
4697 LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( lst.first().get() );
4698 VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry( aStudy, owner->entry().toLatin1().constData() );
4699 VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( anObjectInfo.myBase );
4702 // VisuGUI_FileInfoDlg dlg( getApp()->desktop(), aResult->GetMEDFileInfo() );
4705 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
4706 QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
4708 // get name for the file
4709 QStringList aFilter;
4710 aFilter.append("MED Files (*.med)");
4712 std::string anInitFileName = aResult->GetInitFileName();
4713 QFileInfo anInitFileInfo(anInitFileName.c_str());
4714 QString aBaseName = anInitFileInfo.fileName();
4716 QString aPath = Qtx::addSlash(aDir) + aBaseName;
4718 QFileInfo aFileInfo =
4719 SUIT_FileDlg::getFileName(GetDesktop(this),
4722 tr("VISU_MEN_EXPORT_MED"), // "Export To Med File"
4725 QString aFile = aFileInfo.filePath();
4726 if ( aFile.length() > 0 ) {
4727 aResult->ExportMED((const char*)aFile.toLatin1());
4731 void VisuGUI::OnFilterScalars()
4733 VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg( this );
4738 \brief SLOT called when "Labeling" popup menu item of presentation is clicked
4739 activates/deactivates labeling of results of the screen. This functionality works
4740 to numbering in SMESH module but is intended for showing results on the screen
4741 instead of elements numbers
4742 \sa OnValuesLabelingParams()
4744 void VisuGUI::OnValuesLabeling()
4746 // to do: rewrite for several actors if necessary
4748 VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( this );
4749 if ( aSelectionInfo.empty() )
4752 TSelectionItem aSelectionItem = GetSelectedObjects(this).front();
4753 VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
4757 SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
4761 VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
4765 if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
4767 aScalarMapActor->SetValuesLabeled( !aScalarMapActor->GetValuesLabeled() );
4768 aViewWindow->Repaint();
4770 else if ( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
4772 aGaussPtsAct->SetValuesLabeled( !aGaussPtsAct->GetValuesLabeled() );
4773 aViewWindow->Repaint();
4778 \brief SLOT called when "Labeling parameters" popup menu item of presentation
4779 is clicked launch dialog box for changing parameters of labeling
4780 \sa OnValuesLabeling()
4782 void VisuGUI::OnValuesLabelingParams()
4784 Handle(SALOME_InteractiveObject) anIO;
4785 if ( VISU::Prs3d_i* aPrs3d = GetPrsToModify( this, anIO ) )
4786 EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
4789 \brief Adds preferences for dfont of VTK viewer
4791 \param pIf group identifier
4792 \param param parameter
4793 \return identifier of preferences
4795 int VisuGUI::addVtkFontPref(
4796 const QString& label,
4798 const QString& param,
4799 const bool useSize )
4801 int tfont = addPreference( label, pId, LightApp_Preferences::Font, "VISU", param );
4803 setPreferenceProperty( tfont, "mode", QtxFontEdit::Custom );
4806 fam.append( tr( "VISU_FONT_ARIAL" ) );
4807 fam.append( tr( "VISU_FONT_COURIER" ) );
4808 fam.append( tr( "VISU_FONT_TIMES" ) );
4810 setPreferenceProperty( tfont, "fonts", fam );
4812 int f = QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic | QtxFontEdit::Shadow;
4814 f |= QtxFontEdit::UserSize | QtxFontEdit::Size;
4816 setPreferenceProperty( tfont, "features", f );
4822 \brief SLOT called when "2D Quadratic -> Arcs" popup menu item
4823 \ of presentation is cliked
4825 void VisuGUI::OnArcQuadMode(){
4826 ChangeQuadratic2DRepresentation(this,VISU::ARCS);
4830 \brief SLOT called when "2D Quadratic -> Lines" popup menu item
4831 \ of presentation is cliked
4833 void VisuGUI::OnLineQuadMode(){
4834 ChangeQuadratic2DRepresentation(this,VISU::LINES);