hgeometry-0.6.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.PlanarSubdivision

Synopsis

Documentation

data VertexData r v Source #

Note that the functor instance is in v

Constructors

VertexData 

Fields

Instances

Bifunctor VertexData Source # 

Methods

bimap :: (a -> b) -> (c -> d) -> VertexData a c -> VertexData b d #

first :: (a -> b) -> VertexData a c -> VertexData b c #

second :: (b -> c) -> VertexData a b -> VertexData a c #

Functor (VertexData r) Source # 

Methods

fmap :: (a -> b) -> VertexData r a -> VertexData r b #

(<$) :: a -> VertexData r b -> VertexData r a #

Foldable (VertexData r) Source # 

Methods

fold :: Monoid m => VertexData r m -> m #

foldMap :: Monoid m => (a -> m) -> VertexData r a -> m #

foldr :: (a -> b -> b) -> b -> VertexData r a -> b #

foldr' :: (a -> b -> b) -> b -> VertexData r a -> b #

foldl :: (b -> a -> b) -> b -> VertexData r a -> b #

foldl' :: (b -> a -> b) -> b -> VertexData r a -> b #

foldr1 :: (a -> a -> a) -> VertexData r a -> a #

foldl1 :: (a -> a -> a) -> VertexData r a -> a #

toList :: VertexData r a -> [a] #

null :: VertexData r a -> Bool #

length :: VertexData r a -> Int #

elem :: Eq a => a -> VertexData r a -> Bool #

maximum :: Ord a => VertexData r a -> a #

minimum :: Ord a => VertexData r a -> a #

sum :: Num a => VertexData r a -> a #

product :: Num a => VertexData r a -> a #

Traversable (VertexData r) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> VertexData r a -> f (VertexData r b) #

sequenceA :: Applicative f => VertexData r (f a) -> f (VertexData r a) #

mapM :: Monad m => (a -> m b) -> VertexData r a -> m (VertexData r b) #

sequence :: Monad m => VertexData r (m a) -> m (VertexData r a) #

(Eq v, Eq r) => Eq (VertexData r v) Source # 

Methods

(==) :: VertexData r v -> VertexData r v -> Bool #

(/=) :: VertexData r v -> VertexData r v -> Bool #

(Ord v, Ord r) => Ord (VertexData r v) Source # 

Methods

compare :: VertexData r v -> VertexData r v -> Ordering #

(<) :: VertexData r v -> VertexData r v -> Bool #

(<=) :: VertexData r v -> VertexData r v -> Bool #

(>) :: VertexData r v -> VertexData r v -> Bool #

(>=) :: VertexData r v -> VertexData r v -> Bool #

max :: VertexData r v -> VertexData r v -> VertexData r v #

min :: VertexData r v -> VertexData r v -> VertexData r v #

(Show v, Show r) => Show (VertexData r v) Source # 

Methods

showsPrec :: Int -> VertexData r v -> ShowS #

show :: VertexData r v -> String #

showList :: [VertexData r v] -> ShowS #

vData :: forall r v v. Lens (VertexData r v) (VertexData r v) v v Source #

location :: forall r v r. Lens (VertexData r v) (VertexData r v) (Point 2 r) (Point 2 r) Source #

data EdgeData e Source #

Constructors

EdgeData 

Fields

Instances

Functor EdgeData Source # 

Methods

fmap :: (a -> b) -> EdgeData a -> EdgeData b #

(<$) :: a -> EdgeData b -> EdgeData a #

Foldable EdgeData Source # 

Methods

fold :: Monoid m => EdgeData m -> m #

foldMap :: Monoid m => (a -> m) -> EdgeData a -> m #

foldr :: (a -> b -> b) -> b -> EdgeData a -> b #

foldr' :: (a -> b -> b) -> b -> EdgeData a -> b #

foldl :: (b -> a -> b) -> b -> EdgeData a -> b #

foldl' :: (b -> a -> b) -> b -> EdgeData a -> b #

foldr1 :: (a -> a -> a) -> EdgeData a -> a #

foldl1 :: (a -> a -> a) -> EdgeData a -> a #

toList :: EdgeData a -> [a] #

null :: EdgeData a -> Bool #

length :: EdgeData a -> Int #

elem :: Eq a => a -> EdgeData a -> Bool #

maximum :: Ord a => EdgeData a -> a #

minimum :: Ord a => EdgeData a -> a #

sum :: Num a => EdgeData a -> a #

product :: Num a => EdgeData a -> a #

Traversable EdgeData Source # 

Methods

traverse :: Applicative f => (a -> f b) -> EdgeData a -> f (EdgeData b) #

sequenceA :: Applicative f => EdgeData (f a) -> f (EdgeData a) #

mapM :: Monad m => (a -> m b) -> EdgeData a -> m (EdgeData b) #

sequence :: Monad m => EdgeData (m a) -> m (EdgeData a) #

Eq e => Eq (EdgeData e) Source # 

Methods

(==) :: EdgeData e -> EdgeData e -> Bool #

(/=) :: EdgeData e -> EdgeData e -> Bool #

Ord e => Ord (EdgeData e) Source # 

Methods

compare :: EdgeData e -> EdgeData e -> Ordering #

(<) :: EdgeData e -> EdgeData e -> Bool #

(<=) :: EdgeData e -> EdgeData e -> Bool #

(>) :: EdgeData e -> EdgeData e -> Bool #

(>=) :: EdgeData e -> EdgeData e -> Bool #

max :: EdgeData e -> EdgeData e -> EdgeData e #

min :: EdgeData e -> EdgeData e -> EdgeData e #

Show e => Show (EdgeData e) Source # 

Methods

showsPrec :: Int -> EdgeData e -> ShowS #

show :: EdgeData e -> String #

showList :: [EdgeData e] -> ShowS #

eData :: forall e e. Lens (EdgeData e) (EdgeData e) e e Source #

data FaceData h f Source #

The Face data consists of the data itself and a list of holes

Constructors

FaceData 

Fields

Instances

Functor (FaceData h) Source # 

Methods

fmap :: (a -> b) -> FaceData h a -> FaceData h b #

(<$) :: a -> FaceData h b -> FaceData h a #

Foldable (FaceData h) Source # 

Methods

fold :: Monoid m => FaceData h m -> m #

foldMap :: Monoid m => (a -> m) -> FaceData h a -> m #

foldr :: (a -> b -> b) -> b -> FaceData h a -> b #

foldr' :: (a -> b -> b) -> b -> FaceData h a -> b #

foldl :: (b -> a -> b) -> b -> FaceData h a -> b #

foldl' :: (b -> a -> b) -> b -> FaceData h a -> b #

foldr1 :: (a -> a -> a) -> FaceData h a -> a #

foldl1 :: (a -> a -> a) -> FaceData h a -> a #

toList :: FaceData h a -> [a] #

null :: FaceData h a -> Bool #

length :: FaceData h a -> Int #

elem :: Eq a => a -> FaceData h a -> Bool #

maximum :: Ord a => FaceData h a -> a #

minimum :: Ord a => FaceData h a -> a #

sum :: Num a => FaceData h a -> a #

product :: Num a => FaceData h a -> a #

Traversable (FaceData h) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> FaceData h a -> f (FaceData h b) #

sequenceA :: Applicative f => FaceData h (f a) -> f (FaceData h a) #

mapM :: Monad m => (a -> m b) -> FaceData h a -> m (FaceData h b) #

sequence :: Monad m => FaceData h (m a) -> m (FaceData h a) #

(Eq f, Eq h) => Eq (FaceData h f) Source # 

Methods

(==) :: FaceData h f -> FaceData h f -> Bool #

(/=) :: FaceData h f -> FaceData h f -> Bool #

(Ord f, Ord h) => Ord (FaceData h f) Source # 

Methods

compare :: FaceData h f -> FaceData h f -> Ordering #

(<) :: FaceData h f -> FaceData h f -> Bool #

(<=) :: FaceData h f -> FaceData h f -> Bool #

(>) :: FaceData h f -> FaceData h f -> Bool #

(>=) :: FaceData h f -> FaceData h f -> Bool #

max :: FaceData h f -> FaceData h f -> FaceData h f #

min :: FaceData h f -> FaceData h f -> FaceData h f #

(Show f, Show h) => Show (FaceData h f) Source # 

Methods

showsPrec :: Int -> FaceData h f -> ShowS #

show :: FaceData h f -> String #

showList :: [FaceData h f] -> ShowS #

holes :: forall h f h. Lens (FaceData h f) (FaceData h f) [h] [h] Source #

fData :: forall h f f. Lens (FaceData h f) (FaceData h f) f f Source #

newtype PlanarSubdivision s v e f r Source #

Constructors

PlanarSubdivision 

Fields

Instances

Functor (PlanarSubdivision k s v e f) Source # 

Methods

fmap :: (a -> b) -> PlanarSubdivision k s v e f a -> PlanarSubdivision k s v e f b #

(<$) :: a -> PlanarSubdivision k s v e f b -> PlanarSubdivision k s v e f a #

(Eq r, Eq v, Eq e, Eq f) => Eq (PlanarSubdivision k s v e f r) Source # 

Methods

(==) :: PlanarSubdivision k s v e f r -> PlanarSubdivision k s v e f r -> Bool #

(/=) :: PlanarSubdivision k s v e f r -> PlanarSubdivision k s v e f r -> Bool #

(Show r, Show v, Show e, Show f) => Show (PlanarSubdivision k s v e f r) Source # 

Methods

showsPrec :: Int -> PlanarSubdivision k s v e f r -> ShowS #

show :: PlanarSubdivision k s v e f r -> String #

showList :: [PlanarSubdivision k s v e f r] -> ShowS #

graph :: forall s v e f r s v e f r. Iso (PlanarSubdivision s v e f r) (PlanarSubdivision s v e f r) (PlanarGraph s Primal_ (VertexData r v) (EdgeData e) (FaceData (Dart s) f)) (PlanarGraph s Primal_ (VertexData r v) (EdgeData e) (FaceData (Dart s) f)) Source #

fromPolygon Source #

Arguments

:: proxy s 
-> SimplePolygon p r 
-> f

data inside

-> f

data outside the polygon

-> PlanarSubdivision s p () f r 

Construct a planar subdivision from a polygon

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

fromVertices :: proxy s -> CSeq (Point 2 r :+ p) -> PlanarGraph s Primal_ (VertexData r p) () () Source #

fromConnectedSegments :: (Foldable f, Ord r, Num r) => proxy s -> f (LineSegment 2 p r :+ EdgeData e) -> PlanarSubdivision s [p] e () r Source #

Constructs a connected planar subdivision.

pre: the segments form a single connected component running time: \(O(n\log n)\)

fromConnectedSegments' :: (Foldable f, Ord r, Num r) => proxy s -> f (LineSegment 2 p r :+ e) -> PlanarGraph s Primal_ (VertexData r [p]) e () Source #

Constructs a planar graph

pre: The segments form a single connected component

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