From a0abcdadb72638edd3e22ece5105e0bc8dd04b43 Mon Sep 17 00:00:00 2001 From: asv Date: Tue, 7 Mar 2006 09:36:35 +0000 Subject: [PATCH] merged with current. --- idl/VISU_Gen.idl | 22 ++++++++ src/CONVERTOR/Makefile.in | 2 +- src/CONVERTOR/VISU_MedConvertor.cxx | 5 +- src/ENGINE/VISU_Engine_i.cc | 8 +++ src/ENGINE/VISU_Engine_i.hh | 2 + src/OBJECT/Makefile.in | 3 +- src/OBJECT/VISU_Actor.h | 5 +- src/OBJECT/VISU_ActorFactory.h | 4 +- src/OBJECT/VISU_BoostSignals.h | 56 +++++++++++++++++++ src/VISU_I/Makefile.in | 5 +- src/VISU_I/VISU_ColoredPrs3d_i.cc | 2 +- src/VISU_I/VISU_ColoredPrs3d_i.hh | 2 +- src/VISU_I/VISU_DumpPython.cc | 9 --- src/VISU_I/VISU_Prs3d_i.hh | 1 - src/VISU_I/VISU_Result_i.cc | 4 +- src/VISU_I/VISU_Result_i.hh | 6 +- src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc | 53 +++++++++++++++--- src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh | 11 ++++ src/VISU_SWIG/VISU_Example_01.py | 12 ++++ src/VISU_SWIG/visu.py | 17 ++++++ 20 files changed, 191 insertions(+), 38 deletions(-) create mode 100644 src/OBJECT/VISU_BoostSignals.h diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index 5f7648d6..af87ae1c 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -599,6 +599,16 @@ module VISU { */ double GetScale(); + /*! + * Sets the scalar field + * \param theMeshName - mesh name + * \param theFieldName - the name of scalar field + * \param theIteration - the iteration number for scalar field + * \param theEntity - entity of scalar field + */ + void SetScalarField(in string theMeshName,in string theFieldName, + in long theIteration,in Entity theEntity); + }; //------------------------------------------------------- /*! @@ -1450,6 +1460,18 @@ module VISU { in Entity theEntity, in string theFieldName, in double theIteration); + /*! + * Creates a deformed shape presentation. + * \param theResult Data generated in other sources. (MED object or file) + * \param theMeshName One of the meshes presented in MED file + * \param theEntity Type of entity where the field is defined + * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector. + * \param theIteration Number of iteration on the field + */ + ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName, + in Entity theEntity, in string theFieldName, + in double theIteration); + /*! * Creates a vector presentation. * \param theResult Data generated in other sources. (MED object or file) diff --git a/src/CONVERTOR/Makefile.in b/src/CONVERTOR/Makefile.in index 9f3ea401..36847c34 100644 --- a/src/CONVERTOR/Makefile.in +++ b/src/CONVERTOR/Makefile.in @@ -64,7 +64,7 @@ CPPFLAGS+= -ftemplate-depth-32 $(VTK_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \ $(BOOST_CPPFLAGS) LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) \ - $(BOOST_LIBS) -lboost_thread${BOOST_LIBTHREAD} \ + $(BOOST_LIBS) -lboost_thread${BOOST_LIBSUFFIX} \ -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper \ -L${GUI_ROOT_DIR}/lib/salome -lVTKViewer diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index c5e94862..12178e79 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -963,7 +963,7 @@ extern "C" VISU_Convertor* CreateConvertor(const string& theFileName) { - if(MED::PWrapper aMed = MED::CrWrapper(theFileName)) + if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true)) return new VISU_MedConvertor(theFileName); return NULL; } @@ -2171,7 +2171,8 @@ LoadGaussMesh(const MED::PWrapper& theMed, "; aNbGauss = "<myIsDone = true; diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 45dc68bc..b1a29e01 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -236,6 +236,14 @@ namespace VISU{ return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); } + ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration); + } Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, const char* theMeshName, diff --git a/src/ENGINE/VISU_Engine_i.hh b/src/ENGINE/VISU_Engine_i.hh index d9c665ac..b56e216c 100644 --- a/src/ENGINE/VISU_Engine_i.hh +++ b/src/ENGINE/VISU_Engine_i.hh @@ -86,6 +86,8 @@ namespace VISU{ const char* theFieldName, CORBA::Double theIteration); virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); + virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField(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); diff --git a/src/OBJECT/Makefile.in b/src/OBJECT/Makefile.in index 0499046f..0a5cbee8 100644 --- a/src/OBJECT/Makefile.in +++ b/src/OBJECT/Makefile.in @@ -33,6 +33,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl @COMMENCE@ EXPORT_HEADERS = \ + VISU_BoostSignals.h \ VISU_ActorFactory.h \ VISU_GaussPtsSettings.h \ VISU_GaussPtsActorFactory.h \ @@ -76,7 +77,7 @@ LDFLAGS+= \ -L${KERNEL_ROOT_DIR}/lib/salome LIBS+= \ - -lboost_signals${BOOST_LIBTHREAD} \ + -lboost_signals${BOOST_LIBSUFFIX} \ -lSalomeObject \ -lVisuPipeLine \ -lSVTK diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index 96302c1e..09d4d4bb 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -31,11 +31,10 @@ #include "SALOME_Actor.h" #include "VISU_ActorFactory.h" +#include "VISU_BoostSignals.h" #include #include -#include -#include class vtkProp; class vtkProperty; @@ -60,7 +59,7 @@ namespace VISU //---------------------------------------------------------------------------- class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor, - public boost::BOOST_SIGNALS_NAMESPACE::trackable + public boost::signalslib::trackable { public: vtkTypeMacro(VISU_Actor,SALOME_Actor); diff --git a/src/OBJECT/VISU_ActorFactory.h b/src/OBJECT/VISU_ActorFactory.h index 9a9bc12f..7395f1e1 100644 --- a/src/OBJECT/VISU_ActorFactory.h +++ b/src/OBJECT/VISU_ActorFactory.h @@ -29,7 +29,7 @@ #ifndef VISU_ACTOR_FACTORY_H #define VISU_ACTOR_FACTORY_H -#include +#include "VISU_BoostSignals.h" class VISU_Actor; @@ -46,7 +46,7 @@ namespace VISU This interface inherits from boost::bsignals::trackable in order to provide automatic diconnection from defined signals if the object is destroyed. */ - struct TActorFactory: public virtual boost::BOOST_SIGNALS_NAMESPACE::trackable + struct TActorFactory: public virtual boost::signalslib::trackable { //! Just to make this class virtual virtual diff --git a/src/OBJECT/VISU_BoostSignals.h b/src/OBJECT/VISU_BoostSignals.h new file mode 100644 index 00000000..9723e36b --- /dev/null +++ b/src/OBJECT/VISU_BoostSignals.h @@ -0,0 +1,56 @@ +// 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 +// +// +// +// File : +// Author : +// Module : VISU +// $Header$ + +#ifndef VISU_BOOST_SIGNALS_H +#define VISU_BOOST_SIGNALS_H + +#ifdef signals +# ifndef QOBJECTDEFS_H +# error "Cannot recover the siganlas macro definition" +# else +# define EXTERNAL_SIGNALS_DEFINITION +# undef signals +# endif +#endif + +#include + +namespace boost { + namespace signalslib = BOOST_SIGNALS_NAMESPACE; +} + +#ifdef EXTERNAL_SIGNALS_DEFINITION +# undef EXTERNAL_SIGNALS_DEFINITION +# ifdef QT_MOC_CPP +# define signals signals +# else +# define signals protected +# endif +#endif + +#endif //VISU_BOOST_SIGNALS_H diff --git a/src/VISU_I/Makefile.in b/src/VISU_I/Makefile.in index a8182da9..d1cc61ee 100644 --- a/src/VISU_I/Makefile.in +++ b/src/VISU_I/Makefile.in @@ -112,7 +112,7 @@ LDFLAGS += \ -L${GUI_ROOT_DIR}/lib/salome \ -L${MED_ROOT_DIR}/lib/salome -LIBS+= -lboost_signals${BOOST_LIBTHREAD} \ +LIBS+= -lboost_signals${BOOST_LIBSUFFIX} \ -lSalomeHDFPersist \ -lSalomeGenericObj \ -lSalomeContainer \ @@ -141,8 +141,7 @@ LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \ -lSalomeNotification \ -lSALOMELocalTrace \ -lSalomeResourcesManager \ - -lSalomeDS \ - -lSalomeDSImpl \ + -lSalomeDSClient \ -lSalomeObject \ -lqtx \ -lsuit \ diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 8a691fd4..5501a17a 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -107,7 +107,7 @@ VISU::ColoredPrs3d_i myField = anOrigin->GetField(); myMeshName = myField->myMeshName; - myEntity = myField->myEntity; + myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity; myIteration = anOrigin->GetIteration(); myFieldName = anOrigin->GetFieldName(); diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index e03d772e..9e277a47 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -166,7 +166,7 @@ namespace VISU void SameAsParams(const ColoredPrs3d_i* theOrigin); - const VISU::PField& + virtual const VISU::PField& GetField() const; const std::string& diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 078f1766..91b8ef80 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -1170,15 +1170,6 @@ namespace VISU{ VISU::DumpChildrenToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix); VISU::DumpContainersToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix); - //Output the script that sets up the visul parameters. - if(theIsPublished) { - char* script = aStudy->GetDefaultScript("Post-Pro", aPrefix.c_str()); - if(script && strlen(script) > 0) { - aStr << script; - CORBA::string_free(script); - } - } - aStr< #include class VISU_PipeLine; diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index c150b76d..e911129b 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -796,8 +796,8 @@ VISU::Result_i mySourceId(theSourceId), myIsBuildImmediately(theIsBuildImmediately), myIsBuildFields(theIsBuildFields), - myIsBuildGroups(theIsBuildMinMax), - myIsBuildMinMax(theIsBuildGroups), + myIsBuildMinMax(theIsBuildMinMax), + myIsBuildGroups(theIsBuildGroups), myIsEntitiesDone(false), myIsFieldsDone(false), myIsGroupsDone(false), diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh index 24fa919b..27ec5e08 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -28,11 +28,9 @@ #define __VISU_RESULT_I_H__ #include "VISUConfig.hh" +#include "VISU_BoostSignals.h" #include "SALOME_GenericObj_i.hh" -#include -#include - #include #include @@ -41,7 +39,7 @@ class VISU_Convertor; namespace VISU { //---------------------------------------------------------------------------- - class MinMaxCunsomer: public virtual boost::BOOST_SIGNALS_NAMESPACE::trackable + class MinMaxCunsomer: public virtual boost::signalslib::trackable { protected: bool myMinMaxIsInitilized; diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index 75430d90..c9ee0e66 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -102,6 +102,7 @@ ScalarMapOnDeformedShape_i(Result_i* theResult, VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, int theIteration) { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<GetScalarIteration(); + string theScalarMeshName = this->GetScalarMeshName(); + string theScalarFieldName = this->GetScalarFieldName(); + if(MYDEBUG) cout << "SameAs:"<(theOrigin)){ ScalarMapOnDeformedShape_i* anOrigin = const_cast(aPrs3d); - // increment the scalar iteration for using in VISU_TimeAnimation class implementation. - int anOriginScalarIter = anOrigin->GetScalarIteration(); this->SetScalarField(anOrigin->GetScalarMeshName().c_str(), anOrigin->GetScalarFieldName().c_str(), theScalarIter, @@ -207,6 +213,7 @@ CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){ void VISU::ScalarMapOnDeformedShape_i::DoHook() { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<SetRepresentation(2); anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); @@ -227,6 +235,7 @@ VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_In void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<(theActor)){ if(IsColored()){ anActor->SetBarVisibility(true); @@ -245,12 +254,15 @@ void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName, const int theIteration, const VISU::TEntity theEntity) { + if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<