X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHDS%2FSMESHDS_Mesh.hxx;h=c90ba3e25bec7b0bef4fb88f0235d2535f6bd645;hb=HEAD;hp=ed7852e65d5db8f5878737da96b8a6849c0df40a;hpb=db83efeef8e138c5871f1a3ca8d5d4a64653b663;p=modules%2Fsmesh.git diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index ed7852e65..9fd4c0db9 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -1,4 +1,4 @@ -// 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 @@ -30,8 +30,12 @@ #include "SMESH_SMESHDS.hxx" #include "SMDS_Mesh.hxx" +#include "SMESH_Utils.hxx" +#include "SMESH_RegularGrid.hxx" #include "SMESHDS_SubMesh.hxx" +#include + #include #include @@ -57,8 +61,34 @@ class SMDS_BallElement; * So this functionality implement on new NCollection_DataMap technology */ #include -#include "SMESHDS_DataMapOfShape.hxx" typedef std::list 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{}(S); + } +#endif +}; + typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis; class SMESHDS_GroupBase; @@ -595,8 +625,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh bool ChangeElementNodes(const SMDS_MeshElement * elem, const SMDS_MeshNode * nodes[], const int nbnodes); - bool ChangePolygonNodes(const SMDS_MeshElement * elem, - std::vector nodes); + bool ChangePolygonNodes(const SMDS_MeshElement * elem, + std::vector& nodes); bool ChangePolyhedronNodes(const SMDS_MeshElement * elem, const std::vector& nodes, const std::vector& quantities); @@ -609,6 +639,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh 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); @@ -650,13 +681,20 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh void CleanDownWardConnectivity(); void BuildDownWardConnectivity(bool withEdges); + virtual void SetStructuredGrid( const TopoDS_Shape & shape, const int nx, const int ny, const int nz = 1 ); + virtual void SetNodeOnStructuredGrid( const TopoDS_Shape & shape, const std::shared_ptr& P, const int iIndex, const int jIndex, const int kIndex = 0 ); + virtual void SetNodeOnStructuredGrid( const TopoDS_Shape & shape, const SMDS_MeshNode* point, const int iIndex, const int jIndex, const int kIndex = 0 ); + virtual void SetNodeOnStructuredGrid( const TopoDS_Shape & shape, const SMDS_MeshNode* point, const int index ); + virtual bool HasStructuredGridFilled( const TopoDS_Shape & shape ) const; + virtual bool HasSomeStructuredGridFilled() const; + virtual const std::shared_ptr& GetTheGrid( const TopoDS_Shape & shape ); ~SMESHDS_Mesh(); private: ShapeToHypothesis myShapeToHypothesis; - int myMeshID, myPersistentID; + int myPersistentID; TopoDS_Shape myShape; class SubMeshHolder; @@ -672,6 +710,9 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh int add( const SMDS_MeshElement* elem, SMESHDS_SubMesh* subMesh ); SMESHDS_SubMesh* getSubmesh( const TopoDS_Shape & shape); + + // Index the regular grid associated to the mesh in the geometry index + NCollection_DataMap> myRegularGrid; };