Skip to content

Commit

Permalink
Standardizing plugin naming
Browse files Browse the repository at this point in the history
trying to standardize the internal naming conventions for plugins and keep the default plugins separate from the experimental plugins to make it easier for future explorers of this code to understand it.
  • Loading branch information
danames committed Nov 3, 2018
1 parent db75436 commit 7b3098e
Show file tree
Hide file tree
Showing 2,464 changed files with 173,106 additions and 173,214 deletions.
Empty file.
Binary file not shown.
Expand Up @@ -139,7 +139,7 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="HydroDesktop.Plugins.AttributeDataExplorer.nuspec" />
<None Include="Plugins.AttributeDataExplorer.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
Expand Down
Expand Up @@ -189,7 +189,7 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="HydroDesktop.Plugins.DataAggregation.nuspec" />
<None Include="Plugins.DataAggregation.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Expand Down
@@ -1,30 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacetedSearch3", "FacetedSearch3\FacetedSearch3.csproj", "{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|x86.ActiveCfg = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Any CPU.Build.0 = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacetedSearch3", "FacetedSearch3\FacetedSearch3.csproj", "{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Debug|x86.ActiveCfg = Debug|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Any CPU.Build.0 = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{BA38E49F-BB13-4AA3-A31F-69E16D7AA4A4}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -1,121 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using DotSpatial.Controls;
using DotSpatial.Data;
using DotSpatial.Projections;
using FacetedSearch3.Area;
using FacetedSearch3.Properties;

namespace FacetedSearch3.Area
{
static class AreaHelper
{
#region Fields

private static readonly ProjectionInfo _wgs84Projection = ProjectionInfo.FromEsriString(Resources.wgs_84_esri_string);

#endregion

#region Public methods

public static IEnumerable<IMapPolygonLayer> GetAllPolygonLayers(Map map)
{
if (map == null) throw new ArgumentNullException("map");

return map.GetAllLayers().OfType<IMapPolygonLayer>();
}

public static IEnumerable<IMapPolygonLayer> GetAllSelectedPolygonLayers(Map map)
{
if (map == null) throw new ArgumentNullException("map");

return GetAllPolygonLayers(map)
.Where(subLayer => subLayer.IsVisible &&
subLayer.IsSelected);
}

public static void SelectFirstVisiblePolygonLayer(Map map, bool isWorldTemplate)
{
if (map == null) throw new ArgumentNullException("map");

//special case: world project template
if (isWorldTemplate)
{
map.MapFrame.IsSelected = false;
foreach (var layer in GetAllPolygonLayers(map).Where(subLayer => subLayer.IsVisible))
{
layer.IsSelected = true;
map.Legend.RefreshNodes();
break;
}
}

if (map.MapFrame.IsSelected) return; //don't select layers if map frame is already selected

var hasSelected = GetAllPolygonLayers(map).Where(subLayer => subLayer.IsVisible)
.Any(item => item.IsSelected);
if (hasSelected)
return;

foreach (var layer in GetAllPolygonLayers(map).Where(subLayer => subLayer.IsVisible).Reverse<IMapPolygonLayer>())
{
layer.IsSelected = true;
map.Legend.RefreshNodes();
break;
}
}

public static Box ReprojectBoxToWGS84(Box sourceBox, ProjectionInfo sourceProjection)
{
if (sourceBox == null) throw new ArgumentNullException("sourceBox");
if (sourceProjection == null) throw new ArgumentNullException("sourceProjection");

var xMin = sourceBox.XMin;
var yMin = sourceBox.YMin;
var xMax = sourceBox.XMax;
var yMax = sourceBox.YMax;

var xy = new[] { xMin, yMin, xMax, yMax };
Reproject.ReprojectPoints(xy, new double[] { 0, 0 }, sourceProjection, _wgs84Projection, 0, 2);

xMin = xy[0];
yMin = xy[1];
xMax = xy[2];
yMax = xy[3];
var rectangle = new Box(xMin, xMax, yMin, yMax);
return rectangle;
}

public static List<IFeature> ReprojectPolygonsToWGS84(FeatureSet polygons)
{
if (polygons == null) throw new ArgumentNullException("polygons");

polygons.Reproject(_wgs84Projection);
return Enumerable.ToList(polygons.Features);
}

public static Extent ReprojectExtentToWGS84(Extent sourceExtent, ProjectionInfo sourceProjection)
{
if (sourceExtent == null) throw new ArgumentNullException("sourceBox");
if (sourceProjection == null) throw new ArgumentNullException("sourceProjection");

var MinX = sourceExtent.MinX;
var MinY = sourceExtent.MinY;
var MaxX = sourceExtent.MaxX;
var MaxY = sourceExtent.MaxY;

var xy = new double[] { MinX, MinY, MaxX, MaxY };
Reproject.ReprojectPoints(xy, new double[] { 0, 0 }, sourceProjection, _wgs84Projection, 0, 2);

MinX = xy[0];
MinY = xy[1];
MaxX = xy[2];
MaxY = xy[3];
var rectangle = new Extent(MinX, MinY, MaxX, MaxY);
return rectangle;
}

#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using DotSpatial.Controls;
using DotSpatial.Data;
using DotSpatial.Projections;
using FacetedSearch3.Area;
using FacetedSearch3.Properties;

namespace FacetedSearch3.Area
{
static class AreaHelper
{
#region Fields

private static readonly ProjectionInfo _wgs84Projection = ProjectionInfo.FromEsriString(Resources.wgs_84_esri_string);

#endregion

#region Public methods

public static IEnumerable<IMapPolygonLayer> GetAllPolygonLayers(Map map)
{
if (map == null) throw new ArgumentNullException("map");

return map.GetAllLayers().OfType<IMapPolygonLayer>();
}

public static IEnumerable<IMapPolygonLayer> GetAllSelectedPolygonLayers(Map map)
{
if (map == null) throw new ArgumentNullException("map");

return GetAllPolygonLayers(map)
.Where(subLayer => subLayer.IsVisible &&
subLayer.IsSelected);
}

public static void SelectFirstVisiblePolygonLayer(Map map, bool isWorldTemplate)
{
if (map == null) throw new ArgumentNullException("map");

//special case: world project template
if (isWorldTemplate)
{
map.MapFrame.IsSelected = false;
foreach (var layer in GetAllPolygonLayers(map).Where(subLayer => subLayer.IsVisible))
{
layer.IsSelected = true;
map.Legend.RefreshNodes();
break;
}
}

if (map.MapFrame.IsSelected) return; //don't select layers if map frame is already selected

var hasSelected = GetAllPolygonLayers(map).Where(subLayer => subLayer.IsVisible)
.Any(item => item.IsSelected);
if (hasSelected)
return;

foreach (var layer in GetAllPolygonLayers(map).Where(subLayer => subLayer.IsVisible).Reverse<IMapPolygonLayer>())
{
layer.IsSelected = true;
map.Legend.RefreshNodes();
break;
}
}

public static Box ReprojectBoxToWGS84(Box sourceBox, ProjectionInfo sourceProjection)
{
if (sourceBox == null) throw new ArgumentNullException("sourceBox");
if (sourceProjection == null) throw new ArgumentNullException("sourceProjection");

var xMin = sourceBox.XMin;
var yMin = sourceBox.YMin;
var xMax = sourceBox.XMax;
var yMax = sourceBox.YMax;

var xy = new[] { xMin, yMin, xMax, yMax };
Reproject.ReprojectPoints(xy, new double[] { 0, 0 }, sourceProjection, _wgs84Projection, 0, 2);

xMin = xy[0];
yMin = xy[1];
xMax = xy[2];
yMax = xy[3];
var rectangle = new Box(xMin, xMax, yMin, yMax);
return rectangle;
}

public static List<IFeature> ReprojectPolygonsToWGS84(FeatureSet polygons)
{
if (polygons == null) throw new ArgumentNullException("polygons");

polygons.Reproject(_wgs84Projection);
return Enumerable.ToList(polygons.Features);
}

public static Extent ReprojectExtentToWGS84(Extent sourceExtent, ProjectionInfo sourceProjection)
{
if (sourceExtent == null) throw new ArgumentNullException("sourceBox");
if (sourceProjection == null) throw new ArgumentNullException("sourceProjection");

var MinX = sourceExtent.MinX;
var MinY = sourceExtent.MinY;
var MaxX = sourceExtent.MaxX;
var MaxY = sourceExtent.MaxY;

var xy = new double[] { MinX, MinY, MaxX, MaxY };
Reproject.ReprojectPoints(xy, new double[] { 0, 0 }, sourceProjection, _wgs84Projection, 0, 2);

MinX = xy[0];
MinY = xy[1];
MaxX = xy[2];
MaxY = xy[3];
var rectangle = new Extent(MinX, MinY, MaxX, MaxY);
return rectangle;
}

#endregion
}
}
@@ -1,30 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FacetedSearch3.Area
{

// Represents a latitude / longitude bounding box.
public class Box
{
public Box(double xMin, double xMax, double yMin, double yMax)
{
XMin = xMin;
XMax = xMax;
YMax = yMax;
YMin = yMin;
}

public double XMax { get; set;}

public double XMin { get; set; }

public double YMax { get; set; }

public double YMin { get; set; }

//public override string ToString();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FacetedSearch3.Area
{

// Represents a latitude / longitude bounding box.
public class Box
{
public Box(double xMin, double xMax, double yMin, double yMax)
{
XMin = xMin;
XMax = xMax;
YMax = yMax;
YMin = yMin;
}

public double XMax { get; set;}

public double XMin { get; set; }

public double YMax { get; set; }

public double YMin { get; set; }

//public override string ToString();
}
}

0 comments on commit 7b3098e

Please sign in to comment.