[Liblas-commits] r1222 - in trunk: build/msvc90
build/msvc90/las2ogr include/liblas src test/unit
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Apr 16 12:11:33 EDT 2009
Author: mloskot
Date: Thu Apr 16 12:11:33 2009
New Revision: 1222
URL: http://liblas.org/changeset/1222
Log:
* Use const mask in LASClassification.
* Added a couple of new test cases for LASClassification.
* Updated build/msvc90/las2ogr project.
Modified:
trunk/build/msvc90/las2ogr/las2ogr.vcproj
trunk/build/msvc90/liblas.sln
trunk/include/liblas/lasclassification.hpp
trunk/src/lasclassification.cpp
trunk/test/unit/lasclassification_test.cpp
Modified: trunk/build/msvc90/las2ogr/las2ogr.vcproj
==============================================================================
--- trunk/build/msvc90/las2ogr/las2ogr.vcproj (original)
+++ trunk/build/msvc90/las2ogr/las2ogr.vcproj Thu Apr 16 12:11:33 2009
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="las2ogr"
ProjectGUID="{0CE46FF7-F5B6-4EE2-B8EE-37B5555CAC62}"
RootNamespace="las2ogr"
Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -20,7 +21,7 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
- InheritedPropertySheets="..\liblas.vsprops;.\las2ogr.vsprops"
+ InheritedPropertySheets="..\liblas.vsprops"
CharacterSet="1"
>
<Tool
@@ -65,6 +66,8 @@
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -86,9 +89,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -97,7 +97,7 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
- InheritedPropertySheets="..\liblas.vsprops;.\las2ogr.vsprops"
+ InheritedPropertySheets="..\liblas.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
@@ -141,6 +141,8 @@
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -162,9 +164,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
Modified: trunk/build/msvc90/liblas.sln
==============================================================================
--- trunk/build/msvc90/liblas.sln (original)
+++ trunk/build/msvc90/liblas.sln Thu Apr 16 12:11:33 2009
@@ -61,6 +61,11 @@
{EC92BE01-CFA3-46C6-998E-810484CC5860} = {EC92BE01-CFA3-46C6-998E-810484CC5860}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "las2ogr", "las2ogr\las2ogr.vcproj", "{0CE46FF7-F5B6-4EE2-B8EE-37B5555CAC62}"
+ ProjectSection(ProjectDependencies) = postProject
+ {208417AE-D08E-4938-AC26-A16ABD55AA5B} = {208417AE-D08E-4938-AC26-A16ABD55AA5B}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -103,6 +108,10 @@
{C78B8A0D-12CE-49D6-8615-96B9735564D5}.Debug|Win32.Build.0 = Debug|Win32
{C78B8A0D-12CE-49D6-8615-96B9735564D5}.Release|Win32.ActiveCfg = Release|Win32
{C78B8A0D-12CE-49D6-8615-96B9735564D5}.Release|Win32.Build.0 = Release|Win32
+ {0CE46FF7-F5B6-4EE2-B8EE-37B5555CAC62}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0CE46FF7-F5B6-4EE2-B8EE-37B5555CAC62}.Debug|Win32.Build.0 = Debug|Win32
+ {0CE46FF7-F5B6-4EE2-B8EE-37B5555CAC62}.Release|Win32.ActiveCfg = Release|Win32
+ {0CE46FF7-F5B6-4EE2-B8EE-37B5555CAC62}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: trunk/include/liblas/lasclassification.hpp
==============================================================================
--- trunk/include/liblas/lasclassification.hpp (original)
+++ trunk/include/liblas/lasclassification.hpp Thu Apr 16 12:11:33 2009
@@ -130,7 +130,7 @@
uint8_t GetClass() const
{
bitset_type bits(m_flags);
- bitset_type const mask(class_table_size - 1);
+ bitset_type const mask(static_cast<unsigned long>(class_table_size) - 1);
bits &= mask;
uint8_t const index = static_cast<uint8_t>(bits.to_ulong());
Modified: trunk/src/lasclassification.cpp
==============================================================================
--- trunk/src/lasclassification.cpp (original)
+++ trunk/src/lasclassification.cpp Thu Apr 16 12:11:33 2009
@@ -47,41 +47,41 @@
#include <string>
namespace {
-
-static std::string g_class_names[] =
-{
- "Created, never classified",
- "Unclassified",
- "Ground",
- "Low Vegetation",
- "Medium Vegetation",
- "High Vegetation",
- "Building",
- "Low Point (noise)",
- "Model Key-point (mass point)",
- "Water",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Overlap Points",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition",
- "Reserved for ASPRS Definition"
+
+static std::string g_class_names[] =
+{
+ "Created, never classified",
+ "Unclassified",
+ "Ground",
+ "Low Vegetation",
+ "Medium Vegetation",
+ "High Vegetation",
+ "Building",
+ "Low Point (noise)",
+ "Model Key-point (mass point)",
+ "Water",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Overlap Points",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition",
+ "Reserved for ASPRS Definition"
};
} // namespace anonymous
Modified: trunk/test/unit/lasclassification_test.cpp
==============================================================================
--- trunk/test/unit/lasclassification_test.cpp (original)
+++ trunk/test/unit/lasclassification_test.cpp Thu Apr 16 12:11:33 2009
@@ -377,4 +377,41 @@
std::string const cn("Created, never classified");
ensure_equals(m_default.GetClassName(), cn);
}
+
+ template<>
+ template<>
+ void to::test<21>()
+ {
+ std::string const cn("Low Point (noise)");
+ m_default.SetClass(7);
+ ensure_equals(m_default.GetClassName(), cn);
+ }
+
+ template<>
+ template<>
+ void to::test<22>()
+ {
+ std::string const cn("Reserved for ASPRS Definition");
+ m_default.SetClass(31);
+ ensure_equals(m_default.GetClassName(), cn);
+ }
+
+ template<>
+ template<>
+ void to::test<23>()
+ {
+ try
+ {
+ m_default.SetClass(32);
+ fail("std::out_of_range not thrown but expected");
+ }
+ catch (std::out_of_range const& e)
+ {
+ ensure(e.what(), true);
+ }
+ catch (...)
+ {
+ fail("unhandled exception expected");
+ }
+ }
}
More information about the Liblas-commits
mailing list