-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Vardeman
committed
Jan 1, 2021
1 parent
759a055
commit 5aeec83
Showing
23 changed files
with
560 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using TopoPad.Core.Layers; | ||
using TopoPad.Core.SpatialItems; | ||
|
||
namespace TopoPad.Core.HitTest | ||
{ | ||
public class ItemsHitTestSpec | ||
{ | ||
private Lazy<HashSet<IItemsLayer>> m_Layers; | ||
public HashSet<IItemsLayer> Layers => m_Layers.Value; | ||
|
||
public bool LimitLayers { get; set; } | ||
|
||
private Lazy<HashSet<ISpatialItem>> m_SpatialItems; | ||
public HashSet<ISpatialItem> SpatialItems => m_SpatialItems.Value; | ||
|
||
public bool LimitItems { get; set; } | ||
|
||
public bool BoundaryOnly { get; set; } | ||
|
||
public bool TopmostOnly { get; set; } | ||
|
||
public bool SelectedItemsOnly { get; set; } | ||
|
||
public bool ActiveItemsOnly { get; set; } | ||
|
||
public ItemsHitTestSpec(bool boundaryOnly = false, | ||
bool topmostOnly = false, bool selectedItemsOnly = false, | ||
bool activeItemsOnly = false): | ||
this(null, null, boundaryOnly, topmostOnly, selectedItemsOnly, | ||
activeItemsOnly) | ||
{ | ||
} | ||
|
||
public ItemsHitTestSpec(IEnumerable<IItemsLayer> layers, | ||
bool boundaryOnly = false,bool topmostOnly = false, | ||
bool selectedItemsOnly = false, bool activeItemsOnly = false) : | ||
this(layers, null, boundaryOnly, topmostOnly, | ||
selectedItemsOnly, activeItemsOnly) | ||
{ | ||
} | ||
|
||
public ItemsHitTestSpec(IEnumerable<ISpatialItem> spatialItems, | ||
bool boundaryOnly = false, bool topmostOnly = false, | ||
bool selectedItemsOnly = false, bool activeItemsOnly = false) : | ||
this(null, spatialItems, boundaryOnly, topmostOnly, | ||
selectedItemsOnly, activeItemsOnly) | ||
{ | ||
} | ||
|
||
public ItemsHitTestSpec(IEnumerable<IItemsLayer> layers, | ||
IEnumerable<ISpatialItem> spatialItems, bool boundaryOnly = false, | ||
bool topmostOnly = false, bool selectedItemsOnly = false, | ||
bool activeItemsOnly = false) | ||
{ | ||
if (layers != null) | ||
{ | ||
LimitLayers = true; | ||
foreach (IItemsLayer layer in layers) | ||
{ | ||
Layers.Add(layer); | ||
} | ||
} | ||
if (spatialItems != null) | ||
{ | ||
LimitItems = true; | ||
foreach (ISpatialItem item in spatialItems) | ||
{ | ||
SpatialItems.Add(item); | ||
} | ||
} | ||
BoundaryOnly = boundaryOnly; | ||
TopmostOnly = topmostOnly; | ||
SelectedItemsOnly = selectedItemsOnly; | ||
ActiveItemsOnly = activeItemsOnly; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) 2020 Andrew Vardeman. Published under the MIT license. | ||
// See license.txt in the TopoPad distribution or repository for the | ||
// full text of the license. | ||
|
||
namespace TopoPad.Core | ||
{ | ||
public interface ITranslatable | ||
{ | ||
public void Translate(double x, double y); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.