0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / BRepMesh / BRepMesh_SelectorOfDataStructureOfDelaun.hxx
CommitLineData
fc9b36d6 1// Copyright (c) 2013 OPEN CASCADE SAS
2//
3// This file is part of Open CASCADE Technology software library.
4//
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.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
13
14#ifndef _BRepMesh_SelectorOfDataStructureOfDelaun_HeaderFile
15#define _BRepMesh_SelectorOfDataStructureOfDelaun_HeaderFile
16
7bd071ed 17#include <Standard_Transient.hxx>
fc9b36d6 18#include <BRepMesh_DataStructureOfDelaun.hxx>
fc9b36d6 19#include <BRepMesh_Triangle.hxx>
7bd071ed 20#include <IMeshData_Types.hxx>
fc9b36d6 21
22class BRepMesh_Vertex;
23class BRepMesh_Edge;
24
25//! Describes a selector and an iterator on a
26//! selector of components of a mesh.
7bd071ed 27class BRepMesh_SelectorOfDataStructureOfDelaun : public Standard_Transient
fc9b36d6 28{
29public:
30
fc9b36d6 31 //! Default constructor.
32 Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun();
33
34 //! Constructor.
35 //! Initializes selector by the mesh.
36 Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun(const Handle(BRepMesh_DataStructureOfDelaun)& theMesh);
37
38 //! Initializes selector by the mesh.
39 Standard_EXPORT void Initialize(const Handle(BRepMesh_DataStructureOfDelaun)& theMesh);
40
41 //! Selects all neighboring elements of the given node.
42 Standard_EXPORT void NeighboursOf(const BRepMesh_Vertex& theNode);
43
44 //! Selects all neighboring elements of node with the given index.
45 Standard_EXPORT void NeighboursOfNode(const Standard_Integer theNodeIndex);
46
47 //! Selects all neighboring elements of the given link.
48 Standard_EXPORT void NeighboursOf(const BRepMesh_Edge& theLink);
49
50 //! Selects all neighboring elements of link with the given index.
51 Standard_EXPORT void NeighboursOfLink(const Standard_Integer theLinkIndex);
52
53 //! Selects all neighboring elements of the given element.
54 Standard_EXPORT void NeighboursOf(const BRepMesh_Triangle& theElement);
55
56 //! Selects all neighboring elements by nodes of the given element.
57 Standard_EXPORT void NeighboursOfElement(const Standard_Integer theElementIndex);
58
59 //! Selects all neighboring elements by links of the given element.
60 Standard_EXPORT void NeighboursByEdgeOf(const BRepMesh_Triangle& theElement);
61
62 //! Adds a level of neighbours by edge to the selector.
63 inline void NeighboursOf(const BRepMesh_SelectorOfDataStructureOfDelaun& /*theSelector*/)
64 {
65 }
66
67 //! Adds a level of neighbours by edge the selector.
68 inline void AddNeighbours()
69 {
70 }
71
72 //! Returns selected nodes.
7bd071ed 73 inline const IMeshData::MapOfInteger& Nodes() const
fc9b36d6 74 {
75 return myNodes;
76 }
77
78 //! Returns selected links.
7bd071ed 79 inline const IMeshData::MapOfInteger& Links() const
fc9b36d6 80 {
81 return myLinks;
82 }
83
84 //! Returns selected elements.
7bd071ed 85 inline const IMeshData::MapOfInteger& Elements() const
fc9b36d6 86 {
87 return myElements;
88 }
89
90 //! Gives the list of incices of frontier links.
7bd071ed 91 inline const IMeshData::MapOfInteger& FrontierLinks() const
fc9b36d6 92 {
93 return myFrontier;
94 }
95
7bd071ed 96 DEFINE_STANDARD_RTTI_INLINE(BRepMesh_SelectorOfDataStructureOfDelaun, Standard_Transient)
97
fc9b36d6 98private:
99
100 //! Collects elements connected to link with the given index.
101 void elementsOfLink(const Standard_Integer theIndex);
102
103private:
104 Handle(BRepMesh_DataStructureOfDelaun) myMesh;
7bd071ed 105 IMeshData::MapOfInteger myNodes;
106 IMeshData::MapOfInteger myLinks;
107 IMeshData::MapOfInteger myElements;
108 IMeshData::MapOfInteger myFrontier;
fc9b36d6 109};
110
111#endif