From 3f739a0c1d5a1e63d8f9efdbb55ca462b5634a3a Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 20 Jun 2005 07:07:17 +0000 Subject: [PATCH] Place TableDlg into a separate unit GUITOOLS to make available using it in VISU_I --- src/GUITOOLS/Makefile.in | 66 +++ .../VisuGUI_TableDlg.cxx | 0 src/{VISUGUI => GUITOOLS}/VisuGUI_TableDlg.h | 0 src/Makefile.in | 2 +- src/VISUGUI/Makefile.in | 11 +- src/VISU_I/Makefile.in | 2 +- src/VISU_I/VISU_Gen_i.cc | 397 ++++++++++++------ src/VISU_I/VISU_Gen_i.hh | 51 ++- src/VISU_I/VISU_View_i.cc | 83 ++-- src/VISU_I/VISU_View_i.hh | 13 +- src/VISU_SWIG/visu_view3d.py | 5 + 11 files changed, 444 insertions(+), 186 deletions(-) create mode 100644 src/GUITOOLS/Makefile.in rename src/{VISUGUI => GUITOOLS}/VisuGUI_TableDlg.cxx (100%) rename src/{VISUGUI => GUITOOLS}/VisuGUI_TableDlg.h (100%) diff --git a/src/GUITOOLS/Makefile.in b/src/GUITOOLS/Makefile.in new file mode 100644 index 00000000..eb8eeac4 --- /dev/null +++ b/src/GUITOOLS/Makefile.in @@ -0,0 +1,66 @@ +# VISU VISUGUI : GUI of VISU component +# +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : Makefile.in +# Author : Marc Tajchman (CEA) +# Module : VISU +# $Header$ + +top_srcdir=@top_srcdir@ +top_builddir=../.. +srcdir=@srcdir@ +VPATH=.:@srcdir@ + +@COMMENCE@ + +# header files +EXPORT_HEADERS= \ + VisuGUI_TableDlg.h + +# .po files to transform in .qm +#PO_FILES = \ +# VISU_msg_en.po VISU_images.po + +# Libraries targets +LIB = libVISUGUITOOLS.la + +LIB_SRC = VisuGUI_TableDlg.cxx + +LIB_MOC = VisuGUI_TableDlg.h + +LIB_CLIENT_IDL = SALOME_Exception.idl + +LIB_SERVER_IDL = + +# additionnal information to compil and link file + +CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) \ + $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QWT_INCLUDES) \ + -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) + +CXXFLAGS += -ftemplate-depth-32 $(OCC_CXXFLAGS) \ + -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome + +LDFLAGS += $(QWT_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome + +@CONCLUDE@ diff --git a/src/VISUGUI/VisuGUI_TableDlg.cxx b/src/GUITOOLS/VisuGUI_TableDlg.cxx similarity index 100% rename from src/VISUGUI/VisuGUI_TableDlg.cxx rename to src/GUITOOLS/VisuGUI_TableDlg.cxx diff --git a/src/VISUGUI/VisuGUI_TableDlg.h b/src/GUITOOLS/VisuGUI_TableDlg.h similarity index 100% rename from src/VISUGUI/VisuGUI_TableDlg.h rename to src/GUITOOLS/VisuGUI_TableDlg.h diff --git a/src/Makefile.in b/src/Makefile.in index fe1f880e..b8b86f6e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -32,6 +32,6 @@ VPATH=.:@srcdir@ @COMMENCE@ -SUBDIRS = CONVERTOR PIPELINE OBJECT ENGINE VISU_I VISUGUI VISU_SWIG +SUBDIRS = CONVERTOR PIPELINE OBJECT ENGINE GUITOOLS VISU_I VISUGUI VISU_SWIG @MODULE@ diff --git a/src/VISUGUI/Makefile.in b/src/VISUGUI/Makefile.in index da74603d..8dcc559e 100644 --- a/src/VISUGUI/Makefile.in +++ b/src/VISUGUI/Makefile.in @@ -63,8 +63,7 @@ LIB_SRC = VisuGUI.cxx \ VisuGUI_CutLinesDlg.cxx \ VisuGUI_CutPlanesDlg.cxx \ VisuGUI_StreamLinesDlg.cxx \ - VisuGUI_VectorsDlg.cxx \ - VisuGUI_TableDlg.cxx + VisuGUI_VectorsDlg.cxx LIB_MOC = VisuGUI.h \ VisuGUI_Selection.h \ @@ -80,8 +79,7 @@ LIB_MOC = VisuGUI.h \ VisuGUI_CutLinesDlg.h \ VisuGUI_CutPlanesDlg.h \ VisuGUI_StreamLinesDlg.h \ - VisuGUI_VectorsDlg.h \ - VisuGUI_TableDlg.h + VisuGUI_VectorsDlg.h LIB_CLIENT_IDL = SALOME_Exception.idl \ VISU_Gen.idl \ @@ -105,9 +103,8 @@ CXXFLAGS += -ftemplate-depth-32 $(OCC_CXXFLAGS) \ -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome LDFLAGS += $(QWT_LIBS) -lSalomeNS \ - -lVisuObject -lVISUEngineImpl -lSVTK -lSPlot2d \ - -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome + -lSVTK -lSPlot2d -lVisuObject -lVISUEngineImpl -lVISUGUITOOLS \ + -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome @CONCLUDE@ - diff --git a/src/VISU_I/Makefile.in b/src/VISU_I/Makefile.in index e1267b8b..978c3415 100644 --- a/src/VISU_I/Makefile.in +++ b/src/VISU_I/Makefile.in @@ -58,7 +58,7 @@ CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES LDFLAGS += $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(QWT_LIBS) -lSalomeNS -lTOOLSDS \ -lSalomeContainer -lOpUtil -lSalomeApp -lVTKViewer -lSVTK -lSPlot2d -lSalomeHDFPersist \ - -lVisuConvertor -lVisuPipeLine -lVisuObject -lSalomeGenericObj \ + -lSalomeGenericObj -lVisuConvertor -lVisuPipeLine -lVisuObject -lVISUGUITOOLS \ -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome -lEvent LIBS+= -lPlot2d -L${KERNEL_ROOT_DIR}/lib/salome diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 1b5bcf91..9965c30b 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -1,23 +1,23 @@ // VISU OBJECT : interactive object for VISU entities implementation // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // // // File : VISU_Gen_i.cc @@ -41,24 +41,46 @@ #include "VISU_Table_i.hh" #include "VISU_TimeAnimation.h" +#include "VISU_Actor.h" + #include "HDFascii.hxx" #include "SALOMEDS_Tool.hxx" #include "SALOMEDSClient_AttributeName.hxx" #include "SALOMEDSClient_AttributePixMap.hxx" -#include "utilities.h" +#include "SUIT_Session.h" +#include "SalomeApp_Study.h" +#include "SalomeApp_Application.h" +#include "SalomeApp_SelectionMgr.h" +#include "SVTK_ViewModel.h" +#include "SVTK_ViewWindow.h" +#include "SALOME_Event.hxx" +#include "SALOME_ListIO.hxx" +#include "SALOME_ListIteratorOfListIO.hxx" -#include -#include -#include +#include "utilities.h" -#include +// IDL Headers +#include #include CORBA_SERVER_HEADER(SALOME_Session) #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) +// QT Includes #include #include + +// VTK Includes +#include +#include + +// OCCT Includes +#include +#include + +// STL Includes +#include + #include "Utils_ExceptHandlers.hxx" using namespace std; @@ -73,9 +95,9 @@ static int MYDEBUG = 0; UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception); -extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, - PortableServer::POA_ptr thePOA, - SALOME_NamingService* theNamingService, +extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, + PortableServer::POA_ptr thePOA, + SALOME_NamingService* theNamingService, QMutex* theMutex) { if(MYDEBUG) MESSAGE("extern \"C\" GetImpl"); @@ -99,7 +121,7 @@ namespace VISU{ aStudyBuilder->NewCommand(); int aLocked = theStudyDocument->GetProperties()->IsLocked(); if (aLocked) theStudyDocument->GetProperties()->SetLocked(false); - aSComponent = aStudyBuilder->NewComponent("VISU"); + aSComponent = aStudyBuilder->NewComponent("VISU"); _PTR(GenericAttribute) anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName"); _PTR(AttributeName) aName (anAttr); @@ -124,7 +146,7 @@ namespace VISU{ aStudyBuilder->CommitCommand(); } return aSComponent; - } + } SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument){ SALOMEDS::SComponent_var aSComponent = theStudyDocument->FindComponent("VISU"); @@ -133,7 +155,7 @@ namespace VISU{ aStudyBuilder->NewCommand(); int aLocked = theStudyDocument->GetProperties()->IsLocked(); if (aLocked) theStudyDocument->GetProperties()->SetLocked(false); - aSComponent = aStudyBuilder->NewComponent("VISU"); + aSComponent = aStudyBuilder->NewComponent("VISU"); SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName"); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); @@ -150,14 +172,14 @@ namespace VISU{ anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap"); SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); aPixmap->SetPixMap( "ICON_OBJBROWSER_Visu" ); - + VISU_Gen_var aVisuGen = Base_i::GetVisuGenImpl()->_this(); aStudyBuilder->DefineComponentInstance(aSComponent,aVisuGen); if (aLocked) theStudyDocument->GetProperties()->SetLocked(true); aStudyBuilder->CommitCommand(); } return aSComponent; - } + } void RegistryStorable() { Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore)); @@ -176,7 +198,7 @@ namespace VISU{ //=========================================================================== - VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, + VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, SALOME_NamingService* theNamingService, QMutex* theMutex) : Engines_Component_i() { @@ -211,8 +233,8 @@ namespace VISU{ bool isMultiFile) { Mutex mt(myMutex); - SALOMEDS::Study_var aStudy = theComponent->GetStudy(); - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::Study_var aStudy = theComponent->GetStudy(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str(); TCollection_AsciiString aTmpDir(const_cast(aDir)); VisuTmpDir = aTmpDir.ToCString(); @@ -225,7 +247,7 @@ namespace VISU{ CORBA::Boolean VISU_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile & theStream, const char* theURL, - bool isMultiFile) + bool isMultiFile) { return Load(theComponent, theStream, theURL, isMultiFile); } @@ -233,7 +255,7 @@ namespace VISU{ char* VISU_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, const char* aLocalPersistentID, CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII) + CORBA::Boolean isASCII) { CORBA::String_var aString(""); if(strcmp(aLocalPersistentID,"") != 0) { @@ -255,7 +277,7 @@ namespace VISU{ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<GetStudy(); + SALOMEDS::Study_var aStudy = theComponent->GetStudy(); //CORBA::Boolean anIsValidScript; //Engines::TMPFile_var aDump = DumpPython(aStudy,false,anIsValidScript); @@ -275,14 +297,14 @@ namespace VISU{ QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str(); static QString aCommand; aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1()); - + int aRes = system(aCommand); if(aRes){ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<GetStudy(); + SALOMEDS::Study_var aStudy = theComponent->GetStudy(); SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent); for (; itBig->More(); itBig->Next()) { SALOMEDS::SObject_var gotBranch = itBig->Value(); @@ -330,16 +352,16 @@ namespace VISU{ aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1()); int aRes = system(aCommand); - if(aRes){ + if(aRes){ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<string_to_object(aString); if(!CORBA::is_nil(anObj)){ @@ -403,7 +425,7 @@ namespace VISU{ } SALOMEDS::SObject_ptr VISU_Gen_i::ImportTables(const char* theFileName){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return SALOMEDS::SObject::_nil(); Mutex mt(myMutex); SALOMEDS::SObject_var aRes = VISU::ImportTables(theFileName,myStudyDocument); @@ -417,14 +439,14 @@ namespace VISU{ } Result_ptr VISU_Gen_i::ImportFile(const char* theFileName){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil(); Mutex mt(myMutex); aFileInfo.setFile(theFileName); Result_i* pResult = new Result_i(myStudyDocument, Result_i::eFile, Result_i::eImportFile); - if(pResult->Create(theFileName) != NULL) + if(pResult->Create(theFileName) != NULL) return pResult->_this(); else{ pResult->_remove_ref(); @@ -433,7 +455,7 @@ namespace VISU{ } Result_ptr VISU_Gen_i::CopyAndImportFile(const char* theFileName){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil(); Mutex mt(myMutex); VISU::Result_var aResult; @@ -441,13 +463,13 @@ namespace VISU{ Result_i* pResult = new Result_i(myStudyDocument, Result_i::eRestoredFile, Result_i::eCopyAndImportFile); - if(pResult->Create(theFileName) != NULL) + if(pResult->Create(theFileName) != NULL) aResult = pResult->_this(); return aResult._retn(); } Result_ptr VISU_Gen_i::ImportMed(SALOMEDS::SObject_ptr theMedSObject){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil(); Mutex mt(myMutex); Result_i* pResult = new Result_i(myStudyDocument, @@ -462,7 +484,7 @@ namespace VISU{ } Result_ptr VISU_Gen_i::ImportMedField(SALOME_MED::FIELD_ptr theField){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil(); Mutex mt(myMutex); Result_i* pResult = new Result_i(myStudyDocument, @@ -476,11 +498,11 @@ namespace VISU{ } } - Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, - const char* theMeshName, + Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity) { - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Mesh::_nil(); Mutex mt(myMutex); if(Result_i* pResult = dynamic_cast(GetServant(theResult).in())){ @@ -494,12 +516,12 @@ namespace VISU{ return VISU::Mesh::_nil(); } - Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, + Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, const char* theFamilyName) { - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Mesh::_nil(); Mutex mt(myMutex); if(Result_i* pResult = dynamic_cast(GetServant(theResult).in())){ @@ -513,11 +535,11 @@ namespace VISU{ return VISU::Mesh::_nil(); } - Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, - const char* theMeshName, + Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, + const char* theMeshName, const char* theGroupName) { - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Mesh::_nil(); Mutex mt(myMutex); if(Result_i* pResult = dynamic_cast(GetServant(theResult).in())){ @@ -531,71 +553,71 @@ namespace VISU{ return VISU::Mesh::_nil(); } - ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, + ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration) { return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn(); } - DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, + DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration) { return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } - Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, + Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration) { return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } - IsoSurfaces_ptr VISU_Gen_i::IsoSurfacesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, + IsoSurfaces_ptr VISU_Gen_i::IsoSurfacesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration) { return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } - StreamLines_ptr VISU_Gen_i::StreamLinesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, + StreamLines_ptr VISU_Gen_i::StreamLinesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration) { return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } - CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, + CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration) { return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } - CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, + CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration) { return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Table::_nil(); Mutex mt(myMutex); Table_i* pPresent = new Table_i(myStudyDocument,theTableEntry); @@ -607,11 +629,11 @@ namespace VISU{ } } - Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable, - CORBA::Long theHRow, + Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable, + CORBA::Long theHRow, CORBA::Long theVRow) { - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Curve::_nil(); Mutex mt(myMutex); PortableServer::POA_ptr aPOA = GetPOA(); @@ -626,7 +648,7 @@ namespace VISU{ } Container_ptr VISU_Gen_i::CreateContainer(){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Container::_nil(); Mutex mt(myMutex); Container_i* pPresent = new Container_i(myStudyDocument); @@ -639,7 +661,7 @@ namespace VISU{ } Animation_ptr VISU_Gen_i::CreateAnimation(View3D_ptr theView3D){ - if(myStudyDocument->GetProperties()->IsLocked()) + if(myStudyDocument->GetProperties()->IsLocked()) return Animation::_nil(); Mutex mt(myMutex); if(VISU_TimeAnimation_i* anAnim = new VISU_TimeAnimation_i(myStudyDocument,theView3D)){ @@ -648,6 +670,147 @@ namespace VISU{ return VISU::Animation::_nil(); } + void DeletePrs3d (Prs3d_ptr thePrs3d) + { + Prs3d_i* aPrs3d = dynamic_cast(GetServant(thePrs3d).in()); + if (!aPrs3d) + return; + + // 1. Find appropriate application (code like in VISU_ViewManager_i.cxx) + SALOMEDS::Study_var myStudyDocument = aPrs3d->GetStudyDocument(); + SalomeApp_Application* anApp = NULL; + CORBA::String_var studyName = myStudyDocument->Name(); + std::string aStudyName = studyName.in(); + SUIT_Session* aSession = SUIT_Session::session(); + QPtrList anApplications = aSession->applications(); + QPtrListIterator anIter (anApplications); + while (SUIT_Application* aSUITApp = anIter.current()) { + ++anIter; + if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) { + if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { + if (_PTR(Study) aCStudy = aStudy->studyDS()) { + if (aStudyName == aCStudy->Name()) { + anApp = dynamic_cast(aSUITApp); + break; + } + } + } + } + } + if (!anApp) + return; + + // 2. Remove corresponding IO from selection + SALOMEDS::SObject_var aSObject = aPrs3d->GetSObject(); + CORBA::String_var anEntry = aSObject->GetID(); + + SalomeApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr(); + SALOME_ListIO aListIO, aNewListIO; + aSelectionMgr->selectedObjects(aListIO); + + for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) { + if (it.Value()->hasEntry()) { + std::string aCurEntry (it.Value()->getEntry()); + if (aCurEntry != anEntry) { + aNewListIO.Append(it.Value()); + } + } + } + + aSelectionMgr->setSelectedObjects(aNewListIO); + + // 3. Remove Actors + ViewManagerList aViewManagerList; + anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList); + QPtrListIterator anVMIter (aViewManagerList); + for (; anVMIter.current(); ++anVMIter) { + SUIT_ViewManager* aViewManager = anVMIter.current(); + QPtrVector aViews = aViewManager->getViews(); + for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) { + if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) { + if (SVTK_ViewWindow* vw = dynamic_cast(aViewWindow)) { + //VISU_Actor* anActor = aVISUViewManager->GetActor(aPrs3d, vw); + VISU_Actor* anActor = NULL; + vtkActorCollection *anActColl = vw->getRenderer()->GetActors(); + anActColl->InitTraversal(); + vtkActor *aVTKActor = anActColl->GetNextActor(); + for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) { + if (VISU_Actor* anVISUActor = dynamic_cast(aVTKActor)) { + if (aPrs3d == anVISUActor->GetPrs3d()) { + anActor = anVISUActor->GetParent(); + } + } + } + if (anActor) { + vw->RemoveActor(anActor); + anActor->Delete(); + } + } + } + } + } + + aPrs3d->RemoveFromStudy(); + aPrs3d->Destroy(); + + //jfa tmp:theModule->updateObjBrowser(); //update Object browser + } + + void VISU_Gen_i::DeleteResult (Result_ptr theResult) + { + class TEvent: public SALOME_Event { + Result_ptr myResult; + public: + TEvent(Result_ptr theResult): myResult(theResult) {} + virtual void Execute(){ + if (Result_i* aResult = dynamic_cast(GetServant(myResult).in())) { + SALOMEDS::SObject_var aSObject = aResult->GetSObject(); + SALOMEDS::Study_var aStudyDocument = aSObject->GetStudy(); + SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(aSObject); + for(aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()){ + SALOMEDS::SObject_var aChildSObject = aChildIter->Value(); + CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject); + if(CORBA::is_nil(aChildObj)) continue; + VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aChildObj); + if(CORBA::is_nil(aPrs3d)) continue; + VISU::DeletePrs3d(aPrs3d); + } + + aResult->RemoveFromStudy(); + aResult->Destroy(); + + //jfa tmp:if (QAD_Desktop* aDesktop = QAD_Application::getDesktop()) + //jfa tmp: if (QAD_Study* aStudy = aDesktop->findStudy(aStudyDocument)) + //jfa tmp: aStudy->updateObjBrowser(); //update Object browser + } + } + }; + + if (myStudyDocument->GetProperties()->IsLocked()) + return; + Mutex mt(myMutex); // jfa ??? + + ProcessVoidEvent(new TEvent(theResult)); + } + + void VISU_Gen_i::DeletePrs3d (Prs3d_ptr thePrs3d) + { + class TEvent: public SALOME_Event { + Prs3d_ptr myPrs3d; + public: + TEvent(Prs3d_ptr thePrs3d): myPrs3d(thePrs3d) {} + virtual void Execute() { + VISU::DeletePrs3d(myPrs3d); + } + }; + + if (myStudyDocument->GetProperties()->IsLocked()) + return; + Mutex mt(myMutex); // jfa ??? + + ProcessVoidEvent(new TEvent(thePrs3d)); + } + void VISU_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent){ } @@ -663,8 +826,8 @@ namespace VISU{ SALOMEDS::SObject_ptr VISU_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, - const char* theName) - throw (SALOME::SALOME_Exception) + const char* theName) + throw (SALOME::SALOME_Exception) { Unexpect aCatch(SalomeException); if(MYDEBUG) MESSAGE("VISU_Gen_i::PublishInStudy : "<FindObjectID(anEntry); return aResultSO._retn(); } - + CORBA::Boolean VISU_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) { Mutex mt(myMutex); SALOMEDS::GenericAttribute_var anAttr; @@ -693,7 +856,7 @@ namespace VISU{ if(Result_i* pResult = dynamic_cast(GetServant(aResultObj).in())){ switch(pResult->GetCreationId()){ case Result_i::eImportFile: - case Result_i::eCopyAndImportFile: + case Result_i::eCopyAndImportFile: return true; } } @@ -715,7 +878,7 @@ namespace VISU{ SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; PortableServer::POA_ptr aPOA = GetPOA(); - + SALOMEDS::GenericAttribute_var anAttr; if (!theObject->FindAttribute(anAttr,"AttributeIOR")) return NULL; SALOMEDS::AttributeIOR_var anIORAttr = SALOMEDS::AttributeIOR::_narrow(anAttr); @@ -730,7 +893,7 @@ namespace VISU{ if (CORBA::is_nil(aCorbaObj)) { return NULL; } - + Storable* pStorable = dynamic_cast(GetServant(aCorbaObj).in()); if (!pStorable) { return NULL; @@ -743,7 +906,7 @@ namespace VISU{ string aStr = pStorable->ToString().c_str(); stmOut2<(aPOA->reference_to_servant(aCorbaObj))) { string aFileName = string(SALOMEDS_Tool::GetNameFromPath(theObject->GetStudy()->URL())) + "_"; if(strlen(aFileName.c_str()) == 1) aFileName=""; @@ -768,11 +931,11 @@ namespace VISU{ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), false); SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true); - + // Assign an ID = 1 the the type VISU::Result theObjectID = 1; - - + + SALOMEDS::SComponent_var aSComponent = theObject->GetStudy()->FindComponent("VISU"); return aStreamFile._retn(); } @@ -780,23 +943,23 @@ namespace VISU{ CORBA::Boolean VISU_Gen_i::CanPaste(const char* theComponentName, CORBA::Long theObjectID) { // The VISU component can paste only objects copied by VISU component // and with the object type = 1 - if (strcmp(theComponentName, ComponentDataType()) != 0 || theObjectID != 1) + if (strcmp(theComponentName, ComponentDataType()) != 0 || theObjectID != 1) return false; return true; } SALOMEDS::SObject_ptr VISU_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theObject) + SALOMEDS::SObject_ptr theObject) { Mutex mt(myMutex); SALOMEDS::SObject_var aResultSO; - if (theObjectID != 1) + if (theObjectID != 1) return aResultSO._retn(); string aTmpDir = SALOMEDS_Tool::GetTmpDir(); SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), false); - + ifstream stmIn((aTmpDir + string("copy_persistent")).c_str()); stmIn.seekg(0, ios::end); int aLength = stmIn.tellg(); @@ -805,7 +968,7 @@ namespace VISU{ stmIn.read(aString, aLength); aString[aLength] = 0; myIsMultiFile = false; - + string aFileName(aTmpDir); string aBasicFileName; if(aSeq->length() > 1) { @@ -817,23 +980,23 @@ namespace VISU{ SALOMEDS::Study_var aStudy = theObject->GetStudy(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); CORBA::String_var aComponentID(aComponent->GetID()), aSObjID(theObject->GetID()); - + if (strcmp(aComponentID, aSObjID) == 0) //create the new result SObject aResultSO = aStudyBuilder->NewObject(aComponent); - else + else aResultSO = SALOMEDS::SObject::_duplicate(theObject); - + //Just for Result::Restore to find the Comment attribute :( SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment"); - + Storable* aStorable = Storable::Create(aResultSO,aFileName,aString); - + SALOMEDS::ListOfFileNames_var aSeqToRm = new SALOMEDS::ListOfFileNames; aSeqToRm->length(1); aSeqToRm[0] = "copy_persistent"; SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeqToRm.in(), true); - + anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR"); SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); CORBA::String_var anIORValue(aStorable->GetID()); diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index 3b212add..77584d64 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -5,7 +5,7 @@ // File : VISU_GEN_i.h file // Author : Alexey Petrov // Module : VISU -// $Header: +// $Header: #ifndef __VISU_GEN_I_H__ #define __VISU_GEN_I_H__ @@ -25,9 +25,9 @@ namespace VISU{ VISU_Gen_i(); VISU_Gen_i(const VISU::VISU_Gen_i &); public: - VISU_Gen_i(CORBA::ORB_ptr theORB, - PortableServer::POA_ptr thePOA, - SALOME_NamingService* theNamingService, + VISU_Gen_i(CORBA::ORB_ptr theORB, + PortableServer::POA_ptr thePOA, + SALOME_NamingService* theNamingService, QMutex* theMutex); virtual ~VISU_Gen_i(); @@ -50,13 +50,13 @@ namespace VISU{ //Create Presentation Of Submeshes virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity); - virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName, + virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFamilyName); virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName); //Create 3D collored Presentation Of Different Types - template typename TPrs3d_i::TInterface::_var_type - Prs3dOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + template typename TPrs3d_i::TInterface::_var_type + Prs3dOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true) { typedef typename TPrs3d_i::TInterface TPrs3d; @@ -75,32 +75,39 @@ namespace VISU{ return TPrs3d::_nil(); } - virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); - virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); - virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + virtual Vectors_ptr VectorsOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); - virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); - virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); - virtual CutLines_ptr CutLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + virtual CutLines_ptr CutLinesOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); - virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, + const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); //Create Digital Presentation virtual Table_ptr CreateTable(const char* theTableEntry); virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow); virtual Container_ptr CreateContainer(); virtual Animation_ptr CreateAnimation(View3D_ptr theView3d); - - virtual void DeleteResult(Result_ptr theResult) {} // apo - virtual void DeletePrs3d(Prs3d_ptr thePrs3d) {} // apo + + virtual void DeleteResult(Result_ptr theResult); + virtual void DeletePrs3d(Prs3d_ptr thePrs3d); // inherited methods from Engines::Component - virtual - Engines::TMPFile* + virtual + Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean theIsPublished, CORBA::Boolean& theIsValidScript); @@ -120,7 +127,7 @@ namespace VISU{ const char* theURL, bool isMultiFile); - virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); + virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); virtual char* ComponentDataType(); @@ -132,7 +139,7 @@ namespace VISU{ const char* aLocalPersistentID, CORBA::Boolean isMultiFile, CORBA::Boolean isASCII); - + virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR); virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject, @@ -147,4 +154,4 @@ namespace VISU{ SALOMEDS::SObject_ptr theObject); }; } -#endif +#endif diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index 00f75961..a9b943c3 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -31,6 +31,8 @@ #include "VISU_Table_i.hh" #include "VISU_ViewManager_i.hh" +#include "VisuGUI_TableDlg.h" + #include "VISU_Actor.h" #include "SALOME_Event.hxx" @@ -43,6 +45,8 @@ #include "SVTK_ViewWindow.h" #include "SVTK_ViewModel.h" +#include "SPlot2d_ViewModel.h" + #include "Plot2d_ViewFrame.h" #include "Plot2d_ViewModel.h" @@ -616,8 +620,18 @@ namespace VISU{ } else { myViewWindow = myViewManager->getActiveView(); } - //jfa tmp:myView = dynamic_cast(myViewWindow->getRightFrame()->getViewFrame()); - //jfa tmp:myView->Repaint(); + ////myView = dynamic_cast(myViewWindow->getRightFrame()->getViewFrame()); + //SPlot2d_Viewer* aView = dynamic_cast(myViewManager->getViewModel()); + //myView = aView->getActiveViewFrame(); + if (myViewWindow) { + Plot2d_ViewWindow* aPlot2dVW = dynamic_cast(myViewWindow); + if (aPlot2dVW) { + myView = aPlot2dVW->getViewFrame(); + if (myView) { + myView->Repaint(); + } + } + } return this; } @@ -806,17 +820,17 @@ namespace VISU{ class TXYPlotViewEvent: public SALOME_Event { - _PTR(Study) myStudy; - Plot2d_ViewFrame* myView; - PrsObject_ptr myPrsObj; - int myDisplaing; + SalomeApp_Application* myApplication; + Plot2d_ViewFrame* myView; + PrsObject_ptr myPrsObj; + int myDisplaing; public: - TXYPlotViewEvent(_PTR(Study) theStudy, - Plot2d_ViewFrame* theView, - PrsObject_ptr thePrsObj, - int theDisplaing) - : myStudy(theStudy), + TXYPlotViewEvent(SalomeApp_Application* theApplication, + Plot2d_ViewFrame* theView, + PrsObject_ptr thePrsObj, + int theDisplaing) + : myApplication(theApplication), myView(theView), myPrsObj(thePrsObj), myDisplaing(theDisplaing) @@ -842,9 +856,16 @@ namespace VISU{ } // is it Table ? if (Table_i* aTable = dynamic_cast(VISU::GetServant(myPrsObj).in())) { - _PTR(SObject) TableSO = myStudy->FindObjectID(aTable->GetEntry().latin1()); + _PTR(Study) aCStudy; + if (SUIT_Study* aSStudy = myApplication->activeStudy()) { + if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { + aCStudy = aStudy->studyDS(); + } + } + if (!aCStudy) return; + _PTR(SObject) TableSO = aCStudy->FindObjectID(aTable->GetEntry().latin1()); if (TableSO) { - _PTR(ChildIterator) Iter = myStudy->NewChildIterator(TableSO); + _PTR(ChildIterator) Iter = aCStudy->NewChildIterator(TableSO); for (; Iter->More(); Iter->Next()) { CORBA::Object_var childObject = VISU::ClientSObjectToObject(Iter->Value()); if (!CORBA::is_nil(childObject)) { @@ -862,17 +883,17 @@ namespace VISU{ void XYPlot_i::Display (PrsObject_ptr thePrsObj) { - //jfa tmp:ProcessVoidEvent(new TXYPlotViewEvent (myStudy,myView,thePrsObj,eDisplay)); + ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplay)); } void XYPlot_i::Erase (PrsObject_ptr thePrsObj) { - //jfa tmp:ProcessVoidEvent(new TXYPlotViewEvent (myStudy,myView,thePrsObj,eErase)); + ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eErase)); } void XYPlot_i::DisplayOnly (PrsObject_ptr thePrsObj) { - //jfa tmp:ProcessVoidEvent(new TXYPlotViewEvent (myStudy,myView,thePrsObj,eDisplayOnly)); + ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplayOnly)); } void XYPlot_i::EraseAll() @@ -893,7 +914,7 @@ namespace VISU{ //=========================================================================== TableView_i::TableView_i (SalomeApp_Application* theApplication) - : View_i(theApplication, theApplication->getViewManager("???"/*jfa tmp*/, true)) + : View_i(theApplication, NULL) { } @@ -904,18 +925,17 @@ namespace VISU{ VISU::Table_i* table = dynamic_cast(VISU::GetServant(theTable).in()); if (MYDEBUG) MESSAGE("TableView_i::Create - dynamic_cast = " << table); if (table != NULL) { - - if (SUIT_Study* aSStudy = myViewManager->study()) { + if (SUIT_Study* aSStudy = myApplication->activeStudy()) { if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { if (_PTR(Study) aCStudy = aStudy->studyDS()) { _PTR(SObject) aSObject = aCStudy->FindObjectID(table->GetObjectEntry()); if (aSObject) { - //jfa tmp:myView = new SALOMEGUI_TableDlg (QAD_Application::getDesktop(), - //jfa tmp: aSObject, - //jfa tmp: false, - //jfa tmp: SALOMEGUI_TableDlg::ttAuto, - //jfa tmp: Qt::Vertical); - //jfa tmp:myView->show(); + myView = new VisuGUI_TableDlg (myApplication->desktop(), + aSObject, + false, + VisuGUI_TableDlg::ttAuto, + Qt::Vertical); + myView->show(); return this; } } @@ -929,24 +949,24 @@ namespace VISU{ TableView_i::~TableView_i() { if(MYDEBUG) MESSAGE("TableView_i::~TableView_i"); - //jfa tmp:delete myView; + delete myView; } void TableView_i::SetTitle (const char* theTitle) { - //jfa tmp:ProcessVoidEvent(new TVoidMemFun1ArgEvent - //jfa tmp: (myView, &SALOMEGUI_TableDlg::setCaption, QString(theTitle))); + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (myView, &VisuGUI_TableDlg::setCaption, QString(theTitle))); } char* TableView_i::GetTitle() { - //jfa tmp:return CORBA::string_dup(myView->caption().latin1()); + return CORBA::string_dup(myView->caption().latin1()); return ""; } void TableView_i::Close() { - //jfa tmp:myView->close(); + myView->close(); } @@ -1009,8 +1029,7 @@ namespace VISU{ CORBA::Boolean View3D_i::SavePicture (const char* theFileName) { - //jfa tmp:return ProcessEvent(new TSavePictureEvent - //jfa tmp: (myView->getViewWidget(), theFileName)); + //jfa tmp:return ProcessEvent(new TSavePictureEvent(myView->getViewWidget(), theFileName)); return false; } diff --git a/src/VISU_I/VISU_View_i.hh b/src/VISU_I/VISU_View_i.hh index a76f0c57..4dd18f32 100644 --- a/src/VISU_I/VISU_View_i.hh +++ b/src/VISU_I/VISU_View_i.hh @@ -31,6 +31,8 @@ class QWidget; +class VisuGUI_TableDlg; + class SalomeApp_Application; class SUIT_ViewManager; @@ -46,14 +48,13 @@ namespace VISU class View_i : public virtual POA_VISU::View, public virtual Storable { - SalomeApp_Application *myApplication; - public: - QWidget* myWorkspace; - SUIT_ViewWindow* myViewWindow; + QWidget *myWorkspace; + SUIT_ViewWindow *myViewWindow; protected: - SUIT_ViewManager* myViewManager; + SalomeApp_Application *myApplication; + SUIT_ViewManager *myViewManager; View_i (SalomeApp_Application *theApplication, SUIT_ViewManager* theViewManager); @@ -169,7 +170,7 @@ namespace VISU virtual void Close(); protected: - //SALOMEGUI_TableDlg* myView; + VisuGUI_TableDlg* myView; public: virtual Storable* Create (VISU::Table_ptr theTable); }; diff --git a/src/VISU_SWIG/visu_view3d.py b/src/VISU_SWIG/visu_view3d.py index 8073e354..6300c24a 100644 --- a/src/VISU_SWIG/visu_view3d.py +++ b/src/VISU_SWIG/visu_view3d.py @@ -94,6 +94,11 @@ myView.Update(); print "myView.FitAll()" myView.FitAll(); +aWidth = myView.GetViewWidth() +print "a View Width before = ", aWidth +myView.SetViewWidth(aWidth/2) +aWidth = myView.GetViewWidth() +print "a View Width after = ", aWidth myView = myViewManager.Create3DView(); -- 2.39.2