27#ifndef _SMESHDS_Mesh_HeaderFile
28#define _SMESHDS_Mesh_HeaderFile
37#include <Basics_OCCTVersion.hxx>
39#include <TopTools_IndexedMapOfShape.hxx>
40#include <TopoDS_Shape.hxx>
63#include <NCollection_DataMap.hxx>
64typedef std::list<const SMESHDS_Hypothesis*>
THypList;
68#if OCC_VERSION_LARGE < 0x07080000
69 static inline Standard_Boolean
IsEqual(
const TopoDS_Shape& S1,
70 const TopoDS_Shape& S2)
74 static inline Standard_Integer
HashCode(
const TopoDS_Shape& S,
75 const Standard_Integer Upper)
77 return ::HashCode( S, Upper);
80 bool operator()(
const TopoDS_Shape& S1,
const TopoDS_Shape& S2)
const
85 size_t operator()(
const TopoDS_Shape& S)
const
87 return std::hash<TopoDS_Shape>{}(S);
101 bool IsEmbeddedMode();
102 void SetPersistentId(
int id);
103 int GetPersistentId()
const;
105 void ShapeToMesh(
const TopoDS_Shape & S);
106 TopoDS_Shape ShapeToMesh()
const;
160 smIdType n12,smIdType n23,smIdType n31, smIdType ID);
177 smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID);
196 smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID);
217 smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID);
277 virtual SMDS_MeshVolume*
AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, smIdType ID);
297 smIdType n7, smIdType n8, smIdType n9, smIdType n10, smIdType n11, smIdType n12, smIdType ID);
326 smIdType n12,smIdType n23,smIdType n31,
327 smIdType n14,smIdType n24,smIdType n34, smIdType ID);
352 smIdType n12,smIdType n23,smIdType n34,smIdType n41,
353 smIdType n15,smIdType n25,smIdType n35,smIdType n45,
385 smIdType n4, smIdType n5, smIdType n6,
386 smIdType n12,smIdType n23,smIdType n31,
387 smIdType n45,smIdType n56,smIdType n64,
388 smIdType n14,smIdType n25,smIdType n36,
424 smIdType n4, smIdType n5, smIdType n6,
425 smIdType n12,smIdType n23,smIdType n31,
426 smIdType n45,smIdType n56,smIdType n64,
427 smIdType n14,smIdType n25,smIdType n36,
428 smIdType n1245, smIdType n2356, smIdType n1346,
470 smIdType n5, smIdType n6, smIdType n7, smIdType n8,
471 smIdType n12,smIdType n23,smIdType n34,smIdType n41,
472 smIdType n56,smIdType n67,smIdType n78,smIdType n85,
473 smIdType n15,smIdType n26,smIdType n37,smIdType n48,
519 smIdType n5, smIdType n6, smIdType n7, smIdType n8,
520 smIdType n12,smIdType n23,smIdType n34,smIdType n41,
521 smIdType n56,smIdType n67,smIdType n78,smIdType n85,
522 smIdType n15,smIdType n26,smIdType n37,smIdType n48,
523 smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
524 smIdType n1458,smIdType n5678,smIdType nCenter,
599 (
const std::vector<smIdType>& nodes_ids,
600 const std::vector<int>& quantities,
604 (
const std::vector<const SMDS_MeshNode*>& nodes,
605 const std::vector<int>& quantities,
609 (
const std::vector<const SMDS_MeshNode*>& nodes,
610 const std::vector<int>& quantities);
629 std::vector<const SMDS_MeshNode*>& nodes);
631 const std::vector<const SMDS_MeshNode*>& nodes,
632 const std::vector<int>& quantities);
633 bool ModifyCellNodes(vtkIdType smdsVolId, std::map<int,int> localClonedNodeIds);
634 void Renumber (
const bool isNodes,
const smIdType startID=1,
const smIdType deltaID=1);
636 void SetNodeInVolume(
const SMDS_MeshNode * aNode,
const TopoDS_Shell & S);
637 void SetNodeInVolume(
const SMDS_MeshNode * aNode,
const TopoDS_Solid & S);
638 void SetNodeOnFace (
const SMDS_MeshNode * aNode,
const TopoDS_Face& S,
double u=0.,
double v=0.);
639 void SetNodeOnEdge (
const SMDS_MeshNode * aNode,
const TopoDS_Edge& S,
double u=0.);
640 void SetNodeOnVertex(
const SMDS_MeshNode * aNode,
const TopoDS_Vertex & S);
643 void SetMeshElementOnShape (
const SMDS_MeshElement * anElt,
const TopoDS_Shape & S);
644 void UnSetMeshElementOnShape(
const SMDS_MeshElement * anElt,
const TopoDS_Shape & S);
645 void SetNodeInVolume(
const SMDS_MeshNode * aNode,
int Index);
646 void SetNodeOnFace (
const SMDS_MeshNode * aNode,
int Index,
double u=0.,
double v=0.);
647 void SetNodeOnEdge (
const SMDS_MeshNode * aNode,
int Index,
double u=0.);
648 void SetNodeOnVertex(
const SMDS_MeshNode * aNode,
int Index);
650 bool HasMeshElements(
const TopoDS_Shape & S)
const;
653 std::list<int> SubMeshIndices()
const;
656 bool HasHypothesis(
const TopoDS_Shape & S);
657 const std::list<const SMESHDS_Hypothesis*>& GetHypothesis(
const TopoDS_Shape & S)
const;
664 int ShapeToIndex(
const TopoDS_Shape & aShape)
const;
665 const TopoDS_Shape& IndexToShape(
int ShapeIndex)
const;
667 int MaxSubMeshIndex()
const;
670 int AddCompoundSubmesh(
const TopoDS_Shape& S, TopAbs_ShapeEnum type = TopAbs_SHAPE);
676 const std::set<SMESHDS_GroupBase*>&
GetGroups()
const {
return myGroups; }
678 bool IsGroupOfSubShapes (
const TopoDS_Shape& aSubShape)
const;
681 void CleanDownWardConnectivity();
682 void BuildDownWardConnectivity(
bool withEdges);
684 virtual void SetStructuredGrid(
const TopoDS_Shape & shape,
const int nx,
const int ny,
const int nz = 1 );
685 virtual void SetNodeOnStructuredGrid(
const TopoDS_Shape & shape,
const std::shared_ptr<gp_Pnt>& P,
const int iIndex,
const int jIndex,
const int kIndex = 0 );
686 virtual void SetNodeOnStructuredGrid(
const TopoDS_Shape & shape,
const SMDS_MeshNode* point,
const int iIndex,
const int jIndex,
const int kIndex = 0 );
687 virtual void SetNodeOnStructuredGrid(
const TopoDS_Shape & shape,
const SMDS_MeshNode* point,
const int index );
688 virtual bool HasStructuredGridFilled(
const TopoDS_Shape & shape )
const;
689 virtual bool HasSomeStructuredGridFilled()
const;
690 virtual const std::shared_ptr<SMESHUtils::SMESH_RegularGrid>& GetTheGrid(
const TopoDS_Shape & shape );
715 NCollection_DataMap<int,std::shared_ptr<SMESHUtils::SMESH_RegularGrid>>
myRegularGrid;
NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis
Definition: SMESHDS_Mesh.hxx:92
std::list< const SMESHDS_Hypothesis * > THypList
Definition: SMESHDS_Mesh.hxx:64
boost::shared_ptr< SMESHDS_SubMeshIterator > SMESHDS_SubMeshIteratorPtr
Definition: SMESHDS_SubMesh.hxx:43
#define SMESHDS_EXPORT
Definition: SMESH_SMESHDS.hxx:37
Definition: SMDS_Downward.hxx:46
Ball element.
Definition: SMDS_BallElement.hxx:36
0D mesh element.
Definition: SMDS_Mesh0DElement.hxx:36
Edge mesh element.
Definition: SMDS_MeshEdge.hxx:36
Base class for elements.
Definition: SMDS_MeshElement.hxx:56
Mesh face.
Definition: SMDS_MeshFace.hxx:41
Definition: SMDS_MeshNode.hxx:36
Mesh volume.
Definition: SMDS_MeshVolume.hxx:40
Definition: SMDS_Mesh.hxx:53
virtual void MoveNode(const SMDS_MeshNode *n, double x, double y, double z)
Definition: SMDS_Mesh.cxx:985
bool ChangeElementNodes(const SMDS_MeshElement *elem, const SMDS_MeshNode *nodes[], const int nbnodes)
Definition: SMDS_Mesh.cxx:1116
virtual SMDS_BallElement * AddBallWithID(smIdType n, double diameter, smIdType ID)
create a Ball and add it to the current Mesh
Definition: SMDS_Mesh.cxx:248
bool ChangePolyhedronNodes(const SMDS_MeshElement *elem, const std::vector< const SMDS_MeshNode * > &nodes, const std::vector< int > &quantities)
Definition: SMDS_Mesh.cxx:1080
virtual SMDS_Mesh0DElement * Add0DElementWithID(smIdType n, smIdType ID)
create a Mesh0DElement and add it to the current Mesh
Definition: SMDS_Mesh.cxx:205
virtual SMDS_MeshFace * AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType ID)
Add a triangle defined by its nodes IDs.
Definition: SMDS_Mesh.cxx:351
virtual void RemoveNode(const SMDS_MeshNode *node)
Remove a node and all the elements which own this node.
Definition: SMDS_Mesh.cxx:1016
virtual void RemoveElement(const SMDS_MeshElement *elem, std::vector< const SMDS_MeshElement * > &removedElems, std::vector< const SMDS_MeshElement * > &removedNodes, const bool removenodes=false)
Definition: SMDS_Mesh.cxx:1855
virtual SMDS_MeshFace * AddPolygonalFaceWithID(const std::vector< smIdType > &nodes_ids, const smIdType ID)
Add a polygon defined by its nodes IDs.
Definition: SMDS_Mesh.cxx:816
virtual SMDS_MeshFace * AddPolygonalFace(const std::vector< const SMDS_MeshNode * > &nodes)
Add a polygon defined by its nodes.
Definition: SMDS_Mesh.cxx:854
virtual SMDS_MeshNode * AddNodeWithID(double x, double y, double z, smIdType ID)
create a MeshNode and add it to the current Mesh
Definition: SMDS_Mesh.cxx:187
virtual SMDS_MeshVolume * AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID)
Create a new tetrahedron and add it to the mesh.
Definition: SMDS_Mesh.cxx:458
virtual SMDS_MeshVolume * AddPolyhedralVolume(const std::vector< const SMDS_MeshNode * > &nodes, const std::vector< int > &quantities)
Create a new polyhedral volume and add it to the mesh.
Definition: SMDS_Mesh.cxx:955
virtual SMDS_BallElement * AddBall(const SMDS_MeshNode *n, double diameter)
create a Ball and add it to the current Mesh
Definition: SMDS_Mesh.cxx:259
virtual SMDS_MeshFace * AddQuadPolygonalFaceWithID(const std::vector< smIdType > &nodes_ids, const smIdType ID)
Add a quadratic polygon defined by its nodes IDs.
Definition: SMDS_Mesh.cxx:863
virtual SMDS_MeshFace * AddQuadPolygonalFace(const std::vector< const SMDS_MeshNode * > &nodes)
Add a quadratic polygon defined by its nodes.
Definition: SMDS_Mesh.cxx:899
virtual void CompactMesh()
Definition: SMDS_Mesh.cxx:2997
virtual SMDS_MeshFace * AddFace(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3)
Add a triangle defined by its nodes.
Definition: SMDS_Mesh.cxx:340
virtual SMDS_MeshVolume * AddPolyhedralVolumeWithID(const std::vector< smIdType > &nodes_ids, const std::vector< int > &quantities, const smIdType ID)
Create a new polyhedral volume and add it to the mesh.
Definition: SMDS_Mesh.cxx:911
virtual SMDS_MeshEdge * AddEdgeWithID(smIdType n1, smIdType n2, smIdType ID)
create a MeshEdge and add it to the current Mesh
Definition: SMDS_Mesh.cxx:292
virtual SMDS_MeshNode * AddNode(double x, double y, double z)
create a MeshNode and add it to the current Mesh An ID is automatically assigned to the node.
Definition: SMDS_Mesh.cxx:177
virtual SMDS_MeshEdge * AddEdge(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2)
create a MeshEdge and add it to the current Mesh
Definition: SMDS_Mesh.cxx:305
virtual void RemoveFreeElement(const SMDS_MeshElement *elem)
Remove only the given element and only if it is free.
Definition: SMDS_Mesh.cxx:1952
virtual SMDS_MeshVolume * AddVolume(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4)
Create a new tetrahedron and add it to the mesh.
Definition: SMDS_Mesh.cxx:443
virtual SMDS_Mesh0DElement * Add0DElement(const SMDS_MeshNode *n)
create a Mesh0DElement and add it to the current Mesh
Definition: SMDS_Mesh.cxx:216
Definition: SMESHDS_GroupBase.hxx:42
Definition: SMESHDS_Hypothesis.hxx:37
Definition: SMESHDS_Mesh.cxx:56
Definition: SMESHDS_Mesh.hxx:98
NCollection_DataMap< int, std::shared_ptr< SMESHUtils::SMESH_RegularGrid > > myRegularGrid
Definition: SMESHDS_Mesh.hxx:715
const std::set< SMESHDS_GroupBase * > & GetGroups() const
Definition: SMESHDS_Mesh.hxx:676
ShapeToHypothesis myShapeToHypothesis
Definition: SMESHDS_Mesh.hxx:695
void RemoveGroup(SMESHDS_GroupBase *theGroup)
Definition: SMESHDS_Mesh.hxx:674
std::set< SMESHDS_GroupBase * > TGroups
Definition: SMESHDS_Mesh.hxx:705
int myPersistentID
Definition: SMESHDS_Mesh.hxx:697
TGroups myGroups
Definition: SMESHDS_Mesh.hxx:706
TopoDS_Shape myShape
Definition: SMESHDS_Mesh.hxx:698
SubMeshHolder * mySubMeshHolder
Definition: SMESHDS_Mesh.hxx:701
const ShapeToHypothesis & GetHypotheses() const
Definition: SMESHDS_Mesh.hxx:659
int MaxShapeIndex() const
Definition: SMESHDS_Mesh.hxx:666
bool myIsEmbeddedMode
Definition: SMESHDS_Mesh.hxx:709
SMESHDS_Script * myScript
Definition: SMESHDS_Mesh.hxx:708
size_t GetNbGroups() const
Definition: SMESHDS_Mesh.hxx:675
void AddGroup(SMESHDS_GroupBase *theGroup)
Definition: SMESHDS_Mesh.hxx:673
TopTools_IndexedMapOfShape myIndexToShape
Definition: SMESHDS_Mesh.hxx:703
Definition: SMESHDS_Script.hxx:41
Definition: SMESHDS_SubMesh.hxx:48
Definition: SMESHDS_DataMapOfShape.hxx:36
static Standard_Boolean IsEqual(const TopoDS_Shape &S1, const TopoDS_Shape &S2)
Definition: SMESHDS_Mesh.hxx:69
static Standard_Integer HashCode(const TopoDS_Shape &S, const Standard_Integer Upper)
Definition: SMESHDS_Mesh.hxx:74