Skip to content

Commit

Permalink
Simplify RingVertex point type
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemanja Jovanovic committed Jan 17, 2025
1 parent 538e0b3 commit fa26264
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/clipping/weileratherton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ abstract type Exiting <: VertexType end
# Data structure for clipping the polygons. Fields left and right are used depending on the
# VertexType, as designated with the helper functions. The data structure forms a directed
# graph with each element always pointing to two elements.
mutable struct RingVertex{VT<:VertexType,M<:Manifold,C<:CRS}
point::Point{M,C}
left::RingVertex{<:VertexType,M,C}
right::RingVertex{<:VertexType,M,C}
mutable struct RingVertex{VT<:VertexType,P<:Point}
point::P
left::RingVertex{<:VertexType,P}
right::RingVertex{<:VertexType,P}

function RingVertex{VT,M,C}(point) where {VT<:VertexType,M<:Manifold,C<:CRS}
function RingVertex{VT,P}(point) where {VT<:VertexType,P<:Point}
v = new(point)
v.left = v
v.right = v
v
end
end

RingVertex{VT}(point::Point{M,C}) where {VT<:VertexType,M<:Manifold,C<:CRS} = RingVertex{VT,M,C}(point)
RingVertex{VT}(point::P) where {VT<:VertexType,P<:Point} = RingVertex{VT,P}(point)

isnormal(::RingVertex{Normal}) = true
isnormal(::RingVertex) = false
Expand Down

0 comments on commit fa26264

Please sign in to comment.