[Liblas-commits] hg-main-tree: dump filename

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Aug 18 22:06:26 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/5a2adbd81112
changeset: 1146:5a2adbd81112
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Aug 18 19:05:42 2011 -0700
description:
dump filename
Subject: hg-main-tree: added getId() to base class, for stage debugging

details:   http://hg.libpc.orghg-main-tree/rev/ab9d245e91d6
changeset: 1147:ab9d245e91d6
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Aug 18 19:06:09 2011 -0700
description:
added getId() to base class, for stage debugging

diffstat:

 include/pdal/Filter.hpp                    |  7 +++++++
 include/pdal/MultiFilter.hpp               |  7 +++++++
 include/pdal/Reader.hpp                    |  7 +++++++
 include/pdal/Stage.hpp                     |  8 +++++++-
 include/pdal/StageBase.hpp                 |  9 +++++++++
 include/pdal/drivers/las/Writer.hpp        |  1 +
 include/pdal/drivers/liblas/Writer.hpp     |  1 +
 include/pdal/drivers/qfit/Reader.hpp       |  1 +
 include/pdal/drivers/terrasolid/Reader.hpp |  1 +
 src/StageBase.cpp                          |  2 ++
 src/drivers/pipeline/Reader.cpp            |  2 +-
 test/data/apps/pcinfo_stage.txt            |  1 +
 test/unit/FauxReaderTest.cpp               |  3 +++
 13 files changed, 48 insertions(+), 2 deletions(-)

diffs (208 lines):

diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/Filter.hpp
--- a/include/pdal/Filter.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/Filter.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -42,6 +42,13 @@
 namespace pdal
 {
 
+//
+// supported options:
+//   <uint32>id
+//   <bool>debug
+//   <uint8>verbose
+//
+
 class PDAL_DLL Filter : public Stage
 {
 public:
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/MultiFilter.hpp
--- a/include/pdal/MultiFilter.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/MultiFilter.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -42,6 +42,13 @@
 namespace pdal
 {
 
+//
+// supported options:
+//   <uint32>id
+//   <bool>debug
+//   <uint8>verbose
+//
+
 class PDAL_DLL MultiFilter : public Stage
 {
 public:
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/Reader.hpp
--- a/include/pdal/Reader.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/Reader.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -46,6 +46,13 @@
 class ReaderRandomIterator;
 class ReaderBlockIterator;
 
+//
+// supported options:
+//   <uint32>id
+//   <bool>debug
+//   <uint8>verbose
+//
+
 class PDAL_DLL Reader : public Stage
 {
 public:
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/Stage.hpp
--- a/include/pdal/Stage.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/Stage.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -51,7 +51,13 @@
 class StageRandomIterator;
 class StageBlockIterator;
 
-// every stage owns its own header, they are not shared
+//
+// supported options:
+//   <uint32>id
+//   <bool>debug
+//   <uint8>verbose
+//
+
 class PDAL_DLL Stage : public StageBase
 {
 public:
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/StageBase.hpp
--- a/include/pdal/StageBase.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/StageBase.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -44,6 +44,12 @@
 namespace pdal
 {
 
+//
+// supported options:
+//   <uint32>id
+//   <bool>debug
+//   <uint8>verbose
+//
 
 // both Stages and Writers have a few common properties, so 
 class PDAL_DLL StageBase
@@ -110,6 +116,8 @@
     virtual boost::property_tree::ptree toPTree() const;
     virtual void dump() const;
 
+    boost::uint32_t getId() const { return m_id; }
+
 protected:
     Options& getOptions();
 
@@ -118,6 +126,7 @@
     Options m_options;
     bool m_debug;
     boost::uint8_t m_verbose;
+    const boost::uint32_t m_id;
 
     StageBase& operator=(const StageBase&); // not implemented
     StageBase(const StageBase&); // not implemented
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/drivers/las/Writer.hpp
--- a/include/pdal/drivers/las/Writer.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/drivers/las/Writer.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -53,6 +53,7 @@
 
 //
 // supported options:
+//   <uint32>id
 //   <bool>debug
 //   <uint8>verbose
 //   <string>a_srs
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/drivers/liblas/Writer.hpp
--- a/include/pdal/drivers/liblas/Writer.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/drivers/liblas/Writer.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -52,6 +52,7 @@
 
 //
 // supported options:
+//   <uint32>id
 //   <bool>debug
 //   <uint8>verbose
 //   <string>a_srs
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/drivers/qfit/Reader.hpp
--- a/include/pdal/drivers/qfit/Reader.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/drivers/qfit/Reader.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -118,6 +118,7 @@
 
 //
 // supported options:
+//   <uint32>id
 //   <bool>debug
 //   <uint8>verbose
 //   <string>filename  [required]
diff -r bb46ee778754 -r ab9d245e91d6 include/pdal/drivers/terrasolid/Reader.hpp
--- a/include/pdal/drivers/terrasolid/Reader.hpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/include/pdal/drivers/terrasolid/Reader.hpp	Thu Aug 18 19:06:09 2011 -0700
@@ -126,6 +126,7 @@
 
 //
 // supported options:
+//   <uint32>id
 //   <bool>debug
 //   <uint8>verbose
 //   <string>filename  [required]
diff -r bb46ee778754 -r ab9d245e91d6 src/StageBase.cpp
--- a/src/StageBase.cpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/src/StageBase.cpp	Thu Aug 18 19:06:09 2011 -0700
@@ -50,6 +50,7 @@
     , m_options(options)
     , m_debug(options.getValueOrDefault<bool>("debug", false))
     , m_verbose(options.getValueOrDefault<boost::uint8_t>("verbose", 0))
+    , m_id(options.getValueOrDefault<boost::uint32_t>("id", 0))
 {
     return;
 }
@@ -119,6 +120,7 @@
     boost::property_tree::ptree tree;
 
     tree.add("name", getName());
+    tree.add("id", getId());
     tree.add("description", getDescription());
     tree.add_child("options", getOptions().getPTree());
 
diff -r bb46ee778754 -r ab9d245e91d6 src/drivers/pipeline/Reader.cpp
--- a/src/drivers/pipeline/Reader.cpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/src/drivers/pipeline/Reader.cpp	Thu Aug 18 19:06:09 2011 -0700
@@ -105,7 +105,7 @@
 {
     boost::property_tree::ptree tree = pdal::Reader::toPTree();
 
-    // add stuff here specific to this stage type
+    tree.add("filename", m_filename);
 
     return tree;
 }
diff -r bb46ee778754 -r ab9d245e91d6 test/data/apps/pcinfo_stage.txt
--- a/test/data/apps/pcinfo_stage.txt	Thu Aug 18 17:52:28 2011 -0700
+++ b/test/data/apps/pcinfo_stage.txt	Thu Aug 18 19:06:09 2011 -0700
@@ -1,5 +1,6 @@
 {
     "name": "drivers.las.reader",
+    "id": "0",
     "description": "Las Reader",
     "options":
     {
diff -r bb46ee778754 -r ab9d245e91d6 test/unit/FauxReaderTest.cpp
--- a/test/unit/FauxReaderTest.cpp	Thu Aug 18 17:52:28 2011 -0700
+++ b/test/unit/FauxReaderTest.cpp	Thu Aug 18 19:06:09 2011 -0700
@@ -99,14 +99,17 @@
     Option<Bounds<double> > opt1("bounds", bounds);
     Option<std::string> opt2("mode", "conSTanT");
     Option<boost::uint64_t> opt3("num_points", 1000);
+    Option<boost::uint32_t> opt4("id", 90210);
     Options opts;
     opts.add(opt1);
     opts.add(opt2);
     opts.add(opt3);
+    opts.add(opt4);
     pdal::drivers::faux::Reader reader(opts);
     reader.initialize();
 
     BOOST_CHECK_EQUAL(reader.getDescription(), "Faux Reader");
+    BOOST_CHECK_EQUAL(reader.getId(), 90210u);
 
     const Schema& schema = reader.getSchema();
     SchemaLayout layout(schema);


More information about the Liblas-commits mailing list