Salome HOME
22359: Body Fitting algorithm: grid orientation
authoreap <eap@opencascade.com>
Tue, 4 Feb 2014 13:05:33 +0000 (13:05 +0000)
committereap <eap@opencascade.com>
Tue, 4 Feb 2014 13:05:33 +0000 (13:05 +0000)
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
src/SMESHDS/SMESHDS_Mesh.hxx

index 5b8165cf1d1411b231a876af8a9ea5619497c5d0..35a2ff87ea81a0c970f6068c5e6a35dbcf0bc2c9 100755 (executable)
 /*
  * 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
index 360b8ef6b8742814104c3ee7c16b4a2af2258ca4..6060f4bb8406fce3c7f7095222c808f91af07791 100644 (file)
@@ -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<const SMESHDS_Hypothesis*> THypList;
 
-  typedef NCollection_DataMap< TopoDS_Shape, THypList > ShapeToHypothesis;
+  typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis;
 
   ShapeToHypothesis          myShapeToHypothesis;