1
0
Fork 0

Finally get rid of GPC

This commit is contained in:
Christian Schmitt 2012-09-03 09:19:58 +02:00
parent 1e64cfc974
commit ca9a6dda13
35 changed files with 36 additions and 1149 deletions

View file

@ -71,7 +71,6 @@ find_package(Boost REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Threads REQUIRED)
find_package(SimGear 2.5.0 REQUIRED)
find_package(GPC REQUIRED)
find_package(CGAL COMPONENTS Core REQUIRED)
find_package(TIFF) # needed for SRTM
if (CMAKE_CL_64)

View file

@ -1,24 +0,0 @@
FIND_PATH(GPC_INCLUDE_DIR gpc.h
HINTS $ENV{GPC_DIR}
PATH_SUFFIXES include include/gpcl
PATHS
/usr/local
/usr
/opt
)
FIND_LIBRARY(GPC_LIBRARY
NAMES genpolyclip gpc gpcl agggpc
HINTS $ENV{GPC_DIR}
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
PATHS
/usr/local
/usr
/opt
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPC DEFAULT_MSG
GPC_LIBRARY GPC_INCLUDE_DIR)

View file

@ -1,85 +0,0 @@
You need to have the GPC library installed on your system to build
some of the scenery generation tools, otherwise you won't be able to
create scenery.
Unfortunately, because of wording conflicts between the GPC license
and the GPL licence used by TerraGear we are unable to include the GPC
library with the Flight Gear distribution.
Under Debian you can get the library as libgpcl-dev from the non-free
repository and you are good to go.
If you have to compile manually, you can get the library from:
http://www.cs.man.ac.uk/aig/staff/alan/software/
This library comes as a single source file and header with no build
directions or Makefile. So, here are some directions contributed by
Riley Rainey <riley.rainey@websimulations.com> with additional notes
by Curt Olson:
1. Download the GPC library source code from URL:
http://www.cs.man.ac.uk/aig/staff/alan/software
2. Unpack it; the current version seems to be 2.31:
$ zcat gpc231.tar.Z | tar xvf -
3. ***IMPORTANT STEP*** ***DO NOT SKIP***
This is important step if you want to use gpc to generate quality
scenery!
Before building the library, edit the gpc.h file and change
GPC_EPSILON to something bigger. You may experiment with this
value, but the following seems to work well for me:
#define GPC_EPSILON (0.000001)
4. Copy in the Makefile attached to this message:
$ cp Makefile ./gpc231
5. Check install paths. Edit the Makefile and make sure the install
paths are satisfactory. Also make sure that all the make commands
have leading tabs (i.e. that the tabs aren't expanded out into 8
spaces) otherwise the make will fail.
6. Build and install it:
$ cd ./gpc231
$ make
$ su
Password:
# make install
-------------------------- snip ------------------------------
# Unix/Linux makefile for GPC 2.32
#
# Riley Rainey (riley.rainey@websimulations.com)
# Ralf Gerlich (ralf.gerlich (at) custom-scenery (dot) org)
CFLAGS = -O -g
PREFIX=/usr/local
libgenpolyclip.a: gpc.o
rm -f $@
ar cr $@ $<
ranlib $@
clean:
rm -f libgenpolyclip.a *.o core *~
install: libgenpolyclip.a
-mkdir -p $(PREFIX)/lib
-mkdir -p $(PREFIX)/include
install libgenpolyclip.a $(PREFIX)/lib/libgenpolyclip.a
install gpc.h $(PREFIX)/include/gpc.h

View file

@ -1,26 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpc232", "gpc232.vcxproj", "{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Debug|Win32.ActiveCfg = Debug|Win32
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Debug|Win32.Build.0 = Debug|Win32
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Debug|x64.ActiveCfg = Debug|x64
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Debug|x64.Build.0 = Debug|x64
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Release|Win32.ActiveCfg = Release|Win32
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Release|Win32.Build.0 = Release|Win32
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Release|x64.ActiveCfg = Release|x64
{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -1,308 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="gpc232"
ProjectGUID="{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/gpc232.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/gpc232.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/gpc232.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/gpc232.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\..\..\gpc232\gpc.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\..\..\gpc232\gpc.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -1,160 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9AABEE2B-19BC-4479-ADBE-58CA0A8BBC93}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)gpc232.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)gpc232.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)gpc232.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)gpc232.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\gpc232\gpc.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\gpc232\gpc.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\gpc232\gpc.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\gpc232\gpc.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -1,7 +1,4 @@
include_directories(
${NEWMAT_INCLUDE_DIR}
${GPC_INCLUDE_DIR}
)
include_directories(${NEWMAT_INCLUDE_DIR})
add_executable(genapts
apt_surface.hxx apt_surface.cxx
@ -27,8 +24,7 @@ target_link_libraries(genapts
TriangleJRS
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GDAL_LIBRARY}
${GPC_LIBRARY}
${GDAL_LIBRARY}
${NEWMAT_LIBRARY})
install(TARGETS genapts RUNTIME DESTINATION bin)

View file

@ -1,7 +1,4 @@
include_directories(
${NEWMAT_INCLUDE_DIR}
${GPC_INCLUDE_DIR}
)
include_directories(${NEWMAT_INCLUDE_DIR})
add_executable(genapts850
airport.hxx airport.cxx
@ -22,8 +19,8 @@ add_executable(genapts850
runway.cxx runway.hxx
rwy_simple.cxx
rwy_gen.cxx
scheduler.cxx scheduler.hxx
taxiway.cxx taxiway.hxx
scheduler.cxx scheduler.hxx
taxiway.cxx taxiway.hxx
)
target_link_libraries(genapts850
@ -35,7 +32,6 @@ target_link_libraries(genapts850
${GDAL_LIBRARY}
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY}
${NEWMAT_LIBRARY}
${RT_LIBRARY})

View file

@ -1,5 +1,3 @@
include_directories(${GPC_INCLUDE_DIR})
add_executable(tg-construct
construct.cxx
construct.hxx
@ -19,9 +17,9 @@ target_link_libraries(tg-construct
Array landcover poly2tri
TriangleJRS
${GDAL_LIBRARY}
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
)
install(TARGETS tg-construct RUNTIME DESTINATION bin)

View file

@ -601,11 +601,7 @@ int TGConstruct::LoadLandclassPolys( void ) {
// to reduce the number of separate polygons.
void TGConstruct::add_to_polys ( TGPolygon &accum, const TGPolygon &poly) {
if ( accum.contours() > 0 ) {
#if USE_CLIPPER
accum = tgPolygonUnionClipper( accum, poly );
#else
accum = tgPolygonUnion( accum, poly );
#endif
} else {
accum = poly;
}
@ -1239,11 +1235,7 @@ void TGConstruct::merge_slivers( TGLandclass& clipped, poly_list& slivers_list
poly = clipped.get_poly( area, shape, segment );
original_contours = poly.contours();
#if USE_CLIPPER
result = tgPolygonUnionClipper( poly, sliver );
#else
result = tgPolygonUnion( poly, sliver );
#endif
result_contours = result.contours();
if ( original_contours == result_contours ) {
@ -1254,11 +1246,7 @@ void TGConstruct::merge_slivers( TGLandclass& clipped, poly_list& slivers_list
/* add the sliver to the clip_mask, too */
TGPolygon mask = clipped.get_mask( area, shape );
#if USE_CLIPPER
result = tgPolygonUnionClipper( mask, sliver );
#else
result = tgPolygonUnion( mask, sliver );
#endif
clipped.set_mask( area, shape, result );
if ( IsDebugShape( shape_id ) ) {
@ -1299,11 +1287,7 @@ bool TGConstruct::ClipLandclassPolys( void ) {
#if USE_ACCUMULATOR
#if USE_CLIPPER
tgPolygonInitClipperAccumulator();
#else
tgPolygonInitGPCAccumulator();
#endif
#else
accum.erase();
@ -1341,29 +1325,17 @@ bool TGConstruct::ClipLandclassPolys( void ) {
for ( i = 0; i < TG_MAX_AREA_TYPES; i++ ) {
if ( is_landmass_area( i ) && !ignoreLandmass ) {
for ( unsigned int j = 0; j < polys_in.area_size(i); ++j ) {
#if USE_CLIPPER
land_mask = tgPolygonUnionClipper( land_mask, polys_in.get_mask(i, j) );
#else
land_mask = tgPolygonUnion( land_mask, polys_in.get_mask(i, j) );
#endif
}
} else if ( is_water_area( i ) ) {
for (unsigned int j = 0; j < polys_in.area_size(i); j++) {
#if USE_CLIPPER
water_mask = tgPolygonUnionClipper( water_mask, polys_in.get_mask(i, j) );
#else
water_mask = tgPolygonUnion( water_mask, polys_in.get_mask(i, j) );
#endif
}
} else if ( is_island_area( i ) ) {
for (unsigned int j = 0; j < polys_in.area_size(i); j++) {
#if USE_CLIPPER
island_mask = tgPolygonUnionClipper( island_mask, polys_in.get_mask(i, j) );
#else
island_mask = tgPolygonUnion( island_mask, polys_in.get_mask(i, j) );
#endif
}
}
}
@ -1386,21 +1358,13 @@ bool TGConstruct::ClipLandclassPolys( void ) {
// if not a hole, clip the area to the land_mask
if ( !ignoreLandmass && !is_hole_area( i ) ) {
#if USE_CLIPPER
tmp = tgPolygonIntClipper( tmp, land_mask );
#else
tmp = tgPolygonInt( tmp, land_mask );
#endif
}
// if a water area, cut out potential islands
if ( is_water_area( i ) ) {
// clip against island mask
#if USE_CLIPPER
tmp = tgPolygonDiffClipper( tmp, island_mask );
#else
tmp = tgPolygonDiff( tmp, island_mask );
#endif
}
if ( IsDebugShape( polys_in.get_shape( i, j ).id ) ) {
@ -1409,23 +1373,12 @@ bool TGConstruct::ClipLandclassPolys( void ) {
WriteDebugPoly( "pre-clip", name, tmp );
}
#if USE_CLIPPER
#if USE_ACCUMULATOR
clipped = tgPolygonDiffClipperWithAccumulator( tmp );
#else
clipped = tgPolygonDiffClipper( tmp, accum );
#endif
#else
#if USE_ACCUMULATOR
clipped = tgPolygonDiffWithAccumulator( tmp );
#else
clipped = tgPolygonDiff( tmp, accum );
#endif
#endif
// only add to output list if the clip left us with a polygon
if ( clipped.contours() > 0 ) {
@ -1457,23 +1410,12 @@ bool TGConstruct::ClipLandclassPolys( void ) {
}
}
#if USE_CLIPPER
#if USE_ACCUMULATOR
tgPolygonAddToClipperAccumulator( tmp );
#else
accum = tgPolygonUnionClipper( tmp, accum );
#endif
#else
#if USE_ACCUMULATOR
tgPolygonAddToAccumulator( tmp );
#else
accum = tgPolygonUnion( tmp, accum );
#endif
#endif
}
}
@ -1490,22 +1432,10 @@ bool TGConstruct::ClipLandclassPolys( void ) {
slivers.clear();
// finally, what ever is left over goes to ocean
#if USE_CLIPPER
#if USE_ACCUMULATOR
remains = tgPolygonDiffClipperWithAccumulator( safety_base );
#else
remains = tgPolygonDiffClipper( safety_base, accum );
#endif
#else
#if USE_ACCUMULATOR
remains = tgPolygonDiffWithAccumulator( safety_base );
#else
remains = tgPolygonDiff( safety_base, accum );
#endif
#endif
if ( remains.contours() > 0 ) {
@ -1550,11 +1480,7 @@ bool TGConstruct::ClipLandclassPolys( void ) {
#if USE_ACCUMULATOR
#if USE_CLIPPER
tgPolygonFreeClipperAccumulator();
#else
tgPolygonFreeGPCAccumulator();
#endif
#endif

View file

@ -51,7 +51,6 @@
#include "priorities.hxx"
#define USE_CLIPPER (0)
#define FIND_SLIVERS (1)
#define USE_ACCUMULATOR (1)
@ -83,11 +82,7 @@ public:
for (unsigned int i=0; i<sps.size(); i++)
{
poly = sps[i].get_poly();
#ifdef USE_CLIPPER
clip_mask = tgPolygonUnionClipper( clip_mask, poly );
#else
clip_mask = tgPolygonUnion( clip_mask, poly );
#endif
}
}
@ -100,11 +95,7 @@ public:
{
original = sps[i].get_poly();
#ifdef USE_CLIPPER
intersect = tgPolygonIntClipper( clip_mask, original );
#else
intersect = tgPolygonInt( clip_mask, original );
#endif
sps[i].set_poly( intersect );
}

View file

@ -1,4 +1,4 @@
include_directories(${GPC_INCLUDE_DIR})
add_library(Match STATIC
match.cxx match.hxx

View file

@ -2,7 +2,6 @@ if (GDAL_FOUND)
include_directories(${GDAL_INCLUDE_DIR})
endif (GDAL_FOUND)
include_directories(${GPC_INCLUDE_DIR})
include( ${CGAL_USE_FILE} )
add_library(Geometry STATIC

View file

@ -1073,8 +1073,7 @@ bool find_intermediate_node( const Point3D& start, const Point3D& end,
// Attempt to reduce degeneracies where a subsequent point of a
// polygon lies *on* a previous line segment. These artifacts are
// occasionally introduced by the gpc polygon clipper.
// polygon lies *on* a previous line segment.
static point_list reduce_contour_degeneracy( const point_list& contour ) {
point_list result = contour;

View file

@ -1,4 +1,4 @@
include_directories(${GPC_INCLUDE_DIR})
add_library(Output STATIC
output.cxx output.hxx

View file

@ -1,4 +1,4 @@
include_directories(${GPC_INCLUDE_DIR})
add_library(Polygon STATIC
chop-bin.cxx

View file

@ -88,14 +88,6 @@ static void clip_and_write_poly( string root, long int p_index,
base.add_node( 0, Point3D(max.x(), max.y(), 0) );
base.add_node( 0, Point3D(min.x(), max.y(), 0) );
// SG_LOG( SG_GENERAL, SG_DEBUG, "base = 4 vertices" );
/*
FILE *bfp= fopen("base", "w");
gpc_write_polygon(bfp, &base);
fclose(bfp);
*/
SG_LOG(SG_GENERAL, SG_DEBUG, "shape contours = " << shape.contours() );
for ( int ii = 0; ii < shape.contours(); ii++ )
SG_LOG(SG_GENERAL, SG_DEBUG, " hole = " << shape.get_hole_flag(ii) );
@ -197,14 +189,6 @@ static void clip_and_write_polys_with_mask( string root, long int p_index,
base.add_node( 0, Point3D(max.x(), max.y(), 0) );
base.add_node( 0, Point3D(min.x(), max.y(), 0) );
// SG_LOG( SG_GENERAL, SG_DEBUG, "base = 4 vertices" );
/*
FILE *bfp= fopen("base", "w");
gpc_write_polygon(bfp, &base);
fclose(bfp);
*/
poly_list clipped_shapes;
TGPolygon shape;
unsigned int s;
@ -325,14 +309,6 @@ static void clip_and_write_polys_with_tps( string root, long int p_index,
base.add_node( 0, Point3D(max.x(), max.y(), 0) );
base.add_node( 0, Point3D(min.x(), max.y(), 0) );
// SG_LOG( SG_GENERAL, SG_DEBUG, "base = 4 vertices" );
/*
* FILE *bfp= fopen("base", "w");
* gpc_write_polygon(bfp, &base);
* fclose(bfp);
*/
poly_list clipped_shapes;
texparams_list clipped_tps;
TGPolygon shape;

View file

@ -394,115 +394,6 @@ typedef enum {
POLY_UNION // Union
} clip_op;
//
// wrapper functions for gpc polygon clip routines
//
// Make a gpc_poly from an TGPolygon
void make_gpc_poly( const TGPolygon& in, gpc_polygon *out ) {
gpc_vertex_list v_list;
v_list.num_vertices = 0;
v_list.vertex = new gpc_vertex[FG_MAX_VERTICES];
Point3D p;
// build the gpc_polygon structures
for ( int i = 0; i < in.contours(); ++i ) {
// SG_LOG(SG_GENERAL, SG_DEBUG, " contour " << i << " = " << in.contour_size( i ));
if ( in.contour_size( i ) > FG_MAX_VERTICES ) {
char message[128];
sprintf(message, "Polygon too large, need to increase FG_MAX_VERTICES to a least %d", in.contour_size(i));
throw sg_exception(message);;
}
#if 0
SG_LOG(SG_GENERAL, SG_ALERT,
" make_clipper_poly : processing contour " << i << ", nodes = "
<< in.contour_size(i) << ", hole = "
<< in.get_hole_flag(i)
);
#endif
for ( int j = 0; j < in.contour_size( i ); ++j ) {
p = in.get_pt( i, j );
v_list.vertex[j].x = p.x();
v_list.vertex[j].y = p.y();
}
v_list.num_vertices = in.contour_size( i );
gpc_add_contour( out, &v_list, in.get_hole_flag( i ) );
}
// free alocated memory
delete [] v_list.vertex;
}
void make_tg_poly( const gpc_polygon* in, TGPolygon *out )
{
for ( int i = 0; i < in->num_contours; ++i ) {
for ( int j = 0; j < in->contour[i].num_vertices; j++ ) {
Point3D p( in->contour[i].vertex[j].x, in->contour[i].vertex[j].y, -9999.0 );
out->add_node(i, p);
}
out->set_hole_flag( i, in->hole[i] );
}
}
// Generic clipping routine
TGPolygon polygon_clip( clip_op poly_op, const TGPolygon& subject,
const TGPolygon& clip )
{
TGPolygon result;
gpc_polygon *gpc_subject = new gpc_polygon;
gpc_subject->num_contours = 0;
gpc_subject->contour = NULL;
gpc_subject->hole = NULL;
make_gpc_poly( subject, gpc_subject );
gpc_polygon *gpc_clip = new gpc_polygon;
gpc_clip->num_contours = 0;
gpc_clip->contour = NULL;
gpc_clip->hole = NULL;
make_gpc_poly( clip, gpc_clip );
gpc_polygon *gpc_result = new gpc_polygon;
gpc_result->num_contours = 0;
gpc_result->contour = NULL;
gpc_result->hole = NULL;
gpc_op op;
if ( poly_op == POLY_DIFF ) {
op = GPC_DIFF;
} else if ( poly_op == POLY_INT ) {
op = GPC_INT;
} else if ( poly_op == POLY_XOR ) {
op = GPC_XOR;
} else if ( poly_op == POLY_UNION ) {
op = GPC_UNION;
} else {
throw sg_exception("Unknown polygon op, exiting.");
}
gpc_polygon_clip( op, gpc_subject, gpc_clip, gpc_result );
make_tg_poly( gpc_result, &result );
// free allocated memory
gpc_free_polygon( gpc_subject );
delete gpc_subject;
gpc_free_polygon( gpc_clip );
delete gpc_clip;
gpc_free_polygon( gpc_result );
delete gpc_result;
return result;
}
//#define FIXEDPT (10000000000000)
#define FIXEDPT (10000000000000000)
@ -706,97 +597,24 @@ TGPolygon polygon_clip_clipper( clip_op poly_op, const TGPolygon& subject, const
}
// Accumulator optimization ( to keep from massive data copies and format changes
gpc_polygon *gpc_accumulator = NULL;
void tgPolygonInitGPCAccumulator( void )
{
gpc_accumulator = new gpc_polygon;
gpc_accumulator->num_contours = 0;
gpc_accumulator->contour = NULL;
gpc_accumulator->hole = NULL;
}
void tgPolygonFreeGPCAccumulator( void )
{
gpc_free_polygon( gpc_accumulator );
delete gpc_accumulator;
gpc_accumulator = NULL;
}
void tgPolygonAddToAccumulator( const TGPolygon& subject )
{
gpc_polygon *gpc_subject = new gpc_polygon;
gpc_subject->num_contours = 0;
gpc_subject->contour = NULL;
gpc_subject->hole = NULL;
make_gpc_poly( subject, gpc_subject );
gpc_polygon *gpc_result = new gpc_polygon;
gpc_result->num_contours = 0;
gpc_result->contour = NULL;
gpc_result->hole = NULL;
gpc_polygon_clip( GPC_UNION, gpc_subject, gpc_accumulator, gpc_result );
// free allocated memory
gpc_free_polygon( gpc_subject );
delete gpc_subject;
// throw away old accumulator : and use result for now on
gpc_free_polygon( gpc_accumulator );
delete gpc_accumulator;
gpc_accumulator = gpc_result;
}
TGPolygon tgPolygonDiffWithAccumulator( const TGPolygon& subject )
{
TGPolygon result;
gpc_polygon *gpc_subject = new gpc_polygon;
gpc_subject->num_contours = 0;
gpc_subject->contour = NULL;
gpc_subject->hole = NULL;
make_gpc_poly( subject, gpc_subject );
gpc_polygon *gpc_result = new gpc_polygon;
gpc_result->num_contours = 0;
gpc_result->contour = NULL;
gpc_result->hole = NULL;
gpc_polygon_clip( GPC_DIFF, gpc_subject, gpc_accumulator, gpc_result );
make_tg_poly( gpc_result, &result );
// free allocated memory
gpc_free_polygon( gpc_subject );
delete gpc_subject;
gpc_free_polygon( gpc_result );
delete gpc_result;
return result;
}
// Difference
TGPolygon tgPolygonDiff( const TGPolygon& subject, const TGPolygon& clip ) {
return polygon_clip( POLY_DIFF, subject, clip );
return polygon_clip_clipper( POLY_DIFF, subject, clip );
}
// Intersection
TGPolygon tgPolygonInt( const TGPolygon& subject, const TGPolygon& clip ) {
return polygon_clip( POLY_INT, subject, clip );
return polygon_clip_clipper( POLY_INT, subject, clip );
}
// Exclusive or
TGPolygon tgPolygonXor( const TGPolygon& subject, const TGPolygon& clip ) {
return polygon_clip( POLY_XOR, subject, clip );
return polygon_clip_clipper( POLY_XOR, subject, clip );
}
// Union
TGPolygon tgPolygonUnion( const TGPolygon& subject, const TGPolygon& clip ) {
return polygon_clip( POLY_UNION, subject, clip );
return polygon_clip_clipper( POLY_UNION, subject, clip );
}
@ -1078,147 +896,6 @@ TGPolygon tgPolygonSimplify(const TGPolygon &poly)
return result;
}
#if 0
// Wrapper for the fast Polygon Triangulation based on Seidel's
// Algorithm by Atul Narkhede and Dinesh Manocha
// http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html
// I make this oversize because given an n sided concave polygon with
// m, n, o, ... sided holes, I have no idea how many triangles would
// result and I don't have time right now to see if an upper bound can
// be determined easily.
#define FG_MAX_TRIANGLES 100000
TGPolygon polygon_to_tristrip( const TGPolygon& in_poly ) {
int i, j;
// canonify the polygon winding, outer contour must be
// anti-clockwise, all inner contours must be clockwise.
TGPolygon canon_poly = polygon_canonify( in_poly );
// create and fill in the required structures
int ncontours = canon_poly.contours();
int cntr[ncontours];
int vsize = 1;
for ( i = 0; i < canon_poly.contours(); ++i ) {
cntr[i] = canon_poly.contour_size( i );
vsize += cntr[i];
}
double vertices[vsize][2];
int counter = 1;
Point3D p;
for ( i = 0; i < canon_poly.contours(); ++i ) {
for ( j = 0; j < canon_poly.contour_size( i ); ++j ) {
p = canon_poly.get_pt( i, j );
vertices[counter][0] = p.x();
vertices[counter][1] = p.y();
counter++;
}
}
int triangles[FG_MAX_TRIANGLES][3];
// do the triangulation
int ntriangles = triangulate_polygon(ncontours, cntr, vertices, triangles);
/*
gpc_polygon *tmp_poly = new gpc_polygon;
tmp_poly->num_contours = 0;
tmp_poly->contour = NULL;
tmp_poly->hole = NULL;
make_gpc_poly( in_poly, tmp_poly );
gpc_tristrip *tmp_tristrip = new gpc_tristrip;
tmp_tristrip->num_strips = 0;
tmp_tristrip->strip = NULL;
gpc_polygon_to_tristrip( tmp_poly, tmp_tristrip );
TGPolygon result;
for ( int i = 0; i < tmp_tristrip->num_strips; ++i ) {
SG_LOG(SG_GENERAL, SG_DEBUG, " processing strip = "
<< i << ", nodes = "
<< tmp_tristrip->strip[i].num_vertices);
// sprintf(junkn, "g.%d", junkc++);
// junkfp = fopen(junkn, "w");
for ( int j = 0; j < tmp_tristrip->strip[i].num_vertices; j++ ) {
Point3D p( tmp_tristrip->strip[i].vertex[j].x,
tmp_tristrip->strip[i].vertex[j].y,
0 );
// junkp = in_nodes.get_node( index );
// fprintf(junkfp, "%.4f %.4f\n", junkp.x(), junkp.y());
result.add_node(i, p);
// SG_LOG(SG_GENERAL, SG_DEBUG, " - " << index);
}
// fprintf(junkfp, "%.4f %.4f\n",
// gpc_result->contour[i].vertex[0].x,
// gpc_result->contour[i].vertex[0].y);
// fclose(junkfp);
}
// free allocated memory
gpc_free_polygon( tmp_poly );
gpc_free_tristrip( tmp_tristrip );
*/
// return result;
}
#endif
#if 0
//
// wrapper functions for gpc polygon to tristrip routine
//
TGPolygon polygon_to_tristrip_old( const TGPolygon& in_poly ) {
gpc_polygon *tmp_poly = new gpc_polygon;
tmp_poly->num_contours = 0;
tmp_poly->contour = NULL;
tmp_poly->hole = NULL;
make_gpc_poly( in_poly, tmp_poly );
gpc_tristrip *tmp_tristrip = new gpc_tristrip;
tmp_tristrip->num_strips = 0;
tmp_tristrip->strip = NULL;
gpc_polygon_to_tristrip( tmp_poly, tmp_tristrip );
TGPolygon result;
for ( int i = 0; i < tmp_tristrip->num_strips; ++i ) {
SG_LOG(SG_GENERAL, SG_DEBUG, " processing strip = "
<< i << ", nodes = "
<< tmp_tristrip->strip[i].num_vertices);
// sprintf(junkn, "g.%d", junkc++);
// junkfp = fopen(junkn, "w");
for ( int j = 0; j < tmp_tristrip->strip[i].num_vertices; j++ ) {
Point3D p( tmp_tristrip->strip[i].vertex[j].x,
tmp_tristrip->strip[i].vertex[j].y,
0 );
// junkp = in_nodes.get_node( index );
// fprintf(junkfp, "%.4f %.4f\n", junkp.x(), junkp.y());
result.add_node(i, p);
// SG_LOG(SG_GENERAL, SG_DEBUG, " - " << index);
}
// fprintf(junkfp, "%.4f %.4f\n",
// gpc_result->contour[i].vertex[0].x,
// gpc_result->contour[i].vertex[0].y);
// fclose(junkfp);
}
// free allocated memory
gpc_free_polygon( tmp_poly );
gpc_free_tristrip( tmp_tristrip );
return result;
}
#endif
// Send a polygon to standard output.
ostream &

View file

@ -40,22 +40,9 @@
#include "point2d.hxx"
/* which clipping lib to use? Looks like we should go with clipper
* It appears to be both faster and generates better accuracy
*/
// forward declaration
class TGPolygon;
/* Set to 1 to allow keeping accum poly in native clipping lib format
* Although it seems to work on some airports, EHAM is pretty broken
* when turned on
*/
extern "C" {
#include <gpc.h>
}
#include "clipper.hpp"
#define FG_MAX_VERTICES 1500000
@ -254,13 +241,6 @@ TGPolygon tgPolygon2tristrip( const TGPolygon& poly );
void tgPolygonFindSlivers( TGPolygon& in, poly_list& slivers );
// wrapper functions for gpc polygon clip routines
void tgPolygonInitGPCAccumulator( void );
void tgPolygonFreeGPCAccumulator( void );
void tgPolygonAddToAccumulator( const TGPolygon& subject );
TGPolygon tgPolygonDiffWithAccumulator( const TGPolygon& subject );
// Difference
TGPolygon tgPolygonDiff( const TGPolygon& subject, const TGPolygon& clip );
@ -296,8 +276,6 @@ TGPolygon tgPolygonExpand(const TGPolygon &poly, double delta);
// Simplify
TGPolygon tgPolygonSimplify(const TGPolygon &poly);
// Output
std::ostream &operator<<(std::ostream &output, const TGPolygon &poly);

View file

@ -1,4 +1,4 @@
include_directories(${GPC_INCLUDE_DIR})
add_library(vpf STATIC
component.cxx

View file

@ -1,3 +1,5 @@
include_directories(${PROJECT_SOURCE_DIR}/src/Lib)
# seems unfortunate that lib depends on other dirs

View file

@ -1,4 +1,3 @@
include_directories(${GPC_INCLUDE_DIR})
add_executable(e00lines
main.cxx)
@ -8,6 +7,6 @@ target_link_libraries(e00lines
Polygon Geometry Output poly2tri TriangleJRS vpf
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS e00lines RUNTIME DESTINATION bin)

View file

@ -1,4 +1,3 @@
include_directories(${GPC_INCLUDE_DIR})
add_executable(gshhs
main.cxx
@ -9,7 +8,7 @@ target_link_libraries(gshhs
Polygon Geometry Output poly2tri
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS gshhs RUNTIME DESTINATION bin)
@ -20,6 +19,6 @@ target_link_libraries(gshhs_debug
Polygon Geometry Output poly2tri
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS gshhs_debug RUNTIME DESTINATION bin)

View file

@ -98,7 +98,7 @@ void split_and_shift_chunk( const string& path, const string& poly_type,
// process a large shape through my crude polygon splitter to reduce
// the polygon sizes before handing off to gpc
// the polygon sizes before handing off to clipper
void gshhs_split_polygon( const string& path, const string& poly_type, TGPolygon& shape,
const double min, const double max )
{

View file

@ -37,7 +37,7 @@ void split_and_shift_chunk( const std::string& path, const std::string& poly_typ
// process a large shape through my crude polygon splitter to reduce
// the polygon sizes before handing off to gpc
// the polygon sizes before handing off to clipper
void gshhs_split_polygon( const std::string& path, const std::string& poly_type, TGPolygon& shape,
const double min, const double max );

View file

@ -209,7 +209,7 @@ int main( int argc, char **argv ) {
gshhs_split_polygon(path, "Default", shape, s, n);
}
} else {
// small enough to feed to gpc directly
// small enough to feed to clipper directly
if ( force_area_type.length() > 0 ) {
split_and_shift_chunk(path, force_area_type, shape);
} else {

View file

@ -126,8 +126,6 @@ bool FGMerger::load_polys(const string& path, FGPolyList& subject) {
SG_LOG( SG_CLIPPER, SG_BULK, count - 1 << " = "
<< lastx << ", " << lasty );
}
// gpc_add_contour( poly, &v_list, hole_flag );
}
in >> skipcomment;
@ -147,9 +145,6 @@ bool FGMerger::load_polys(const string& path, FGPolyList& subject) {
exit(-1);
}
//FILE *ofp= fopen("outfile", "w");
//gpc_write_polygon(ofp, &polys);
return true;
}

View file

@ -51,8 +51,6 @@ class FGMerger {
private:
// gpc_vertex_list v_list;
// static gpc_polygon poly;
FGPolyList polys_subject, polys_clipp, polys_out;
public:

View file

@ -1,11 +1,7 @@
if (GDAL_FOUND)
include_directories(
${GDAL_INCLUDE_DIR}
${GPC_INCLUDE_DIR}
)
include_directories(${GDAL_INCLUDE_DIR})
add_executable(ogr-decode ogr-decode.cxx)
target_link_libraries(ogr-decode
@ -13,7 +9,7 @@ target_link_libraries(ogr-decode
Polygon Geometry poly2tri TriangleJRS
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS ogr-decode RUNTIME DESTINATION bin)
endif(GDAL_FOUND)

View file

@ -1,4 +1,3 @@
include_directories(${GPC_INCLUDE_DIR})
add_executable(photo
photo.cxx)
@ -7,7 +6,7 @@ target_link_libraries(photo
Polygon Geometry Array Output poly2tri TriangleJRS
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS photo RUNTIME DESTINATION bin)

View file

@ -1,4 +1,4 @@
include_directories(${GPC_INCLUDE_DIR})
add_executable(shape-decode shape-decode.cxx)
@ -6,7 +6,7 @@ target_link_libraries(shape-decode
shape Polygon Geometry Output poly2tri TriangleJRS vpf
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS shape-decode RUNTIME DESTINATION bin)
@ -16,6 +16,6 @@ target_link_libraries(noaa-decode
shape Polygon Geometry Output poly2tri TriangleJRS vpf
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS noaa-decode RUNTIME DESTINATION bin)

View file

@ -1,4 +1,3 @@
include_directories(${GPC_INCLUDE_DIR})
add_executable(tgvpf tgvpf.cxx)
@ -6,7 +5,6 @@ target_link_libraries(tgvpf
Polygon Geometry Output poly2tri TriangleJRS vpf
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY}
${RT_LIBRARY})
install(TARGETS tgvpf RUNTIME DESTINATION bin)

View file

@ -1,4 +1,3 @@
include_directories(${GPC_INCLUDE_DIR})
add_executable(tguserdef tguserdef.cxx)
@ -6,6 +5,6 @@ target_link_libraries(tguserdef
Polygon Geometry Output poly2tri TriangleJRS
${SIMGEAR_CORE_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${GPC_LIBRARY})
)
install(TARGETS tguserdef RUNTIME DESTINATION bin)

View file

@ -1,10 +1,7 @@
if (GDAL_FOUND)
include_directories(
${GDAL_INCLUDE_DIR}
${GPC_INCLUDE_DIR}
)
include_directories(${GDAL_INCLUDE_DIR})
add_executable(poly2ogr poly2ogr.cxx)
if(MSVC)