]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To customize VISU::ScalarMap_i::Build method
authorapo <apo@opencascade.com>
Fri, 26 Aug 2005 08:28:05 +0000 (08:28 +0000)
committerapo <apo@opencascade.com>
Fri, 26 Aug 2005 08:28:05 +0000 (08:28 +0000)
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CorbaMedConvertor.hxx
src/VISU_I/VISU_GaussPoints_i.cc

index ab518de3823d2ee665ade0b27bad6f5cd87da18c..2426356d8340c1f346a4a7b68539de1b725f4cad 100644 (file)
@@ -39,6 +39,8 @@
 #include "MED_SharedPtr.hxx"
 #include "MED_Vector.hxx"
 
+#include <vtkSystemIncludes.h>
+
 class vtkUnstructuredGrid;
 
 namespace VISU
@@ -83,6 +85,12 @@ namespace VISU
   struct TValForTime;
   typedef SharedPtr<TValForTime> PValForTime;
 
+  struct TMeshValForTime;
+  typedef SharedPtr<TMeshValForTime> PMeshValForTime;
+
+  struct TGaussPtsValForTime;
+  typedef SharedPtr<TGaussPtsValForTime> PGaussPtsValForTime;
+
   typedef std::string TName;
 
   typedef TVector<TName> TNames;
@@ -152,11 +160,14 @@ namespace VISU
   struct TGaussSubMesh: virtual TBaseStructure
   {
     PSubProfile mySubProfile;
-    PGauss myGauss;
   };
 
   
   //---------------------------------------------------------------
+  typedef vtkIdType TCellID;
+  typedef vtkIdType TLocalPntID;
+  typedef std::pair<TCellID,TLocalPntID> TGaussPointID;
+
   struct TGaussMesh: virtual TBaseStructure
   {};
 
@@ -205,7 +216,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  typedef std::map<int,PValForTime> TValField;
+  typedef std::map<int,PGaussPtsValForTime> TValField;
 
   struct TField: virtual TIntId
   {
@@ -231,11 +242,23 @@ namespace VISU
     TName myMeshName;
     TName myFieldName;
     TTime myTime;
-    
+  };
+
+
+  //---------------------------------------------------------------
+  struct TMeshValForTime: virtual TValForTime
+  {
     PProfile myProfile;
+  };
+
+
+  struct TGaussPtsValForTime: virtual TValForTime
+  {
     PGaussMesh myGaussMesh;
   };
 
+
+  //---------------------------------------------------------------
   PFamily
   FindFamily(VISU::PMesh theMesh, 
             const std::string& theFamilyName);
@@ -315,6 +338,13 @@ public:
                     const std::string& theFieldName,
                     int theStampsNum) = 0;
    
+  virtual
+  TOutput* 
+  GetGaussPointsOnMesh(const std::string& theMeshName, 
+                      const VISU::TEntity& theEntity,
+                      const std::string& theFieldName,
+                      int theStampsNum) = 0;
+   
   virtual 
   float
   GetTimeStampSize(const std::string& theMeshName, 
index 1abe7336076f14c640f16213a0feae96f314b25a..4f96c751a5ec555f9778edc712daf26756af6ef0 100644 (file)
@@ -57,7 +57,7 @@ static float ERR_SIZE_CALC = 1.00;
 static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 static int MYDEBUGWITHFILES = 0;
 #else
 static int MYDEBUG = 0;
@@ -213,18 +213,29 @@ namespace VISU
     myStatus(eNone)
   {}
   
+  TGaussPointID
+  TGaussSubMeshImpl
+  ::GetObjID(vtkIdType theID) const
+  {
+    TCellID aCellID = theID / myGauss->myNbPoints;
+    TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
+    
+    return TGaussPointID(aCellID,aLocalPntID);
+  }
 
   //---------------------------------------------------------------
   bool
   operator<(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight)
   {
-    PGaussImpl aLeft(theLeft->myGauss), aRight(theRight->myGauss);
+    PGaussSubMeshImpl aLeft(theLeft), aRight(theRight);
+    const PGaussImpl& aGaussLeft = aLeft->myGauss;
+    const PGaussImpl& aGaussRight = aRight->myGauss;
 
-    if(aLeft->myGeom != aRight->myGeom)
-      return aLeft->myGeom < aRight->myGeom;
+    if(aGaussLeft->myGeom != aGaussRight->myGeom)
+      return aGaussLeft->myGeom < aGaussRight->myGeom;
 
-    if(aLeft->myName != aRight->myName)
-      return aLeft->myName < aRight->myName;
+    if(aGaussLeft->myName != aGaussRight->myName)
+      return aGaussLeft->myName < aGaussRight->myName;
 
     return theLeft->mySubProfile < theRight->mySubProfile;
   }
@@ -303,7 +314,7 @@ namespace VISU
   ::GetCompValueSliceArr(vtkIdType theElemId) const
   {
     TCValueSliceArr aValueSliceArr(myNbComp);
-    vtkIdType anId = theElemId*myStep;
+    vtkIdType anId = theElemId;
     for(vtkIdType aCompId = 0; aCompId < myNbComp; aCompId++){
       aValueSliceArr[aCompId] =
        TCValueSlice(myValue,std::slice(anId,myNbGauss,myNbGauss));
@@ -349,12 +360,18 @@ namespace VISU
   TValForTimeImpl
   ::GetNbGauss(vtkIdType theGeom) const
   {
-    PGaussMeshImpl aGaussMesh = myGaussMesh;
-    if(aGaussMesh){
+    return myNbGauss;
+  }
+  
+  int
+  TGaussPtsValForTimeImpl
+  ::GetNbGauss(vtkIdType theGeom) const
+  {
+    if(PGaussMeshImpl aGaussMesh = myGaussMesh){
       const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
       TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.find(theGeom);
       if(anIter != aGeom2GaussSubMesh.end()){
-       PGaussSubMesh aGaussSubMesh = anIter->second;
+       PGaussSubMeshImpl aGaussSubMesh = anIter->second;
        PGaussImpl aGauss = aGaussSubMesh->myGauss;
        return aGauss->myNbPoints;
       }
@@ -938,7 +955,7 @@ namespace
   void 
   GetTimeStampOnGaussMesh(const TVTKSource& theSource,
                          const PFieldImpl& theField, 
-                         const PValForTimeImpl& theValForTime)
+                         const PGaussPtsValForTimeImpl& theValForTime)
   {
     int aNbTuples = theSource->GetNumberOfPoints();
     std::string aFieldName = GenerateFieldName(theField,theValForTime);
@@ -1320,16 +1337,17 @@ VISU_Convertor_impl
   PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
   PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
   PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindTimeStamp);
-  PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+  PGaussPtsValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
 
   //Main part of code
-  const TVTKSource& aSource = aValForTime->GetSource();
+  TSource& aMeshSource = aValForTime->myMeshSource;
+  const TVTKSource& aSource = aMeshSource.GetSource();
 #ifndef _DEXCEPT_
   try{
 #endif
-    if(!aValForTime->myIsVTKDone){
-      LoadFieldOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
+    if(!aMeshSource.myIsVTKDone){
+      LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
 
       try{
        LoadMeshOnEntity(aVTKMeshOnEntity);
@@ -1344,24 +1362,92 @@ VISU_Convertor_impl
       GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);
       
       PProfileImpl aProfile = aValForTime->myProfile;
+      GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile);
+      
+      const TVTKAppendFilter& anAppendFilter = aProfile->GetFilter();
+      aSource->ShallowCopy(anAppendFilter->GetOutput());
+      GetTimeStampOnProfile(aSource,aField,aValForTime);
+
+      aMeshSource.myIsVTKDone = true;
+
+      if(MYDEBUGWITHFILES){
+       string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
+       string aFieldName = QString(theFieldName.c_str()).simplifyWhiteSpace().latin1();
+       string aPrefix = string("/users/")+getenv("USER")+"/"+getenv("USER")+"-";
+       string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) + 
+         aFieldName + dtos("-%d",theStampsNum) + "-Conv.vtk";
+       VISU::WriteToFile(aSource.GetPointer(),aFileName);
+      }
+      if(MYVTKDEBUG){
+       GetTimeStampSize(theMeshName,theEntity,theFieldName,theStampsNum);
+       aSource->Update();
+       if(theEntity == VISU::NODE_ENTITY)
+         BEGMSG(MYVTKDEBUG,"GetPointData() = "<<float(aSource->GetPointData()->GetActualMemorySize()*1000)<<endl);
+       else
+         BEGMSG(MYVTKDEBUG,"GetCellData() = "<<float(aSource->GetCellData()->GetActualMemorySize()*1000)<<endl);
+       BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<float(aSource->GetActualMemorySize()*1000)<<endl);
+      }
+    }
+#ifndef _DEXCEPT_
+  }catch(std::exception& exc){
+    throw;
+  }catch(...){
+    throw;
+  }
+#endif
+
+  return aSource.GetPointer();
+}
+
+
+//---------------------------------------------------------------
+VISU_Convertor::TOutput* 
+VISU_Convertor_impl
+::GetGaussPointsOnMesh(const string& theMeshName, 
+                      const VISU::TEntity& theEntity,
+                      const string& theFieldName,
+                      int theStampsNum)
+{
+  INITMSG(MYDEBUG,"GetGaussPointsOnMesh"<<
+         "; theMeshName = '"<<theMeshName<<"'"<<
+         "; theEntity = "<<theEntity<<
+         "; theFieldName = '"<<theFieldName<<"'"<<
+         "; theStampsNum = "<<theStampsNum<<
+         endl);
+
+  //Cheching possibility do the query
+  TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
+                                               theEntity,
+                                               theFieldName,
+                                               theStampsNum);
+  
+  PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
+  PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
+  PMeshOnEntityImpl aVTKMeshOnEntity = aMeshOnEntity;
+  PGaussPtsValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+  PFieldImpl aField = boost::get<3>(aFindTimeStamp);
+
+  //Main part of code
+  TSource& aGaussPtsSource = aValForTime->myGaussPtsSource;
+  const TVTKSource& aSource = aGaussPtsSource.GetSource();
+#ifndef _DEXCEPT_
+  try{
+#endif
+    if(!aGaussPtsSource.myIsVTKDone){
+      LoadValForTimeOnGaussPts(aMesh,aMeshOnEntity,aField,aValForTime);
+      
+      GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);
+      
       PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
       INITMSG(MYDEBUG,"aGaussMesh = "<<bool(aGaussMesh)<<endl);
-      if(!aGaussMesh){
-       GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile);
-     
-       const TVTKAppendFilter& anAppendFilter = aProfile->GetFilter();
-       aSource->ShallowCopy(anAppendFilter->GetOutput());
-       GetTimeStampOnProfile(aSource,aField,aValForTime);
-      }else{
-       const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
-       GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
-     
-       const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
-       aSource->ShallowCopy(anAppendFilter->GetOutput());
-       GetTimeStampOnGaussMesh(aSource,aField,aValForTime);
-      }
+      const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
+      GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
+      
+      const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
+      aSource->ShallowCopy(anAppendFilter->GetOutput());
+      GetTimeStampOnGaussMesh(aSource,aField,aValForTime);
 
-      aValForTime->myIsVTKDone = true;
+      aGaussPtsSource.myIsVTKDone = true;
 
       if(MYDEBUGWITHFILES){
        string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
@@ -1653,7 +1739,7 @@ VISU_Convertor_impl
   PMeshImpl aMesh = boost::get<0>(aFindField);
   PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindField);
   PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindField);
-  PValForTimeImpl aValForTime = aValFieldIter->second;
+  PGaussPtsValForTimeImpl aValForTime = aValFieldIter->second;
 
   return TFindTimeStamp(aMesh,
                        aMeshOnEntity,
index ae52155ed08dc5636e75076765582298db787917..1bb1f44348feef67920e31791a38bf1f9fb8a6c7 100644 (file)
@@ -9,8 +9,6 @@
 #ifndef VISU_Convertor_impl_HeaderFile
 #define VISU_Convertor_impl_HeaderFile
 
-#include <vtkSystemIncludes.h>
-
 #include <vtkSmartPointer.h>
 
 #include <boost/tuple/tuple.hpp>
@@ -195,14 +193,12 @@ namespace VISU
     TGaussSubMeshImpl();
 
     virtual
-    vtkIdType
-    GetObjID(vtkIdType theID) const
-    {
-      return theID;
-    }
+    TGaussPointID
+    GetObjID(vtkIdType theID) const;
     
-    TPointCoords myPointCoords;
+    PGaussImpl myGauss;
     ESubMeshStatus myStatus;
+    TPointCoords myPointCoords;
   };
   typedef SharedPtr<TGaussSubMeshImpl> PGaussSubMeshImpl;
 
@@ -300,7 +296,7 @@ namespace VISU
   //---------------------------------------------------------------
   typedef std::map<vtkIdType,TMeshValue> TGeom2Value;
 
-  struct TValForTimeImpl: virtual TValForTime, virtual TSource
+  struct TValForTimeImpl: virtual TValForTime
   {
     TGeom2Value myGeom2Value;
 
@@ -312,11 +308,33 @@ namespace VISU
 
     int myNbGauss;
 
+    virtual
     int
     GetNbGauss(vtkIdType theGeom) const;
   };
   typedef SharedPtr<TValForTimeImpl> PValForTimeImpl;
 
+
+  //---------------------------------------------------------------
+  struct TMeshValForTimeImpl: virtual TMeshValForTime, virtual TValForTimeImpl
+  {
+    TSource myMeshSource;
+  };
+
+
+  //---------------------------------------------------------------
+  struct TGaussPtsValForTimeImpl: virtual TGaussPtsValForTime, virtual TMeshValForTimeImpl
+  {
+    TSource myGaussPtsSource;
+
+    virtual
+    int
+    GetNbGauss(vtkIdType theGeom) const;
+  };
+  typedef SharedPtr<TGaussPtsValForTimeImpl> PGaussPtsValForTimeImpl;
+
+
+  //---------------------------------------------------------------
   vtkIdType
   VTKGeom2NbNodes(vtkIdType theGeom);
 }
@@ -393,6 +411,13 @@ public:
                     const std::string& theFieldName,
                     int theStampsNum);
 
+  virtual
+  TOutput* 
+  GetGaussPointsOnMesh(const std::string& theMeshName, 
+                      const VISU::TEntity& theEntity,
+                      const std::string& theFieldName,
+                      int theStampsNum);
+
 protected:
   VISU::PMeshImpl 
   FindMesh(const std::string& theMeshName);
@@ -421,7 +446,7 @@ protected:
                       VISU::PMeshOnEntityImpl,
                       VISU::PMeshOnEntityImpl,
                       VISU::PFieldImpl,
-                      VISU::PValForTimeImpl> TFindTimeStamp;
+                      VISU::PGaussPtsValForTimeImpl> TFindTimeStamp;
   TFindTimeStamp
   FindTimeStamp(const std::string& theMeshName, 
                const VISU::TEntity& theEntity, 
@@ -441,10 +466,17 @@ protected:
 
   virtual 
   int
-  LoadFieldOnMesh(VISU::PMeshImpl theMesh, 
-                 VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                 VISU::PFieldImpl theField, 
-                 VISU::PValForTimeImpl theValForTime) = 0;
+  LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, 
+                      VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                      VISU::PFieldImpl theField, 
+                      VISU::PValForTimeImpl theValForTime) = 0;
+
+  virtual 
+  int
+  LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh, 
+                          VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                          VISU::PFieldImpl theField, 
+                          VISU::PValForTimeImpl theValForTime) = 0;
 };
 
 #endif
index 358bad43e415a9fd4706d96760afec2a5d60b9b6..f0ec57c02a2214d7000d207a37cdcc3a653f57f2 100644 (file)
@@ -47,7 +47,7 @@ using MED::TFloat;
 using MED::EBooleen;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 static int MYVALUEDEBUG = 0;
 static int MY_FAMILY_DEBUG = 0;
 static int MY_GROUP_DEBUG = 0;
@@ -725,6 +725,21 @@ namespace
     }
   }
 
+  TGaussPointID
+  TMEDGaussSubMesh
+  ::GetObjID(vtkIdType theID) const
+  {
+    TCellID aCellID = theID / myGauss->myNbPoints;
+    TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
+    
+    if(myIsElemNum)
+      aCellID = myElemNum[theID];
+    else
+      aCellID = theID;
+
+    return TGaussPointID(aCellID,aLocalPntID);
+  }
+  
 }
 
 
@@ -880,15 +895,32 @@ VISU_MedConvertor
 //---------------------------------------------------------------
 int
 VISU_MedConvertor
-::LoadFieldOnMesh(VISU::PMeshImpl theMesh, 
-                 VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                 VISU::PFieldImpl theField, 
-                 VISU::PValForTimeImpl theValForTime)
+::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, 
+                      VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                      VISU::PFieldImpl theField, 
+                      VISU::PValForTimeImpl theValForTime)
 {
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
   int isPointsUpdated = LoadPoints(aMed,theMesh);
   int isCellsOnEntityUpdated = LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
-  int isFieldUpdated = LoadField(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
+  int isFieldUpdated = LoadValForTimeOnMesh(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
+  
+  return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
+}
+
+
+//---------------------------------------------------------------
+int
+VISU_MedConvertor
+::LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh, 
+                          VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                          VISU::PFieldImpl theField, 
+                          VISU::PValForTimeImpl theValForTime)
+{
+  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
+  int isPointsUpdated = LoadPoints(aMed,theMesh);
+  int isCellsOnEntityUpdated = LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
+  int isFieldUpdated = LoadValForTimeOnGaussPts(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
   
   return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
 }
@@ -1338,17 +1370,18 @@ LoadGaussMesh(const MED::PWrapper& theMed,
 
 //---------------------------------------------------------------
 int 
-VISU_MedConvertor
-::LoadField(const MED::PWrapper& theMed,
-           VISU::PMEDMesh theMesh,
-           VISU::PMEDMeshOnEntity theMeshOnEntity,
-           VISU::PMEDField theField, 
-           VISU::PMEDValForTime theValForTime)
+LoadValForTime(const MED::PWrapper& theMed,
+              VISU::PMEDMesh theMesh,
+              VISU::PMEDMeshOnEntity theMeshOnEntity,
+              VISU::PMEDField theField, 
+              VISU::PMEDValForTime theValForTime,
+              bool theIsGauss)
 {
-  INITMSG(MYDEBUG,"LoadField"<<endl);
+  INITMSG(MYDEBUG,"LoadValForTime - theIsGauss = "<<theIsGauss<<endl);
 
   //Check on loading already done
-  if(theValForTime->myIsDone) 
+  TSource& aMeshSource = theValForTime->myMeshSource;
+  if(aMeshSource.myIsDone) 
     return 0;
 
   //Main part of code
@@ -1382,11 +1415,12 @@ VISU_MedConvertor
              theValForTime,
              theMeshOnEntity);
   
-  LoadGaussMesh(theMed,
-               theMesh,
-               aTimeStampVal,
-               theValForTime,
-               theMeshOnEntity);
+  if(theIsGauss)
+    LoadGaussMesh(theMed,
+                 theMesh,
+                 aTimeStampVal,
+                 theValForTime,
+                 theMeshOnEntity);
   
   PMEDProfile aProfile = theValForTime->myProfile;
   TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
@@ -1445,7 +1479,33 @@ VISU_MedConvertor
     }
   }
 
-  theValForTime->myIsDone = true;
+  aMeshSource.myIsDone = true;
 
   return 1; 
 }
+
+
+//---------------------------------------------------------------
+int 
+VISU_MedConvertor
+::LoadValForTimeOnMesh(const MED::PWrapper& theMed,
+                      VISU::PMEDMesh theMesh,
+                      VISU::PMEDMeshOnEntity theMeshOnEntity,
+                      VISU::PMEDField theField, 
+                      VISU::PMEDValForTime theValForTime)
+{
+  return LoadValForTime(theMed,theMesh,theMeshOnEntity,theField,theValForTime,false);
+}
+
+
+//---------------------------------------------------------------
+int 
+VISU_MedConvertor
+::LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
+                          VISU::PMEDMesh theMesh,
+                          VISU::PMEDMeshOnEntity theMeshOnEntity,
+                          VISU::PMEDField theField, 
+                          VISU::PMEDValForTime theValForTime)
+{
+  return LoadValForTime(theMed,theMesh,theMeshOnEntity,theField,theValForTime,true);
+}
index bb187c23d36b976c9d8cda49f65f30510e4e697e..6bfb8a2134fffd17c17930157eb505b7d9a54bd1 100644 (file)
@@ -56,14 +56,8 @@ namespace VISU
     MED::TElemNum myElemNum;
 
     virtual
-    vtkIdType
-    GetObjID(vtkIdType theID) const
-    {
-      if(myIsElemNum)
-       return myElemNum[theID];
-      else
-       return theID;
-    }
+    TGaussPointID
+    GetObjID(vtkIdType theID) const;
   };
   typedef SharedPtr<TMEDGaussSubMesh> PMEDGaussSubMesh;
 
@@ -101,7 +95,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TMEDValForTime: virtual TValForTimeImpl
+  struct TMEDValForTime: virtual TGaussPtsValForTimeImpl
   {};
   typedef SharedPtr<TMEDValForTime> PMEDValForTime;
 
@@ -134,11 +128,18 @@ protected:
   
   virtual
   int
-  LoadFieldOnMesh(VISU::PMeshImpl theMesh, 
-                 VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                 VISU::PFieldImpl theField, 
-                 VISU::PValForTimeImpl theValForTime);
+  LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, 
+                      VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                      VISU::PFieldImpl theField, 
+                      VISU::PValForTimeImpl theValForTime);
   
+  virtual 
+  int
+  LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh, 
+                          VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                          VISU::PFieldImpl theField, 
+                          VISU::PValForTimeImpl theValForTime);
+
   int
   LoadPoints(const MED::PWrapper& theMed,
             VISU::PMEDMesh theMesh, 
@@ -151,12 +152,18 @@ protected:
                    const std::string& theFamilyName = "");
   
   int
-  LoadField(const MED::PWrapper& theMed,
-           VISU::PMEDMesh theMesh,
-           VISU::PMEDMeshOnEntity theMeshOnEntity,
-           VISU::PMEDField theField, 
-           VISU::PMEDValForTime theValForTime);
+  LoadValForTimeOnMesh(const MED::PWrapper& theMed,
+                      VISU::PMEDMesh theMesh,
+                      VISU::PMEDMeshOnEntity theMeshOnEntity,
+                      VISU::PMEDField theField, 
+                      VISU::PMEDValForTime theValForTime);
   
+  int
+  LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
+                          VISU::PMEDMesh theMesh,
+                          VISU::PMEDMeshOnEntity theMeshOnEntity,
+                          VISU::PMEDField theField, 
+                          VISU::PMEDValForTime theValForTime);
 };
 
 #endif
index ed5c29e0c7b7bdccb4b99810ae69c1f7a07cbd9a..4d2df3a2ed0c6dc8b8f67692a255fe4f4798b097 100644 (file)
@@ -912,10 +912,10 @@ VISU_MEDConvertor::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
 
 //---------------------------------------------------------------
 int 
-VISU_MEDConvertor::LoadFieldOnMesh(VISU::PMeshImpl theMesh, 
-                                  VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                                  VISU::PFieldImpl theField, 
-                                  VISU::PValForTimeImpl theValForTime)
+VISU_MEDConvertor::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, 
+                                       VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                                       VISU::PFieldImpl theField, 
+                                       VISU::PValForTimeImpl theValForTime)
 {
   //Main part of code
   int isPointsUpdated = LoadPoints(theMesh);
@@ -1213,7 +1213,8 @@ VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh,
                             VISU::PCValForTime theValForTime)
 {
   //Check on loading already done
-  if(theValForTime->myIsDone) 
+  TSource& aMeshSource = theValForTime->myMeshSource;
+  if(aMeshSource.myIsDone) 
     return 0;
   
   SALOME_MED::FIELD_var aMEDField = theValForTime->myField;
@@ -1230,7 +1231,7 @@ VISU_MEDConvertor::LoadField(VISU::PCMesh theMesh,
     ::ImportField(anArray,theMesh,theField,theValForTime,theMeshOnEntity);
   }
 
-  theValForTime->myIsDone = true;
+  aMeshSource.myIsDone = true;
 
   return 1;
 }
index 376eff77c3b0c31f813ad37cd079c89326cf2cfd..35ff1acada2cba3cb8ef2ddf3b008390e8bf999a 100644 (file)
@@ -79,7 +79,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TCValForTime: virtual TValForTimeImpl
+  struct TCValForTime: virtual TGaussPtsValForTimeImpl
   {
     SALOME_MED::FIELD_var myField;
   };
@@ -94,36 +94,61 @@ class VISU_MEDConvertor: public VISU_Convertor_impl{
   VISU_MEDConvertor() {};
 
  public:
-  VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject) : mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) {}
-  virtual VISU_Convertor* Build();
-
- protected:
+  VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject): 
+    mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) 
+  {}
 
-  VISU_Convertor* Build(SALOME_MED::MED_ptr theMED);
-  VISU_Convertor* Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
+  virtual
+  VISU_Convertor* 
+  Build();
 
-  virtual int LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                              const std::string& theFamilyName = "");
+ protected:
 
-  virtual int LoadMeshOnGroup(VISU::PMeshImpl theMesh, 
-                             const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+  VISU_Convertor* 
+  Build(SALOME_MED::MED_ptr theMED);
+  
+  VISU_Convertor* 
+  Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
 
-  virtual int LoadFieldOnMesh(VISU::PMeshImpl theMesh, 
-                             VISU::PMeshOnEntityImpl theMeshOnEntity, 
-                             VISU::PFieldImpl theField, 
-                             VISU::PValForTimeImpl theValForTime);
+  virtual
+  int
+  LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                  const std::string& theFamilyName = "");
+  
+  virtual
+  int
+  LoadMeshOnGroup(VISU::PMeshImpl theMesh, 
+                 const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+
+  virtual 
+  int
+  LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, 
+                      VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                      VISU::PFieldImpl theField, 
+                      VISU::PValForTimeImpl theValForTime);
+
+  virtual
+  int
+  LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh, 
+                          VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                          VISU::PFieldImpl theField, 
+                          VISU::PValForTimeImpl theValForTime)
+  {}
 
-  int LoadPoints(VISU::PCMesh theMesh,
-                const std::string& theFamilyName = "") ;
+  int 
+  LoadPoints(VISU::PCMesh theMesh,
+            const std::string& theFamilyName = "") ;
 
-  int LoadCellsOnEntity(VISU::PCMesh theMesh,
-                       VISU::PCMeshOnEntity theMeshOnEntity, 
-                       const std::string& theFamilyName = "");
+  int 
+  LoadCellsOnEntity(VISU::PCMesh theMesh,
+                   VISU::PCMeshOnEntity theMeshOnEntity, 
+                   const std::string& theFamilyName = "");
   
-  int LoadField(VISU::PCMesh theMesh,
-               VISU::PCMeshOnEntity theMeshOnEntity,
-               VISU::PField theField, 
-               VISU::PCValForTime theValForTime);
+  int 
+  LoadField(VISU::PCMesh theMesh,
+           VISU::PCMeshOnEntity theMeshOnEntity,
+           VISU::PField theField, 
+           VISU::PCValForTime theValForTime);
 
 };
 
index 81d2c4637b4818abd53a07bd3887a0dba3ab5bc4..71c175e5fb0e6fd12b0a097d8dc3458ceaa19576 100644 (file)
@@ -123,8 +123,21 @@ VISU::GaussPoints_i
 }
 
 
-void VISU::GaussPoints_i::DoSetInput(Result_i* theResult){
-  ScalarMap_i::DoSetInput(theResult);
+void
+VISU::GaussPoints_i
+::DoSetInput(Result_i* theResult)
+{
+  if(theResult->GetInput() == NULL)
+    throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+  myField = theResult->GetInput()->GetField(myMeshName,myEntity,myFieldName);
+  if(myField == NULL) 
+    throw std::runtime_error("There is no Field with the parameters !!!");
+  VISU_Convertor::TOutput *anOutput =
+    theResult->GetInput()->GetGaussPointsOnMesh(myMeshName,myEntity,myFieldName,myIteration);
+  if(anOutput == NULL) 
+    throw std::runtime_error("There is no TimeStamp with the parameters !!!");
+  myScalarMapPL->SetInput(anOutput);
+  myScalarMapPL->Build();
 }