]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Added creation of ScalarMapOnDeformedShape in batch mode
authorenk <enk@opencascade.com>
Wed, 1 Mar 2006 07:14:48 +0000 (07:14 +0000)
committerenk <enk@opencascade.com>
Wed, 1 Mar 2006 07:14:48 +0000 (07:14 +0000)
idl/VISU_Gen.idl
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_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 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 d462ab8f53324db50b3b2ad04f4ad91ebeafff4c..c9ee0e66a3ef620730f2b000c646bca08f5e333d 100644 (file)
@@ -271,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;
@@ -289,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;
 }
@@ -296,10 +305,19 @@ 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 
index 0a2ee955b9625b0a935740bc48735cce04a7a3f0..cdd1444a3589335c5f2d97d197f4842c3e22ffc3 100644 (file)
@@ -123,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();
@@ -132,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