Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:14

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 
0031   //! Default constructor.
0032   Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun();
0033   
0034   //! Constructor.
0035   //! Initializes selector by the mesh.
0036   Standard_EXPORT BRepMesh_SelectorOfDataStructureOfDelaun(const Handle(BRepMesh_DataStructureOfDelaun)& theMesh);
0037   
0038   //! Initializes selector by the mesh.
0039   Standard_EXPORT void Initialize(const 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 Standard_Integer 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 Standard_Integer 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 Standard_Integer 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   }
0066   
0067   //! Adds a level of neighbours by edge the selector.
0068   void AddNeighbours()
0069   {
0070   }
0071   
0072   //! Returns selected nodes.
0073   const IMeshData::MapOfInteger& Nodes() const
0074   {
0075     return myNodes;
0076   }
0077   
0078   //! Returns selected links.
0079   const IMeshData::MapOfInteger& Links() const
0080   {
0081     return myLinks;
0082   }
0083   
0084   //! Returns selected elements.
0085   const IMeshData::MapOfInteger& Elements() const
0086   {
0087     return myElements;
0088   }
0089   
0090   //! Gives the list of incices of frontier links.
0091   const IMeshData::MapOfInteger& FrontierLinks() const
0092   {
0093     return myFrontier;
0094   }
0095 
0096   DEFINE_STANDARD_RTTIEXT(BRepMesh_SelectorOfDataStructureOfDelaun, Standard_Transient)
0097 
0098 private:
0099 
0100   //! Collects elements connected to link with the given index.
0101   void elementsOfLink(const Standard_Integer theIndex);
0102 
0103 private:
0104   Handle(BRepMesh_DataStructureOfDelaun) myMesh;
0105   IMeshData::MapOfInteger                myNodes;
0106   IMeshData::MapOfInteger                myLinks;
0107   IMeshData::MapOfInteger                myElements;
0108   IMeshData::MapOfInteger                myFrontier;
0109 };
0110 
0111 #endif