[Liblas-commits] hg-main-tree: added note about FP compares
liblas-commits at liblas.org
liblas-commits at liblas.org
Fri Mar 25 12:45:04 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/531e0eb31acd
changeset: 447:531e0eb31acd
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Mar 25 09:44:24 2011 -0700
description:
added note about FP compares
Subject: hg-main-tree: use perc, not eps, for FP compares
details: http://hg.libpc.orghg-main-tree/rev/d63b6c43244e
changeset: 448:d63b6c43244e
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Mar 25 09:44:44 2011 -0700
description:
use perc, not eps, for FP compares
Subject: hg-main-tree: merge
details: http://hg.libpc.orghg-main-tree/rev/c198f477d09b
changeset: 449:c198f477d09b
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Mar 25 09:45:00 2011 -0700
description:
merge
diffstat:
include/libpc/Chipper.hpp | 8 +++
include/libpc/Iterator.hpp | 2 +
include/libpc/Stage.hpp | 1 +
include/libpc/drivers/faux/Reader.hpp | 11 +++-
include/libpc/drivers/las/Reader.hpp | 8 +++
include/libpc/drivers/liblas/Reader.hpp | 8 +++
include/libpc/drivers/mrsid/Reader.hpp | 11 ++++
include/libpc/drivers/oci/Reader.hpp | 10 ++++
include/libpc/filters/CacheFilter.hpp | 9 +++
include/libpc/filters/ColorFilter.hpp | 8 +++
include/libpc/filters/CropFilter.hpp | 8 +++
include/libpc/filters/DecimationFilter.hpp | 8 +++
include/libpc/filters/MosaicFilter.hpp | 7 +++
include/libpc/types.hpp | 7 +++
test/unit/FauxReaderTest.cpp | 70 +++++++++++++++++++----------
test/unit/LiblasReaderTest.cpp | 12 +++++
test/unit/support.hpp | 6 ++
17 files changed, 168 insertions(+), 26 deletions(-)
diffs (truncated from 423 to 300 lines):
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/Chipper.hpp
--- a/include/libpc/Chipper.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/Chipper.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -156,6 +156,14 @@
const std::string& getName() const ;
+ inline boost::uint8_t getIteratorSupport () const
+ {
+ // FIXME: make this represent what this reader actually supports!
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Block;
+ return mask;
+ }
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return false; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/Iterator.hpp
--- a/include/libpc/Iterator.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/Iterator.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -42,6 +42,8 @@
class Stage;
class PointBuffer;
+
+
class LIBPC_DLL Iterator
{
public:
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/Stage.hpp
--- a/include/libpc/Stage.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/Stage.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -66,6 +66,7 @@
const Header& getHeader() const;
Header& getHeader();
+ virtual boost::uint8_t getIteratorSupport () const { return 0; }
virtual bool supportsSequentialIterator() const { return false; }
virtual bool supportsRandomIterator() const { return false; }
virtual SequentialIterator* createSequentialIterator() const { return NULL; }
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/drivers/faux/Reader.hpp
--- a/include/libpc/drivers/faux/Reader.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/drivers/faux/Reader.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -41,7 +41,6 @@
#include <libpc/Bounds.hpp>
#include <libpc/Dimension.hpp>
-
namespace libpc
{
class PointBuffer;
@@ -81,7 +80,15 @@
const std::string& getName() const;
Mode getMode() const;
-
+
+ boost::uint8_t getIteratorSupport ()
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ mask |= StageIterator_Random;
+ return mask;
+ }
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return true; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/drivers/las/Reader.hpp
--- a/include/libpc/drivers/las/Reader.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/drivers/las/Reader.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -60,6 +60,14 @@
const LasHeader& getLasHeader() const;
+ boost::uint8_t getIteratorSupport () const
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ mask |= StageIterator_Random;
+ return mask;
+ }
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return true; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/drivers/liblas/Reader.hpp
--- a/include/libpc/drivers/liblas/Reader.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/drivers/liblas/Reader.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -72,6 +72,14 @@
bool hasColorData() const;
bool hasWaveData() const;
+ boost::uint8_t getIteratorSupport () const
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ mask |= StageIterator_Random;
+ return mask;
+ }
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return true; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/drivers/mrsid/Reader.hpp
--- a/include/libpc/drivers/mrsid/Reader.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/drivers/mrsid/Reader.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -60,6 +60,17 @@
void seekToPoint(boost::uint64_t pointNum);
Iterator* createIterator(const Bounds<double>& bounds);
+
+ boost::uint8_t getIteratorSupport () const
+ {
+ // FIXME: make this represent what this reader actually supports!
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ mask |= StageIterator_Random;
+ mask |= StageIterator_Block;
+ return mask;
+ }
+
protected:
boost::uint32_t readBuffer(PointBuffer&);
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/drivers/oci/Reader.hpp
--- a/include/libpc/drivers/oci/Reader.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/drivers/oci/Reader.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -60,6 +60,16 @@
void seekToPoint(boost::uint64_t pointNum);
+ boost::uint8_t getIteratorSupport () const
+ {
+ // FIXME: make this represent what this reader actually supports!
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ mask |= StageIterator_Random;
+ mask |= StageIterator_Block;
+ return mask;
+ }
+
private:
Reader& operator=(const Reader&); // not implemented
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/filters/CacheFilter.hpp
--- a/include/libpc/filters/CacheFilter.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/filters/CacheFilter.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -86,6 +86,15 @@
boost::uint64_t& numCacheInsertMisses,
boost::uint64_t& numCacheInsertHits) const;
+ boost::uint8_t getIteratorSupport () const
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ mask |= StageIterator_Random;
+ return mask;
+ }
+
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return true; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/filters/ColorFilter.hpp
--- a/include/libpc/filters/ColorFilter.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/filters/ColorFilter.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -62,6 +62,14 @@
void getColor(float value, boost::uint8_t& red, boost::uint8_t& green, boost::uint8_t& blue) const;
+ inline boost::uint8_t getIteratorSupport () const
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ return mask;
+ }
+
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return false; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/filters/CropFilter.hpp
--- a/include/libpc/filters/CropFilter.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/filters/CropFilter.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -59,6 +59,14 @@
const std::string& getName() const;
+ inline boost::uint8_t getIteratorSupport ()
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ return mask;
+ }
+
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return false; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/filters/DecimationFilter.hpp
--- a/include/libpc/filters/DecimationFilter.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/filters/DecimationFilter.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -57,6 +57,14 @@
const std::string& getName() const;
+ inline boost::uint8_t getIteratorSupport () const
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ return mask;
+ }
+
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return false; }
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/filters/MosaicFilter.hpp
--- a/include/libpc/filters/MosaicFilter.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/filters/MosaicFilter.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -59,6 +59,13 @@
const std::vector<const Stage*>& getPrevStages() const;
+ inline boost::uint8_t getIteratorSupport () const
+ {
+ boost::uint8_t mask(0);
+ mask |= StageIterator_Sequential;
+ return mask;
+ }
+
bool supportsSequentialIterator() const { return true; }
bool supportsRandomIterator() const { return false; } // BUG: could be true
libpc::SequentialIterator* createSequentialIterator() const;
diff -r f3bcb01c42a5 -r c198f477d09b include/libpc/types.hpp
--- a/include/libpc/types.hpp Fri Mar 25 08:59:12 2011 -0700
+++ b/include/libpc/types.hpp Fri Mar 25 09:45:00 2011 -0700
@@ -46,6 +46,13 @@
PointCount_Unknown // the stage has an unknown count, and getNumPoints will return 0
};
+enum StageIteratorType
+{
+ StageIterator_Sequential = (1u << 0),
+ StageIterator_Random = (1u << 1),
+ StageIterator_Block = (1u << 2),
+ StageIterator_Unknown = (1u << 8)
+};
} // namespace
diff -r f3bcb01c42a5 -r c198f477d09b test/unit/FauxReaderTest.cpp
--- a/test/unit/FauxReaderTest.cpp Fri Mar 25 08:59:12 2011 -0700
+++ b/test/unit/FauxReaderTest.cpp Fri Mar 25 09:45:00 2011 -0700
@@ -41,6 +41,8 @@
#include <libpc/drivers/faux/Reader.hpp>
#include <libpc/drivers/faux/Iterator.hpp>
+#include <iostream>
+
using namespace libpc;
BOOST_AUTO_TEST_SUITE(FauxReaderTest)
@@ -74,9 +76,9 @@
double z = data.getField<double>(i, offsetZ);
boost::uint64_t t = data.getField<boost::uint64_t>(i, offsetT);
- BOOST_CHECK_CLOSE(x, 1.0, (std::numeric_limits<double>::min)());
- BOOST_CHECK_CLOSE(y, 2.0, (std::numeric_limits<double>::min)());
- BOOST_CHECK_CLOSE(z, 3.0, (std::numeric_limits<double>::min)());
+ BOOST_CHECK_CLOSE(x, 1.0, 0.00001);
+ BOOST_CHECK_CLOSE(y, 2.0, 0.00001);
+ BOOST_CHECK_CLOSE(z, 3.0, 0.00001);
BOOST_CHECK_EQUAL(t, i);
}
@@ -116,9 +118,9 @@
double z = data.getField<double>(i, offsetZ);
boost::uint64_t t = data.getField<boost::uint64_t>(i, offsetT);
- BOOST_CHECK_CLOSE(x, 1.0, (std::numeric_limits<double>::min)());
- BOOST_CHECK_CLOSE(y, 2.0, (std::numeric_limits<double>::min)());
- BOOST_CHECK_CLOSE(z, 3.0, (std::numeric_limits<double>::min)());
+ BOOST_CHECK_CLOSE(x, 1.0, 0.00001);
+ BOOST_CHECK_CLOSE(y, 2.0, 0.00001);
+ BOOST_CHECK_CLOSE(z, 3.0, 0.00001);
BOOST_CHECK_EQUAL(t, i);
}
}
@@ -134,9 +136,9 @@
double z = data.getField<double>(i, offsetZ);
boost::uint64_t t = data.getField<boost::uint64_t>(i, offsetT);
- BOOST_CHECK_CLOSE(x, 1.0, (std::numeric_limits<double>::min)());
- BOOST_CHECK_CLOSE(y, 2.0, (std::numeric_limits<double>::min)());
- BOOST_CHECK_CLOSE(z, 3.0, (std::numeric_limits<double>::min)());
+ BOOST_CHECK_CLOSE(x, 1.0, 0.00001);
+ BOOST_CHECK_CLOSE(y, 2.0, 0.00001);
More information about the Liblas-commits
mailing list