[Liblas-commits] hg-main-tree: stub in an Options-based ctor for every stage

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Jul 22 18:09:42 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/a3cb4cf5201a
changeset: 917:a3cb4cf5201a
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Jul 22 15:09:33 2011 -0700
description:
stub in an Options-based ctor for every stage

diffstat:

 include/pdal/MultiFilter.hpp                |   2 +-
 include/pdal/Writer.hpp                     |   6 +++---
 include/pdal/drivers/faux/Reader.hpp        |   1 +
 include/pdal/drivers/faux/Writer.hpp        |   2 +-
 include/pdal/drivers/las/Reader.hpp         |   1 +
 include/pdal/drivers/las/Writer.hpp         |   1 +
 include/pdal/drivers/liblas/Reader.hpp      |   1 +
 include/pdal/drivers/liblas/Writer.hpp      |   1 +
 include/pdal/drivers/oci/Reader.hpp         |   5 +++--
 include/pdal/drivers/oci/Writer.hpp         |   1 +
 include/pdal/drivers/qfit/Reader.hpp        |   2 +-
 include/pdal/drivers/terrasolid/Reader.hpp  |   1 +
 include/pdal/filters/ByteSwapFilter.hpp     |   1 +
 include/pdal/filters/CacheFilter.hpp        |   1 +
 include/pdal/filters/Chipper.hpp            |   1 +
 include/pdal/filters/ColorFilter.hpp        |   1 +
 include/pdal/filters/CropFilter.hpp         |   1 +
 include/pdal/filters/DecimationFilter.hpp   |   1 +
 include/pdal/filters/MosaicFilter.hpp       |   2 +-
 include/pdal/filters/ReprojectionFilter.hpp |   1 +
 include/pdal/filters/ScalingFilter.hpp      |   1 +
 src/MultiFilter.cpp                         |   2 +-
 src/Writer.cpp                              |   4 ++--
 src/drivers/faux/Reader.cpp                 |   7 +++++++
 src/drivers/faux/Writer.cpp                 |   4 ++--
 src/drivers/las/Reader.cpp                  |   7 +++++++
 src/drivers/las/Writer.cpp                  |   8 ++++++++
 src/drivers/liblas/Reader.cpp               |   7 +++++++
 src/drivers/liblas/Writer.cpp               |   8 ++++++++
 src/drivers/oci/Reader.cpp                  |  10 +++++++++-
 src/drivers/oci/Writer.cpp                  |   9 +++++++++
 src/drivers/qfit/Reader.cpp                 |   2 +-
 src/drivers/terrasolid/Reader.cpp           |   8 ++++++++
 src/filters/ByteSwapFilter.cpp              |   7 +++++++
 src/filters/CacheFilter.cpp                 |   7 +++++++
 src/filters/Chipper.cpp                     |   7 +++++++
 src/filters/ColorFilter.cpp                 |   7 +++++++
 src/filters/CropFilter.cpp                  |   7 +++++++
 src/filters/DecimationFilter.cpp            |   7 +++++++
 src/filters/MosaicFilter.cpp                |   4 ++--
 src/filters/ReprojectionFilter.cpp          |   7 +++++++
 src/filters/ScalingFilter.cpp               |   7 +++++++
 test/unit/CropFilterTest.cpp                |   2 +-
 test/unit/FauxWriterTest.cpp                |   4 ++--
 test/unit/MosaicFilterTest.cpp              |   2 +-
 45 files changed, 156 insertions(+), 22 deletions(-)

diffs (truncated from 668 to 300 lines):

diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/MultiFilter.hpp
--- a/include/pdal/MultiFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/MultiFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -47,7 +47,7 @@
 public:
     // entries may not be null
     // vector.size() must be > 0
-    MultiFilter(std::vector<const Stage*> prevStages, const Options& options);
+    MultiFilter(const std::vector<const Stage*>& prevStages, const Options& options);
 
     const std::vector<const Stage*>& getPrevStages() const;
 
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/Writer.hpp
--- a/include/pdal/Writer.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/Writer.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -50,7 +50,7 @@
 class PDAL_DLL Writer : public StageBase
 {
 public:
-    Writer(Stage& prevStage, const Options& options);
+    Writer(const Stage& prevStage, const Options& options);
     virtual ~Writer() {}
 
     // size of the PointBuffer buffer to use
@@ -72,14 +72,14 @@
     // called once, after the writeBuffer calls
     virtual void writeEnd() = 0;
 
-    Stage& getPrevStage();
+    const Stage& getPrevStage();
 
     // these two are valid for use after writeBegin has been called
     boost::uint64_t m_actualNumPointsWritten;
     boost::uint64_t m_targetNumPointsToWrite;
 
 private:
-    Stage& m_prevStage;
+    const Stage& m_prevStage;
     boost::uint32_t m_chunkSize;
     static const boost::uint32_t s_defaultChunkSize;
 
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/faux/Reader.hpp
--- a/include/pdal/drivers/faux/Reader.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/faux/Reader.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -76,6 +76,7 @@
     };
 
 public:
+    Reader(const Options& options);
     Reader(const Bounds<double>&, int numPoints, Mode mode);
     Reader(const Bounds<double>&, int numPoints, Mode mode, const std::vector<Dimension>& dimensions);
     
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/faux/Writer.hpp
--- a/include/pdal/drivers/faux/Writer.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/faux/Writer.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -54,7 +54,7 @@
     DECLARE_STATICS
 
 public:
-    Writer(Stage& prevStage);
+    Writer(const Stage& prevStage, const Options&);
 
     // retrieve the summary info
     double getMinX() const { return m_minimumX; }
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/las/Reader.hpp
--- a/include/pdal/drivers/las/Reader.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/las/Reader.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -58,6 +58,7 @@
     DECLARE_STATICS
 
 public:
+    LasReader(const Options&);
     LasReader(const std::string& filename);
 
     const std::string& getFileName() const;
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/las/Writer.hpp
--- a/include/pdal/drivers/las/Writer.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/las/Writer.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -55,6 +55,7 @@
     DECLARE_STATICS
 
 public:
+    LasWriter(const Stage& prevStage, const Options&);
     LasWriter(Stage& prevStage, std::ostream&);
     ~LasWriter();
 
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/liblas/Reader.hpp
--- a/include/pdal/drivers/liblas/Reader.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/liblas/Reader.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -58,6 +58,7 @@
     DECLARE_STATICS
 
 public:
+    LiblasReader(const Options&);
     LiblasReader(const std::string& filename);
     ~LiblasReader();
 
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/liblas/Writer.hpp
--- a/include/pdal/drivers/liblas/Writer.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/liblas/Writer.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -55,6 +55,7 @@
     DECLARE_STATICS
 
 public:
+    LiblasWriter(const Stage& prevStage, const Options&);
     LiblasWriter(Stage& prevStage, std::ostream&);
     ~LiblasWriter();
 
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/oci/Reader.hpp
--- a/include/pdal/drivers/oci/Reader.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/oci/Reader.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -37,7 +37,7 @@
 
 #include <pdal/pdal.hpp>
 
-#include <pdal/Stage.hpp>
+#include <pdal/Reader.hpp>
 #include <pdal/drivers/oci/common.hpp>
 
 #include <boost/scoped_ptr.hpp>
@@ -49,11 +49,12 @@
 
 
 
-class PDAL_DLL Reader : public pdal::Stage
+class PDAL_DLL Reader : public pdal::Reader
 {
     DECLARE_STATICS
 
 public:
+    Reader(const Options&);
     Reader(OptionsOld& options);
     ~Reader();
  
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/oci/Writer.hpp
--- a/include/pdal/drivers/oci/Writer.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/oci/Writer.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -52,6 +52,7 @@
     DECLARE_STATICS
 
 public:
+    Writer(const Stage& prevStage, const Options&);
     Writer(Stage& prevStage, OptionsOld& options);
     ~Writer();
     
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/qfit/Reader.hpp
--- a/include/pdal/drivers/qfit/Reader.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/qfit/Reader.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -122,7 +122,7 @@
     DECLARE_STATICS
 
 public:
-    Reader(Options& options);
+    Reader(const Options& options);
     ~Reader();
     
     std::string getFileName() const;
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/drivers/terrasolid/Reader.hpp
--- a/include/pdal/drivers/terrasolid/Reader.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/drivers/terrasolid/Reader.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -130,6 +130,7 @@
     DECLARE_STATICS
 
 public:
+    Reader(const Options&);
     Reader(OptionsOld& options);
     ~Reader();
     
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/ByteSwapFilter.hpp
--- a/include/pdal/filters/ByteSwapFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/ByteSwapFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -57,6 +57,7 @@
     DECLARE_STATICS
 
 public:
+    ByteSwapFilter(const Stage& prevStage, const Options&);
     ByteSwapFilter(const Stage& prevStage);
 
     bool supportsIterator (StageIteratorType t) const
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/CacheFilter.hpp
--- a/include/pdal/filters/CacheFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/CacheFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -60,6 +60,7 @@
     DECLARE_STATICS
 
 public:
+    CacheFilter(const Stage& prevStage, const Options&);
     CacheFilter(const Stage& prevStage, boost::uint32_t numBlocks, boost::uint32_t blockSize);
     ~CacheFilter();
 
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/Chipper.hpp
--- a/include/pdal/filters/Chipper.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/Chipper.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -154,6 +154,7 @@
     DECLARE_STATICS
 
 public:
+    Chipper(const Stage& prevStage, const Options&);
     Chipper(Stage& prevStage, boost::uint32_t max_partition_size)
         : pdal::Filter(prevStage, Options::none())
         , m_threshold(max_partition_size)
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/ColorFilter.hpp
--- a/include/pdal/filters/ColorFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/ColorFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -58,6 +58,7 @@
     DECLARE_STATICS
 
 public:
+    ColorFilter(const Stage& prevStage, const Options&);
     ColorFilter(const Stage& prevStage);
 
     void getColor_F32_U8(float value, boost::uint8_t& red, boost::uint8_t& green, boost::uint8_t& blue) const;
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/CropFilter.hpp
--- a/include/pdal/filters/CropFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/CropFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -57,6 +57,7 @@
     DECLARE_STATICS
 
 public:
+    CropFilter(const Stage& prevStage, const Options&);
     CropFilter(const Stage& prevStage, Bounds<double> const& bounds);
 
     bool supportsIterator (StageIteratorType t) const
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/DecimationFilter.hpp
--- a/include/pdal/filters/DecimationFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/DecimationFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -55,6 +55,7 @@
     DECLARE_STATICS
 
 public:
+    DecimationFilter(const Stage& prevStage, const Options&);
     DecimationFilter(const Stage& prevStage, boost::uint32_t step);
 
     bool supportsIterator (StageIteratorType t) const
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/MosaicFilter.hpp
--- a/include/pdal/filters/MosaicFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/MosaicFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -55,7 +55,7 @@
 public:
     // entries may not be null
     // vector.size() must be > 0
-    MosaicFilter(std::vector<const Stage*> prevStages);
+    MosaicFilter(const std::vector<const Stage*>& prevStages, const Options&);
     
     bool supportsIterator (StageIteratorType t) const
     {   
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/ReprojectionFilter.hpp
--- a/include/pdal/filters/ReprojectionFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/ReprojectionFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -55,6 +55,7 @@
     DECLARE_STATICS
 
 public:
+    ReprojectionFilter(const Stage& prevStage, const Options&);
     ReprojectionFilter(const Stage& prevStage,
                        const SpatialReference& inSRS,
                        const SpatialReference& outSRS);
diff -r f2ff84a215f9 -r a3cb4cf5201a include/pdal/filters/ScalingFilter.hpp
--- a/include/pdal/filters/ScalingFilter.hpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/include/pdal/filters/ScalingFilter.hpp	Fri Jul 22 15:09:33 2011 -0700
@@ -62,6 +62,7 @@
     //   - "forward=true" means doubles --> ints
     //   - "forward=false" means ints --> doubles
     //   - 1st version uses the scale/offset values already present
+    ScalingFilter(const Stage& prevStage, const Options&);
     ScalingFilter(const Stage& prevStage, bool forward);
     ScalingFilter(const Stage& prevStage, double scaleX, double offsetX, double scaleY, double offsetY, double scaleZ, double offsetZ, bool forward);
 
diff -r f2ff84a215f9 -r a3cb4cf5201a src/MultiFilter.cpp
--- a/src/MultiFilter.cpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/src/MultiFilter.cpp	Fri Jul 22 15:09:33 2011 -0700
@@ -39,7 +39,7 @@
 {
 
 
-MultiFilter::MultiFilter(std::vector<const Stage*> prevStages, const Options& options)
+MultiFilter::MultiFilter(const std::vector<const Stage*>& prevStages, const Options& options)
     : Stage(options)
 {
     if (prevStages.size() == 0)
diff -r f2ff84a215f9 -r a3cb4cf5201a src/Writer.cpp
--- a/src/Writer.cpp	Fri Jul 22 13:41:19 2011 -0700
+++ b/src/Writer.cpp	Fri Jul 22 15:09:33 2011 -0700
@@ -47,7 +47,7 @@
 const boost::uint32_t Writer::s_defaultChunkSize = 1024 * 32;
 
 
-Writer::Writer(Stage& prevStage, const Options& options)
+Writer::Writer(const Stage& prevStage, const Options& options)
     : StageBase(options)
     , m_actualNumPointsWritten(0)
     , m_targetNumPointsToWrite(0)
@@ -59,7 +59,7 @@
 }
 
 
-Stage& Writer::getPrevStage()
+const Stage& Writer::getPrevStage()
 {
     return m_prevStage;


More information about the Liblas-commits mailing list