-// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "SMDS_Mesh.hxx"
#include "SMESHDS_SubMesh.hxx"
+#include <Basics_OCCTVersion.hxx>
+
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Shape.hxx>
* So this functionality implement on new NCollection_DataMap technology
*/
#include <NCollection_DataMap.hxx>
-#include "SMESHDS_DataMapOfShape.hxx"
typedef std::list<const SMESHDS_Hypothesis*> THypList;
+
+struct SMESHDS_Hasher
+{
+#if OCC_VERSION_LARGE < 0x07080000
+ 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);
+ }
+#else
+ bool operator()(const TopoDS_Shape& S1, const TopoDS_Shape& S2) const
+ {
+ // for the purpose of ShapeToHypothesis map we don't consider shapes orientation
+ return S1.IsSame(S2);
+ }
+ size_t operator()(const TopoDS_Shape& S) const
+ {
+ return std::hash<TopoDS_Shape>{}(S);
+ }
+#endif
+};
+
typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis;
class SMESHDS_GroupBase;
bool ChangeElementNodes(const SMDS_MeshElement * elem,
const SMDS_MeshNode * nodes[],
const int nbnodes);
- bool ChangePolygonNodes(const SMDS_MeshElement * elem,
- std::vector<const SMDS_MeshNode*> nodes);
+ bool ChangePolygonNodes(const SMDS_MeshElement * elem,
+ std::vector<const SMDS_MeshNode*>& nodes);
bool ChangePolyhedronNodes(const SMDS_MeshElement * elem,
const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities);
void SetNodeOnEdge (const SMDS_MeshNode * aNode, const TopoDS_Edge& S, double u=0.);
void SetNodeOnVertex(const SMDS_MeshNode * aNode, const TopoDS_Vertex & S);
void UnSetNodeOnShape(const SMDS_MeshNode * aNode);
+ void UnSetElementOnShape(const SMDS_MeshElement * anElt);
void SetMeshElementOnShape (const SMDS_MeshElement * anElt, const TopoDS_Shape & S);
void UnSetMeshElementOnShape(const SMDS_MeshElement * anElt, const TopoDS_Shape & S);
void SetNodeInVolume(const SMDS_MeshNode * aNode, int Index);
ShapeToHypothesis myShapeToHypothesis;
- int myMeshID, myPersistentID;
+ int myPersistentID;
TopoDS_Shape myShape;
class SubMeshHolder;