Skip to content

Commit

Permalink
Reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
FObermaier committed Mar 15, 2021
1 parent de51784 commit 246a5d7
Show file tree
Hide file tree
Showing 34 changed files with 60 additions and 68 deletions.
5 changes: 4 additions & 1 deletion src/Directory.Build.props → Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<Project>

<PropertyGroup>
<SolutionDir Condition=" '$(SolutionDir)' == '' ">$(MSBuildThisFileDirectory)</SolutionDir>

<Copyright>Copyright 2014-$([System.DateTime]::UtcNow.Year) SharpMap - Team</Copyright>
<Authors>SharpMap - Team</Authors>
<NoWarn>1701;1702;2100;2235</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/SharpMap/SharpMap.BusinessObjects.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/SharpMap/SharpMap.BusinessObjects</PackageProjectUrl>
<PackageIcon>SharpMap.Logo.png</PackageIcon>
<PackageLicenseExpression>LGPL-2.1-or-later</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup Label="SourceLink Info">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30517.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects", "SharpMap.BusinessObjects\SharpMap.BusinessObjects.csproj", "{AC492306-4594-4E1E-A7B4-8982937061F8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects", "src\SharpMap.BusinessObjects\SharpMap.BusinessObjects.csproj", "{AC492306-4594-4E1E-A7B4-8982937061F8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.EF6", "SharpMap.BusinessObjects.EF6\SharpMap.BusinessObjects.EF6.csproj", "{F2EF6114-B690-45A6-BDAD-4F362EF0BC36}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.EF6", "src\SharpMap.BusinessObjects.EF6\SharpMap.BusinessObjects.EF6.csproj", "{F2EF6114-B690-45A6-BDAD-4F362EF0BC36}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.MongoDB", "SharpMap.BusinessObjects.MongoDB\SharpMap.BusinessObjects.MongoDB.csproj", "{210F7E37-648C-426B-A0C4-101FDCB28362}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.MongoDB", "src\SharpMap.BusinessObjects.MongoDB\SharpMap.BusinessObjects.MongoDB.csproj", "{210F7E37-648C-426B-A0C4-101FDCB28362}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.MongoDB.Gtfs", "SharpMap.BusinessObjects.MongoDB.Gtfs\SharpMap.BusinessObjects.MongoDB.Gtfs.csproj", "{513BE777-DCCE-43A1-A727-F521C570BCFD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.MongoDB.Gtfs", "src\SharpMap.BusinessObjects.MongoDB.Gtfs\SharpMap.BusinessObjects.MongoDB.Gtfs.csproj", "{513BE777-DCCE-43A1-A727-F521C570BCFD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.Tests", "SharpMap.BusinessObjects.Tests\SharpMap.BusinessObjects.Tests.csproj", "{6BB66868-62EA-49C7-A6F4-06B87E2BDE6D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpMap.BusinessObjects.Tests", "test\SharpMap.BusinessObjects.Tests\SharpMap.BusinessObjects.Tests.csproj", "{6BB66868-62EA-49C7-A6F4-06B87E2BDE6D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{3F947150-250D-4662-AA5D-E970C66C0C7B}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Global
Expand Down
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,10 @@
<Product>SharpMap.BusinessObjects.EF6</Product>
<PackageTags>SharpMap GIS Map GeoSpatial Business EF6</PackageTags>
<RootNamespace>SharpMap</RootNamespace>
<Version>1.2.0</Version>
<Authors>SharpMap - Team</Authors>
<Description>EF6 business objects to work with SharpMap</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\SharpMap.Logo.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@
<Product>SharpMap.BusinessObjects.MongoDB.Gtfs</Product>
<PackageTags>SharpMap GIS Map GeoSpatial Business MongoDB Gtfs</PackageTags>
<RootNamespace>SharpMap.Data.Providers.Business.MongoDB</RootNamespace>
<Version>1.2.0</Version>
<Authors>SharpMap - Team</Authors>
<Description>MongoDB business objects to work with SharpMap</Description>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<Pack>false</Pack>
<Pack>false</Pack>
</PropertyGroup>

<ItemGroup>
<None Include="..\SharpMap.Logo.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.10.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
<Authors>SharpMap - Team</Authors>
<Description>MongoDB business objects to work with SharpMap</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Pack>true</Pack>
</PropertyGroup>

<ItemGroup>
<None Include="..\SharpMap.Logo.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\..\SharpMap.Logo.png"><Pack>True</Pack></None>
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 0 additions & 13 deletions src/SharpMap.BusinessObjects.MongoDB/packages.config

This file was deleted.

8 changes: 0 additions & 8 deletions src/SharpMap.BusinessObjects/SharpMap.BusinessObjects.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,4 @@
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
</ItemGroup>


<ItemGroup>
<None Include="..\SharpMap.Logo.png">
<Pack>True</Pack>
</None>
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
Expand All @@ -10,6 +10,7 @@
using NUnit.Framework;
using SharpMap.Data.Providers.Business;
using SharpMap.Layers;
using SharpMap.Rendering;
using SharpMap.Rendering.Business;

namespace SharpMap.Business.Tests.Memory
Expand Down Expand Up @@ -82,33 +83,36 @@ public LinkWithLoadRenderer()
/// Method to render each individual business object
/// </summary>
/// <param name="businessObject">The business object to render</param>
public override void Render(LinkWithLoad businessObject)
public override Rectangle Render(LinkWithLoad businessObject)
{
var g = (ILineString)Transformation(businessObject.LineString);

// Draw the loads in positive direction
RenderLoadStrips(g, businessObject.Load[0], Scale);
var affectedArea = RenderLoadStrips(g, businessObject.Load[0], Scale);

// Draw the loads in negative direction
RenderLoadStrips(g, businessObject.Load[1], -Scale);
affectedArea.ExpandToInclude(RenderLoadStrips(g, businessObject.Load[1], -Scale));

// Draw the axis
if (AxisPen != null)
Graphics.DrawLines(AxisPen, businessObject.LineString.TransformToImage(Map));

return affectedArea;
}

private void RenderLoadStrips(ILineString ls, double[] loads, double scale = 1)
private Rectangle RenderLoadStrips(ILineString ls, double[] loads, double scale = 1)
{
// Get the coordinates
var start = Simplify
? NetTopologySuite.Simplify.DouglasPeuckerLineSimplifier.Simplify(ls.Coordinates, 2*Map.PixelSize)
? NetTopologySuite.Simplify.DouglasPeuckerLineSimplifier.Simplify(ls.Coordinates, 2*Map.PixelWidth)
: ls.Coordinates;

// Compute the initial offset
if (Offset != 0d)
start = RemoveSelfIntersections(_offsetCurveBuilder
.GetOffsetCurve(start, Math.Sign(scale)*Offset * Map.PixelSize), ls.Factory);
.GetOffsetCurve(start, Math.Sign(scale)*Offset * Map.PixelWidth), ls.Factory);

var affectedArea = RectangleF.Empty;
// All strips
for (var i = 0; i < loads.Length; i++)
{
Expand All @@ -129,21 +133,50 @@ private void RenderLoadStrips(ILineString ls, double[] loads, double scale = 1)

// Transform to image coordinates
var gp = ring.TransformToImage(Map);
var affectedAreaItem = GetAffectedArea(gp);

// Draw the polygon
Brush b;
if (!LoadBrush.TryGetValue(i, out b))
b = new HatchBrush(HatchStyle.LargeCheckerBoard, Color.HotPink, Color.Chartreuse);


Graphics.FillPolygon(b, gp);

if (FramePen != null)
{
Graphics.DrawPolygon(FramePen, gp);
affectedAreaItem = RectangleF.Inflate(affectedAreaItem, (int)FramePen.Width, (int)FramePen.Width);
}

start = offset;
affectedArea = ExpandToInclude(affectedArea, affectedAreaItem);
}

return Rectangle.Round(affectedArea);
}

private RectangleF GetAffectedArea(PointF[] points)
{
var affected = RectangleF.Empty;
if (points == null || points.Length == 0)
return affected;

for (int i = 1; i < points.Length; i += 2)
affected = ExpandToInclude(affected, new RectangleF(points[i], SizeF.Empty));

return affected;
}

private RectangleF ExpandToInclude(RectangleF a, RectangleF b)
{
if (a.IsEmpty)
return b;
if (b.IsEmpty)
return a;

return RectangleF.Union(a, b);
}
//private ILineString GetOffsetCurve(ILineString lineString)
//{
// return lineString.Factory.CreateLineString(
Expand Down Expand Up @@ -215,4 +248,4 @@ public void TestRendering()
Console.WriteLine(new Uri(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "LinkWithLoadImage2.png")).AbsoluteUri);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
<TargetFramework>net472</TargetFramework>
<Product>SharpMap.BusinessObjects.Tests</Product>
<RootNamespace>SharpMap.Business.Tests</RootNamespace>
<Version>1.2.0</Version>
<Authors>SharpMap - Team</Authors>
<Description>Tests around business objects that should work with SharpMap</Description>
<DocumentationFile></DocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>

Expand All @@ -20,10 +17,10 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SharpMap.BusinessObjects\SharpMap.BusinessObjects.csproj" />
<ProjectReference Include="..\SharpMap.BusinessObjects.EF6\SharpMap.BusinessObjects.EF6.csproj" />
<ProjectReference Include="..\SharpMap.BusinessObjects.MongoDB\SharpMap.BusinessObjects.MongoDB.csproj" />
<ProjectReference Include="..\SharpMap.BusinessObjects.MongoDB.Gtfs\SharpMap.BusinessObjects.MongoDB.Gtfs.csproj" />
<ProjectReference Include="..\..\src\SharpMap.BusinessObjects\SharpMap.BusinessObjects.csproj" />
<ProjectReference Include="..\..\src\SharpMap.BusinessObjects.EF6\SharpMap.BusinessObjects.EF6.csproj" />
<ProjectReference Include="..\..\src\SharpMap.BusinessObjects.MongoDB\SharpMap.BusinessObjects.MongoDB.csproj" />
<ProjectReference Include="..\..\src\SharpMap.BusinessObjects.MongoDB.Gtfs\SharpMap.BusinessObjects.MongoDB.Gtfs.csproj" />
</ItemGroup>

</Project>

0 comments on commit 246a5d7

Please sign in to comment.