From a62ca0b865089cbe32f5153341c02fbc6db88467 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 4 Feb 2014 13:05:33 +0000 Subject: [PATCH] 22359: Body Fitting algorithm: grid orientation Move global methods needed for NCollection_DataMap< TopoDS_Shape, * > to class SMESHDS_Hasher in order not to clash with the same global definitions - typedef NCollection_DataMap< TopoDS_Shape, THypList > ShapeToHypothesis; + typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis; --- src/SMESHDS/SMESHDS_DataMapOfShape.hxx | 20 +++++++++++++------- src/SMESHDS/SMESHDS_Mesh.hxx | 10 +++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/SMESHDS/SMESHDS_DataMapOfShape.hxx b/src/SMESHDS/SMESHDS_DataMapOfShape.hxx index 5b8165cf1..35a2ff87e 100755 --- a/src/SMESHDS/SMESHDS_DataMapOfShape.hxx +++ b/src/SMESHDS/SMESHDS_DataMapOfShape.hxx @@ -32,13 +32,19 @@ /* * This method needed for instance NCollection_DataMap with TopoDS_Shape as key */ - -inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, - const TopoDS_Shape& S2) +struct SMESHDS_Hasher { - return S1.IsSame(S2); -} - + static inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, + const TopoDS_Shape& S2) + { + return S1.IsSame(S2); + } + static inline Standard_Integer HashCode(const TopoDS_Shape& S, + const Standard_Integer Upper) + { + return ::HashCode( S, Upper); + } +}; -#endif +#endif diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index 360b8ef6b..6060f4bb8 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -61,7 +61,8 @@ class SMDS_BallElement; class SMESHDS_GroupBase; class DownIdType; -class SMESHDS_EXPORT SMESHDS_Mesh:public SMDS_Mesh{ +class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh +{ public: SMESHDS_Mesh(int theMeshID, bool theIsEmbeddedMode); bool IsEmbeddedMode(); @@ -603,14 +604,9 @@ private: it->second->AddNode( aNode ); // add aNode to submesh } - /*int HashCode( const TopoDS_Shape& S, const Standard_Integer theUpper ) const - { - return S.HashCode(2147483647); - }*/ - typedef std::list THypList; - typedef NCollection_DataMap< TopoDS_Shape, THypList > ShapeToHypothesis; + typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis; ShapeToHypothesis myShapeToHypothesis; -- 2.30.2