]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
merged with current. OCC_visual_parameters_2006
authorasv <asv@opencascade.com>
Tue, 7 Mar 2006 09:36:35 +0000 (09:36 +0000)
committerasv <asv@opencascade.com>
Tue, 7 Mar 2006 09:36:35 +0000 (09:36 +0000)
20 files changed:
idl/VISU_Gen.idl
src/CONVERTOR/Makefile.in
src/CONVERTOR/VISU_MedConvertor.cxx
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_i.hh
src/OBJECT/Makefile.in
src/OBJECT/VISU_Actor.h
src/OBJECT/VISU_ActorFactory.h
src/OBJECT/VISU_BoostSignals.h [new file with mode: 0644]
src/VISU_I/Makefile.in
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_Prs3d_i.hh
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_Result_i.hh
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_SWIG/VISU_Example_01.py
src/VISU_SWIG/visu.py

index 5f7648d6150efd3482c7e5e3cb70087b95f0afd5..af87ae1cc8f97d2988ff19a83da0fca3581f2a62 100644 (file)
@@ -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)
index 9f3ea401d50c0634e88f4baddda2a358d160cbb5..36847c3406014ec5ac14ac039d1a961ab8d38408 100644 (file)
@@ -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
 
index c5e948621e77a2b588710d97d5a373bda8a587bf..12178e79cce7cec61dc3b7a2818ddef4d85fef5e 100644 (file)
@@ -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 = "<<aNbGauss<<
              "; aNbCells = "<<aNbCells<<
              endl);
-    }
+    }else
+      EXCEPTION(runtime_error,"LoadGaussMesh - Gauss Points localization error!!!");
   }
   
   aGaussMesh->myIsDone = true;
index 45dc68bcc768c0fe181b93ffa050a39ba6c49ed8..b1a29e01e354aa4be79d857546fb7186d8989243 100644 (file)
@@ -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, 
index d9c665ac349c8dd55080c6cd4ebfb27cfe96ac1b..b56e216cf74a23484dae11d8ed6a886a10f0a8ac 100644 (file)
@@ -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);
index 0499046fc70b8a03afe29b286810e74545a2da73..0a5cbee80f117cbc7b06b3ede4824e97d5f128ef 100644 (file)
@@ -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
index 96302c1e588a2eed2a6368c4d8566124c13b4c4b..09d4d4bbc41f22280a2bb6f759736e5f950e9de6 100644 (file)
 
 #include "SALOME_Actor.h"
 #include "VISU_ActorFactory.h"
+#include "VISU_BoostSignals.h"
 
 #include <string>
 #include <vtkSmartPointer.h>
-#include <boost/signals/signal1.hpp>
-#include <boost/signals/trackable.hpp>
 
 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);
index 9a9bc12f4e43e9dd71552dc4c649e2a945da0482..7395f1e13f1624dd2b7b226c2acd98bb21aa8b5f 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef VISU_ACTOR_FACTORY_H
 #define VISU_ACTOR_FACTORY_H
 
-#include <boost/signals/trackable.hpp>
+#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 (file)
index 0000000..9723e36
--- /dev/null
@@ -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 <boost/signals.hpp>
+
+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
index a8182da9408c0fa813a0485c0e962686cc4af1a4..d1cc61eec6a76e524c6619acf7a211ff5e354290 100644 (file)
@@ -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 \
index 8a691fd463f73a1af1366f1c0df165bfb158b957..5501a17ada3f85bd6b671ae9d0b84eaf7a8bc60f 100644 (file)
@@ -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();
     
index e03d772eae5123da9cbe52c9c451904bbbe6b47f..9e277a47e4f46a209bac769872a16b7b8127c7bc 100644 (file)
@@ -166,7 +166,7 @@ namespace VISU
     void
     SameAsParams(const ColoredPrs3d_i* theOrigin);
 
-    const VISU::PField&
+    virtual const VISU::PField&
     GetField() const;
 
     const std::string& 
index 078f17665aea3f0be9253693902e311590631620..91b8ef80fbdc5f9a9d214cca5d7dd3585dbea8ff 100644 (file)
@@ -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<<aPrefix<<"pass"<<endl;
 
 #ifndef COUT
index efdd55565bbb61f4428683202ad045c6bb29e1cc..c83955f5bd1c983865b51111269a06ff7371c9ed 100644 (file)
@@ -35,7 +35,6 @@
 #include "SALOME_GenericObj_i.hh"
 #include "SALOME_InteractiveObject.hxx"
 
-#include <boost/signals/signal0.hpp>
 #include <vtkSmartPointer.h>
 
 class VISU_PipeLine;
index c150b76dec54f59429c7f64d8b1ae7de48f00cd4..e911129b731b03f34f7de87a7301ed3861ee207d 100644 (file)
@@ -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),
index 24fa919b5c0de1cf704da63dc82637a934cc476d..27ec5e085c7b347531dd12f9205f55d70fc9592d 100644 (file)
 #define __VISU_RESULT_I_H__
 
 #include "VISUConfig.hh"
+#include "VISU_BoostSignals.h"
 #include "SALOME_GenericObj_i.hh"
 
-#include <boost/signals/trackable.hpp>
-#include <boost/signals/signal0.hpp>
-
 #include <gp_Dir.hxx>
 #include <vector>
 
@@ -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;
index 75430d9088eae6e4dabb2d549b29715d04e849d7..c9ee0e66a3ef620730f2b000c646bca08f5e333d 100644 (file)
@@ -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__<<endl;
   myIsColored = true;
   myColor.R = myColor.G = myColor.B = 0.5;
   VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
@@ -116,6 +117,7 @@ VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName
 
 VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
   TSuperClass::Restore(theMap);
   
   SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
@@ -138,6 +140,7 @@ VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TResto
 
 void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::ToStream:"<<__LINE__<<endl;
   TSuperClass::ToStream(theStr);
   
   Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
@@ -161,15 +164,18 @@ void
 VISU::ScalarMapOnDeformedShape_i
 ::SameAs(const Prs3d_i* theOrigin)
 {
-  int theScalarIter = GetScalarIteration();
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SameAs:"<<__LINE__<<endl;
+  int theScalarIter = this->GetScalarIteration();
+  string theScalarMeshName = this->GetScalarMeshName();
+  string theScalarFieldName = this->GetScalarFieldName();
+  if(MYDEBUG) cout << "SameAs:"<<endl
+                  << "\t"<<theScalarIter<<":"<<theScalarMeshName.c_str()<<":"<<theScalarFieldName.c_str()<<endl;
 
   TSuperClass::SameAs(theOrigin);
 
   if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
     ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(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__<<endl;
   if(!myPipeLine)
     myPipeLine = VISU_ScalarMapOnDeformedShapePL::New();
   
@@ -218,6 +225,7 @@ void VISU::ScalarMapOnDeformedShape_i::DoHook()
 
 VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
 {
+  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
   VISU_Actor* anActor = TSuperClass::CreateActor(theIO);
   anActor->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__<<endl;
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(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__<<endl;
+  if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
+  if(MYDEBUG) cout << "\ttheIteration="<<theIteration<<endl;
+  myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
+  TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
+                                                             theEntity,
+                                                             theFieldName,
+                                                             theIteration)->GetVTKOutput();
   if (myScalarMapOnDeformedShapePL){
-    myField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
-    TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
-                                                               theEntity,
-                                                               theFieldName,
-                                                               theIteration)->GetVTKOutput();
     myScalarMapOnDeformedShapePL->SetScalars(aOut);
   }
   this->SetScalarMeshName(theMeshName);
@@ -259,6 +271,13 @@ void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
   this->SetScalarEntity(theEntity);
 }
 
+void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
+                                                     const char* theFieldName,
+                                                     const long  theIteration,
+                                                     const VISU::Entity  theEntity)
+{
+  this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
+}
 
 void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
   myScalarMeshName = theName;
@@ -277,6 +296,8 @@ std::string VISU::ScalarMapOnDeformedShape_i::GetScalarFieldName(){
 void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
   myScalarIteration = theValue;
 }
+
+
 int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
   return myScalarIteration;
 }
@@ -284,6 +305,22 @@ int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
 void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
   myScalarEntity = theValue;
 }
+
 VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
   return myScalarEntity;
 }
+
+void VISU::ScalarMapOnDeformedShape_i::SetScalarEEntity(const VISU::Entity theValue){
+  myScalarEntity = VISU::TEntity(theValue);
+}
+
+VISU::Entity VISU::ScalarMapOnDeformedShape_i::GetScalarEEntity(){
+  return VISU::Entity(myScalarEntity);
+}
+
+const VISU::PField&
+VISU::ScalarMapOnDeformedShape_i
+::GetField() const 
+{ 
+  return myScalarField;
+}
index b7433720fc83292ecdd45f07bebc6c3a9e7b6270..cdd1444a3589335c5f2d97d197f4842c3e22ffc3 100644 (file)
@@ -78,6 +78,9 @@ namespace VISU{
     void
     SameAs(const Prs3d_i* theOrigin);
 
+    virtual const VISU::PField&
+    GetField() const;
+
     VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
    
   protected:
@@ -93,6 +96,7 @@ namespace VISU{
     std::string myScalarFieldName;
     VISU::TEntity myScalarEntity;
     int myScalarIteration;
+    PField myScalarField;
 
   public:
     static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
@@ -119,6 +123,11 @@ namespace VISU{
                                const char* theFieldName,
                                const int   theIteration,
                                const VISU::TEntity  theEntity);
+    
+    virtual void SetScalarField(const char* theMeshName,
+                               const char* theFieldName,
+                               const long  theIteration,
+                               const VISU::Entity  theEntity);
 
     virtual void SetScalarFieldName(const char* theName);
     virtual std::string GetScalarFieldName();
@@ -128,6 +137,8 @@ namespace VISU{
     virtual std::string GetScalarMeshName();
     virtual void SetScalarEntity(const VISU::TEntity theValue);
     virtual VISU::TEntity GetScalarEntity();
+    virtual void SetScalarEEntity(const VISU::Entity theValue);
+    virtual VISU::Entity GetScalarEEntity();
   };
 }
 #endif
index d8c19b65f00c0ba10e3fa9f71e2a975b7c2d34f9..e9727b81a585e89618426012b3b9415003e545bd 100644 (file)
@@ -80,6 +80,13 @@ cutplanes.SetNbPlanes(30)
 cutplanes.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
 myView.DisplayOnly(cutplanes)
 
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
+if scalarmapondefshape is None : print "Error"
+else : print "OK"
+scalarmapondefshape.SetScalarField(myMeshName,'pression',2,myCellEntity);
+myView.DisplayOnly(scalarmapondefshape)
+
 #%====================Stage4: Opening a new study and Med file import====================%
 
 # Opening a new study tempoparily commented due to a problem
@@ -131,6 +138,11 @@ else : print "OK"
 cutplanes1.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
 myView1.DisplayOnly(cutplanes1)
 
+print "Creating Scalar Map On Deformed Shape.......",
+scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
+if scalarmapondefshape1 is None : print "Error"
+else : print "OK"
+myView1.DisplayOnly(scalarmapondefshape1)
 #%====================Stage6: Object browser popup====================%
 
 print "**** Stage6: Object browser popup"
index daadf7aa4f935a60d91c2587847a18132f5e3518..4b7b442000772cb3e6bff4e3e3274f5147ae8f42 100644 (file)
@@ -602,6 +602,23 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                             aPrsObj.RemoveFromStudy()
                                         else :
                                             aVISUObjList.append(aPrsObj)
+
+                                if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
+                                    print "          Creating ScalarMapOnDeformedShapeOnField",
+                                    aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+                                    if aPrsObj is None : print "Error"
+                                    else :
+                                        print ",OK"
+                                        theView.DisplayOnly(aPrsObj)
+                                        theView.FitAll()
+                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+                                        aPictureName = re.sub("\s+","_", aPictureName)
+                                        theView.SavePicture(aPictureName)
+                                        if theIsAutoDelete :
+                                            aPrsObj.RemoveFromStudy()
+                                        else :
+                                            aVISUObjList.append(aPrsObj)
+                                
     return aVISUObjList