1 // VISU VISUGUI : GUI of VISU component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
25 // Author : Laurent CORNABE
34 #include <qptrvector.h>
35 #include <qcolordialog.h>
37 #include <vtkRenderer.h>
38 #include <vtkRenderWindow.h>
39 #include <vtkActorCollection.h>
41 #include "SALOME_LifeCycleCORBA.hxx"
43 #include "SUIT_ResourceMgr.h"
44 #include "SUIT_MessageBox.h"
46 #include "SUIT_ViewWindow.h"
47 #include "SUIT_ViewManager.h"
49 #include "CAM_Module.h"
51 #include "SVTK_RenderWindow.h"
52 #include "SVTK_ViewWindow.h"
53 #include "SVTK_ViewModel.h"
54 #include "SVTK_Functor.h"
56 #include "SPlot2d_ViewModel.h"
57 #include "SPlot2d_SetupPlot2dDlg.h"
58 #include "Plot2d_SetupCurveDlg.h"
60 #include "OB_Browser.h"
62 #include "SALOME_ListIO.hxx"
63 #include "SALOME_ListIteratorOfListIO.hxx"
65 #include "SalomeApp_Application.h"
66 #include "SalomeApp_DataModel.h"
67 #include "SalomeApp_Study.h"
68 #include "SalomeApp_SelectionMgr.h"
69 #include "SalomeApp_Selection.h"
71 #include "VISUConfig.hh"
72 #include "VISU_Gen_i.hh"
73 #include "VISU_Mesh_i.hh"
74 #include "VISU_Table_i.hh"
75 #include "VISU_Result_i.hh"
76 #include "VISU_View_i.hh"
77 #include "VISU_ViewManager_i.hh"
79 #include "VISU_Actor.h"
82 #include "VisuGUI_Tools.h"
83 #include "VisuGUI_PopupTools.h"
84 #include "VisuGUI_NameDlg.h"
85 #include "VisuGUI_FileDlg.h"
86 #include "VisuGUI_CursorDlg.h"
87 #include "VisuGUI_Selection.h"
88 #include "VisuGUI_TimeAnimation.h"
89 #include "VisuGUI_EditContainerDlg.h"
90 #include "VisuGUI_NonIsometricDlg.h"
92 #include "VISU_ScalarMap_i.hh"
93 #include "VisuGUI_ScalarBarDlg.h"
95 #include "VISU_DeformedShape_i.hh"
96 #include "VisuGUI_DeformedShapeDlg.h"
98 #include "VISU_IsoSurfaces_i.hh"
99 #include "VisuGUI_IsoSurfacesDlg.h"
101 #include "VISU_CutPlanes_i.hh"
102 #include "VisuGUI_CutPlanesDlg.h"
104 #include "VISU_CutLines_i.hh"
105 #include "VisuGUI_CutLinesDlg.h"
107 #include "VISU_StreamLines_i.hh"
108 #include "VisuGUI_StreamLinesDlg.h"
110 #include "VISU_Vectors_i.hh"
111 #include "VisuGUI_VectorsDlg.h"
113 #include "VisuGUI_TableDlg.h"
115 #include "SALOMEconfig.h"
116 #include CORBA_SERVER_HEADER(MED_Gen)
118 #include "utilities.h"
120 #include "VisuGUI_ActionsDef.h"
122 using namespace VISU;
125 static int MYDEBUG = 1;
127 static int MYDEBUG = 0;
130 //////////////////////////////////////////////////
132 //////////////////////////////////////////////////
135 SalomeApp_Module( "VISU" )
149 if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
150 CheckLock(GetCStudy(GetAppStudy(this)));
151 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
154 aFilter.append( tr("FLT_MED_FILES") );
155 aFilter.append( tr("FLT_ALL_FILES") );
157 QFileInfo aFileInfo =
158 SUIT_FileDlg::getFileName(GetDesktop(this),
161 tr("MEN_IMPORT_FROM_FILE"),
163 if(aFileInfo.exists()){
164 application()->putInfo( "Importing From File " + aFileInfo.filePath() + "..." );
166 VISU::Result_var aResult;
167 bool anIsBuild = aResourceMgr->booleanValue("Visu:BuildResult",false);
168 if(VisuGUI_FileDlg::IsBuild){
169 aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
170 if(!CORBA::is_nil(aResult.in()))
171 if(Result_i* aRes = dynamic_cast<Result_i*>(GetServant(aResult).in())){
172 if(!aRes->IsPossible())
173 SUIT_MessageBox::warn1(GetDesktop(this),
175 tr("ERR_CANT_BUILD_PRESENTATION"),
181 aResourceMgr->setValue("Visu:BuildResult",false);
182 aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
183 aResourceMgr->setValue("Visu:BuildResult",anIsBuild);
186 if(CORBA::is_nil(aResult.in())) {
187 SUIT_MessageBox::warn1(GetDesktop(this),
189 tr("ERR_ERROR_IN_THE_FILE"),
192 application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
203 if(MYDEBUG) MESSAGE("VisuGUI::OnExploreMEDFile()");
204 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
207 SALOME_MED::MED_Gen_var aGen = GetMEDEngine();
210 aFilter.append( tr("FLT_MED_FILES") );
211 aFilter.append( tr("FLT_ALL_FILES") );
213 QFileInfo aFileInfo =
214 SUIT_FileDlg::getFileName(GetDesktop(this),
217 tr("MEN_EXPLORE_MED_FILE"),
219 if(aFileInfo.exists()){
220 application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." );
221 std::string aStudyName = aStudy->Name();
222 aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
223 application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
231 OnImportTableFromFile()
233 if(MYDEBUG) MESSAGE("VisuGUI::OnImportTableFromFile()");
234 CheckLock(GetCStudy(GetAppStudy(this)));
237 aFilter.append( tr("FLT_TABLE_FILES") );
238 aFilter.append( tr("FLT_ALL_FILES") );
240 QFileInfo aFileInfo =
241 SUIT_FileDlg::getFileName(GetDesktop(this),
244 tr("MEN_IMPORT_TABLE"),
246 if(aFileInfo.exists()){
247 application()->putInfo( tr("MEN_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
249 CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath());
251 if(CORBA::is_nil(anObject.in())) {
252 SUIT_MessageBox::warn1(GetDesktop(this),
254 tr("ERR_ERROR_IN_THE_FILE"),
257 application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
265 OnExportTableToFile()
267 if(MYDEBUG) MESSAGE("VisuGUI::OnExportTableToFile()");
271 CreateCurves( SalomeApp_Module* theModule,
272 VISU::CutLines_i* thePrs,
274 const bool theCreate = true )
278 VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg );
282 _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
283 _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry().latin1() );
285 if ( !theCreate && aSObject ){
287 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
288 for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
289 _PTR(SObject) aTblObj = aIter->Value();
291 _PTR(GenericAttribute) anAttr;
292 if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
293 aBuilder->RemoveObjectWithChildren( aIter->Value() ); // We should have only one child
300 if ( aCutDlg->isGenerateTable() ) {
301 GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
302 if ( aCutDlg->isGenerateCurves() ) {
304 _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
305 for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
306 _PTR(SObject) aTblObj = aIter->Value();
308 _PTR(GenericAttribute) anAttr;
309 if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
310 CreatePlot( theModule, aTblObj );
319 template<class TPrs3d_i>
321 CreatePrs3d(SalomeApp_Module* theModule,
322 SALOMEDS::SObject_var theTimeStamp,
323 const char* theMeshName,
324 VISU::Entity theEntity,
325 const char* theFieldName,
328 VISU::Result_var aResult;
329 if(CheckResult(theModule,theTimeStamp,aResult)){
330 QApplication::setOverrideCursor(Qt::waitCursor);
331 typedef typename TPrs3d_i::TInterface TPrs3d;
332 typename TPrs3d::_var_type aPrs3d =
333 GetVisuGen(theModule)->template Prs3dOnField<TPrs3d_i>
334 (aResult,theMeshName,theEntity,theFieldName,theTimeId);
335 QApplication::restoreOverrideCursor();
336 if(!CORBA::is_nil(aPrs3d.in()))
337 return dynamic_cast<TPrs3d_i*>(VISU::GetServant(aPrs3d.in()).in());
339 SUIT_MessageBox::warn1(GetDesktop(theModule),
340 QObject::tr("WRN_VISU"),
341 QObject::tr("ERR_CANT_BUILD_PRESENTATION"),
342 QObject::tr("BUT_OK") );
347 template<class TPrs3d_i, class TDlg, int IsDlgModal>
349 CreatePrs3d(SalomeApp_Module* theModule,
350 SALOMEDS::SObject_var theTimeStamp,
351 const Handle(SALOME_InteractiveObject)& theIO)
353 using namespace VISU;
354 Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
356 QString aType = Storable::FindValue(aMap,"myType",&isExist);
357 if(!isExist || aType.toInt() != TTIMESTAMP )
359 QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
360 QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
361 QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
362 QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
363 QApplication::setOverrideCursor(Qt::waitCursor);
365 CreatePrs3d<TPrs3d_i>(theModule,
368 (Entity)anEntity.toInt(),
370 aTimeStampId.toInt());
371 QApplication::restoreOverrideCursor();
373 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
374 int aValue = aResourceMgr->integerValue("Visu:BuildDefaultPrs3d",0);
376 if(TDlg* aDlg = new TDlg(GetDesktop(theModule))){ // dialog box in creation mode
377 aDlg->initFromPrsObject(aPrs3d);
379 if(aDlg->exec() && (aDlg->storeToPrsObject(aPrs3d))) {
380 // Optionally, create table and curves for cut lines
381 QApplication::setOverrideCursor(Qt::waitCursor);
382 CreateCurves( theModule, dynamic_cast<VISU::CutLines_i*>( aPrs3d ), aDlg, true ); // in creation mode
383 QApplication::restoreOverrideCursor();
386 DeletePrs3d(theModule,aPrs3d,theIO);
396 PublishInView(theModule,aPrs3d);
403 template<class TPrs3d_i, class TDlg, int IsDlgModal>
405 CreatePrs3d(SalomeApp_Module* theModule)
407 if(CheckLock(GetCStudy(GetAppStudy(theModule))))
410 SALOMEDS::SObject_var aTimeStampSObj;
411 Handle(SALOME_InteractiveObject) anIO;
412 if(!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
415 if(!CreatePrs3d<TPrs3d_i,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
418 theModule->application()->putInfo(QObject::tr("INF_DONE"));
419 theModule->updateObjBrowser();
421 if(SVTK_ViewWindow* aView = GetViewWindow(theModule))
425 void VisuGUI::CreateMesh (const Handle(SALOME_InteractiveObject)& theIO)
427 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
428 //if (CheckLock(aStudy))
431 SALOMEDS::SObject_var aResultSObj =
432 GetDSStudy(aStudy)->FindObjectID(theIO->getEntry());
435 VISU::Result_var aResult;
436 VISU::Result_i* pResult = CheckResult(this, aResultSObj, aResult);
440 Storable::TRestoringMap aMap = getMapOfValue(aResultSObj);
442 string aComment = Storable::FindValue(aMap,"myComment",&isExist).latin1();
446 CORBA::Object_var aMesh;
447 string aMeshName = Storable::FindValue(aMap,"myMeshName").latin1();
452 if (aComment == "ENTITY") {
453 VISU::Entity anEntity = (VISU::Entity)Storable::FindValue(aMap,"myId").toInt();
454 if (VISU::Mesh_i::IsPossible(pResult,aMeshName.c_str(),anEntity))
455 aMesh = GetVisuGen(this)->MeshOnEntity(aResult,aMeshName.c_str(),anEntity);
456 } else if (aComment == "FAMILY") {
457 VISU::Entity anEntity = (VISU::Entity)Storable::FindValue(aMap,"myEntityId").toInt();
458 string aFamilyName = Storable::FindValue(aMap,"myName").latin1();
459 if (VISU::Mesh_i::IsPossible(pResult,aMeshName.c_str(),anEntity,aFamilyName.c_str()))
460 aMesh = GetVisuGen(this)->FamilyMeshOnEntity(aResult,aMeshName.c_str(),anEntity,aFamilyName.c_str());
461 } else if (aComment == "GROUP") {
462 string aGroupName = Storable::FindValue(aMap,"myName").latin1();
463 if (VISU::Mesh_i::IsPossible(pResult,aMeshName.c_str(),aGroupName.c_str()))
464 aMesh = GetVisuGen(this)->GroupMesh(aResult,aMeshName.c_str(),aGroupName.c_str());
468 MESSAGE("VisuGUI::CreateMesh() - CREATE MESH");
472 QApplication::restoreOverrideCursor();
473 VISU::Mesh_i* pPresent = NULL;
474 if (!CORBA::is_nil(aMesh))
475 pPresent = dynamic_cast<VISU::Mesh_i*>(VISU::GetServant(aMesh).in());
476 if (pPresent == NULL) {
477 SUIT_MessageBox::warn1 (GetDesktop(this),
479 tr("ERR_CANT_BUILD_PRESENTATION"),
484 if (SVTK_ViewWindow* aView = GetViewWindow(this)){
490 PublishInView(this, pPresent);
494 MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
497 application()->putInfo(QObject::tr("INF_DONE"));
498 } catch (std::runtime_error& exc) {
500 SUIT_MessageBox::warn1 (GetDesktop(this),
502 tr("ERR_CANT_CREATE_ACTOR") + " " + tr(exc.what()),
512 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
513 if (CheckLock(aStudy))
516 // Get selected SObject
517 SALOMEDS::SObject_var aResultSObj;
518 Handle(SALOME_InteractiveObject) anIO;
519 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
520 if (anIO.IsNull() || !anIO->hasEntry())
530 _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
531 if (CheckLock(aStudy))
534 // Get selected SObject
535 SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
536 SALOME_ListIO aListIO;
537 aSelectionMgr->selectedObjects(aListIO);
538 SALOME_ListIteratorOfListIO anIter (aListIO);
539 for (; anIter.More(); anIter.Next()) {
540 Handle(SALOME_InteractiveObject) anIO = anIter.Value();
541 if (anIO.IsNull() || !anIO->hasEntry())
552 CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
558 OnCreateDeformedShape()
560 CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
567 CreatePrs3d<VISU::Vectors_i,VisuGUI_VectorsDlg,1>(this);
572 OnCreateIsoSurfaces()
574 CreatePrs3d<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg,1>(this);
581 CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,1>(this);
588 CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,1>(this);
593 OnCreateStreamLines()
595 CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
602 CheckLock(GetCStudy(GetAppStudy(this)));
603 GetVisuGen( this )->CreateContainer();
611 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
613 QApplication::setOverrideCursor(Qt::waitCursor);
615 SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this);
616 mgr->selectedObjects(aList);
618 Handle(SALOME_InteractiveObject) anIO;
619 for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
621 CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
622 if ( !CORBA::is_nil( anObject ) ) {
623 // is it Prs3d object ?
624 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
626 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
627 UpdateViewer( this, aPrsObject );
628 if (SVTK_ViewWindow* vw = GetViewWindow( this )) {
629 vw->highlight(anIO, 1);
634 VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
636 if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
637 PlotCurve( this, aCurve, VISU::eDisplay );
641 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
643 if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
644 PlotContainer( this, aContainer, VISU::eDisplay );
648 VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
650 if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
651 PlotTable( this, aTable, VISU::eDisplay );
656 if (SVTK_ViewWindow* vw = GetViewWindow( this )) {
657 vw->getRenderer()->ResetCameraClippingRange();
660 QApplication::restoreOverrideCursor();
671 void VisuGUI::ErasePrs (CORBA::Object_ptr theObject, bool theUpdate)
673 if (MYDEBUG) MESSAGE("ErasePrs");
675 if ( !CORBA::is_nil( theObject ) ) {
676 VISU::Base_var aBase = VISU::Base::_narrow(theObject);
677 if ( CORBA::is_nil( aBase ) ) return;
678 VISU::VISUType aType = aBase->GetType();
681 if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
682 PlotCurve(this, aCurve, VISU::eErase );
685 case VISU::TCONTAINER:{
686 if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
687 PlotContainer(this, aContainer, VISU::eErase );
691 if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
692 PlotTable(this, aTable, VISU::eErase );
696 if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())){
697 ErasePrs3d( this, aPrsObject );
699 if (SVTK_ViewWindow* vw = GetViewWindow( this ))
712 if(MYDEBUG) MESSAGE("OnErasePrs");
714 QApplication::setOverrideCursor(Qt::waitCursor);
716 SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this);
717 mgr->selectedObjects(aList);
719 Handle(SALOME_InteractiveObject) anIO;
720 for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
722 CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
723 ErasePrs(anObject, false);
725 if (SVTK_ViewWindow* vw = GetViewWindow( this ))
727 QApplication::restoreOverrideCursor();
730 template<class TPrs3d_i, class TDlg>
732 EditPrs3d (SalomeApp_Module* theModule, VISU::Prs3d_i* thePrs3d)
734 TPrs3d_i* aPrsObject = dynamic_cast<TPrs3d_i*>(thePrs3d);
736 //TDlg* aDlg = new TDlg (GetDesktop(theModule), false, true);
737 TDlg* aDlg = new TDlg (GetDesktop(theModule));
738 aDlg->initFromPrsObject(aPrsObject);
740 if (!(aDlg->storeToPrsObject(aPrsObject))) {
744 RecreateActor(theModule, aPrsObject);
745 if (SVTK_ViewWindow* vw = GetViewWindow(theModule)) {
746 //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
747 vw->getRenderer()->ResetCameraClippingRange();
760 if (CheckLock(GetCStudy(GetAppStudy(this))))
763 Handle(SALOME_InteractiveObject) anIO;
764 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
765 if (CORBA::is_nil(anObject)) return;
766 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
767 if (!aServant.in()) return;
769 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
772 switch (aPrs3d->GetType()) {
775 case VISU::TSCALARMAP:
776 EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg>(this, aPrs3d);
778 case VISU::TDEFORMEDSHAPE:
779 EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg>(this, aPrs3d);
781 case VISU::TCUTPLANES:
782 EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg>(this, aPrs3d);
784 VISU::CutPlanes_i* aPrsObject = dynamic_cast<VISU::CutPlanes_i*>(aPrs3d);
786 VisuGUI_CutPlanesDlg* aDlg =
787 new VisuGUI_CutPlanesDlg (GetDesktop(this), false, false);
788 aDlg->initFromPrsObject(aPrsObject);
793 case VISU::TCUTLINES:
794 EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg>(this, aPrs3d);
796 VISU::CutLines_i* aPrsObject = dynamic_cast<VISU::CutLines_i*>(aPrs3d);
798 VisuGUI_CutLinesDlg* aDlg =
799 new VisuGUI_CutLinesDlg (GetDesktop(this), false, false);
800 aDlg->initFromPrsObject(aPrsObject);
805 case VISU::TISOSURFACE:
806 EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg>(this, aPrs3d);
809 EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg>(this, aPrs3d);
811 case VISU::TSTREAMLINES:
812 EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg>(this, aPrs3d);
818 if (SVTK_ViewWindow* vw = GetViewWindow())
819 vw->highlight(anIO, 1);
826 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
827 if (CheckLock(aCStudy))
829 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
831 Handle(SALOME_InteractiveObject) anIO;
832 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
836 // There is a transaction
837 SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
838 aStudyBuilder->NewCommand();
840 // is it Prs3d object ?
841 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
843 DeletePrs3d(this, aPrsObject, anIO);
846 // is it Curve object ?
847 VISU::Curve_i* aCurveObject = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
849 //jfa tmp:DeleteCurve(this, aCurveObject, anIO);
852 aStudyBuilder->CommitCommand();
860 if (SVTK_ViewWindow* vw = GetViewWindow()) {
861 vw->unHighlightAll();
862 if (vtkRenderer *aRen = vw->getRenderer()) {
864 vtkActorCollection *anActColl = aRen->GetActors();
865 for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
866 if (anActor->GetVisibility() > 0)
867 if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
868 anVISUActor = anVISUActor->GetParent();
869 anVISUActor->VisibilityOff();
874 } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
879 void VisuGUI::ChangeRepresentation (VISU::PresentationType theType)
881 SVTK_ViewWindow* vw = GetViewWindow();
884 Handle(SALOME_InteractiveObject) anIO;
885 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
886 if (CORBA::is_nil(anObject)) return;
887 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
888 if (!aServant.in()) return;
890 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
892 if (VISU_Actor* anActor = GetActor(aPrs3d, vw)) {
895 if (anActor->IsShrunk())
898 anActor->SetShrink();
901 if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
902 aMesh->SetPresentationType(theType);
903 RecreateActor(this, aMesh);
905 anActor->SetRepresentation(theType);
917 ChangeRepresentation(VISU::SURFACEFRAME);
924 ChangeRepresentation(VISU::INSIDEFRAME);
931 ChangeRepresentation(VISU::WIREFRAME);
938 ChangeRepresentation(VISU::SHADED);
945 ChangeRepresentation(VISU::POINT);
952 ChangeRepresentation(VISU::SHRINK);
959 Handle(SALOME_InteractiveObject) anIO;
960 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
961 if (CORBA::is_nil(anObject)) return;
962 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
963 if (!aServant.in()) return;
965 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
968 SVTK_ViewWindow* vw = GetViewWindow();
971 VISU_Actor* anActor = GetActor(aPrs3d, vw);
972 if (!anActor) return;
974 VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
975 VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
976 SALOMEDS::Color anOldColor, aNewColor;
977 int aRepresent = anActor->GetRepresentation();
979 switch (aRepresent) {
981 anOldColor = aMesh->GetNodeColor();
983 case VISU::WIREFRAME :
984 case VISU::INSIDEFRAME :
985 anOldColor = aMesh->GetLinkColor();
988 case VISU::SURFACEFRAME :
989 anOldColor = aMesh->GetCellColor();
992 } else if (aDeformedShape) {
993 anOldColor = aDeformedShape->GetColor();
998 QColor aColor (int(255*anOldColor.R),
999 int(255*anOldColor.G),
1000 int(255*anOldColor.B));
1001 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1002 if (aColorNew.isValid()) {
1003 aNewColor.R = aColorNew.red()/255.;
1004 aNewColor.G = aColorNew.green()/255.;
1005 aNewColor.B = aColorNew.blue()/255.;
1007 switch (aRepresent) {
1009 aMesh->SetNodeColor(aNewColor);
1011 case VISU::WIREFRAME :
1012 case VISU::INSIDEFRAME :
1013 aMesh->SetLinkColor(aNewColor);
1016 case VISU::SURFACEFRAME :
1017 aMesh->SetCellColor(aNewColor);
1021 aDeformedShape->SetColor(aNewColor);
1023 RecreateActor(this, aPrs3d);
1029 OnChangeWireframeColor()
1031 Handle(SALOME_InteractiveObject) anIO;
1032 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1033 if (CORBA::is_nil(anObject)) return;
1034 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1035 if (!aServant.in()) return;
1037 VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1038 if (!aPrs3d) return;
1040 SVTK_ViewWindow* vw = GetViewWindow();
1043 VISU_Actor* anActor = GetActor(aPrs3d, vw);
1044 if (!anActor) return;
1046 if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
1047 SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor;
1048 QColor aColor (int(255*anOldColor.R),
1049 int(255*anOldColor.G),
1050 int(255*anOldColor.B));
1051 QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
1052 if (aColorNew.isValid()) {
1053 aNewColor.R = aColorNew.red()/255.;
1054 aNewColor.G = aColorNew.green()/255.;
1055 aNewColor.B = aColorNew.blue()/255.;
1056 aMesh->SetLinkColor(aNewColor);
1057 RecreateActor(this, aMesh);
1066 Handle(SALOME_InteractiveObject) anIO;
1067 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1068 if (CORBA::is_nil(anObject)) return;
1069 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1070 if (!aServant.in()) return;
1072 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1073 if (!aPrsObject) return;
1075 SVTK_ViewWindow* vw = GetViewWindow();
1078 VISU_Actor* anActor = GetActor(aPrsObject, vw);
1079 if (!anActor) return;
1081 VisuGUI_CursorDlg* CursorDlg =
1082 new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_OPACITY_TITLE"), TRUE);
1084 CursorDlg->Comment1->setText(tr("DLG_OPACITY_CMT1"));
1085 CursorDlg->Comment2->setText(tr("DLG_OPACITY_CMT2"));
1086 CursorDlg->SpinBox1->setMinValue(0);
1087 CursorDlg->SpinBox1->setMaxValue(100);
1089 float oldopac = anActor->GetOpacity();
1090 int intopac = int(oldopac*100. + 0.5);
1091 CursorDlg->SpinBox1->setValue(intopac);
1093 int ret = CursorDlg->exec();
1095 intopac = CursorDlg->SpinBox1->value();
1096 float newopac = intopac/100.;
1097 anActor->SetOpacity(newopac);
1106 Handle(SALOME_InteractiveObject) anIO;
1107 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1108 if (CORBA::is_nil(anObject)) return;
1109 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1110 if (!aServant.in()) return;
1112 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1113 if (!aPrsObject) return;
1115 SVTK_ViewWindow* vw = GetViewWindow();
1118 VISU_Actor* anActor = GetActor(aPrsObject, vw);
1119 if (!anActor) return;
1121 VisuGUI_CursorDlg* CursorDlg =
1122 new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_LINEWIDTH_TITLE"), TRUE);
1124 CursorDlg->Comment1->setText("DLG_LINEWIDTH_CMT1");
1125 CursorDlg->Comment2->setText("DLG_LINEWIDTH_CMT2");
1126 CursorDlg->SpinBox1->setMinValue(1);
1127 CursorDlg->SpinBox1->setMaxValue(10);
1129 float oldlwid = anActor->GetLineWidth();
1130 int intlwid = int(oldlwid);
1131 CursorDlg->SpinBox1->setValue(intlwid);
1133 int ret = CursorDlg->exec();
1135 intlwid = CursorDlg->SpinBox1->value();
1136 float newlwid = intlwid;
1137 anActor->SetLineWidth(newlwid);
1146 Handle(SALOME_InteractiveObject) anIO;
1147 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1149 if ( !CORBA::is_nil( anObject ) ) {
1150 VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject );
1151 if ( !CORBA::is_nil( aVisuObj ) && aVisuObj->GetType() == VISU::TTABLE ) {
1152 CORBA::Object_ptr aTable = VISU::Table::_narrow( anObject );
1153 if( !CORBA::is_nil( aTable ) ) {
1154 VISU::Table_i* table = dynamic_cast<VISU::Table_i*>( VISU::GetServant(aTable).in() );
1156 SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( table->GetObjectEntry() );
1161 // possibly this is Table SObject
1162 SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( anIO->getEntry() );
1165 if( !IsSObjectTable( SO ) )
1168 VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
1171 //SAL2670 Orientation of show tables
1172 VisuGUI_TableDlg::ttAuto,
1181 Handle(SALOME_InteractiveObject) anIO;
1182 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1183 _PTR(Study) aStudy = GetCStudy( GetAppStudy( this ) );
1184 _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
1185 VISU::CutLines_var aCutLines = VISU::CutLines::_narrow( anObject );
1186 if(!aCutLines->_is_nil() || IsSObjectTable(aSObject)) {
1187 GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
1196 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1197 if (CheckLock(aCStudy))
1199 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
1201 Handle(SALOME_InteractiveObject) anIO;
1202 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1203 if (anIO.IsNull() || !anIO->hasEntry())
1206 SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
1207 if (!aSObject->_is_nil()) {
1208 SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
1209 for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
1210 SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
1211 CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
1212 ErasePrs(aChildObj);
1214 SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
1215 // There is a transaction
1216 aStudyBuilder->NewCommand();
1217 CORBA::Object_var anObj = VISU::SObjectToObject(aSObject);
1218 if (!CORBA::is_nil(anObj)) {
1219 VISU::Base_var aBase = VISU::Base::_narrow(anObj);
1220 if (!CORBA::is_nil(aBase)) {
1221 VISU::VISUType aType = aBase->GetType();
1225 SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
1226 for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
1227 SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
1228 CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
1229 if (CORBA::is_nil(aChildObj)) continue;
1230 VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aChildObj);
1231 if (CORBA::is_nil(aPrs3d)) continue;
1232 VISU::Prs3d_i* pPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
1233 DeletePrs3d(this, pPrs3d, NULL);
1239 SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
1240 for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
1241 SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
1242 CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
1243 if (CORBA::is_nil(aChildObj)) continue;
1244 CORBA::Object_ptr aCurve = VISU::Curve::_narrow(aChildObj);
1245 if (CORBA::is_nil(aCurve)) continue;
1246 //VISU::Curve_i* pCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
1247 //jfa tmp:DeleteCurve(this, pCurve, NULL);
1254 aStudyBuilder->RemoveObjectWithChildren(aSObject);
1255 aStudyBuilder->CommitCommand();
1256 //jfa tmp:GetActiveStudy()->unHighlightAll();
1257 updateObjBrowser(true);
1265 Handle(SALOME_InteractiveObject) anIO;
1266 CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
1268 _PTR(GenericAttribute) anAttr;
1269 _PTR(AttributeName) aName;
1271 _PTR(Study) aStudy = GetCStudy( GetAppStudy( this ) );
1273 if ( !CORBA::is_nil( anObject ) ) {
1274 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1275 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TTABLE) {
1276 // Table (VISU object) is selected
1277 CORBA::Object_ptr aTbl = VISU::Table::_narrow( anObject );
1278 if( !CORBA::is_nil( aTbl ) ) {
1279 VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTbl).in());
1281 _PTR(SObject) SO = aStudy->FindObjectID( table->GetObjectEntry() );
1282 if ( IsSObjectTable(SO) ) {
1283 // get name of SObject
1284 if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
1286 SOName = QString( aName->Value().c_str() );
1288 SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
1289 if ( dlg->exec() == QDialog::Accepted ) {
1290 if ( !IsStudyLocked( aStudy ) ) {
1291 // if study is not locked - create new container, create curves
1292 // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
1294 QValueList<int> verIndices;
1295 dlg->getCurvesSource( horIndex, verIndices );
1296 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1297 CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
1298 if( !CORBA::is_nil( aContainer ) ) {
1299 VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1301 for ( int i = 0; i < verIndices.count(); i++ ) {
1302 CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
1303 if( !CORBA::is_nil( aNewCurve ) ) {
1304 VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
1307 int marker, line, lineWidth;
1309 if ( dlg->getCurveAttributes( verIndices[i], isAuto, marker, line, lineWidth, color ) && !isAuto ) {
1310 SALOMEDS::Color c; c.R = color.red()/255.; c.G = color.green()/255.; c.B = color.blue()/255.;
1311 pCrv->SetColor( c );
1312 pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
1313 pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1315 pContainer->AddCurve( pCrv->_this() );
1320 PlotContainer( this, pContainer, VISU::eDisplay );
1326 // if study is locked just get curves info and plot them if current viewer is of VIEW_PLOT2D type
1327 QPtrList<Plot2d_Curve> container;
1328 dlg->getCurves( container );
1329 if ( !container.isEmpty() ) {
1330 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1331 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
1341 else if ( !anIO.IsNull() ) {
1342 // check if Table SObject is selected
1343 SO = aStudy->FindObjectID( anIO->getEntry() );
1344 if ( IsSObjectTable(SO) ) {
1345 // get name of SObject
1346 if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
1348 SOName = QString( aName->Value().c_str() );
1350 SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
1351 if ( dlg->exec() == QDialog::Accepted ) {
1352 if ( !IsStudyLocked( aStudy ) ) {
1353 // if study is not locked - create new table and container objects, create curves
1354 // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
1356 QValueList<int> verIndices;
1357 dlg->getCurvesSource( horIndex, verIndices );
1358 if ( horIndex >= 0 && verIndices.count() > 0 ) {
1359 CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
1360 CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
1361 if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
1362 VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
1363 VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1365 if ( pContainer && pTable ) {
1366 for ( int i = 0; i < verIndices.count(); i++ ) {
1367 CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve( pTable->_this(), horIndex+1, verIndices[i]+1 );
1368 if( !CORBA::is_nil( aNewCurve ) ) {
1369 VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
1372 int marker, line, lineWidth;
1374 if ( dlg->getCurveAttributes( verIndices[i], isAuto, marker, line, lineWidth, color ) && !isAuto ) {
1375 SALOMEDS::Color c; c.R = color.red()/255.; c.G = color.green()/255.; c.B = color.blue()/255.;
1376 pCrv->SetColor( c );
1377 pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
1378 pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
1380 pContainer->AddCurve( pCrv->_this() );
1385 PlotContainer( this, pContainer, VISU::eDisplay );
1390 // if study is locked just get curves info and plot them
1391 QPtrList<Plot2d_Curve> container;
1392 dlg->getCurves( container );
1393 if ( !container.isEmpty() ) {
1394 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
1395 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
1408 SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1409 SALOME_ListIO aListIO;
1410 aSelectionMgr->selectedObjects(aListIO);
1411 if (aListIO.Extent() != 1) return;
1413 SalomeApp_Study* aAppStudy = GetAppStudy(this);
1414 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1415 CORBA::Object_var anObject = GetSelectedObj( aAppStudy, anIO->getEntry() );
1416 if (CORBA::is_nil( anObject )) return;
1418 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1419 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) {
1421 CORBA::Object_ptr aCurve = VISU::Curve::_narrow( anObject );
1422 if( !CORBA::is_nil( aCurve ) ) {
1423 VISU::Curve_i* aDSCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
1424 if ( aDSCurve && (!IsStudyLocked( GetCStudy(aAppStudy) )) ) {
1425 Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
1427 aDlg.setLine( (int)aDSCurve->GetLine(), aDSCurve->GetLineWidth() );
1428 aDlg.setMarker( (int)aDSCurve->GetMarker() );
1429 SALOMEDS::Color aColor = aDSCurve->GetColor();
1430 aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
1431 if( aDlg.exec() == QDialog::Accepted ) {
1432 aDSCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
1433 aDSCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
1434 SALOMEDS::Color newColor;
1435 newColor.R = aDlg.getColor().red()/255.;
1436 newColor.G = aDlg.getColor().green()/255.;
1437 newColor.B = aDlg.getColor().blue()/255.;
1438 aDSCurve->SetColor( newColor );
1439 PlotCurve(this, aDSCurve, VISU::eDisplay);
1450 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1451 if (CheckLock(aCStudy))
1453 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
1454 Handle(SALOME_InteractiveObject) anIO;
1455 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1456 if (anIO.IsNull() || CORBA::is_nil(anObject))
1459 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1460 if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCONTAINER) {
1462 CORBA::Object_ptr aCnt = VISU::Container::_narrow(anObject);
1463 if (!CORBA::is_nil(aCnt)) {
1464 VISU::Container_i* container = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
1465 if (container && container->GetNbCurves() > 0) {
1477 Handle(SALOME_InteractiveObject) anIO;
1478 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1479 if (CORBA::is_nil(anObject)) return;
1481 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1482 if (!aServant.in()) return;
1483 VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aServant.in());
1484 if (!aContainer) return;
1486 VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (GetDesktop(this));
1487 aDlg->initFromPrsObject(aContainer);
1489 aDlg->storeToPrsObject(aContainer);
1490 updateObjBrowser(true);
1499 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1500 if (CheckLock(aCStudy))
1502 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
1504 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1505 if (aViewMgr->getType() != SVTK_Viewer::Type())
1508 SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1509 SALOME_ListIO aListIO;
1510 aSelectionMgr->selectedObjects(aListIO);
1511 if (aListIO.Extent() > 1)
1514 if (aListIO.Extent() == 0) {
1515 VISU::View3D_i::SaveViewParams(aViewMgr, VISU::View3D_i::GenerateViewParamsName().latin1());
1517 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1518 VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
1525 OnRestoreViewParams()
1527 SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
1528 if (aViewMgr->getType() != SVTK_Viewer::Type())
1531 SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1532 SALOME_ListIO aListIO;
1533 aSelectionMgr->selectedObjects(aListIO);
1534 if (aListIO.Extent() != 1)
1537 const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
1538 //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName());
1539 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp
1540 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp
1541 VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
1546 OnDeleteViewParams()
1548 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1549 if (CheckLock(aCStudy))
1551 SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
1553 Handle(SALOME_InteractiveObject) anIO;
1554 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1555 _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
1556 if (!aSObject) return;
1558 VISU::VISUType aType = (VISU::VISUType)getValue(aSObject, "myType").toInt();
1559 if (aType == VISU::TVIEW3D) {
1560 SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1561 SALOME_ListIO aListIO, aNewListIO;
1562 aSelectionMgr->selectedObjects(aListIO);
1563 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
1564 if (it.Value()->getEntry() != anIO->getEntry()) {
1565 aNewListIO.Append(it.Value());
1568 aSelectionMgr->setSelectedObjects(aNewListIO);
1570 aCStudy->NewBuilder()->RemoveObject(aSObject);
1580 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1581 if (CheckLock(aCStudy))
1584 Handle(SALOME_InteractiveObject) anIO;
1585 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1587 _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
1590 //TEST DU PARENT == VISU
1591 _PTR(GenericAttribute) anAttr;
1592 if (aSObj->FindAttribute(anAttr, "AttributeName")) {
1593 _PTR(AttributeName) aName (anAttr);
1594 QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
1595 if (!Name.isEmpty()) {
1596 QApplication::setOverrideCursor(Qt::waitCursor);
1598 // rename specific objects
1599 if (!CORBA::is_nil(anObject)) {
1600 VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
1601 if (!CORBA::is_nil(aVisuObj)) {
1602 switch (aVisuObj->GetType()) {
1603 case VISU::TCURVE: // Curve object
1605 CORBA::Object_ptr aCurve = VISU::Curve::_narrow(anObject);
1606 if (!CORBA::is_nil(aCurve)) {
1607 VISU::Curve_i* curve =
1608 dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
1610 curve->SetName(Name.latin1());
1614 case VISU::TTABLE: // Table object
1616 CORBA::Object_ptr aTable = VISU::Table::_narrow(anObject);
1617 if (!CORBA::is_nil(aTable)) {
1618 VISU::Table_i* table =
1619 dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
1621 table->SetName(Name.latin1());
1625 case VISU::TCONTAINER: // Container object
1627 CORBA::Object_ptr aContainer = VISU::Container::_narrow(anObject);
1628 if (!CORBA::is_nil(aContainer)) {
1629 VISU::Container_i* container =
1630 dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
1632 container->SetName(Name.latin1());
1643 // rename the study object
1644 //getApp()->activeStudy()->renameIObject(anIO, Name);
1645 aName->SetValue(Name.latin1()); // rename the SObject
1646 anIO->setName(Name.latin1()); // rename the InteractiveObject
1647 updateObjBrowser(false);
1649 QApplication::restoreOverrideCursor();
1659 Handle(SALOME_InteractiveObject) anIO;
1660 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1661 if (CORBA::is_nil(anObject)) return;
1662 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1663 if (!aServant.in()) return;
1665 VISU::ScalarMap_i* aPrsObject = dynamic_cast<VISU::ScalarMap_i*>(aServant.in());
1666 if (!aPrsObject) return;
1668 SVTK_ViewWindow* vw = GetViewWindow();
1671 VISU_Actor* aActor = GetActor(aPrsObject, vw);
1672 if (!aActor) return;
1674 if (!aActor->GetVisibility()) {
1675 aActor->VisibilityOn();
1678 // Get sweep parameters
1679 SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
1681 double aTempoDbl = aResourceMgr->doubleValue("Visu:SweepTempo", 0.1);
1682 int aTemp = int(1.E6 * aTempoDbl);
1684 int aCycles = aResourceMgr->integerValue("Visu:SweepCycles", 1);
1685 int aSteps = aResourceMgr->integerValue("Visu:SweepSteps", 40);
1688 QApplication::setOverrideCursor(Qt::waitCursor);
1690 for (int j = 0; j < aCycles; j++) {
1691 for (int i = 0; i <= aSteps; i++) {
1692 float aPercents = float(i)/aSteps;
1693 aPrsObject->SetMapScale(aPercents);
1694 aPrsObject->UpdateActor(aActor);
1695 vw->getRenderWindow()->getRenderWindow()->Render();
1699 } catch (std::exception& exc) {
1700 INFOS("Follow exception was occured :\n" << exc.what());
1702 INFOS("Unknown exception was occured!");
1704 QApplication::restoreOverrideCursor();
1711 _PTR(Study) aStudyDS = GetCStudy(GetAppStudy(this));
1712 VisuGUI_TimeAnimationDlg* aAnimationDlg =
1713 new VisuGUI_TimeAnimationDlg(GetDesktop(this), aStudyDS);
1715 SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
1716 SALOME_ListIO aListIO;
1717 aSelectionMgr->selectedObjects(aListIO);
1719 bool isDefined = false;
1721 SALOME_ListIteratorOfListIO It (aListIO);
1722 for (; It.More(); It.Next()) {
1723 _PTR(SObject) aSObject = aStudyDS->FindObjectID(It.Value()->getEntry());
1724 if (!aSObject) continue;
1725 if (getValue(aSObject, "myComment") == QString("FIELD")) {
1726 long aNumber = getValue(aSObject, "myNbTimeStamps").toLong();
1730 aAnimationDlg->addField(aSObject);
1732 } else if (aNbTimes == aNumber) {
1733 aAnimationDlg->addField(aSObject);
1738 if (isDefined) aAnimationDlg->show();
1739 else delete aAnimationDlg;
1744 OnCopyPresentation()
1746 _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
1747 if (CheckLock(aCStudy))
1750 //VISU::Prs3d_i* aPrsObject = GetSelectedPrs3d();
1751 Handle(SALOME_InteractiveObject) anIO;
1752 CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
1753 if (CORBA::is_nil(anObject)) return;
1754 PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
1755 if (!aServant.in()) return;
1757 VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
1758 if (!aPrsObject) return;
1760 switch (aPrsObject->GetType()) {
1763 VISU::Mesh_i* aMeshPrs = dynamic_cast<VISU::Mesh_i*>(aPrsObject);
1764 VISU::Mesh_i* aSameMesh = new VISU::Mesh_i(aMeshPrs->GetResult());
1765 aSameMesh->SameAs(aMeshPrs);
1766 UpdateViewer(this, aSameMesh);
1769 case VISU::TSCALARMAP:
1771 VISU::ScalarMap_i* aScalarPrs = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
1772 VISU::ScalarMap_i* aSameScalar = new VISU::ScalarMap_i(aScalarPrs->GetResult(),true);
1773 aSameScalar->SameAs(aScalarPrs);
1774 UpdateViewer(this, aSameScalar);
1777 case VISU::TDEFORMEDSHAPE:
1779 VISU::DeformedShape_i* aDefPrs = dynamic_cast<VISU::DeformedShape_i*>(aPrsObject);
1780 VISU::DeformedShape_i* aSameDeformed = new VISU::DeformedShape_i(aDefPrs->GetResult(),true);
1781 aSameDeformed->SameAs(aDefPrs);
1782 UpdateViewer(this, aSameDeformed);
1785 case VISU::TCUTPLANES:
1787 VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
1788 VISU::CutPlanes_i* aSameCut = new VISU::CutPlanes_i(aCutPrs->GetResult(),true);
1789 aSameCut->SameAs(aCutPrs);
1790 UpdateViewer(this, aSameCut);
1793 case VISU::TCUTLINES:
1795 VISU::CutLines_i* aCutPrs = dynamic_cast<VISU::CutLines_i*>(aPrsObject);
1796 VISU::CutLines_i* aSameCut = new VISU::CutLines_i(aCutPrs->GetResult(),true);
1797 aSameCut->SameAs(aCutPrs);
1798 UpdateViewer(this, aSameCut);
1801 case VISU::TISOSURFACE:
1803 VISU::IsoSurfaces_i* aIsoPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aPrsObject);
1804 VISU::IsoSurfaces_i* aSameIso = new VISU::IsoSurfaces_i(aIsoPrs->GetResult(),true);
1805 aSameIso->SameAs(aIsoPrs);
1806 UpdateViewer(this, aSameIso);
1809 case VISU::TSTREAMLINES:
1811 VISU::StreamLines_i* aLinesPrs = dynamic_cast<VISU::StreamLines_i*>(aPrsObject);
1812 VISU::StreamLines_i* aSameLines = new VISU::StreamLines_i(aLinesPrs->GetResult(),true);
1813 aSameLines->SameAs(aLinesPrs);
1814 UpdateViewer(this, aSameLines);
1817 case VISU::TVECTORS:
1819 VISU::Vectors_i* aVectorsPrs = dynamic_cast<VISU::Vectors_i*>(aPrsObject);
1820 VISU::Vectors_i* aSameVectors = new VISU::Vectors_i(aVectorsPrs->GetResult(),true);
1821 aSameVectors->SameAs(aVectorsPrs);
1822 UpdateViewer(this, aSameVectors);
1833 (new VisuGUI_SelectionDlg(GetDesktop(this)))->show();
1840 VisuGUI_NonIsometricDlg* m_NonIsoDlg =
1841 new VisuGUI_NonIsometricDlg (GetDesktop(this), "m_NonIsoDlg",
1842 false, Qt::WDestructiveClose);
1843 m_NonIsoDlg->show();
1848 initialize( CAM_Application* theApp )
1850 SalomeApp_Module::initialize( theApp );
1863 QWidget* aParent = application()->desktop();
1864 SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
1867 createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(), tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
1868 this, SLOT(OnImportFromFile()));
1869 createAction( VISU_EXPLORE_MED, "", QIconSet(), tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
1870 this, SLOT(OnExploreMEDFile()));
1871 createAction( VISU_IMPORT_TABLE, "", QIconSet(), tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
1872 this, SLOT(OnImportTableFromFile()));
1874 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
1875 createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIconSet(aPixmap), tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
1876 this, SLOT(OnCreateScalarMap()));
1878 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
1879 createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIconSet(aPixmap), tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
1880 this, SLOT(OnCreateDeformedShape()));
1882 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
1883 createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap), tr("MEN_VECTORS"), "", 0, aParent, false,
1884 this, SLOT(OnCreateVectors()));
1886 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
1887 createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIconSet(aPixmap), tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
1888 this, SLOT(OnCreateIsoSurfaces()));
1890 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
1891 createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIconSet(aPixmap), tr("MEN_CUT_PLANES"), "", 0, aParent, false,
1892 this, SLOT(OnCreateCutPlanes()));
1894 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
1895 createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIconSet(aPixmap), tr("MEN_STREAM_LINES"), "", 0, aParent, false,
1896 this, SLOT(OnCreateStreamLines()));
1898 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
1899 createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIconSet(aPixmap), tr("MEN_CUT_LINES"), "", 0, aParent, false,
1900 this, SLOT(OnCreateCutLines()));
1902 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
1903 createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIconSet(aPixmap), tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
1904 this, SLOT(OnCreatePlot2dView()));
1906 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1907 createAction( VISU_DELETE, tr("MEN_DELETE_OBJ"), QIconSet(), tr("MEN_DELETE_OBJ"), "", 0, aParent, false,
1908 this, SLOT(OnDeleteObject()));
1910 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1911 //createAction( 4022, tr("MEN_RENAME_TABLE"), QIconSet(aPixmap), tr("MEN_RENAME_TABLE"), "", 0, aParent, false,
1912 //this, SLOT(OnRenameTable()));
1914 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1915 createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIconSet(), tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
1916 this, SLOT(OnShowTable()));
1918 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1919 createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIconSet(), tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
1920 this, SLOT(OnPlotData()));
1922 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1923 createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(), tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
1924 this, SLOT(OnExportTableToFile()));
1926 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1927 createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIconSet(), tr("MEN_CREATE_PRS"), "", 0, aParent, false,
1928 this, SLOT(OnCreateMesh()));
1930 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1931 createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIconSet(), tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
1932 this, SLOT(OnCreateManyMesh()));
1934 //aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE"));
1935 createAction( VISU_ERASE, tr("MEN_ERASE"), QIconSet(), tr("MEN_ERASE"), "", 0, aParent, false,
1936 this, SLOT(OnErasePrs()));
1938 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1939 createAction( VISU_DISPLAY, tr("MEN_DISPLAY"), QIconSet(), tr("MEN_DISPLAY"), "", 0, aParent, false,
1940 this, SLOT(OnDisplayPrs()));
1942 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1943 createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIconSet(), tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
1944 this, SLOT(OnDisplayOnlyPrs()));
1946 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1947 createAction( VISU_DELETE_PRS, tr("MEN_DELETE_PRS"), QIconSet(), tr("MEN_DELETE_PRS"), "", 0, aParent, false,
1948 this, SLOT(OnDeletePrs()));
1950 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1951 createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIconSet(), tr("MEN_COPY_PRS"), "", 0, aParent, false,
1952 this, SLOT(OnCopyPresentation()));
1954 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1955 createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIconSet(), tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
1956 this, SLOT(OnCurveProperties()));
1958 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1959 createAction( VISU_RENAME, tr("MEN_RENAME"), QIconSet(), tr("MEN_RENAME"), "", 0, aParent, false,
1960 this, SLOT(OnRename()));
1962 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1963 createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIconSet(), tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
1964 this, SLOT(OnEditContainer()));
1966 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1967 //createAction( 4043, tr("MEN_RENAME_CONTAINER"), QIconSet(aPixmap), tr("MEN_RENAME_CONTAINER"), "", 0, aParent, false,
1968 //this, SLOT(OnRenameContainer()));
1970 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1971 createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(), tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
1972 this, SLOT(OnClearContainer()));
1974 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1975 createAction( VISU_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
1976 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
1977 this, SLOT(OnSaveViewParams()));
1979 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1980 createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIconSet(),
1981 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
1982 this, SLOT(OnRestoreViewParams()));
1984 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
1985 createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(),
1986 tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
1987 this, SLOT(OnDeleteViewParams()));
1989 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
1990 createAction( VISU_POINTS, tr("MEN_POINTS"), QIconSet(aPixmap), tr("MEN_POINTS"), "", 0, aParent, false,
1991 this, SLOT(OnMakePoints()));
1993 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
1994 createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIconSet(aPixmap), tr("MEN_WIREFRAME"), "", 0, aParent, false,
1995 this, SLOT(OnMakeWireframe()));
1997 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
1998 createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIconSet(aPixmap), tr("MEN_SURFACE"), "", 0, aParent, false,
1999 this, SLOT(OnMakeSurface()));
2001 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2002 createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIconSet(), tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
2003 this, SLOT(OnMakeInsideframe()));
2005 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2006 createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIconSet(), tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
2007 this, SLOT(OnMakeSurfaceframe()));
2009 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2010 createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIconSet(), tr("MEN_SHRINK"), "", 0, aParent, false,
2011 this, SLOT(OnMakeShrink()));
2013 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2014 createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(), tr("MEN_UNSHRINK"), "", 0, aParent, false,
2015 this, SLOT(OnMakeShrink()));
2017 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2018 createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(), tr("MEN_CELL_COLOR"), "", 0, aParent, false,
2019 this, SLOT(OnChangeColor()));
2021 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2022 createAction( VISU_COLOR, tr("MEN_COLOR"), QIconSet(), tr("MEN_COLOR"), "", 0, aParent, false,
2023 this, SLOT(OnChangeColor()));
2025 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2026 createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIconSet(), tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
2027 this, SLOT(OnChangeWireframeColor()));
2029 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2030 createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIconSet(), tr("MEN_OPACITY"), "", 0, aParent, false,
2031 this, SLOT(OnChangeOpacity()));
2033 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2034 createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIconSet(), tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
2035 this, SLOT(OnChangeLines()));
2037 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2038 createAction( VISU_EDIT_PRS, tr("MEN_EDIT_PRS"), QIconSet(), tr("MEN_EDIT_PRS"), "", 0, aParent, false,
2039 this, SLOT(OnEditPrs()));
2041 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2042 createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(), tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
2043 this, SLOT(OnCreateTable()));
2045 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP"));
2046 createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIconSet(aPixmap), tr("MEN_SWEEP"), "", 0, aParent, false,
2047 this, SLOT(OnSweep()));
2049 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2050 createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIconSet(),
2051 tr("MEN_SELECTION_INFO"), "", 0, aParent, false,
2052 this, SLOT(OnSelectionInfo()));
2054 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
2055 createAction( VISU_ANIMATION, tr("MEN_ANIMATION"), QIconSet(aPixmap), tr("MEN_ANIMATION"), "", 0, aParent, false,
2056 this, SLOT(OnTimeAnimation()));
2058 aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE"));
2059 createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIconSet(aPixmap),
2060 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
2061 this, SLOT(OnEraseAll()));
2063 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2064 createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(),
2065 tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
2066 //this, SLOT(OnEraseAll()));
2069 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2070 createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(),
2071 tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
2072 //this, SLOT(OnEraseAll()));
2075 //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
2076 createAction( VISU_SCALING, tr("MEN_SCALING"), QIconSet(),
2077 tr("MEN_SCALING"), "", 0, aParent, false,
2078 this, SLOT(OnScaling()));
2085 // Add actions to menus
2087 aMenuId = createMenu( tr( "MEN_FILE" ), -1 );
2088 createMenu( separator(), aMenuId, -1, 10 );
2089 createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file
2090 createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file
2091 createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table
2093 aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
2094 createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
2095 createMenu( VISU_DEFORMED_SHAPE, aMenuId, 10 ); // deformed shape
2096 createMenu( VISU_VECTORS, aMenuId, 10 ); // vectors
2097 createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
2098 createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
2099 createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
2100 createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
2102 aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
2103 createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
2105 aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
2107 createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
2108 createMenu( VISU_POINTS, parentId, 10 ); // points
2109 createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
2110 createMenu( VISU_SURFACE, parentId, 10 ); // surface
2111 createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
2112 createMenu( VISU_GLOBAL_SELECTION, aMenuId, 10 ); // global selection
2113 createMenu( VISU_PARTIAL_SELECTION, aMenuId, 10 ); // partial selection
2114 createMenu( VISU_SCALING, aMenuId, 10 ); // scaling
2121 int aToolId = createTool(tr("TOOL_VISUALISATION"));
2122 createTool( VISU_SCALAR_MAP, aToolId );
2123 createTool( VISU_DEFORMED_SHAPE, aToolId );
2124 createTool( VISU_VECTORS, aToolId );
2125 createTool( VISU_ISO_SURFACES, aToolId );
2126 createTool( VISU_CUT_PLANES, aToolId );
2127 createTool( VISU_STREAM_LINES, aToolId );
2128 createTool( VISU_CUT_LINES, aToolId );
2135 // Prepare popup menus
2136 QtxPopupMgr* mgr = popupMgr();
2138 // VISU root commands
2139 QString aRule( "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'" );
2140 mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED
2141 mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule, true );
2142 mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables
2143 mgr->setRule( action( VISU_IMPORT_TABLE ), aRule, true );
2144 mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d
2145 mgr->setRule( action( VISU_PLOT2D ), aRule, true );
2146 aRule = "client='ObjectBrowser' and selcount=1 and $type in {'VISU::TRESULT' 'VISU::TTABLE' 'VISU::TCONTAINER'}";
2147 mgr->insert( action( VISU_DELETE ), -1, -1, -1 ); // delete object
2148 mgr->setRule( action( VISU_DELETE ), aRule, true );
2150 // timestamp commands
2151 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTIMESTAMP'";
2152 mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
2153 mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
2154 mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
2155 mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
2156 mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
2157 mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
2158 mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
2159 mgr->setRule( action( VISU_CUT_LINES ), aRule, true );
2160 aRule += " and nbComponents>1";
2161 mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
2162 mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule, true );
2163 mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
2164 mgr->setRule( action( VISU_VECTORS ), aRule, true );
2165 mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
2166 mgr->setRule( action( VISU_STREAM_LINES ), aRule, true );
2168 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTABLE'";
2169 //mgr->insert( action( 4022 ), -1, -1, -1 ); // rename table
2170 //mgr->setRule( action( 4022 ), aRule, true );
2171 mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
2172 mgr->setRule( action( VISU_SHOW_TABLE ), aRule, true );
2173 mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
2174 mgr->setRule( action( VISU_CREATE_CURVES ), aRule, true );
2175 mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
2176 mgr->setRule( action( VISU_EXPORT_TABLE ), aRule, true );
2177 mgr->insert( separator(), -1, -1, -1 );
2178 aRule = "(client='ObjectBrowser' and selcount>0 and ((type='VISU::TTABLE' and nbChildren>0) "
2179 "or (type='VISU::TCURVE'%1) or (type='VISU::TCONTAINER'))) "
2180 " or (selcount>0 and $type in {"
2181 "'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
2182 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'})";
2183 mgr->insert( action( VISU_ERASE ), -1, -1, -1 ); // erase
2184 mgr->setRule( action( VISU_ERASE ), aRule.arg(""), true );// TODO: aRule.arg(" and isVisible=1"), true );
2185 mgr->insert( action( VISU_DISPLAY ), -1, -1, -1 ); // display
2186 mgr->setRule( action( VISU_DISPLAY ), aRule.arg(""), true );// TODO: aRule.arg(" and isVisible=0"), true );
2187 mgr->insert( action( VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
2188 mgr->setRule( action( VISU_DISPLAY_ONLY ), aRule.arg(""), true );
2190 aRule = "client='ObjectBrowser' and selcount=1 and $type in {'VISU::TTABLE' "
2191 "'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::TMESH' 'VISU::TSCALARMAP' "
2192 "'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
2193 "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
2194 mgr->insert( action( VISU_DELETE_PRS ), -1, -1, -1 ); // delete presentation
2195 mgr->setRule( action( VISU_DELETE_PRS ), aRule, true );
2198 mgr->insert ( action( VISU_VIEW_PARAMS ), -1, -1, -1 ); // save view params
2199 //jfa tmp:mgr->setRule( action( 4046 ), "(client='VTKViewer' and selcount=0) or (selcount=1 and type='VISU::TVIEW3D')", true );
2200 mgr->setRule( action( VISU_VIEW_PARAMS ), "selcount=0", true ); //jfa tmp
2201 mgr->insert ( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
2202 mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
2203 mgr->insert ( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
2204 mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
2206 // 3D presentations commands
2207 QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
2208 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
2209 QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
2210 QString aSurfType = " and $type in {'VISU::TMESH'}";
2211 QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
2212 "'VISU::TCUTPLANES' 'VISU::TCUTLINES'}";
2213 QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
2214 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES'}";
2215 aRule = "selcount=1";
2217 int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 ); // "Representation" submenu
2218 mgr->insert( action( VISU_POINTS ), parentId, -1, -1 ); // points
2219 mgr->setRule( action( VISU_POINTS ), aRule + aPrsType +
2220 " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}", true );
2221 mgr->insert( action( VISU_WIREFRAME ), parentId, -1, -1 ); // wireframe
2222 mgr->setRule( action( VISU_WIREFRAME ), aRule + aPrsType +
2223 " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}", true );
2224 mgr->insert( action( VISU_SURFACE ), parentId, -1, -1 ); // surface
2225 mgr->setRule( action( VISU_SURFACE ), aRule + aPrsType +
2226 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}", true );
2227 mgr->insert( action( VISU_INSIDEFRAME ), parentId, -1, -1 ); // insideframe
2228 mgr->setRule( action( VISU_INSIDEFRAME ), aRule + aInsideType +
2229 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME'}", true );
2230 mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
2231 mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType +
2232 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}", true );
2233 mgr->insert( action( VISU_SHRINK ), parentId, -1, -1 ); // shrink
2234 mgr->setRule( action( VISU_SHRINK ), aRule + aShrinkType + " and isShrunk=0", true );
2235 mgr->insert( action( VISU_UNSHRINK ), parentId, -1, -1 ); // unshrink
2236 mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true );
2238 parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 ); // "Properties" submenu
2239 mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
2240 mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
2241 mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
2242 mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
2243 mgr->insert( action( VISU_COLOR ), parentId, -1, -1 ); // color
2244 mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
2245 " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
2246 "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))", true );
2247 mgr->insert( action( VISU_OPACITY ), parentId, -1, -1 ); // opacity
2248 mgr->setRule( action( VISU_OPACITY ), aRule + aShrinkType + " and hasActor=1", true );
2249 mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
2250 mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
2253 QString aCurveType = "$type in {'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'}";
2254 aPrsType = "$type in {'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
2255 "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
2257 aRule = "selcount=1 and (type=VISU::TVIEW3D or " + aCurveType + " or " + aPrsType + ")";
2258 mgr->insert ( action( VISU_RENAME ), -1, -1, -1 ); // rename
2259 mgr->setRule( action( VISU_RENAME ), aRule, true );
2261 // copy presentation command
2262 aRule = "selcount=1 and " + aPrsType;
2263 mgr->insert ( action( VISU_COPY_PRS ), -1, -1, -1 ); // copy
2264 mgr->setRule( action( VISU_COPY_PRS ), aRule, true );
2267 aRule = "selcount=1 and type='VISU::TCURVE'";
2268 mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
2269 mgr->setRule( action( VISU_CURVE_PROPS ), aRule, true );
2271 // curve container commands
2272 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
2273 mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 ); // edit container
2274 mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule, true );
2275 //mgr->insert( action( 4043 ), -1, -1, -1 ); // rename container
2276 //mgr->setRule( action( 4043 ), aRule, true );
2277 mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 ); // clear container
2278 mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
2280 aRule = "selcount=1 and ";
2281 mgr->insert( action( VISU_EDIT_PRS ), -1, -1, -1 ); // edit prs
2282 mgr->setRule( action( VISU_EDIT_PRS ), aRule + aPrsType, true );
2284 aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
2285 mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
2286 mgr->setRule( action( VISU_CREATE_TABLE ), aRule, true );
2288 aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TSCALARMAP'";
2289 mgr->insert ( action( VISU_SWEEP ), -1, -1, -1 ); // sweep
2290 mgr->setRule( action( VISU_SWEEP ), aRule, true );
2292 // Selection info popup item
2293 // aRule = "client='ObjectBrowser' and selcount=1" + aInsideType;
2294 // mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
2295 // mgr->setRule( action( VISU_SELECTION_INFO ), aRule, true );
2297 aRule = "client='ObjectBrowser' and selcount>0 and $type in {'VISU::TFIELD'} and nbTimeStamps>1";
2298 mgr->insert( action( VISU_ANIMATION ), -1, -1, -1 ); // animation
2299 mgr->setRule( action( VISU_ANIMATION ), aRule, true );
2301 aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
2302 mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
2303 mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
2304 mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
2305 mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
2310 windows( QMap<int, int>& theMap ) const
2313 theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
2319 viewManagers( QStringList& theList ) const
2322 theList.append( SVTK_Viewer::Type() );
2330 CORBA::String_var anIOR = GetVisuGen(this)->GetID();
2331 return QString(anIOR.in());
2337 activateModule( SUIT_Study* theStudy )
2339 SalomeApp_Module::activateModule( theStudy );
2341 setMenuShown( true );
2342 setToolShown( true );
2349 deactivateModule( SUIT_Study* theStudy )
2351 setMenuShown( false );
2352 setToolShown( false );
2354 SalomeApp_Module::deactivateModule( theStudy );
2358 SalomeApp_Selection*
2360 createSelection() const
2362 return new VisuGUI_Selection( (SalomeApp_Module*)this );
2365 //******************************************************************
2366 void VisuGUI::studyActivated()
2368 GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
2376 return new VisuGUI();