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

HGeometry.Polygon.WithHoles

Description

A simple type for representing polygonswith holes

Synopsis

Documentation

data PolygonalDomainF (h :: Type -> Type) (f :: Type -> Type) point Source #

Simple data type modelling polygons with holes

Constructors

PolygonalDomain 

Fields

Instances

Instances details
(Foldable h, Foldable1 f) => Foldable1 (PolygonalDomainF h f) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

fold1 :: Semigroup m => PolygonalDomainF h f m -> m Source #

foldMap1 :: Semigroup m => (a -> m) -> PolygonalDomainF h f a -> m Source #

foldMap1' :: Semigroup m => (a -> m) -> PolygonalDomainF h f a -> m Source #

toNonEmpty :: PolygonalDomainF h f a -> NonEmpty a Source #

maximum :: Ord a => PolygonalDomainF h f a -> a Source #

minimum :: Ord a => PolygonalDomainF h f a -> a Source #

head :: PolygonalDomainF h f a -> a Source #

last :: PolygonalDomainF h f a -> a Source #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> PolygonalDomainF h f a -> b Source #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> PolygonalDomainF h f a -> b Source #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> PolygonalDomainF h f a -> b Source #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> PolygonalDomainF h f a -> b Source #

(Functor h, Functor f) => Functor (PolygonalDomainF h f) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

fmap :: (a -> b) -> PolygonalDomainF h f a -> PolygonalDomainF h f b Source #

(<$) :: a -> PolygonalDomainF h f b -> PolygonalDomainF h f a Source #

(Foldable h, Foldable f) => Foldable (PolygonalDomainF h f) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

fold :: Monoid m => PolygonalDomainF h f m -> m Source #

foldMap :: Monoid m => (a -> m) -> PolygonalDomainF h f a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PolygonalDomainF h f a -> m Source #

foldr :: (a -> b -> b) -> b -> PolygonalDomainF h f a -> b Source #

foldr' :: (a -> b -> b) -> b -> PolygonalDomainF h f a -> b Source #

foldl :: (b -> a -> b) -> b -> PolygonalDomainF h f a -> b Source #

foldl' :: (b -> a -> b) -> b -> PolygonalDomainF h f a -> b Source #

foldr1 :: (a -> a -> a) -> PolygonalDomainF h f a -> a Source #

foldl1 :: (a -> a -> a) -> PolygonalDomainF h f a -> a Source #

toList :: PolygonalDomainF h f a -> [a] Source #

null :: PolygonalDomainF h f a -> Bool Source #

length :: PolygonalDomainF h f a -> Int Source #

elem :: Eq a => a -> PolygonalDomainF h f a -> Bool Source #

maximum :: Ord a => PolygonalDomainF h f a -> a Source #

minimum :: Ord a => PolygonalDomainF h f a -> a Source #

sum :: Num a => PolygonalDomainF h f a -> a Source #

product :: Num a => PolygonalDomainF h f a -> a Source #

(Traversable h, Traversable f) => Traversable (PolygonalDomainF h f) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

traverse :: Applicative f0 => (a -> f0 b) -> PolygonalDomainF h f a -> f0 (PolygonalDomainF h f b) Source #

sequenceA :: Applicative f0 => PolygonalDomainF h f (f0 a) -> f0 (PolygonalDomainF h f a) Source #

mapM :: Monad m => (a -> m b) -> PolygonalDomainF h f a -> m (PolygonalDomainF h f b) Source #

sequence :: Monad m => PolygonalDomainF h f (m a) -> m (PolygonalDomainF h f a) Source #

(Traversable h, Traversable1 f) => Traversable1 (PolygonalDomainF h f) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> PolygonalDomainF h f a -> f0 (PolygonalDomainF h f b) Source #

sequence1 :: Apply f0 => PolygonalDomainF h f (f0 b) -> f0 (PolygonalDomainF h f b) Source #

(NFData (SimplePolygonF f point), NFData (h (SimplePolygonF f point))) => NFData (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

rnf :: PolygonalDomainF h f point -> () Source #

Generic (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Associated Types

type Rep (PolygonalDomainF h f point) 
Instance details

Defined in HGeometry.Polygon.WithHoles

type Rep (PolygonalDomainF h f point) = D1 ('MetaData "PolygonalDomainF" "HGeometry.Polygon.WithHoles" "hgeometry-polygon-1.0.0.0-inplace" 'False) (C1 ('MetaCons "PolygonalDomain" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SimplePolygonF f point)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (h (SimplePolygonF f point)))))

Methods

from :: PolygonalDomainF h f point -> Rep (PolygonalDomainF h f point) x Source #

to :: Rep (PolygonalDomainF h f point) x -> PolygonalDomainF h f point Source #

(Read (SimplePolygonF f point), Read (h (SimplePolygonF f point))) => Read (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

(Show (SimplePolygonF f point), Show (h (SimplePolygonF f point))) => Show (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

showsPrec :: Int -> PolygonalDomainF h f point -> ShowS Source #

show :: PolygonalDomainF h f point -> String Source #

showList :: [PolygonalDomainF h f point] -> ShowS Source #

(Eq (SimplePolygonF f point), Eq (h (SimplePolygonF f point))) => Eq (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

(==) :: PolygonalDomainF h f point -> PolygonalDomainF h f point -> Bool Source #

(/=) :: PolygonalDomainF h f point -> PolygonalDomainF h f point -> Bool Source #

(VertexContainer f point, Point_ point 2 r) => IsBoxable (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

boundingBox :: forall (d :: Nat) r0. (d ~ Dimension (PolygonalDomainF h f point), r0 ~ NumType (PolygonalDomainF h f point), Ord r0) => PolygonalDomainF h f point -> Box (Point d r0) Source #

(VertexContainer f point, Traversable h, DefaultTransformByConstraints (PolygonalDomainF h f point) 2 r, Point_ point 2 r) => IsTransformable (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

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
HoleContainer h f point => HasOuterBoundary (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

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)
(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 #

(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 #

(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 #

(VertexContainer f point, Traversable h) => HasPoints (PolygonalDomainF h f point) (PolygonalDomainF h f point') point point' Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

Methods

allPoints :: forall (d :: Nat) r r'. (Point_ point d r, Point_ point' d r', NumType (PolygonalDomainF h f point) ~ r, NumType (PolygonalDomainF h f point') ~ r', Dimension (PolygonalDomainF h f point) ~ d, Dimension (PolygonalDomainF h f point') ~ d) => Traversal1 (PolygonalDomainF h f point) (PolygonalDomainF h f point') point point' Source #

type Rep (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

type Rep (PolygonalDomainF h f point) = D1 ('MetaData "PolygonalDomainF" "HGeometry.Polygon.WithHoles" "hgeometry-polygon-1.0.0.0-inplace" 'False) (C1 ('MetaCons "PolygonalDomain" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SimplePolygonF f point)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (h (SimplePolygonF f point)))))
type HoleF (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

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

Defined in HGeometry.Polygon.WithHoles

type HoleIx (PolygonalDomainF h f point) = Int
type Dimension (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

type Dimension (PolygonalDomainF h f point) = 2
type NumType (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

type NumType (PolygonalDomainF h f point) = NumType point
type Vertex (PolygonalDomainF h f point) Source # 
Instance details

Defined in HGeometry.Polygon.WithHoles

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

Defined in HGeometry.Polygon.WithHoles

type VertexIx (PolygonalDomainF h f point)

type PolygonalDomain point = PolygonalDomainF Vector (Cyclic NonEmptyVector) point Source #

Polygonal domain implemented using Vectors

asSimplePolygon :: forall (h :: Type -> Type) (f :: Type -> Type) point. (HasFromFoldable h, HoleContainer h f point) => Prism' (PolygonalDomainF h f point) (SimplePolygonF f point) Source #

interpret a simple polygon as a Polygonal domain.

outerBoundaryPolygon :: forall (h :: Type -> Type) (f1 :: Type -> Type) point f2. Functor f2 => (SimplePolygonF f1 point -> f2 (SimplePolygonF f1 point)) -> PolygonalDomainF h f1 point -> f2 (PolygonalDomainF h f1 point) Source #

The simple polygon representing the outer boundary

theHoles :: forall h (f1 :: Type -> Type) point h' f2. Functor f2 => (h (SimplePolygonF f1 point) -> f2 (h' (SimplePolygonF f1 point))) -> PolygonalDomainF h f1 point -> f2 (PolygonalDomainF h' f1 point) Source #

Lens to access the holes

type HoleContainer (h :: Type -> Type) (f :: Type -> Type) point = (TraversableWithIndex Int h, Index (h (SimplePolygonF f point)) ~ Int, IxValue (h (SimplePolygonF f point)) ~ SimplePolygonF f point, Ixed (h (SimplePolygonF f point)), VertexContainer f point) Source #

Containers that stores holes must satisfy the following constraints: