Skip to content

Commit

Permalink
Group method in a way that makes more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Mar 11, 2022
1 parent c0a2ef2 commit 21dd277
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/kernel/shape/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ impl Topology<'_> {
Ok(handle)
}

/// Access iterator over all vertices
///
/// The caller must not make any assumptions about the order of vertices.
pub fn vertices(&self) -> impl Iterator<Item = Handle<Vertex>> + '_ {
self.vertices.iter().map(|storage| storage.handle())
}

/// Add an edge to the shape
///
/// Validates that the edge is structurally sound (i.e. the curve and
Expand Down Expand Up @@ -161,13 +154,6 @@ impl Topology<'_> {
})
}

/// Access iterator over all edges
///
/// The caller must not make any assumptions about the order of edges.
pub fn edges(&self) -> impl Iterator<Item = Handle<Edge>> + '_ {
self.edges.iter().map(|storage| storage.handle())
}

/// Add a cycle to the shape
///
/// Validates that the cycle is structurally sound (i.e. the edges it refers
Expand Down Expand Up @@ -198,11 +184,6 @@ impl Topology<'_> {
Ok(handle)
}

/// Access an iterator over all cycles
pub fn cycles(&self) -> impl Iterator<Item = Handle<Cycle>> + '_ {
self.cycles.iter().map(|storage| storage.handle())
}

/// Add a face to the shape
///
/// Validates that the face is structurally sound (i.e. the surface and
Expand Down Expand Up @@ -238,6 +219,25 @@ impl Topology<'_> {
Ok(handle)
}

/// Access iterator over all vertices
///
/// The caller must not make any assumptions about the order of vertices.
pub fn vertices(&self) -> impl Iterator<Item = Handle<Vertex>> + '_ {
self.vertices.iter().map(|storage| storage.handle())
}

/// Access iterator over all edges
///
/// The caller must not make any assumptions about the order of edges.
pub fn edges(&self) -> impl Iterator<Item = Handle<Edge>> + '_ {
self.edges.iter().map(|storage| storage.handle())
}

/// Access an iterator over all cycles
pub fn cycles(&self) -> impl Iterator<Item = Handle<Cycle>> + '_ {
self.cycles.iter().map(|storage| storage.handle())
}

/// Access an iterator over all faces
pub fn faces(&self) -> impl Iterator<Item = Handle<Face>> + '_ {
self.faces.iter().map(|storage| storage.handle())
Expand Down

0 comments on commit 21dd277

Please sign in to comment.