[Liblas-commits] hg-main-tree: namespace'd the filters

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 15 22:26:54 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/8283a7a8995e
changeset: 256:8283a7a8995e
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Tue Mar 15 22:26:50 2011 -0400
description:
namespace'd the filters

diffstat:

 include/libpc/drivers/faux/Reader.hpp |  19 +++++++++----------
 include/libpc/drivers/faux/Writer.hpp |  17 ++++++++---------
 src/drivers/faux/Reader.cpp           |  19 +++++++++----------
 src/drivers/faux/Writer.cpp           |  17 ++++++++---------
 test/unit/CacheFilterTest.cpp         |   3 ++-
 test/unit/CropFilterTest.cpp          |   7 ++++---
 test/unit/DecimationFilterTest.cpp    |   3 ++-
 test/unit/FauxReaderTest.cpp          |   7 ++++---
 test/unit/FauxWriterTest.cpp          |   9 +++++----
 test/unit/MosaicFilterTest.cpp        |   7 ++++---
 10 files changed, 55 insertions(+), 53 deletions(-)

diffs (truncated from 386 to 300 lines):

diff -r d6cf2a007f17 -r 8283a7a8995e include/libpc/drivers/faux/Reader.hpp
--- a/include/libpc/drivers/faux/Reader.hpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/include/libpc/drivers/faux/Reader.hpp	Tue Mar 15 22:26:50 2011 -0400
@@ -32,13 +32,12 @@
 * OF SUCH DAMAGE.
 ****************************************************************************/
 
-#ifndef INCLUDED_FAUXREADER_HPP
-#define INCLUDED_FAUXREADER_HPP
+#ifndef INCLUDED_DRIVERS_FAUX_READER_HPP
+#define INCLUDED_DRIVERS_FAUX_READER_HPP
 
 #include <libpc/Reader.hpp>
 
-namespace libpc
-{
+namespace libpc { namespace drivers { namespace faux {
 
 // The FauxReader doesn't read from disk, but instead just makes up data for its
 // points.  The reader is constructed with a given bounding box and a given 
@@ -53,7 +52,7 @@
 // points to always be at the minimum of the bounding box.  The Time field
 // is always set to the point number.
 //
-class LIBPC_DLL FauxReader : public Reader
+class LIBPC_DLL Reader : public libpc::Reader
 {
 public:
     enum Mode
@@ -63,8 +62,8 @@
     };
 
 public:
-    FauxReader(const Bounds<double>&, int numPoints, Mode mode);
-    FauxReader(const Bounds<double>&, int numPoints, Mode mode, const std::vector<Dimension>& dimensions);
+    Reader(const Bounds<double>&, int numPoints, Mode mode);
+    Reader(const Bounds<double>&, int numPoints, Mode mode, const std::vector<Dimension>& dimensions);
 
     const std::string& getName() const;
 
@@ -75,10 +74,10 @@
 
     Mode m_mode;
 
-    FauxReader& operator=(const FauxReader&); // not implemented
-    FauxReader(const FauxReader&); // not implemented
+    Reader& operator=(const Reader&); // not implemented
+    Reader(const Reader&); // not implemented
 };
 
-} // namespace libpc
+} } } // namespaces
 
 #endif
diff -r d6cf2a007f17 -r 8283a7a8995e include/libpc/drivers/faux/Writer.hpp
--- a/include/libpc/drivers/faux/Writer.hpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/include/libpc/drivers/faux/Writer.hpp	Tue Mar 15 22:26:50 2011 -0400
@@ -32,15 +32,14 @@
 * OF SUCH DAMAGE.
 ****************************************************************************/
 
-#ifndef INCLUDED_FAUXWRITER_HPP
-#define INCLUDED_FAUXWRITER_HPP
+#ifndef INCLUDED_DRIVERS_FAUX_WRITER_HPP
+#define INCLUDED_DRIVERS_FAUX_WRITER_HPP
 
 #include <string>
 
 #include <libpc/Writer.hpp>
 
-namespace libpc
-{
+namespace libpc { namespace drivers { namespace faux {
 
 //
 // The FauxWriter doesn't actually write to disk -- instead, it just
@@ -48,10 +47,10 @@
 //
 // This writer knows only about three dimensions: X,Y,Z (as floats).
 //
-class LIBPC_DLL FauxWriter : public Writer
+class LIBPC_DLL Writer : public libpc::Writer
 {
 public:
-    FauxWriter(Stage& prevStage);
+    Writer(Stage& prevStage);
 
     const std::string& getName() const;
 
@@ -81,10 +80,10 @@
     boost::uint32_t writeBuffer(const PointData&);
     void writeEnd();
 
-    FauxWriter& operator=(const FauxWriter&); // not implemented
-    FauxWriter(const FauxWriter&); // not implemented
+    Writer& operator=(const Writer&); // not implemented
+    Writer(const Writer&); // not implemented
 };
 
-} // namespace libpc
+} } } // namespaces
 
 #endif
diff -r d6cf2a007f17 -r 8283a7a8995e src/drivers/faux/Reader.cpp
--- a/src/drivers/faux/Reader.cpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/src/drivers/faux/Reader.cpp	Tue Mar 15 22:26:50 2011 -0400
@@ -43,11 +43,10 @@
 using std::string;
 using std::cout;
 
-namespace libpc
-{
+namespace libpc { namespace drivers { namespace faux {
 
-FauxReader::FauxReader(const Bounds<double>& bounds, int numPoints, Mode mode)
-    : Reader()
+Reader::Reader(const Bounds<double>& bounds, int numPoints, Mode mode)
+    : libpc::Reader()
     , m_mode(mode)
 {
     Header* header = new Header;
@@ -66,8 +65,8 @@
     return;
 }
 
-FauxReader::FauxReader(const Bounds<double>& bounds, int numPoints, Mode mode, const std::vector<Dimension>& dimensions)
-    : Reader()
+Reader::Reader(const Bounds<double>& bounds, int numPoints, Mode mode, const std::vector<Dimension>& dimensions)
+    : libpc::Reader()
     , m_mode(mode)
 {
     Header* header = new Header;
@@ -88,14 +87,14 @@
 }
 
 
-const std::string& FauxReader::getName() const
+const std::string& Reader::getName() const
 {
     static std::string name("Faux Reader");
     return name;
 }
 
 
-boost::uint32_t FauxReader::readBuffer(PointData& data)
+boost::uint32_t Reader::readBuffer(PointData& data)
 {
     if (data.getSchemaLayout().getSchema().getDimensions().size() != 4)
         throw not_yet_implemented("need to add ability to read from arbitrary fields");
@@ -159,10 +158,10 @@
 }
 
 
-void FauxReader::seekToPoint(boost::uint64_t pointNumber)
+void Reader::seekToPoint(boost::uint64_t pointNumber)
 {
     setCurrentPointIndex(pointNumber);
 }
 
 
-} // namespace libpc
+} } } // namespaces
diff -r d6cf2a007f17 -r 8283a7a8995e src/drivers/faux/Writer.cpp
--- a/src/drivers/faux/Writer.cpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/src/drivers/faux/Writer.cpp	Tue Mar 15 22:26:50 2011 -0400
@@ -40,24 +40,23 @@
 using std::cout;
 using std::endl;
 
-namespace libpc
-{
+namespace libpc { namespace drivers { namespace faux {
 
-FauxWriter::FauxWriter(Stage& prevStage) :
-    Writer(prevStage)
+Writer::Writer(Stage& prevStage) :
+    libpc::Writer(prevStage)
 {
     return;
 }
 
 
-const std::string& FauxWriter::getName() const
+const std::string& Writer::getName() const
 {
     static std::string name("Faux Writer");
     return name;
 }
 
 
-void FauxWriter::writeBegin()
+void Writer::writeBegin()
 {
     m_minimumX = m_minimumY = m_minimumZ = std::numeric_limits<float>::max();
     m_maximumX = m_maximumY = m_maximumZ = std::numeric_limits<float>::min();
@@ -67,7 +66,7 @@
 }
 
 
-void FauxWriter::writeEnd()
+void Writer::writeEnd()
 {
     m_averageX /= (float)m_actualNumPointsWritten;
     m_averageY /= (float)m_actualNumPointsWritten;
@@ -89,7 +88,7 @@
 }
 
 
-boost::uint32_t FauxWriter::writeBuffer(const PointData& pointData)
+boost::uint32_t Writer::writeBuffer(const PointData& pointData)
 {
     const boost::uint32_t numPoints = pointData.getNumPoints();
 
@@ -126,4 +125,4 @@
 }
 
 
-} // namespace libpc
+} } } // namespaces
diff -r d6cf2a007f17 -r 8283a7a8995e test/unit/CacheFilterTest.cpp
--- a/test/unit/CacheFilterTest.cpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/test/unit/CacheFilterTest.cpp	Tue Mar 15 22:26:50 2011 -0400
@@ -40,13 +40,14 @@
 
 using namespace libpc;
 using namespace libpc::filters;
+using namespace libpc::drivers::faux;
 
 BOOST_AUTO_TEST_SUITE(CacheFilterTest)
 
 BOOST_AUTO_TEST_CASE(test1)
 {
     Bounds<double> srcBounds(0.0, 0.0, 0.0, 100.0, 100.0, 100.0);
-    FauxReader reader(srcBounds, 10000, FauxReader::Constant);
+    libpc::drivers::faux::Reader reader(srcBounds, 10000, libpc::drivers::faux::Reader::Constant);
 
     CacheFilter cache(reader, 2, 1024);
     BOOST_CHECK(cache.getName() == "Cache Filter");
diff -r d6cf2a007f17 -r 8283a7a8995e test/unit/CropFilterTest.cpp
--- a/test/unit/CropFilterTest.cpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/test/unit/CropFilterTest.cpp	Tue Mar 15 22:26:50 2011 -0400
@@ -41,6 +41,7 @@
 
 using namespace libpc;
 using namespace libpc::filters;
+using namespace libpc::drivers::faux;
 
 BOOST_AUTO_TEST_SUITE(CropFilterTest)
 
@@ -48,15 +49,15 @@
 {
     Bounds<double> srcBounds(0.0, 0.0, 0.0, 100.0, 100.0, 100.0);
 
-    // crop tjhe window to 1/8th the size
+    // crop the window to 1/8th the size
     Bounds<double> dstBounds(0.0, 0.0, 0.0, 50.0, 50.0, 50.0);
     
-    FauxReader reader(srcBounds, 1000, FauxReader::Random);
+    libpc::drivers::faux::Reader reader(srcBounds, 1000, libpc::drivers::faux::Reader::Random);
 
     CropFilter filter(reader, dstBounds);
     BOOST_CHECK(filter.getName() == "Crop Filter");
 
-    FauxWriter writer(filter);
+    libpc::drivers::faux::Writer writer(filter);
 
     boost::uint64_t numWritten = writer.write(1000);
 
diff -r d6cf2a007f17 -r 8283a7a8995e test/unit/DecimationFilterTest.cpp
--- a/test/unit/DecimationFilterTest.cpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/test/unit/DecimationFilterTest.cpp	Tue Mar 15 22:26:50 2011 -0400
@@ -41,6 +41,7 @@
 
 using namespace libpc;
 using namespace libpc::filters;
+using namespace libpc::drivers::faux;
 
 BOOST_AUTO_TEST_SUITE(DecimationFilterTest)
 
@@ -48,7 +49,7 @@
 {
     Bounds<double> srcBounds(0.0, 0.0, 0.0, 100.0, 100.0, 100.0);
 
-    FauxReader reader(srcBounds, 1000, FauxReader::Random);
+    libpc::drivers::faux::Reader reader(srcBounds, 1000, libpc::drivers::faux::Reader::Random);
 
     DecimationFilter filter(reader, 10);
     BOOST_CHECK(filter.getName() == "Decimation Filter");
diff -r d6cf2a007f17 -r 8283a7a8995e test/unit/FauxReaderTest.cpp
--- a/test/unit/FauxReaderTest.cpp	Tue Mar 15 21:51:33 2011 -0400
+++ b/test/unit/FauxReaderTest.cpp	Tue Mar 15 22:26:50 2011 -0400
@@ -38,13 +38,14 @@
 #include <libpc/drivers/faux/Reader.hpp>
 
 using namespace libpc;
+using namespace libpc::drivers::faux;
 
 BOOST_AUTO_TEST_SUITE(FauxReaderTest)
 
 BOOST_AUTO_TEST_CASE(test_constant)


More information about the Liblas-commits mailing list