[Liblas-commits] hg: default the scale for XYZ to 1.0 instead of
0.01 #241
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Jul 12 11:33:05 EDT 2011
details: http://hg.liblas.orghg/rev/f4eeea950482
changeset: 3074:f4eeea950482
user: Howard Butler <hobu.inc at gmail.com>
date: Tue Jul 12 10:32:42 2011 -0500
description:
default the scale for XYZ to 1.0 instead of 0.01 #241
Subject: hg: fix up tests for #241
details: http://hg.liblas.orghg/rev/fa15eb8f8f19
changeset: 3075:fa15eb8f8f19
user: Howard Butler <hobu.inc at gmail.com>
date: Tue Jul 12 10:32:56 2011 -0500
description:
fix up tests for #241
diffstat:
src/header.cpp | 11 +++++------
test/unit/common.cpp | 7 ++++---
test/unit/reader_iterator_test.cpp | 6 ++++++
3 files changed, 15 insertions(+), 9 deletions(-)
diffs (75 lines):
diff -r 8bda4636609c -r fa15eb8f8f19 src/header.cpp
--- a/src/header.cpp Mon Jul 11 12:49:51 2011 -0700
+++ b/src/header.cpp Tue Jul 12 10:32:56 2011 -0500
@@ -454,10 +454,10 @@
void Header::SetScale(double x, double y, double z)
{
- double const minscale = 0.01;
- m_scales.x = (detail::compare_distance(0.0, x)) ? minscale : x;
- m_scales.y = (detail::compare_distance(0.0, y)) ? minscale : y;
- m_scales.z = (detail::compare_distance(0.0, z)) ? minscale : z;
+ // double const minscale = 0.01;
+ m_scales.x = x;
+ m_scales.y = y;
+ m_scales.z = z;
}
double Header::GetOffsetX() const
@@ -601,8 +601,7 @@
m_pointRecordsByReturn.resize(ePointsByReturnSize);
- // Zero scale value is useless, so we need to use a small value.
- SetScale(0.01, 0.01, 0.01);
+ SetScale(1.0, 1.0, 1.0);
m_isCompressed = false;
}
diff -r 8bda4636609c -r fa15eb8f8f19 test/unit/common.cpp
--- a/test/unit/common.cpp Mon Jul 11 12:49:51 2011 -0700
+++ b/test/unit/common.cpp Tue Jul 12 10:32:56 2011 -0500
@@ -69,9 +69,9 @@
ensure_equals("wrong default point records count",
h.GetPointRecordsCount(), boost::uint32_t(0));
- ensure_equals("wrong default X scale", h.GetScaleX(), double(0.01));
- ensure_equals("wrong default Y scale", h.GetScaleY(), double(0.01));
- ensure_equals("wrong default Z scale", h.GetScaleZ(), double(0.01));
+ ensure_equals("wrong default X scale", h.GetScaleX(), double(1.0));
+ ensure_equals("wrong default Y scale", h.GetScaleY(), double(1.0));
+ ensure_equals("wrong default Z scale", h.GetScaleZ(), double(1.0));
ensure_equals("wrong default X offset", h.GetOffsetX(), double(0));
ensure_equals("wrong default Y offset", h.GetOffsetY(), double(0));
@@ -176,6 +176,7 @@
void test_file10_point2(liblas::Point const& p)
{
+
ensure_distance(p.GetX(), double(630282.45), 0.0001);
ensure_distance(p.GetY(), double(4834500), 0.0001);
ensure_distance(p.GetZ(), double(51.63), 0.0001);
diff -r 8bda4636609c -r fa15eb8f8f19 test/unit/reader_iterator_test.cpp
--- a/test/unit/reader_iterator_test.cpp Mon Jul 11 12:49:51 2011 -0700
+++ b/test/unit/reader_iterator_test.cpp Tue Jul 12 10:32:56 2011 -0500
@@ -270,6 +270,9 @@
{
// Construct copy of 2nd point record from tested file
Point pt;
+ Header h;
+ h.SetScale(0.01, 0.01, 0.01);
+ pt.SetHeader(HeaderOptionalConstRef(h));
pt.SetCoordinates(630282.45, 4834500, 51.63);
pt.SetIntensity(350);
pt.SetClassification(1);
@@ -332,6 +335,9 @@
{
// Construct copy of 2nd point record from tested file
Point pt;
+ Header h;
+ h.SetScale(0.01, 0.01, 0.01);
+ pt.SetHeader(HeaderOptionalConstRef(h));
pt.SetCoordinates(630282.45, 4834500, 51.63);
pt.SetIntensity(350);
pt.SetClassification(1);
More information about the Liblas-commits
mailing list