]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To use detail comprision of the MED::TGaussInfo structures in order to apply caching...
authorapo <apo@opencascade.com>
Tue, 13 Dec 2005 14:10:01 +0000 (14:10 +0000)
committerapo <apo@opencascade.com>
Tue, 13 Dec 2005 14:10:01 +0000 (14:10 +0000)
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx

index fd4dbd114675f03a3dab8bf88ffd32f86f951b83..e104ce31ac6ce11dbf3bb36bfdd514868b77b75b 100644 (file)
@@ -434,6 +434,16 @@ namespace VISU
   }
   
 
+  //---------------------------------------------------------------
+  void
+  TGaussImpl
+  ::LessThan(const PGaussImpl& theGauss,
+            bool& theResult) const
+  {
+    theResult = false;
+  }
+
+
   //---------------------------------------------------------------
   TGaussSubMeshImpl::TGaussSubMeshImpl():
     myStatus(eNone)
@@ -456,14 +466,17 @@ namespace VISU
     PGaussSubMeshImpl aLeft(theLeft), aRight(theRight);
     const PGaussImpl& aGaussLeft = aLeft->myGauss;
     const PGaussImpl& aGaussRight = aRight->myGauss;
-
+    
     if(aGaussLeft->myGeom != aGaussRight->myGeom)
       return aGaussLeft->myGeom < aGaussRight->myGeom;
 
-    if(aGaussLeft->myName != aGaussRight->myName)
-      return aGaussLeft->myName < aGaussRight->myName;
+    if(aLeft->mySubProfile != aRight->mySubProfile)
+      return aLeft->mySubProfile < aRight->mySubProfile;
+
+    bool aResult;
+    aGaussLeft->LessThan(aGaussRight,aResult);
 
-    return theLeft->mySubProfile < theRight->mySubProfile;
+    return aResult;
   }
 
 
index ec250fc1f9d5d2a1478e582d764a4ed607c8d5c9..c1923c3b3265026d132a7f2d402f453ffc3af80b 100644 (file)
@@ -418,14 +418,22 @@ namespace VISU
 
 
   //---------------------------------------------------------------
+  struct TGaussImpl;
+  typedef SharedPtr<TGaussImpl> PGaussImpl;
+
   //! Specialize TGauss to provide more detail information of the MED GAUSS entity for VTK mapping
   struct TGaussImpl: virtual TGauss
   {
     EGeometry myGeom; //!< Define, to which geometrical type the MED GAUSS entity belongs
     std::string myName; //!< Keeps name of the MED GAUSS entity
     vtkIdType myNbPoints; //<! Keeps number of points for the MED GAUSS entity
+
+    //! To define a way to implement more detail comparision of the TGaussSubMesh instances
+    virtual
+    void
+    LessThan(const PGaussImpl& theGauss,
+            bool& theResult) const;
   };
-  typedef SharedPtr<TGaussImpl> PGaussImpl;
 
 
   //---------------------------------------------------------------
index d0c198c507a887829e57b99e778208ed154945b5..f4bb2ec22038ea3d930c742ad9f6776b20047c11 100644 (file)
@@ -386,28 +386,25 @@ namespace
        PMEDGauss aGauss(new TMEDGauss());
        aGaussSubMesh->myGauss = aGauss;
        aGauss->myGeom = aEGeom;
-
-       TInt aNbGauss = 1;
-       std::string aName;
+       aGauss->myNbPoints = 1;
 
        MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
        if(aGaussIter != aGeom2Gauss.end()){
          MED::PGaussInfo aGaussInfo = aGaussIter->second;
          aGauss->myGaussInfo = aGaussInfo;
-         aName = aGauss->myName = aGaussInfo->GetName();
-         aNbGauss = aGauss->myNbPoints = aGaussInfo->GetNbGauss();
+         aGauss->myName = aGaussInfo->GetName();
+         aGauss->myNbPoints = aGaussInfo->GetNbGauss();
        }
        
-       aGauss->myNbPoints = aNbGauss;
-       aGaussSubMesh->myNbCells = aNbCells*aNbGauss;
+       aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints;
        aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2;
 
        aGaussKey.insert(aGaussSubMesh);
 
        INITMSGA(MYDEBUG,0,
-                "- aEGeom = "<<aEGeom<<
-                "; aName = '"<<aName<<"'"<<
-                "; aNbGauss = "<<aNbGauss<<
+                "- aEGeom = "<<aGauss->myGeom<<
+                "; aName = '"<<aGauss->myName<<"'"<<
+                "; aNbGauss = "<<aGauss->myNbPoints<<
                 "; aStatus = "<<aGaussSubMesh->myStatus<<
                 "; aNbCells = "<<aGaussSubMesh->myNbCells<<
                 "; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
@@ -464,6 +461,7 @@ namespace
          aGaussSubMeshArr[anID] = aGaussSubMesh;
        }
       }
+      INITMSG(MYDEBUG,"aGaussMeshMap[aGaussKey] = aGaussMesh"<<endl);
       aGaussMeshMap[aGaussKey] = aGaussMesh;
       theValForTime.myGaussMesh = aGaussMesh;
     }
@@ -865,6 +863,23 @@ namespace
   }
   
 
+  //---------------------------------------------------------------
+  void
+  TMEDGauss
+  ::LessThan(const PGaussImpl& theGauss,
+            bool& theResult) const
+  {
+    TGaussImpl::LessThan(theGauss,theResult);
+    if(myGaussInfo){
+      if(PMEDGauss aGauss = theGauss){
+       const MED::TGaussInfo& aLeft = myGaussInfo;
+       const MED::TGaussInfo& aReight = aGauss->myGaussInfo;
+       theResult = MED::TGaussInfo::TLess()(aLeft,aReight);
+      }
+    }
+  }
+
+
   //---------------------------------------------------------------
   TGaussPointID
   TMEDGaussSubMesh
index 082c237db1eff4ae5a9b1ec995a1cbb803aa0a77..abcb6ad70549e9b5ea9ef8515fa5eb325d978c60 100644 (file)
@@ -77,6 +77,12 @@ namespace VISU
   struct TMEDGauss: virtual TGaussImpl
   {
     MED::PGaussInfo myGaussInfo;
+
+    //! To define a way to implement more detail comparision of the TGaussSubMesh instances
+    virtual
+    void
+    LessThan(const PGaussImpl& theGauss,
+            bool& theResult) const;
   };
   typedef SharedPtr<TMEDGauss> PMEDGauss;