From 04d029c4f9bd27fb75125631729a80ad803bd120 Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 13 Dec 2005 14:10:01 +0000 Subject: [PATCH] To use detail comprision of the MED::TGaussInfo structures in order to apply caching of the information --- src/CONVERTOR/VISU_Convertor_impl.cxx | 21 +++++++++++++--- src/CONVERTOR/VISU_Convertor_impl.hxx | 10 +++++++- src/CONVERTOR/VISU_MedConvertor.cxx | 35 +++++++++++++++++++-------- src/CONVERTOR/VISU_MedConvertor.hxx | 6 +++++ 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index fd4dbd11..e104ce31 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -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; } diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index ec250fc1..c1923c3b 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -418,14 +418,22 @@ namespace VISU //--------------------------------------------------------------- + struct TGaussImpl; + typedef SharedPtr 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; // PGaussImpl; //--------------------------------------------------------------- diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index d0c198c5..f4bb2ec2 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -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 = "<myGaussInfo; + theResult = MED::TGaussInfo::TLess()(aLeft,aReight); + } + } + } + + //--------------------------------------------------------------- TGaussPointID TMEDGaussSubMesh diff --git a/src/CONVERTOR/VISU_MedConvertor.hxx b/src/CONVERTOR/VISU_MedConvertor.hxx index 082c237d..abcb6ad7 100644 --- a/src/CONVERTOR/VISU_MedConvertor.hxx +++ b/src/CONVERTOR/VISU_MedConvertor.hxx @@ -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 PMEDGauss; -- 2.39.2