1 // Copyright (c) 2013 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _BRepMesh_SelectorOfDataStructureOfDelaun_HeaderFile
15 #define _BRepMesh_SelectorOfDataStructureOfDelaun_HeaderFile
17 #include <Standard.hxx>
18 #include <Standard_DefineAlloc.hxx>
19 #include <Standard_Macro.hxx>
20 #include <BRepMesh_DataStructureOfDelaun.hxx>
21 #include <BRepMesh.hxx>
22 #include <Standard_Integer.hxx>
23 #include <BRepMesh_Triangle.hxx>
25 class BRepMesh_Vertex;
28 //! Describes a selector and an iterator on a
29 //! selector of components of a mesh.
30 class BRepMesh_SelectorOfDataStructureOfDelaun
36 //! Default constructor.
37 Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun();
40 //! Initializes selector by the mesh.
41 Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun(const Handle(BRepMesh_DataStructureOfDelaun)& theMesh);
43 //! Initializes selector by the mesh.
44 Standard_EXPORT void Initialize(const Handle(BRepMesh_DataStructureOfDelaun)& theMesh);
46 //! Selects all neighboring elements of the given node.
47 Standard_EXPORT void NeighboursOf(const BRepMesh_Vertex& theNode);
49 //! Selects all neighboring elements of node with the given index.
50 Standard_EXPORT void NeighboursOfNode(const Standard_Integer theNodeIndex);
52 //! Selects all neighboring elements of the given link.
53 Standard_EXPORT void NeighboursOf(const BRepMesh_Edge& theLink);
55 //! Selects all neighboring elements of link with the given index.
56 Standard_EXPORT void NeighboursOfLink(const Standard_Integer theLinkIndex);
58 //! Selects all neighboring elements of the given element.
59 Standard_EXPORT void NeighboursOf(const BRepMesh_Triangle& theElement);
61 //! Selects all neighboring elements by nodes of the given element.
62 Standard_EXPORT void NeighboursOfElement(const Standard_Integer theElementIndex);
64 //! Selects all neighboring elements by links of the given element.
65 Standard_EXPORT void NeighboursByEdgeOf(const BRepMesh_Triangle& theElement);
67 //! Adds a level of neighbours by edge to the selector.
68 inline void NeighboursOf(const BRepMesh_SelectorOfDataStructureOfDelaun& /*theSelector*/)
72 //! Adds a level of neighbours by edge the selector.
73 inline void AddNeighbours()
77 //! Returns selected nodes.
78 inline const BRepMesh::MapOfInteger& Nodes() const
83 //! Returns selected links.
84 inline const BRepMesh::MapOfInteger& Links() const
89 //! Returns selected elements.
90 inline const BRepMesh::MapOfInteger& Elements() const
95 //! Gives the list of incices of frontier links.
96 inline const BRepMesh::MapOfInteger& FrontierLinks() const
103 //! Collects elements connected to link with the given index.
104 void elementsOfLink(const Standard_Integer theIndex);
107 Handle(NCollection_IncAllocator) myAllocator;
108 Handle(BRepMesh_DataStructureOfDelaun) myMesh;
109 BRepMesh::MapOfInteger myNodes;
110 BRepMesh::MapOfInteger myLinks;
111 BRepMesh::MapOfInteger myElements;
112 BRepMesh::MapOfInteger myFrontier;