pub trait IsPolygon<V> {
// Required methods
fn num_segments(&self) -> usize;
fn segment_vertex_ids(&self, segmentid: SId) -> Result<(VId, VId)>;
fn segment_vertices(&self, segmentid: SId) -> Result<(V, V)>;
fn vertex(&self, vertexid: VId) -> Result<V>;
// Provided method
fn num_vertices(&self) -> usize { ... }
}
Expand description
IsPolygon is a trait used for closed polygons
Required Methods§
Sourcefn num_segments(&self) -> usize
fn num_segments(&self) -> usize
Should return the number of segments within the polygon
Sourcefn segment_vertex_ids(&self, segmentid: SId) -> Result<(VId, VId)>
fn segment_vertex_ids(&self, segmentid: SId) -> Result<(VId, VId)>
Should return the ids of vertices of the given segment
Sourcefn segment_vertices(&self, segmentid: SId) -> Result<(V, V)>
fn segment_vertices(&self, segmentid: SId) -> Result<(V, V)>
Should return the vertices of the given segment
Provided Methods§
Sourcefn num_vertices(&self) -> usize
fn num_vertices(&self) -> usize
Returns the number of vertices within the polygon