Class Mesh<TPosition>
Class for a polyhedral face-vertex mesh data structure.
Inheritance
Inherited Members
Namespace: BRIDGES.DataStructures.PolyhedralMeshes.FaceVertexMesh
Assembly: BRIDGES.dll
Syntax
public class Mesh<TPosition> : Mesh<TPosition, Vertex<TPosition>, Edge<TPosition>, Face<TPosition>>, IMesh<TPosition> where TPosition : IEquatable<TPosition>
Type Parameters
Name | Description |
---|---|
TPosition | Type for the position of the vertex. |
Constructors
| Improve this Doc View SourceMesh()
Initialises a new instance of the Mesh<TPosition> class.
Declaration
public Mesh()
Fields
| Improve this Doc View Source_newEdgeIndex
Index for a newly created edge.
Declaration
protected int _newEdgeIndex
Field Value
Type | Description |
---|---|
Int32 |
Remarks
This may not match with EdgeCount if edges are removed from the mesh.
_newFaceIndex
Index for a newly created face.
Declaration
protected int _newFaceIndex
Field Value
Type | Description |
---|---|
Int32 |
Remarks
This may not match with FaceCount if faces are removed from the mesh.
_newVertexIndex
Index for a newly created vertex.
Declaration
protected int _newVertexIndex
Field Value
Type | Description |
---|---|
Int32 |
Remarks
This may not match with VertexCount if vertices are removed from the mesh.
Properties
| Improve this Doc View SourceEdgeCount
Gets the number of edges in the current mesh.
Declaration
public override int EdgeCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
FaceCount
Gets the number of faces in the current mesh.
Declaration
public override int FaceCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
VertexCount
Gets the number of vertices in the current mesh.
Declaration
public override int VertexCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
Methods
| Improve this Doc View SourceAddFace(List<Vertex<TPosition>>)
Adds a new face to the current mesh from its vertices.
Declaration
public override Face<TPosition> AddFace(List<Vertex<TPosition>> vertices)
Parameters
Type | Name | Description |
---|---|---|
List<Vertex<TPosition>> | vertices |
Returns
Type | Description |
---|---|
Face<TPosition> | The new face if it was added, null otherwise. |
Overrides
AddVertex(TPosition)
Adds a vertex in the mesh from its position.
Declaration
public override Vertex<TPosition> AddVertex(TPosition position)
Parameters
Type | Name | Description |
---|---|---|
TPosition | position | Position of the vertex. |
Returns
Type | Description |
---|---|
Vertex<TPosition> | The new vertex if it was added, null otherwise. |
Overrides
CleanMesh(Boolean)
Cleans the current mesh by reindexing the faces, edges and vertices.
Declaration
public override void CleanMesh(bool cullIsolated = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | cullIsolated | Evaluates whether isolated members should be removed in the process. |
Overrides
Clone()
Creates a new object that is a deep copy of the current instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
Object | The new object that is a deep copy of the current instance. |
Overrides
EraseEdge(Edge<TPosition>)
Erases the edge from the mesh. The mesh may not be manifold after this operation.
Declaration
public override void EraseEdge(Edge<TPosition> edge)
Parameters
Type | Name | Description |
---|---|---|
Edge<TPosition> | edge |
Overrides
EraseFace(Face<TPosition>)
Erases the face from the mesh. The mesh may not be manifold after this operation.
Declaration
public override void EraseFace(Face<TPosition> face)
Parameters
Type | Name | Description |
---|---|---|
Face<TPosition> | face |
Overrides
EraseVertex(Vertex<TPosition>)
Erases the vertex from the mesh. Every reference to this vertex should be deleted before it is erased.
Declaration
protected override void EraseVertex(Vertex<TPosition> vertex)
Parameters
Type | Name | Description |
---|---|---|
Vertex<TPosition> | vertex |
Overrides
GetEdge(Int32)
Returns the edge at the given index in the mesh.
Declaration
public override Edge<TPosition> GetEdge(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Edge<TPosition> | The edge at the given index in the mesh. |
Overrides
GetEdges()
Returns the list of edges of the current mesh.
Declaration
public override IReadOnlyList<Edge<TPosition>> GetEdges()
Returns
Type | Description |
---|---|
IReadOnlyList<Edge<TPosition>> | List of edges of the mesh. |
Overrides
Remarks
If some edges were removed from the mesh, the index of the edge in the returned list might not match the edge index in the mesh.
The index of the edges in the mesh is accessible through the Index property.
GetFace(Int32)
Returns the face at the given index in the mesh.
Declaration
public override Face<TPosition> GetFace(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Face<TPosition> | The face at the given index in the mesh. |
Overrides
GetFaces()
Returns the list of faces of the current mesh.
Declaration
public override IReadOnlyList<Face<TPosition>> GetFaces()
Returns
Type | Description |
---|---|
IReadOnlyList<Face<TPosition>> | List of faces of the mesh. |
Overrides
Remarks
If some faces were removed from the mesh, the index of the face in the returned list might not match the face index in the mesh.
The index of the faces in the mesh is accessible through the Index property.
GetVertex(Int32)
Returns the vertex at the given index in the mesh.
Declaration
public override Vertex<TPosition> GetVertex(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Vertex<TPosition> | The vertex at the given index in the mesh. |
Overrides
GetVertices()
Returns the list of vertices of the current mesh.
Declaration
public override IReadOnlyList<Vertex<TPosition>> GetVertices()
Returns
Type | Description |
---|---|
IReadOnlyList<Vertex<TPosition>> | List of vertices of the mesh. |
Overrides
Remarks
If some vertices were removed from the mesh, the index of the vertex in the returned list might not match the vertex index in the mesh.
The index of the vertices in the mesh is accessible through the Index property.
RemoveEdge(Edge<TPosition>)
Removes the edge from the mesh by keeping the mesh manifold.
Declaration
public override void RemoveEdge(Edge<TPosition> edge)
Parameters
Type | Name | Description |
---|---|---|
Edge<TPosition> | edge |
Overrides
RemoveFace(Face<TPosition>)
Removes the face from the mesh by keeping the mesh manifold.
Declaration
public override void RemoveFace(Face<TPosition> face)
Parameters
Type | Name | Description |
---|---|---|
Face<TPosition> | face |
Overrides
RemoveVertex(Vertex<TPosition>)
Removes the vertex from the mesh by keeping the mesh manifold.
Declaration
public override void RemoveVertex(Vertex<TPosition> vertex)
Parameters
Type | Name | Description |
---|---|---|
Vertex<TPosition> | vertex |
Overrides
ToHalfedgeMesh()
Creates a halfedge mesh from the current face-vertex mesh.
Declaration
public Mesh<TPosition> ToHalfedgeMesh()
Returns
Type | Description |
---|---|
Mesh<TPosition> | Halfedge mesh which represents the topology and geometry of the current face-vertex mesh. |
ToString()
Class for a polyhedral face-vertex mesh data structure.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
TryGetEdge(Int32)
Returns the edge at the given index in the mesh if it exists, null otherwise.
Declaration
public override Edge<TPosition> TryGetEdge(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the edge to look for. |
Returns
Type | Description |
---|---|
Edge<TPosition> | The edge if it exists, null otherwise. |
Overrides
TryGetFace(Int32)
Returns the face at the given index in the mesh if it exists, null otherwise.
Declaration
public override Face<TPosition> TryGetFace(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the face to look for. |
Returns
Type | Description |
---|---|
Face<TPosition> | The face if it exists, null otherwise. |
Overrides
TryGetVertex(Int32)
Returns the vertex at the given index in the mesh if it exists, null otherwise.
Declaration
public override Vertex<TPosition> TryGetVertex(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the vertex to look for. |
Returns
Type | Description |
---|---|
Vertex<TPosition> | The vertex if it exists, null otherwise. |