Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:16:38

0001 // Copyright (c) 2013 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _BRepMesh_SelectorOfDataStructureOfDelaun_HeaderFile
0015 #define _BRepMesh_SelectorOfDataStructureOfDelaun_HeaderFile
0016 
0017 #include <Standard_Transient.hxx>
0018 #include <BRepMesh_DataStructureOfDelaun.hxx>
0019 #include <BRepMesh_Triangle.hxx>
0020 #include <IMeshData_Types.hxx>
0021 
0022 class BRepMesh_Vertex;
0023 class BRepMesh_Edge;
0024 
0025 //! Describes a selector and an iterator on a
0026 //! selector of components of a mesh.
0027 class BRepMesh_SelectorOfDataStructureOfDelaun : public Standard_Transient
0028 {
0029 public:
0030   //! Default constructor.
0031   Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun();
0032 
0033   //! Constructor.
0034   //! Initializes selector by the mesh.
0035   Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun(
0036     const occ::handle<BRepMesh_DataStructureOfDelaun>& theMesh);
0037 
0038   //! Initializes selector by the mesh.
0039   Standard_EXPORT void Initialize(const occ::handle<BRepMesh_DataStructureOfDelaun>& theMesh);
0040 
0041   //! Selects all neighboring elements of the given node.
0042   Standard_EXPORT void NeighboursOf(const BRepMesh_Vertex& theNode);
0043 
0044   //! Selects all neighboring elements of node with the given index.
0045   Standard_EXPORT void NeighboursOfNode(const int theNodeIndex);
0046 
0047   //! Selects all neighboring elements of the given link.
0048   Standard_EXPORT void NeighboursOf(const BRepMesh_Edge& theLink);
0049 
0050   //! Selects all neighboring elements of link with the given index.
0051   Standard_EXPORT void NeighboursOfLink(const int theLinkIndex);
0052 
0053   //! Selects all neighboring elements of the given element.
0054   Standard_EXPORT void NeighboursOf(const BRepMesh_Triangle& theElement);
0055 
0056   //! Selects all neighboring elements by nodes of the given element.
0057   Standard_EXPORT void NeighboursOfElement(const int theElementIndex);
0058 
0059   //! Selects all neighboring elements by links of the given element.
0060   Standard_EXPORT void NeighboursByEdgeOf(const BRepMesh_Triangle& theElement);
0061 
0062   //! Adds a level of neighbours by edge to the selector.
0063   void NeighboursOf(const BRepMesh_SelectorOfDataStructureOfDelaun& /*theSelector*/) {}
0064 
0065   //! Adds a level of neighbours by edge the selector.
0066   void AddNeighbours() {}
0067 
0068   //! Returns selected nodes.
0069   const IMeshData::MapOfInteger& Nodes() const { return myNodes; }
0070 
0071   //! Returns selected links.
0072   const IMeshData::MapOfInteger& Links() const { return myLinks; }
0073 
0074   //! Returns selected elements.
0075   const IMeshData::MapOfInteger& Elements() const { return myElements; }
0076 
0077   //! Gives the list of incices of frontier links.
0078   const IMeshData::MapOfInteger& FrontierLinks() const { return myFrontier; }
0079 
0080   DEFINE_STANDARD_RTTIEXT(BRepMesh_SelectorOfDataStructureOfDelaun, Standard_Transient)
0081 
0082 private:
0083   //! Collects elements connected to link with the given index.
0084   void elementsOfLink(const int theIndex);
0085 
0086 private:
0087   occ::handle<BRepMesh_DataStructureOfDelaun> myMesh;
0088   IMeshData::MapOfInteger                     myNodes;
0089   IMeshData::MapOfInteger                     myLinks;
0090   IMeshData::MapOfInteger                     myElements;
0091   IMeshData::MapOfInteger                     myFrontier;
0092 };
0093 
0094 #endif