hgeometry-polygon
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2024

HGeometry.Polygon.Class

Description

A polygon and some basic functions to interact with them.

Synopsis

Documentation

class HasVertices polygon polygon => HasOuterBoundary polygon where Source #

A class for items that have an outer boundary.

Methods

outerBoundary :: IndexedTraversal1' (VertexIx polygon) polygon (Vertex polygon) Source #

A fold over all vertices of the outer boundary, the vertices are traversed in CCW order.

running time :: \(O(n)\)

default outerBoundary :: Num (VertexIx polygon) => IndexedFold1 (VertexIx polygon) polygon (Vertex polygon) Source #

ccwOuterBoundaryFrom :: VertexIx polygon -> IndexedTraversal1' (VertexIx polygon) polygon (Vertex polygon) Source #

A CCW-traversal over all vertices of the outer boundary, starting from the vertex with the given index.

running time :: \(O(n)\)

cwOuterBoundaryFrom :: VertexIx polygon -> IndexedTraversal1' (VertexIx polygon) polygon (Vertex polygon) Source #

A CW-fold over all vertices of the outer boundary, starting from the vertex with the given index.

running time :: \(O(n)\)

outerBoundaryVertexAt :: VertexIx polygon -> IndexedGetter (VertexIx polygon) polygon (Vertex polygon) Source #

A particular vertex of the outer polygon

running time: \(O(1)\)

outerBoundaryEdges :: IndexedFold1 (VertexIx polygon, VertexIx polygon) polygon (Vertex polygon, Vertex polygon) Source #

A fold over all edges in the polygon. The edges are folded over in CCW order, and each edge is associated with the index of its start vertex outerBoundaryEdges :: IndexedFold (VertexIx polygon) polygon (Vertex polygon, Vertex polygon)

running time :: \(O(n)\)

default outerBoundaryEdges :: Enum (VertexIx polygon) => IndexedFold1 (VertexIx polygon, VertexIx polygon) polygon (Vertex polygon, Vertex polygon) Source #

outerBoundaryEdgeAt :: VertexIx polygon -> IndexedGetter (VertexIx polygon, VertexIx polygon) polygon (Vertex polygon, Vertex polygon) Source #

Get the edge that has the given vertex as its starting edge

running time: \(O(1)\)

default outerBoundaryEdgeAt :: Enum (VertexIx polygon) => VertexIx polygon -> IndexedGetter (VertexIx polygon, VertexIx polygon) polygon (Vertex polygon, Vertex polygon) Source #

Instances

Instances details
(Point_ point 2 r, Num r, Eq r) => HasOuterBoundary (Triangle point) Source # 
Instance details

Defined in HGeometry.Polygon.Class

HasOuterBoundary polygon => HasOuterBoundary (polygon :+ extra) Source # 
Instance details

Defined in HGeometry.Polygon.Class

Methods

outerBoundary :: IndexedTraversal1' (VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra)) Source #

ccwOuterBoundaryFrom :: VertexIx (polygon :+ extra) -> IndexedTraversal1' (VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra)) Source #

cwOuterBoundaryFrom :: VertexIx (polygon :+ extra) -> IndexedTraversal1' (VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra)) Source #

outerBoundaryVertexAt :: VertexIx (polygon :+ extra) -> IndexedGetter (VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra)) Source #

outerBoundaryEdges :: IndexedFold1 (VertexIx (polygon :+ extra), VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra), Vertex (polygon :+ extra)) Source #

outerBoundaryEdgeAt :: VertexIx (polygon :+ extra) -> IndexedGetter (VertexIx (polygon :+ extra), VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra), Vertex (polygon :+ extra)) Source #

(HasOuterBoundary (SimplePolygonF f point), VertexIx (SimplePolygonF f point) ~ Int) => HasOuterBoundary (ConvexPolygonF f point) Source # 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

VertexContainer f point => HasOuterBoundary (SimplePolygonF f point) Source # 
Instance details

Defined in HGeometry.Polygon.Simple

HoleContainer h f point => HasOuterBoundary (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

signedArea2X :: (Num r, HasOuterBoundary simplePolygon, Point_ point 2 r, Vertex simplePolygon ~ point) => simplePolygon -> r Source #

Compute the signed area times 2 of a simple polygon. The the vertices are in clockwise order, the signed area will be negative, if the verices are given in counter clockwise order, the area will be positive.

running time: \(O(n)\)

minimumVertexBy :: HasOuterBoundary polygon => (Vertex polygon -> Vertex polygon -> Ordering) -> IndexedFold1 (VertexIx polygon) polygon (Vertex polygon) Source #

Yield the minimum vertex of a polygon according to the given comparison function.

running time \( O(n) \)

Yield the minimum vertex of a polygon according to the given comparison function.

running time \( O(n) \)

maximumVertexBy :: HasOuterBoundary polygon => (Vertex polygon -> Vertex polygon -> Ordering) -> IndexedFold1 (VertexIx polygon) polygon (Vertex polygon) Source #

Yield the maximum vertex of a polygon according to the given comparison function.

running time \( O(n) \)

outerBoundaryEdgeSegmentAt :: (HasOuterBoundary polygon, Vertex polygon ~ point, Point_ point 2 r) => VertexIx polygon -> IndexedGetter (VertexIx polygon, VertexIx polygon) polygon (ClosedLineSegment point) Source #

Get the line segment representing the edge that has the given vertex as its starting edge

running time: \(O(1)\)

outerBoundaryEdgeSegments :: (HasOuterBoundary polygon, Vertex polygon ~ point, Point_ point 2 r) => IndexedFold1 (VertexIx polygon, VertexIx polygon) polygon (ClosedLineSegment point) Source #

Get the line segments representing the outer boundary of the polygon.

outerBoundaryWithNeighbours :: (HasOuterBoundary polygon, VertexIx polygon ~ Int) => IndexedFold1 (VertexIx polygon, (VertexIx polygon, VertexIx polygon)) polygon (Vertex polygon, (Vertex polygon, Vertex polygon)) Source #

A fold that associates each vertex on the boundary with its predecessor and successor (in that order) along the boundary.

type Hole polygon = SimplePolygonF (HoleF polygon) (Vertex polygon) Source #

A hole is a simple polygon

class VertexContainer (HoleF polygon) (Vertex polygon) => HasHoles polygon where Source #

Accessing the holes in a polygon (if there are any.)

the default implementation assumes there are no holes

Minimal complete definition

Nothing

Associated Types

type HoleIx polygon Source #

Type we use to index holes.

type HoleIx polygon = Void

type HoleF polygon :: Type -> Type Source #

The functor used in the holes

Traversal over the holes in the polygon. Each hole is a simple polygon.

type HoleF polygon = Cyclic NonEmptyVector

Methods

holes :: IndexedTraversal' (HoleIx polygon) polygon (Hole polygon) Source #

holeAt :: HoleIx polygon -> IndexedTraversal' (HoleIx polygon) polygon (Hole polygon) Source #

Instances

Instances details
HasHoles polygon => HasHoles (polygon :+ extra) Source # 
Instance details

Defined in HGeometry.Polygon.Class

Associated Types

type HoleIx (polygon :+ extra) 
Instance details

Defined in HGeometry.Polygon.Class

type HoleIx (polygon :+ extra) = HoleIx polygon
type HoleF (polygon :+ extra) 
Instance details

Defined in HGeometry.Polygon.Class

type HoleF (polygon :+ extra) = HoleF polygon

Methods

holes :: IndexedTraversal' (HoleIx (polygon :+ extra)) (polygon :+ extra) (Hole (polygon :+ extra)) Source #

holeAt :: HoleIx (polygon :+ extra) -> IndexedTraversal' (HoleIx (polygon :+ extra)) (polygon :+ extra) (Hole (polygon :+ extra)) Source #

HasHoles (ConvexPolygonF f point) Source # 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

Associated Types

type HoleIx (ConvexPolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

type HoleIx (ConvexPolygonF f point) = Void
type HoleF (ConvexPolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

HasHoles (SimplePolygonF f point) Source # 
Instance details

Defined in HGeometry.Polygon.Simple

Associated Types

type HoleIx (SimplePolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Simple

type HoleIx (SimplePolygonF f point) = Void
type HoleF (SimplePolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Simple

HoleContainer h f point => HasHoles (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Associated Types

type HoleIx (PolygonalDomainF h f point) 
Instance details

Defined in HGeometry.Polygon.WithHoles

type HoleIx (PolygonalDomainF h f point) = Int
type HoleF (PolygonalDomainF h f point) 
Instance details

Defined in HGeometry.Polygon.WithHoles

type HoleF (PolygonalDomainF h f point) = f

class (HasOuterBoundary polygon, Vertex polygon ~ point, Point_ point 2 r, NumType polygon ~ r, Dimension polygon ~ 2, HasHoles polygon) => Polygon_ polygon point r where Source #

A class representing (planar) polygons. The edges of the polygon may not intersect.

Minimal complete definition

ccwPredecessorOf, ccwSuccessorOf

Methods

extremes :: Vector 2 r -> polygon -> (point, point) Source #

Finds the extreme points, minimum and maximum, in a given direction

running time: \(O(n)\)

ccwPredecessorOf :: VertexIx polygon -> IndexedLens' (VertexIx polygon) polygon (Vertex polygon) Source #

Given a vertexIdx v; get an IndexedLens to access the CCW predecessor of v

ccwSuccessorOf :: VertexIx polygon -> IndexedLens' (VertexIx polygon) polygon (Vertex polygon) Source #

Given a vertexIdx v; get an IndexedLens to access the CCW predecessor of v

Instances

Instances details
Polygon_ polygon point r => Polygon_ (polygon :+ extra) point r Source # 
Instance details

Defined in HGeometry.Polygon.Class

Methods

extremes :: Vector 2 r -> (polygon :+ extra) -> (point, point) Source #

ccwPredecessorOf :: VertexIx (polygon :+ extra) -> IndexedLens' (VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra)) Source #

ccwSuccessorOf :: VertexIx (polygon :+ extra) -> IndexedLens' (VertexIx (polygon :+ extra)) (polygon :+ extra) (Vertex (polygon :+ extra)) Source #

(SimplePolygon_ (SimplePolygonF f point) point r, Point_ point 2 r) => Polygon_ (ConvexPolygonF f point) point r Source # 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

(Point_ point 2 r, HasFromFoldable1 f, VertexContainer f point) => Polygon_ (SimplePolygonF f point) point r Source # 
Instance details

Defined in HGeometry.Polygon.Simple

(Point_ point 2 r, HasFromFoldable1 f, HoleContainer h f point) => Polygon_ (PolygonalDomainF h f point) point r Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

extremes :: Vector 2 r -> PolygonalDomainF h f point -> (point, point) Source #

ccwPredecessorOf :: VertexIx (PolygonalDomainF h f point) -> IndexedLens' (VertexIx (PolygonalDomainF h f point)) (PolygonalDomainF h f point) (Vertex (PolygonalDomainF h f point)) Source #

ccwSuccessorOf :: VertexIx (PolygonalDomainF h f point) -> IndexedLens' (VertexIx (PolygonalDomainF h f point)) (PolygonalDomainF h f point) (Vertex (PolygonalDomainF h f point)) Source #

class HasVertices' graph => HasVertices graph graph' where Source #

Class that expresses that we have a non-empty type changing traversal of all vertices.

Methods

vertices :: IndexedTraversal1 (VertexIx graph) graph graph' (Vertex graph) (Vertex graph') Source #

Traversal of all vertices in the graph

Instances

Instances details
HasVertices Graph Graph Source # 
Instance details

Defined in Hiraffe.Graph.Class

HasVertices (Triangle point) (Triangle point') Source # 
Instance details

Defined in HGeometry.Triangle

Methods

vertices :: IndexedTraversal1 (VertexIx (Triangle point)) (Triangle point) (Triangle point') (Vertex (Triangle point)) (Vertex (Triangle point')) Source #

HasVertices graph graph' => HasVertices (graph :+ extra) (graph' :+ extra) Source # 
Instance details

Defined in Hiraffe.Graph.Class

Methods

vertices :: IndexedTraversal1 (VertexIx (graph :+ extra)) (graph :+ extra) (graph' :+ extra) (Vertex (graph :+ extra)) (Vertex (graph' :+ extra)) Source #

(Traversable1 endPoint, EndPoint_ (endPoint v), IxValue (endPoint v) ~ v) => HasVertices (LineSegment endPoint v) (LineSegment endPoint v') Source # 
Instance details

Defined in HGeometry.LineSegment.Internal

Methods

vertices :: IndexedTraversal1 (VertexIx (LineSegment endPoint v)) (LineSegment endPoint v) (LineSegment endPoint v') (Vertex (LineSegment endPoint v)) (Vertex (LineSegment endPoint v')) Source #

HasVertices (SimplePolygonF f point) (SimplePolygonF f point') => HasVertices (ConvexPolygonF f point) (ConvexPolygonF f point') Source # 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

(Traversable1 nonEmpty, Ixed (nonEmpty vertex), IxValue (nonEmpty vertex) ~ vertex, IxValue (nonEmpty vertex') ~ vertex', Index (nonEmpty vertex) ~ Int, Index (nonEmpty vertex') ~ Int) => HasVertices (UnboundedConvexRegionF r nonEmpty vertex) (UnboundedConvexRegionF r nonEmpty vertex') Source # 
Instance details

Defined in HGeometry.Polygon.Convex.Unbounded

Methods

vertices :: IndexedTraversal1 (VertexIx (UnboundedConvexRegionF r nonEmpty vertex)) (UnboundedConvexRegionF r nonEmpty vertex) (UnboundedConvexRegionF r nonEmpty vertex') (Vertex (UnboundedConvexRegionF r nonEmpty vertex)) (Vertex (UnboundedConvexRegionF r nonEmpty vertex')) Source #

VertexContainer f point => HasVertices (SimplePolygonF f point) (SimplePolygonF f point') Source # 
Instance details

Defined in HGeometry.Polygon.Simple.Type

(HoleContainer h f point, VertexContainer f point) => HasVertices (PolygonalDomainF h f point) (PolygonalDomainF h f point') Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

vertices :: IndexedTraversal1 (VertexIx (PolygonalDomainF h f point)) (PolygonalDomainF h f point) (PolygonalDomainF h f point') (Vertex (PolygonalDomainF h f point)) (Vertex (PolygonalDomainF h f point')) Source #

HasVertices (GGraph f v e) (GGraph f v' e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep

Methods

vertices :: IndexedTraversal1 (VertexIx (GGraph f v e)) (GGraph f v e) (GGraph f v' e) (Vertex (GGraph f v e)) (Vertex (GGraph f v' e)) Source #

Ord i => HasVertices (GGraph f i v e) (GGraph f i v' e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

Methods

vertices :: IndexedTraversal1 (VertexIx (GGraph f i v e)) (GGraph f i v e) (GGraph f i v' e) (Vertex (GGraph f i v e)) (Vertex (GGraph f i v' e)) Source #

HasVertices (PlanarGraph w s v e f) (PlanarGraph w s v' e f) Source # 
Instance details

Defined in Hiraffe.PlanarGraph.Type

Methods

vertices :: IndexedTraversal1 (VertexIx (PlanarGraph w s v e f)) (PlanarGraph w s v e f) (PlanarGraph w s v' e f) (Vertex (PlanarGraph w s v e f)) (Vertex (PlanarGraph w s v' e f)) Source #

class HasVertices' graph where Source #

A class representing types that have vertices.

Minimal complete definition

vertexAt

Associated Types

type Vertex graph Source #

Vertices of the graph are of this type

type VertexIx graph Source #

Vertices are indexed by elements of type VertexIx

Methods

vertexAt :: VertexIx graph -> IndexedTraversal' (VertexIx graph) graph (Vertex graph) Source #

Accessor to a given vertex.

numVertices :: graph -> Int Source #

Number of vertices in the graph.

running time: O(1)

default numVertices :: HasVertices graph graph => graph -> Int Source #

Instances

Instances details
HasVertices' Graph Source # 
Instance details

Defined in Hiraffe.Graph.Class

Associated Types

type Vertex Graph 
Instance details

Defined in Hiraffe.Graph.Class

type Vertex Graph = ()
type VertexIx Graph 
Instance details

Defined in Hiraffe.Graph.Class

HasVertices' (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Associated Types

type Vertex (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type Vertex (Triangle point) = point
type VertexIx (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type VertexIx (Triangle point) = Int
HasVertices' graph => HasVertices' (graph :+ extra) Source # 
Instance details

Defined in Hiraffe.Graph.Class

Associated Types

type Vertex (graph :+ extra) 
Instance details

Defined in Hiraffe.Graph.Class

type Vertex (graph :+ extra) = Vertex graph
type VertexIx (graph :+ extra) 
Instance details

Defined in Hiraffe.Graph.Class

type VertexIx (graph :+ extra) = VertexIx graph

Methods

vertexAt :: VertexIx (graph :+ extra) -> IndexedTraversal' (VertexIx (graph :+ extra)) (graph :+ extra) (Vertex (graph :+ extra)) Source #

numVertices :: (graph :+ extra) -> Int Source #

(IxValue (endPoint vertex) ~ vertex, EndPoint_ (endPoint vertex)) => HasVertices' (LineSegment endPoint vertex) Source # 
Instance details

Defined in HGeometry.LineSegment.Internal

Associated Types

type Vertex (LineSegment endPoint vertex) 
Instance details

Defined in HGeometry.LineSegment.Internal

type Vertex (LineSegment endPoint vertex) = vertex
type VertexIx (LineSegment endPoint vertex) 
Instance details

Defined in HGeometry.LineSegment.Internal

type VertexIx (LineSegment endPoint vertex) = StartEnd

Methods

vertexAt :: VertexIx (LineSegment endPoint vertex) -> IndexedTraversal' (VertexIx (LineSegment endPoint vertex)) (LineSegment endPoint vertex) (Vertex (LineSegment endPoint vertex)) Source #

numVertices :: LineSegment endPoint vertex -> Int Source #

HasVertices' (SimplePolygonF f point) => HasVertices' (ConvexPolygonF f point) Source # 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

Associated Types

type Vertex (ConvexPolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

type Vertex (ConvexPolygonF f point) = Vertex (SimplePolygonF f point)
type VertexIx (ConvexPolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Convex.Internal

type VertexIx (ConvexPolygonF f point) = VertexIx (SimplePolygonF f point)
(Traversable1 nonEmpty, Ixed (nonEmpty vertex), IxValue (nonEmpty vertex) ~ vertex, Index (nonEmpty vertex) ~ Int) => HasVertices' (UnboundedConvexRegionF r nonEmpty vertex) Source # 
Instance details

Defined in HGeometry.Polygon.Convex.Unbounded

Associated Types

type Vertex (UnboundedConvexRegionF r nonEmpty vertex) 
Instance details

Defined in HGeometry.Polygon.Convex.Unbounded

type Vertex (UnboundedConvexRegionF r nonEmpty vertex) = vertex
type VertexIx (UnboundedConvexRegionF r nonEmpty vertex) 
Instance details

Defined in HGeometry.Polygon.Convex.Unbounded

type VertexIx (UnboundedConvexRegionF r nonEmpty vertex) = Int

Methods

vertexAt :: VertexIx (UnboundedConvexRegionF r nonEmpty vertex) -> IndexedTraversal' (VertexIx (UnboundedConvexRegionF r nonEmpty vertex)) (UnboundedConvexRegionF r nonEmpty vertex) (Vertex (UnboundedConvexRegionF r nonEmpty vertex)) Source #

numVertices :: UnboundedConvexRegionF r nonEmpty vertex -> Int Source #

VertexContainer f point => HasVertices' (SimplePolygonF f point) Source # 
Instance details

Defined in HGeometry.Polygon.Simple.Type

Associated Types

type Vertex (SimplePolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Simple.Type

type Vertex (SimplePolygonF f point) = point
type VertexIx (SimplePolygonF f point) 
Instance details

Defined in HGeometry.Polygon.Simple.Type

type VertexIx (SimplePolygonF f point) = Int
HoleContainer h f point => HasVertices' (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Associated Types

type Vertex (PolygonalDomainF h f point) 
Instance details

Defined in HGeometry.Polygon.WithHoles

type Vertex (PolygonalDomainF h f point) = point
type VertexIx (PolygonalDomainF h f point) 
Instance details

Defined in HGeometry.Polygon.WithHoles

type VertexIx (PolygonalDomainF h f point)
HasVertices' (GGraph f v e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep

Associated Types

type Vertex (GGraph f v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep

type Vertex (GGraph f v e) = v
type VertexIx (GGraph f v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep

type VertexIx (GGraph f v e) = Int

Methods

vertexAt :: VertexIx (GGraph f v e) -> IndexedTraversal' (VertexIx (GGraph f v e)) (GGraph f v e) (Vertex (GGraph f v e)) Source #

numVertices :: GGraph f v e -> Int Source #

Ord i => HasVertices' (GGraph f i v e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

Associated Types

type Vertex (GGraph f i v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

type Vertex (GGraph f i v e) = v
type VertexIx (GGraph f i v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

type VertexIx (GGraph f i v e) = i

Methods

vertexAt :: VertexIx (GGraph f i v e) -> IndexedTraversal' (VertexIx (GGraph f i v e)) (GGraph f i v e) (Vertex (GGraph f i v e)) Source #

numVertices :: GGraph f i v e -> Int Source #

HasVertices' (DualGraph w s v e f) Source # 
Instance details

Defined in Hiraffe.PlanarGraph.Type

Associated Types

type Vertex (DualGraph w s v e f) 
Instance details

Defined in Hiraffe.PlanarGraph.Type

type Vertex (DualGraph w s v e f) = Face (PlanarGraph w s v e f)
type VertexIx (DualGraph w s v e f) 
Instance details

Defined in Hiraffe.PlanarGraph.Type

type VertexIx (DualGraph w s v e f) = FaceIx (PlanarGraph w s v e f)

Methods

vertexAt :: VertexIx (DualGraph w s v e f) -> IndexedTraversal' (VertexIx (DualGraph w s v e f)) (DualGraph w s v e f) (Vertex (DualGraph w s v e f)) Source #

numVertices :: DualGraph w s v e f -> Int Source #

HasVertices' (PlanarGraph w s v e f) Source # 
Instance details

Defined in Hiraffe.PlanarGraph.Type

Associated Types

type Vertex (PlanarGraph w s v e f) 
Instance details

Defined in Hiraffe.PlanarGraph.Type

type Vertex (PlanarGraph w s v e f) = v
type VertexIx (PlanarGraph w s v e f) 
Instance details

Defined in Hiraffe.PlanarGraph.Type

type VertexIx (PlanarGraph w s v e f) = VertexId s

Methods

vertexAt :: VertexIx (PlanarGraph w s v e f) -> IndexedTraversal' (VertexIx (PlanarGraph w s v e f)) (PlanarGraph w s v e f) (Vertex (PlanarGraph w s v e f)) Source #

numVertices :: PlanarGraph w s v e f -> Int Source #

class HasEdges' graph => HasEdges graph graph' where Source #

Class for types that have a type changing traversal of the edges

Methods

edges :: IndexedTraversal (EdgeIx graph) graph graph' (Edge graph) (Edge graph') Source #

Traversal of all edges in the graph

Instances

Instances details
HasEdges Graph Graph Source # 
Instance details

Defined in Hiraffe.Graph.Class

HasEdges graph graph' => HasEdges (graph :+ extra) (graph' :+ extra) Source # 
Instance details

Defined in Hiraffe.Graph.Class

Methods

edges :: IndexedTraversal (EdgeIx (graph :+ extra)) (graph :+ extra) (graph' :+ extra) (Edge (graph :+ extra)) (Edge (graph' :+ extra)) Source #

VertexContainer f vertex => HasEdges (SimplePolygonF f vertex) (SimplePolygonF f vertex) Source # 
Instance details

Defined in HGeometry.Polygon.Simple.Type

Methods

edges :: IndexedTraversal (EdgeIx (SimplePolygonF f vertex)) (SimplePolygonF f vertex) (SimplePolygonF f vertex) (Edge (SimplePolygonF f vertex)) (Edge (SimplePolygonF f vertex)) Source #

HasEdges (GGraph f v e) (GGraph f v e') Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep

Methods

edges :: IndexedTraversal (EdgeIx (GGraph f v e)) (GGraph f v e) (GGraph f v e') (Edge (GGraph f v e)) (Edge (GGraph f v e')) Source #

Ord i => HasEdges (GGraph f i v e) (GGraph f i v e') Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

Methods

edges :: IndexedTraversal (EdgeIx (GGraph f i v e)) (GGraph f i v e) (GGraph f i v e') (Edge (GGraph f i v e)) (Edge (GGraph f i v e')) Source #

HasEdges (PlanarGraph w s v e f) (PlanarGraph w s v e' f) Source # 
Instance details

Defined in Hiraffe.PlanarGraph.Type

Methods

edges :: IndexedTraversal (EdgeIx (PlanarGraph w s v e f)) (PlanarGraph w s v e f) (PlanarGraph w s v e' f) (Edge (PlanarGraph w s v e f)) (Edge (PlanarGraph w s v e' f)) Source #

class HasEdges' graph where Source #

A class for things that have edges

Minimal complete definition

edgeAt

Associated Types

type Edge graph Source #

The edges of the graph are of this type

type EdgeIx graph Source #

The Edges are indexed by something of type EdgeIx

Methods

edgeAt :: EdgeIx graph -> IndexedTraversal' (EdgeIx graph) graph (Edge graph) Source #

Indexed traversal of a given edge.

numEdges :: graph -> Int Source #

Number of edges in the graph.

running time: O(1)

default numEdges :: HasEdges graph graph => graph -> Int Source #

Instances

Instances details
HasEdges' Graph Source # 
Instance details

Defined in Hiraffe.Graph.Class

Associated Types

type Edge Graph 
Instance details

Defined in Hiraffe.Graph.Class

type EdgeIx Graph 
Instance details

Defined in Hiraffe.Graph.Class

HasEdges' (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Associated Types

type Edge (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type Edge (Triangle point) = (point, point)
type EdgeIx (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type EdgeIx (Triangle point) = Int

Methods

edgeAt :: EdgeIx (Triangle point) -> IndexedTraversal' (EdgeIx (Triangle point)) (Triangle point) (Edge (Triangle point)) Source #

numEdges :: Triangle point -> Int Source #

HasEdges' graph => HasEdges' (graph :+ extra) Source # 
Instance details

Defined in Hiraffe.Graph.Class

Associated Types

type Edge (graph :+ extra) 
Instance details

Defined in Hiraffe.Graph.Class

type Edge (graph :+ extra) = Edge graph
type EdgeIx (graph :+ extra) 
Instance details

Defined in Hiraffe.Graph.Class

type EdgeIx (graph :+ extra) = EdgeIx graph

Methods

edgeAt :: EdgeIx (graph :+ extra) -> IndexedTraversal' (EdgeIx (graph :+ extra)) (graph :+ extra) (Edge (graph :+ extra)) Source #

numEdges :: (graph :+ extra) -> Int Source #

VertexContainer f vertex => HasEdges' (SimplePolygonF f vertex) Source # 
Instance details

Defined in HGeometry.Polygon.Simple.Type

Associated Types

type Edge (SimplePolygonF f vertex) 
Instance details

Defined in HGeometry.Polygon.Simple.Type

type Edge (SimplePolygonF f vertex) = ()
type EdgeIx (SimplePolygonF f vertex) 
Instance details

Defined in HGeometry.Polygon.Simple.Type

type EdgeIx (SimplePolygonF f vertex) = VertexIx (SimplePolygonF f vertex)

Methods

edgeAt :: EdgeIx (SimplePolygonF f vertex) -> IndexedTraversal' (EdgeIx (SimplePolygonF f vertex)) (SimplePolygonF f vertex) (Edge (SimplePolygonF f vertex)) Source #

numEdges :: SimplePolygonF f vertex -> Int Source #

HasEdges' (GGraph f v e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep

Associated Types

type Edge (GGraph f v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep

type Edge (GGraph f v e) = Dart (GGraph f v e)
type EdgeIx (GGraph f v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep

type EdgeIx (GGraph f v e) = DartIx (GGraph f v e)

Methods

edgeAt :: EdgeIx (GGraph f v e) -> IndexedTraversal' (EdgeIx (GGraph f v e)) (GGraph f v e) (Edge (GGraph f v e)) Source #

numEdges :: GGraph f v e -> Int Source #

Ord i => HasEdges' (GGraph f i v e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

Associated Types

type Edge (GGraph f i v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

type Edge (GGraph f i v e) = Dart (GGraph f i v e)
type EdgeIx (GGraph f i v e) 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

type EdgeIx (GGraph f i v e) = DartIx (GGraph f i v e)

Methods

edgeAt :: EdgeIx (GGraph f i v e) -> IndexedTraversal' (EdgeIx (GGraph f i v e)) (GGraph f i v e) (Edge (GGraph f i v e)) Source #

numEdges :: GGraph f i v e -> Int Source #

HasEdges' (PlanarGraph w s v e f) Source # 
Instance details

Defined in Hiraffe.PlanarGraph.Type

Associated Types

type Edge (PlanarGraph w s v e f) 
Instance details

Defined in Hiraffe.PlanarGraph.Type

type Edge (PlanarGraph w s v e f) = e
type EdgeIx (PlanarGraph w s v e f) 
Instance details

Defined in Hiraffe.PlanarGraph.Type

type EdgeIx (PlanarGraph w s v e f) = Dart s

Methods

edgeAt :: EdgeIx (PlanarGraph w s v e f) -> IndexedTraversal' (EdgeIx (PlanarGraph w s v e f)) (PlanarGraph w s v e f) (Edge (PlanarGraph w s v e f)) Source #

numEdges :: PlanarGraph w s v e f -> Int Source #

class HasPickPoint polygon r | polygon -> r where Source #

A Class for polygon types that support returning a point inside the polygon.

Methods

pointInteriorTo :: polygon -> Point 2 r Source #

Returns a point in the interior of the polygon

Instances

Instances details
(Point_ vertex 2 r, Fractional r, Eq r) => HasPickPoint (Triangle vertex) r Source # 
Instance details

Defined in HGeometry.Polygon.Class

Methods

pointInteriorTo :: Triangle vertex -> Point 2 r Source #

(VertexContainer nonEmpty vertex, HasFromFoldable1 nonEmpty, Point_ vertex 2 r, Fractional r) => HasPickPoint (SimplePolygonF nonEmpty vertex) r Source # 
Instance details

Defined in HGeometry.Polygon.Simple

Methods

pointInteriorTo :: SimplePolygonF nonEmpty vertex -> Point 2 r Source #

(HoleContainer h nonEmpty vertex, VertexContainer nonEmpty vertex, HasFromFoldable1 nonEmpty, Point_ vertex 2 r, Fractional r, Ord r) => HasPickPoint (PolygonalDomainF h nonEmpty vertex) r Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

pointInteriorTo :: PolygonalDomainF h nonEmpty vertex -> Point 2 r Source #