Skip to content

Commit

Permalink
Merge 27f97ab into 8e37a15
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstace committed May 29, 2022
2 parents 8e37a15 + 27f97ab commit 418e9ce
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
4 changes: 2 additions & 2 deletions geom/dcel.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func newDCELFromMultiLineString(mls MultiLineString, operand operand, interactio
prev: nil, // set later
intermediate: intermediateFwd,
edgeLabels: newHalfPopulatedLabels(operand, true),
faceLabels: newHalfPopulatedLabels(operand, false),
faceLabels: newUnpopulatedLabels(),
}
rev := &halfEdgeRecord{
origin: vDestin,
Expand All @@ -276,7 +276,7 @@ func newDCELFromMultiLineString(mls MultiLineString, operand operand, interactio
prev: fwd,
intermediate: intermediateRev,
edgeLabels: newHalfPopulatedLabels(operand, true),
faceLabels: newHalfPopulatedLabels(operand, false),
faceLabels: newUnpopulatedLabels(),
}
fwd.twin = rev
fwd.next = rev
Expand Down
4 changes: 4 additions & 0 deletions geom/dcel_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ type label struct {
inSet bool
}

func newUnpopulatedLabels() [2]label {
return [2]label{}
}

func newHalfPopulatedLabels(operand operand, inSet bool) [2]label {
var labels [2]label
labels[operand].populated = true
Expand Down
56 changes: 28 additions & 28 deletions geom/dcel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,22 +562,22 @@ func TestGraphMultiLineString(t *testing.T) {
Edges: []EdgeSpec{
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v0, v1, v2},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v2, v1, v0},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v3, v4, v5},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v5, v4, v3},
},
},
Expand Down Expand Up @@ -618,42 +618,42 @@ func TestGraphSelfOverlappingLineString(t *testing.T) {
Edges: []EdgeSpec{
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v0, v1},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v1, v0},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v1, v2},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v2, v1},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v1, v3, v2},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v2, v3, v1},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v2, v4},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v4, v2},
},
},
Expand Down Expand Up @@ -698,12 +698,12 @@ func TestGraphGhostDeduplication(t *testing.T) {
Edges: []EdgeSpec{
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v0, v1},
},
{
EdgeLabels: []LabelOption{OperandA(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
Sequence: []XY{v1, v0},
},
{
Expand Down Expand Up @@ -1695,22 +1695,22 @@ func TestGraphOverlayTwoLineStringsIntersectingAtEndpoints(t *testing.T) {
{
Sequence: []XY{v1, v2},
EdgeLabels: []LabelOption{OperandA(true), OperandB(false)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v2, v1},
EdgeLabels: []LabelOption{OperandA(true), OperandB(false)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v0, v1},
EdgeLabels: []LabelOption{OperandA(false), OperandB(true)},
FaceLabels: []LabelOption{OperandB(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v1, v0},
EdgeLabels: []LabelOption{OperandA(false), OperandB(true)},
FaceLabels: []LabelOption{OperandB(false)},
FaceLabels: nil,
},
},
Faces: []FaceSpec{{
Expand Down Expand Up @@ -1768,12 +1768,12 @@ func TestGraphOverlayReproduceFaceAllocationBug(t *testing.T) {
{
Sequence: []XY{v1, v3},
EdgeLabels: []LabelOption{OperandA(true), OperandB(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v3, v1},
EdgeLabels: []LabelOption{OperandA(true), OperandB(true)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v0, v1},
Expand Down Expand Up @@ -1926,22 +1926,22 @@ func TestGraphOverlayReproducePointOnLineStringPrecisionBug(t *testing.T) {
{
Sequence: []XY{v0, v1},
EdgeLabels: []LabelOption{OperandA(true), OperandB(false)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v1, v2},
EdgeLabels: []LabelOption{OperandA(true), OperandB(false)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v2, v1},
EdgeLabels: []LabelOption{OperandA(true), OperandB(false)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
{
Sequence: []XY{v1, v0},
EdgeLabels: []LabelOption{OperandA(true), OperandB(false)},
FaceLabels: []LabelOption{OperandA(false)},
FaceLabels: nil,
},
},
Faces: []FaceSpec{
Expand Down Expand Up @@ -1993,12 +1993,12 @@ func TestGraphOverlayReproduceGhostOnGeometryBug(t *testing.T) {
{
Sequence: []XY{v0, v1},
EdgeLabels: []LabelOption{OperandA(true), OperandB(true)},
FaceLabels: []LabelOption{OperandA(false), OperandB(true)},
FaceLabels: []LabelOption{OperandB(true)},
},
{
Sequence: []XY{v1, v0},
EdgeLabels: []LabelOption{OperandA(true), OperandB(true)},
FaceLabels: []LabelOption{OperandA(false), OperandB(false)},
FaceLabels: []LabelOption{OperandB(false)},
},
{
Sequence: []XY{v1, v2, v3},
Expand All @@ -2013,12 +2013,12 @@ func TestGraphOverlayReproduceGhostOnGeometryBug(t *testing.T) {
{
Sequence: []XY{v3, v4, v0},
EdgeLabels: []LabelOption{OperandA(true), OperandB(true)},
FaceLabels: []LabelOption{OperandA(false), OperandB(true)},
FaceLabels: []LabelOption{OperandB(true)},
},
{
Sequence: []XY{v0, v4, v3},
EdgeLabels: []LabelOption{OperandA(true), OperandB(true)},
FaceLabels: []LabelOption{OperandA(false), OperandB(false)},
FaceLabels: []LabelOption{OperandB(false)},
},
},
Faces: []FaceSpec{
Expand Down

0 comments on commit 418e9ce

Please sign in to comment.