Skip to content

Commit

Permalink
updating to allow newer hiraffe
Browse files Browse the repository at this point in the history
  • Loading branch information
noinia committed Mar 30, 2024
1 parent f4e2e16 commit 71ffd77
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 11 deletions.
75 changes: 75 additions & 0 deletions hgeometry/data/test-with-ipe/PlaneGraph/myPlaneGraph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
adjacencies:
- - 0
- - 1
- 5
- 9
- 2
- - 1
- - 0
- 5
- 12
- - 2
- - 3
- 0
- - 3
- - 4
- 2
- - 4
- - 3
- 13
- - 5
- - 1
- 0
- 6
- 8
- - 6
- - 5
- 9
- - 7
- - 8
- 11
- - 8
- - 5
- 7
- 12
- - 9
- - 6
- 0
- 10
- - 10
- - 9
- 11
- - 11
- - 10
- 7
- - 12
- - 8
- 14
- 1
- 13
- - 13
- - 4
- 14
- 12
- - 14
- - 13
- 12
faces:
- core: 0
extra: "Outer"
- core: 1
extra: A
- core: 2
extra: B
- core: 3
extra: C
- core: 4
extra: D
- core: 5
extra: E
- core: 6
extra: F
darts:

vertices:
- core:
2 changes: 1 addition & 1 deletion hgeometry/src/HGeometry/PlaneGraph/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ( PlanarGraph_ planeGraph
-- | gets the id of the outer face
--
outerFaceId :: planeGraph -> FaceIx planeGraph
outerFaceId ps = leftFace (outerFaceDart ps) ps
outerFaceId ps = ps^.leftFaceOf (outerFaceDart ps).asIndex

-- | gets a dart incident to the outer face (in particular, that has the
-- outerface on its left)
Expand Down
19 changes: 9 additions & 10 deletions hgeometry/src/HGeometry/PlaneGraph/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ instance HasFaces (PlaneGraph s v e f) (PlaneGraph s v e f') where
faces = _PlanarGraph.faces

----------------------------------------
instance DirGraph_ (PlaneGraph s v e f) where
type DirGraphFromAdjListExtraConstraints (PlaneGraph s v e f) h = (f ~ (), Foldable1 h)
dirGraphFromAdjacencyLists = PlaneGraph . dirGraphFromAdjacencyLists
instance DiGraph_ (PlaneGraph s v e f) where
type DiGraphFromAdjListExtraConstraints (PlaneGraph s v e f) h = (f ~ (), Foldable1 h)
diGraphFromAdjacencyLists = PlaneGraph . diGraphFromAdjacencyLists
endPoints (PlaneGraph g) = endPoints g
twinDartOf d = twinOf d . to Just
outgoingDartsOf v = _PlanarGraph.outgoingDartsOf v
Expand All @@ -109,17 +109,16 @@ instance Graph_ (PlaneGraph s v e f) where
instance PlanarGraph_ (PlaneGraph s v e f) where
type DualGraphOf (PlaneGraph s v e f) = PlanarGraph s Dual f e v


dualGraph = dualGraph . coerce @_ @(PlanarGraph s Primal v e f)

leftFace d = leftFace d . coerce @_ @(PlanarGraph s Primal v e f)
rightFace d = rightFace d . coerce @_ @(PlanarGraph s Primal v e f)
leftFaceOf d = _PlanarGraph.leftFaceOf d
rightFaceOf d = _PlanarGraph.rightFaceOf d

nextEdge d = nextEdge d . coerce @_ @(PlanarGraph s Primal v e f)
prevEdge d = prevEdge d . coerce @_ @(PlanarGraph s Primal v e f)
nextDartOf d = _PlanarGraph.nextDartOf d
prevDartOf d = _PlanarGraph.prevDartOf d

boundaryDart f = boundaryDart f . coerce @_ @(PlanarGraph s Primal v e f)
boundary f = boundary f . coerce @_ @(PlanarGraph s Primal v e f)
boundaryDartOf f = _PlanarGraph.boundaryDartOf f
boundaryDarts f = boundaryDarts f . coerce @_ @(PlanarGraph s Primal v e f)


instance ( Point_ v 2 (NumType v)
Expand Down

0 comments on commit 71ffd77

Please sign in to comment.