Skip to content

Commit

Permalink
version cleanup for 1.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
PeteMichaud committed Mar 15, 2022
1 parent d4d4d8d commit c96a2ab
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 4,449 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,4 @@ MigrationBackup/
FodyWeavers.xsd
/MapProjectorCLI/Tests/Output/Formats
/MapProjectorCLI/Tests/Output/Inverted
/MapProjectorCLI/Properties/launchSettings.json
1 change: 1 addition & 0 deletions MapProjectorCLI/CLIParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class CLIParams
{
config.CaseSensitive = false;
config.CaseInsensitiveEnumValues = true;
config.AutoVersion = true;
});

public static ParserResult<CLIParams> Parse(string[] args, Parser parser = null)
Expand Down
18 changes: 17 additions & 1 deletion MapProjectorCLI/MapProjectorCLI.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
Expand All @@ -20,11 +21,26 @@
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Authors>Pete Michaud</Authors>
<Product>MapProjectorCLI</Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/PeteMichaud/MapProjectorStudio</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
<StartupObject>MapProjectorCLI.Program</StartupObject>
<Copyright>Pete Michaud 2022</Copyright>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/PeteMichaud/MapProjectorStudio</RepositoryUrl>
<PackageTags>map;projection;geography</PackageTags>
</PropertyGroup>
<ItemGroup>
<None Include="..\readme.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MapProjectorLib\MapProjectorLib.csproj" />
</ItemGroup>
Expand Down
15 changes: 9 additions & 6 deletions MapProjectorCLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,29 @@
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

[assembly:AssemblyVersion("1.3.0")]

namespace MapProjectorCLI
{
public class Program
{
const string AUTHOR = "Pete Michaud";
const int COPYRIGHT_YEAR = 2022;
static void Main(string[] args)
{
var parseErrors = new List<Error>();
Console.Write("Loading... ");
var result = CLIParams.Parse(args).WithParsed(cliParams =>
{
Console.Write("Loading... ");
(var success, var pParams) = ProcessParams(cliParams);
if (success)
{
//Console.Write(pParams.ToString());
Console.WriteLine("Loaded!");
Console.WriteLine($"Loaded! (Input file: {pParams.srcImageFileName})");
Console.WriteLine("Processing...");
Stopwatch timer = new Stopwatch();
var timer = new Stopwatch();
timer.Start();
Projector.Project(pParams, projectedImage =>
Expand All @@ -50,14 +54,13 @@ static void Main(string[] args)

if(parseErrors.Count > 0)
{
Console.WriteLine("");
var helpText = HelpText.AutoBuild(result,
h => HelpText.DefaultParsingErrorsHandler(result, h),
e => e);
helpText.Copyright = new CopyrightInfo(AUTHOR, COPYRIGHT_YEAR);
Console.WriteLine(helpText);
}

Console.ReadKey();

}


Expand Down
2 changes: 1 addition & 1 deletion MapProjectorLib/MapProjectorLib.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion MapProjectorLib/Projections/LatLong.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override double GetLong(double x, double _)
protected override (bool inBounds, PointD mappedPoint) GetXY(
double phi, double lambda)
{
return (true, new PointD(lambda,phi));
return (true, new PointD(lambda, phi));
}
}
}
13 changes: 8 additions & 5 deletions MapProjectorLib/Projections/Perspective.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ public override (bool inProjectionBounds, double x1, double y1, double z1, doubl

// Projecting from (rx, ry, rz) to point (x1, y1, z1)
// Solve a quadratic obtained from equating line equation with r = 1
var qa = a2 * ProjMath.Sqr(rotatedViewX - x1) + b2 * ProjMath.Sqr(rotatedViewY - y1) +
c2 * ProjMath.Sqr(rotatedViewZ - z1);
var qb = 2 * (a2 * x1 * (rotatedViewX - x1) + b2 * y1 * (rotatedViewY - y1) +
c2 * z1 * (rotatedViewZ - z1));
var qc = a2 * ProjMath.Sqr(x1) + b2 * ProjMath.Sqr(y1) +
var qa = a2 * ProjMath.Sqr(rotatedViewX - x1) + b2 *
ProjMath.Sqr(rotatedViewY - y1) +
c2 * ProjMath.Sqr(rotatedViewZ - z1);
var qb = 2 * (a2 * x1 * (rotatedViewX - x1) + b2 *
y1 * (rotatedViewY - y1) +
c2 * z1 * (rotatedViewZ - z1));
var qc = a2 * ProjMath.Sqr(x1) + b2 *
ProjMath.Sqr(y1) +
c2 * ProjMath.Sqr(z1) - 1;
var qm = qb * qb - 4 * qa * qc;

Expand Down
35 changes: 0 additions & 35 deletions Properties/AssemblyInfo.cs

This file was deleted.

70 changes: 0 additions & 70 deletions Properties/Resources.Designer.cs

This file was deleted.

117 changes: 0 additions & 117 deletions Properties/Resources.resx

This file was deleted.

29 changes: 0 additions & 29 deletions Properties/Settings.Designer.cs

This file was deleted.

7 changes: 0 additions & 7 deletions Properties/Settings.settings

This file was deleted.

Loading

0 comments on commit c96a2ab

Please sign in to comment.