[Liblas-commits] r989 - in trunk: build/msvc90 include/liblas
src/detail test/unit
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Feb 3 10:41:00 EST 2009
Author: mloskot
Date: Tue Feb 3 10:40:59 2009
New Revision: 989
URL: http://liblas.org/changeset/989
Log:
* Updated LASWriter test with checks of get/set methods for Point Source ID attribute.
* Removed unused <iostream> from laspoint.hpp.
* Include missing <iostream> in reader11.cpp, std::cerr object is used.
* build/msvc90 project updated.
Modified:
trunk/build/msvc90/liblas.sln
trunk/include/liblas/laspoint.hpp
trunk/src/detail/reader11.cpp
trunk/test/unit/laswriter_test.cpp
Modified: trunk/build/msvc90/liblas.sln
==============================================================================
--- trunk/build/msvc90/liblas.sln (original)
+++ trunk/build/msvc90/liblas.sln Tue Feb 3 10:40:59 2009
@@ -12,7 +12,6 @@
..\..\LICENSE.txt = ..\..\LICENSE.txt
..\..\makefile.vc = ..\..\makefile.vc
..\..\NEWS = ..\..\NEWS
- ..\..\nmake.opt = ..\..\nmake.opt
..\..\README = ..\..\README
EndProjectSection
EndProject
Modified: trunk/include/liblas/laspoint.hpp
==============================================================================
--- trunk/include/liblas/laspoint.hpp (original)
+++ trunk/include/liblas/laspoint.hpp Tue Feb 3 10:40:59 2009
@@ -48,8 +48,6 @@
#include <stdexcept> // std::out_of_range
#include <cstdlib> // std::size_t
-#include <iostream>
-
namespace liblas {
/// Definition of point data record.
Modified: trunk/src/detail/reader11.cpp
==============================================================================
--- trunk/src/detail/reader11.cpp (original)
+++ trunk/src/detail/reader11.cpp Tue Feb 3 10:40:59 2009
@@ -55,6 +55,7 @@
#endif // HAVE_LIBGEOTIFF
// std
#include <fstream>
+#include <iostream>
#include <stdexcept>
#include <cstdlib> // std::size_t
#include <cassert>
Modified: trunk/test/unit/laswriter_test.cpp
==============================================================================
--- trunk/test/unit/laswriter_test.cpp (original)
+++ trunk/test/unit/laswriter_test.cpp Tue Feb 3 10:40:59 2009
@@ -25,9 +25,9 @@
std::string tmpfile_;
std::string file10_;
- laswriter_data()
- : tmpfile_(g_test_data_path + "//tmp.las"),
- file10_(g_test_data_path + "//TO_core_last_clip.las")
+ laswriter_data() :
+ tmpfile_(g_test_data_path + "//tmp.las"),
+ file10_(g_test_data_path + "//TO_core_last_clip.las")
{}
~laswriter_data()
@@ -36,45 +36,6 @@
int const rc = std::remove(tmpfile_.c_str());
ensure_equals(rc, 0);
}
-
- void test_file10_point1(liblas::LASPoint const& p)
- {
- ensure_distance(p.GetX(), double(630262.30), 0.0001);
- ensure_distance(p.GetY(), double(4834500), 0.0001);
- ensure_distance(p.GetZ(), double(51.53), 0.0001);
- ensure_equals(p.GetIntensity(), 670);
- ensure_equals(p.GetClassification(), 1);
- ensure_equals(p.GetScanAngleRank(), 0);
- ensure_equals(p.GetUserData(), 0);
- ensure_equals(p.GetScanFlags(), 9);
- ensure_distance(p.GetTime(), double(413665.23360000004), 0.0001);
- }
-
- void test_file10_point2(liblas::LASPoint 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);
- ensure_equals(p.GetIntensity(), 350);
- ensure_equals(p.GetClassification(), 1);
- ensure_equals(p.GetScanAngleRank(), 0);
- ensure_equals(p.GetUserData(), 0);
- ensure_equals(p.GetScanFlags(), 9);
- ensure_distance(p.GetTime(), double(413665.52880000003), 0.0001);
- }
-
- void test_file10_point4(liblas::LASPoint const& p)
- {
- ensure_distance(p.GetX(), double(630346.83), 0.0001);
- ensure_distance(p.GetY(), double(4834500), 0.0001);
- ensure_distance(p.GetZ(), double(50.90), 0.0001);
- ensure_equals(p.GetIntensity(), 150);
- ensure_equals(p.GetClassification(), 1);
- ensure_equals(p.GetScanAngleRank(), 0);
- ensure_equals(p.GetUserData(), 0);
- ensure_equals(p.GetScanFlags(), 18);
- ensure_distance(p.GetTime(), double(414093.84360000002), 0.0001);
- }
};
typedef test_group<laswriter_data> tg;
@@ -140,15 +101,18 @@
point.SetClassification(7);
point.SetScanAngleRank(90);
point.SetUserData(0);
+ point.SetPointSourceID(1);
writer.WritePoint(point);
// write 2nd point
point.SetCoordinates(40, 50, 60);
+ point.SetPointSourceID(2);
writer.WritePoint(point);
// write 3rd point
point.SetCoordinates(70, 80, 90);
+ point.SetPointSourceID(3);
writer.WritePoint(point);
}
@@ -174,8 +138,9 @@
ensure_equals(point.GetClassification(), 7);
ensure_equals(point.GetScanAngleRank(), 90);
ensure_equals(point.GetUserData(), 0);
+ ensure_equals(point.GetPointSourceID(), 1);
- // read 3rd point
+ // read 2nd point
reader.ReadNextPoint();
point = reader.GetPoint();
ensure_distance(point.GetX(), 40.0, 0.1);
@@ -189,8 +154,9 @@
ensure_equals(point.GetClassification(), 7);
ensure_equals(point.GetScanAngleRank(), 90);
ensure_equals(point.GetUserData(), 0);
+ ensure_equals(point.GetPointSourceID(), 2);
- // read 1st point
+ // read 3rd point
reader.ReadNextPoint();
point = reader.GetPoint();
ensure_distance(point.GetX(), 70.0, 0.1);
@@ -204,6 +170,7 @@
ensure_equals(point.GetClassification(), 7);
ensure_equals(point.GetScanAngleRank(), 90);
ensure_equals(point.GetUserData(), 0);
+ ensure_equals(point.GetPointSourceID(), 3);
}
}
More information about the Liblas-commits
mailing list