]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce ID's
authorapo <apo@opencascade.com>
Mon, 29 Aug 2005 05:15:43 +0000 (05:15 +0000)
committerapo <apo@opencascade.com>
Mon, 29 Aug 2005 05:15:43 +0000 (05:15 +0000)
src/CONVERTOR/VISUConvertor.cxx
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.hxx
src/VISU_I/VISU_GaussPoints_i.cc

index 716ab8e6a4f60de8df29919cdce337fdfb74a3ff..3e0d804ad9040d556acf235215b5d118f8bee9e6 100644 (file)
@@ -88,7 +88,7 @@ void parseFile(const char* theFileName)
            //int aNbNodes, aNbCells, i;
            //VISU::TGaussPointID aID;
            //
-           aOut=aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           aOut=aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
 
            //aNbNodes=aOut->GetNumberOfPoints();
            //aNbCells=aOut->GetNumberOfCells();
index f8b627fdaa30df23b7bb6decaac558c6f4489655..ffda7dc5707d246f3a04e08349aa6361ed2a4b99 100644 (file)
@@ -59,7 +59,7 @@ static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
 static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 0;
+static int MYDEBUGWITHFILES = 1;
 #else
 static int MYDEBUG = 0;
 static int MYDEBUGWITHFILES = 0;
@@ -190,6 +190,21 @@ namespace VISU
   }
 
 
+  vtkIdType
+  TSubProfileImpl
+  ::GetNodeObjId(vtkIdType theID) const
+  {
+    return theID;
+  }
+
+  vtkIdType
+  TSubProfileImpl
+  ::GetElemObjId(vtkIdType theID) const
+  {
+    return theID;
+  }
+
+
   //---------------------------------------------------------------
   bool
   operator<(const PSubProfile& theLeft, const PSubProfile& theRight)
@@ -208,6 +223,28 @@ namespace VISU
     myIsAll(true)
   {}
 
+  vtkIdType
+  TProfileImpl
+  ::GetNodeObjId(vtkIdType theID) const
+  {
+    vtkIdType anInputID;
+    const TVTKAppendFilter& anAppendFilter = GetFilter();
+    vtkIdType aID = anAppendFilter->GetNodeObjId(theID,anInputID);
+    const TSubProfileImpl& aSubProfileImpl = mySubProfileArr[anInputID];
+    return aSubProfileImpl.GetNodeObjId(aID);
+  }
+
+  vtkIdType
+  TProfileImpl
+  ::GetElemObjId(vtkIdType theID) const
+  {
+    vtkIdType anInputID;
+    const TVTKAppendFilter& anAppendFilter = GetFilter();
+    vtkIdType aID = anAppendFilter->GetElemObjId(theID,anInputID);
+    const TSubProfileImpl& aSubProfileImpl = mySubProfileArr[anInputID];
+    return aSubProfileImpl.GetElemObjId(aID);
+  }
+
 
   //---------------------------------------------------------------
   TGaussSubMeshImpl::TGaussSubMeshImpl():
@@ -248,7 +285,9 @@ namespace VISU
   {}
 
   //---------------------------------------------------------------
-  TGaussPointID TGaussMeshImpl::GetObjId(int theVtkI)
+  TGaussPointID 
+  TGaussMeshImpl
+  ::GetObjId(int theVtkI) const
   {
     TGaussPointID aRetVID;
     int aID, anIndexDS;
@@ -257,7 +296,7 @@ namespace VISU
     const TVTKAppendFilter& anAppendFilter = GetFilter();
     aID=anAppendFilter->GetElemObjId(theVtkI, anIndexDS);
     //
-    TGaussSubMeshImpl& aSubMeshImpl=myGaussSubMeshArr[anIndexDS];
+    const TGaussSubMeshImpl& aSubMeshImpl = myGaussSubMeshArr[anIndexDS];
     aVID=(vtkIdType)aID;
     aRetVID=aSubMeshImpl.GetObjID(aVID);
     return aRetVID;
@@ -333,7 +372,7 @@ namespace VISU
     vtkIdType anId = theElemId;
     for(vtkIdType aCompId = 0; aCompId < myNbComp; aCompId++){
       aValueSliceArr[aCompId] =
-       TCValueSlice(myValue,std::slice(anId,myNbGauss,myNbGauss));
+       TCValueSlice(myValue,std::slice(anId,myNbGauss,myNbComp));
       anId += 1;
     }
     return aValueSliceArr;
@@ -344,10 +383,10 @@ namespace VISU
   ::GetCompValueSliceArr(vtkIdType theElemId)
   {
     TValueSliceArr aValueSliceArr(myNbComp);
-    vtkIdType anId = theElemId*myStep;
+    vtkIdType anId = theElemId;
     for(vtkIdType aCompId = 0; aCompId < myNbComp; aCompId++){
       aValueSliceArr[aCompId] =
-       TValueSlice(myValue,std::slice(anId,myNbGauss,myNbGauss));
+       TValueSlice(myValue,std::slice(anId,myNbGauss,myNbComp));
       anId += 1;
     }
     return aValueSliceArr;
@@ -375,13 +414,6 @@ namespace VISU
   int
   TValForTimeImpl
   ::GetNbGauss(vtkIdType theGeom) const
-  {
-    return myNbGauss;
-  }
-  
-  int
-  TGaussPtsValForTimeImpl
-  ::GetNbGauss(vtkIdType theGeom) const
   {
     if(PGaussMeshImpl aGaussMesh = myGaussMesh){
       const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
@@ -394,7 +426,7 @@ namespace VISU
     }
     return myNbGauss;
   }
-
+  
 
   //---------------------------------------------------------------
   vtkIdType
@@ -971,7 +1003,7 @@ namespace
   void 
   GetTimeStampOnGaussMesh(const TVTKSource& theSource,
                          const PFieldImpl& theField, 
-                         const PGaussPtsValForTimeImpl& theValForTime)
+                         const PValForTimeImpl& theValForTime)
   {
     int aNbTuples = theSource->GetNumberOfPoints();
     std::string aFieldName = GenerateFieldName(theField,theValForTime);
@@ -1354,7 +1386,7 @@ VISU_Convertor_impl
   PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
   PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
   PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindTimeStamp);
-  PGaussPtsValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+  PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
 
   //Main part of code
@@ -1420,12 +1452,12 @@ VISU_Convertor_impl
 //---------------------------------------------------------------
 VISU_Convertor::TOutput* 
 VISU_Convertor_impl
-::GetGaussPointsOnMesh(const string& theMeshName, 
-                      const VISU::TEntity& theEntity,
-                      const string& theFieldName,
-                      int theStampsNum)
+::GetTimeStampOnGaussPts(const string& theMeshName, 
+                        const VISU::TEntity& theEntity,
+                        const string& theFieldName,
+                        int theStampsNum)
 {
-  INITMSG(MYDEBUG,"GetGaussPointsOnMesh"<<
+  INITMSG(MYDEBUG,"GetTimeStampOnGaussPts"<<
          "; theMeshName = '"<<theMeshName<<"'"<<
          "; theEntity = "<<theEntity<<
          "; theFieldName = '"<<theFieldName<<"'"<<
@@ -1441,7 +1473,7 @@ VISU_Convertor_impl
   PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
   PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
   PMeshOnEntityImpl aVTKMeshOnEntity = aMeshOnEntity;
-  PGaussPtsValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+  PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
 
   //Main part of code
@@ -1456,10 +1488,8 @@ VISU_Convertor_impl
       GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);
       
       PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
-      INITMSG(MYDEBUG,"aGaussMesh = "<<bool(aGaussMesh)<<endl);
       const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
       BuildGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
-      //GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
       
       const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
       aSource->ShallowCopy(anAppendFilter->GetOutput());
@@ -1497,18 +1527,20 @@ VISU_Convertor_impl
 }
 
 //---------------------------------------------------------------
-VISU::PGaussMesh VISU_Convertor_impl::GetGaussMesh(const string& theMeshName, 
-                                                  const VISU::TEntity& theEntity,
-                                                  const string& theFieldName,
-                                                  int theStampsNum)
+VISU::PGaussMesh 
+VISU_Convertor_impl
+::GetGaussMesh(const string& theMeshName, 
+              const VISU::TEntity& theEntity,
+              const string& theFieldName,
+              int theStampsNum)
 {
-  GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum);
+  GetTimeStampOnGaussPts(theMeshName, theEntity, theFieldName, theStampsNum);
 
   TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
                                                theEntity,
                                                theFieldName,
                                                theStampsNum);
-  PGaussPtsValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+  PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
   PGaussMeshImpl aGaussMesh=aValForTime->myGaussMesh;
   
   return aGaussMesh;
@@ -1775,7 +1807,7 @@ VISU_Convertor_impl
   PMeshImpl aMesh = boost::get<0>(aFindField);
   PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindField);
   PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindField);
-  PGaussPtsValForTimeImpl aValForTime = aValFieldIter->second;
+  PValForTimeImpl aValForTime = aValFieldIter->second;
 
   return TFindTimeStamp(aMesh,
                        aMeshOnEntity,
index df319f0f4a851e1e96ae8bb42eb4e6c67f7d70ef..0d95088c819fe65d052613dd19376c49efea90f2 100644 (file)
@@ -160,6 +160,14 @@ namespace VISU
     vtkIdType myGeom;
     std::string myName;
 
+    virtual 
+    vtkIdType 
+    GetNodeObjId(int theVtkI) const;
+
+    virtual 
+    vtkIdType 
+    GetElemObjId(int theVtkI) const;
+
     ESubMeshStatus myStatus;
     TSubMeshID mySubMeshID;
   };
@@ -167,12 +175,23 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  typedef std::map<vtkIdType,PSubProfile> TGeom2SubProfile;
+  typedef std::vector<PSubProfileImpl> TSubProfileArr;
+  typedef std::map<vtkIdType,PSubProfileImpl> TGeom2SubProfile;
 
   struct TProfileImpl: virtual TProfile, virtual TAppendFilter
   {
     TProfileImpl();
     bool myIsAll;
+
+    virtual 
+    vtkIdType 
+    GetNodeObjId(int theVtkI) const;
+
+    virtual 
+    vtkIdType 
+    GetElemObjId(int theVtkI) const;
+
+    TSubProfileArr mySubProfileArr;
     TGeom2SubProfile myGeom2SubProfile;
   };
   typedef SharedPtr<TProfileImpl> PProfileImpl;
@@ -211,7 +230,11 @@ namespace VISU
   struct TGaussMeshImpl: virtual TGaussMesh, virtual TAppendFilter
   {
     TGaussMeshImpl();
-    virtual TGaussPointID GetObjId(int theVtkI);
+
+    virtual
+    TGaussPointID
+    GetObjId(int theVtkI) const;
+
     TGaussSubMeshArr myGaussSubMeshArr;
     TGeom2GaussSubMesh myGeom2GaussSubMesh;
   };
@@ -308,32 +331,16 @@ namespace VISU
     TMeshValue& 
     GetMeshValue(vtkIdType theGeom);
 
-    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;
 
+    int myNbGauss;
+
     virtual
     int
     GetNbGauss(vtkIdType theGeom) const;
   };
-  typedef SharedPtr<TGaussPtsValForTimeImpl> PGaussPtsValForTimeImpl;
+  typedef SharedPtr<TValForTimeImpl> PValForTimeImpl;
 
 
   //---------------------------------------------------------------
@@ -413,19 +420,19 @@ public:
                     const std::string& theFieldName,
                     int theStampsNum);
   virtual
+  TOutput* 
+  GetTimeStampOnGaussPts(const std::string& theMeshName, 
+                        const VISU::TEntity& theEntity,
+                        const std::string& theFieldName,
+                        int theStampsNum);
+  
+  virtual
   VISU::PGaussMesh 
   GetGaussMesh(const std::string& theMeshName, 
               const VISU::TEntity& theEntity,
               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);
@@ -454,7 +461,7 @@ protected:
                       VISU::PMeshOnEntityImpl,
                       VISU::PMeshOnEntityImpl,
                       VISU::PFieldImpl,
-                      VISU::PGaussPtsValForTimeImpl> TFindTimeStamp;
+                      VISU::PValForTimeImpl> TFindTimeStamp;
   TFindTimeStamp
   FindTimeStamp(const std::string& theMeshName, 
                const VISU::TEntity& theEntity, 
index f0ec57c02a2214d7000d207a37cdcc3a653f57f2..0023e3b8e2ce0ddbef70a2ff992686b3eee14b25 100644 (file)
@@ -49,8 +49,8 @@ using MED::EBooleen;
 #ifdef _DEBUG_
 static int MYDEBUG = 1;
 static int MYVALUEDEBUG = 0;
-static int MY_FAMILY_DEBUG = 0;
-static int MY_GROUP_DEBUG = 0;
+static int MY_FAMILY_DEBUG = 1;
+static int MY_GROUP_DEBUG = 1;
 #else
 static int MYDEBUG = 0;
 static int MYVALUEDEBUG = 0;
@@ -243,6 +243,15 @@ namespace
        vtkIdType aVGeom = aSubProfile->myGeom;
        aGeom2SubProfile[aVGeom] = aSubProfile;
       }
+      {
+       TSubProfileArr& aSubProfileArr = aProfile->mySubProfileArr;
+       aSubProfileArr.resize(aGeom2SubProfile.size());
+       TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
+       for(TInt anID = 0; anIter != aGeom2SubProfile.end(); anIter++, anID++){
+         const PSubProfileImpl& aSubProfile = anIter->second;
+         aSubProfileArr[anID] = aSubProfile;
+       }
+      }
       aProfileMap[aProfileKey] = aProfile;
       theValForTime.myProfile = aProfile;
     }
@@ -725,6 +734,24 @@ namespace
     }
   }
 
+
+  //---------------------------------------------------------------
+  vtkIdType
+  TMEDSubProfile
+  ::GetNodeObjId(vtkIdType theID) const
+  {
+    return theID;
+  }
+  
+  vtkIdType
+  TMEDSubProfile
+  ::GetElemObjId(vtkIdType theID) const
+  {
+    return theID;
+  }
+  
+
+  //---------------------------------------------------------------
   TGaussPointID
   TMEDGaussSubMesh
   ::GetObjID(vtkIdType theID) const
index 6bfb8a2134fffd17c17930157eb505b7d9a54bd1..11421033aea467faa9eb0699020b465151e0acaa 100644 (file)
@@ -31,6 +31,17 @@ namespace VISU
   struct TMEDSubProfile: virtual TSubProfileImpl
   {
     MED::EGeometrieElement myMGeom;
+    MED::EBooleen myIsElemNum;
+    MED::TElemNum myElemNum;
+
+    virtual 
+    vtkIdType 
+    GetNodeObjId(vtkIdType theID) const;
+
+    virtual 
+    vtkIdType 
+    GetElemObjId(vtkIdType theID) const;
+
   };
   typedef SharedPtr<TMEDSubProfile> PMEDSubProfile;
 
@@ -95,7 +106,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TMEDValForTime: virtual TGaussPtsValForTimeImpl
+  struct TMEDValForTime: virtual TValForTimeImpl
   {};
   typedef SharedPtr<TMEDValForTime> PMEDValForTime;
 
index 35ff1acada2cba3cb8ef2ddf3b008390e8bf999a..6366a060d25c18245702ea2e63b699b966c24e6f 100644 (file)
@@ -79,7 +79,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TCValForTime: virtual TGaussPtsValForTimeImpl
+  struct TCValForTime: virtual TValForTimeImpl
   {
     SALOME_MED::FIELD_var myField;
   };
index 71c175e5fb0e6fd12b0a097d8dc3458ceaa19576..e1207625959ef6f060af235611e06b7366c77c2d 100644 (file)
@@ -133,7 +133,7 @@ VISU::GaussPoints_i
   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);
+    theResult->GetInput()->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
   if(anOutput == NULL) 
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
   myScalarMapPL->SetInput(anOutput);