[Liblas-commits] hg-main-tree: cut down precision of tolerance and output the sch...

liblas-commits at liblas.org liblas-commits at liblas.org
Sun Jul 3 15:14:18 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/29d33748e591
changeset: 838:29d33748e591
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Jul 01 23:39:30 2011 -0500
description:
cut down precision of tolerance and output the schema to the current directory
Subject: hg-main-tree: we should still apply scaling if the offset were set.

details:   http://hg.libpc.orghg-main-tree/rev/ad7de836aa14
changeset: 839:ad7de836aa14
user:      Howard Butler <hobu.inc at gmail.com>
date:      Sun Jul 03 14:08:10 2011 -0500
description:
we should still apply scaling if the offset were set.
Subject: hg-main-tree: set the dimension to a fixed precision dimension if we've set an offset value

details:   http://hg.libpc.orghg-main-tree/rev/842f8bebff4c
changeset: 840:842f8bebff4c
user:      Howard Butler <hobu.inc at gmail.com>
date:      Sun Jul 03 14:08:59 2011 -0500
description:
set the dimension to a fixed precision dimension if we've set an offset value
Subject: hg-main-tree: typo

details:   http://hg.libpc.orghg-main-tree/rev/5d436fa0b6d2
changeset: 841:5d436fa0b6d2
user:      Howard Butler <hobu.inc at gmail.com>
date:      Sun Jul 03 14:10:44 2011 -0500
description:
typo
Subject: hg-main-tree: start noodling around with boost::multi_index as the container for the Dimensions

details:   http://hg.libpc.orghg-main-tree/rev/1de8e153c856
changeset: 842:1de8e153c856
user:      Howard Butler <hobu.inc at gmail.com>
date:      Sun Jul 03 14:14:00 2011 -0500
description:
start noodling around with boost::multi_index as the container for the Dimensions
Subject: hg-main-tree: merge

details:   http://hg.libpc.orghg-main-tree/rev/aca9d8c0e188
changeset: 843:aca9d8c0e188
user:      Howard Butler <hobu.inc at gmail.com>
date:      Sun Jul 03 14:14:07 2011 -0500
description:
merge

diffstat:

 apps/pc2pc.cpp                                |    4 +-
 apps/pcview/main.cpp                          |    4 +-
 include/pdal/Dimension.hpp                    |   13 +-
 include/pdal/Filter.hpp                       |    2 +-
 include/pdal/FilterIterator.hpp               |   32 +-
 include/pdal/Iterator.hpp                     |  160 -------------------
 include/pdal/MultiFilter.hpp                  |   64 +++++++
 include/pdal/MultiFilterIterator.hpp          |   75 +++++++++
 include/pdal/Options.hpp                      |   25 +-
 include/pdal/PipelineManager.hpp              |   15 +-
 include/pdal/Reader.hpp                       |   58 +++++++
 include/pdal/ReaderIterator.hpp               |   84 ++++++++++
 include/pdal/Schema.hpp                       |   37 ++++
 include/pdal/Stage.hpp                        |   20 +-
 include/pdal/StageIterator.hpp                |  160 +++++++++++++++++++
 include/pdal/Writer.hpp                       |    9 +-
 include/pdal/drivers/faux/Iterator.hpp        |    6 +-
 include/pdal/drivers/faux/Reader.hpp          |    8 +-
 include/pdal/drivers/las/Iterator.hpp         |    6 +-
 include/pdal/drivers/las/Reader.hpp           |    4 +-
 include/pdal/drivers/las/ReaderBase.hpp       |    6 +-
 include/pdal/drivers/liblas/Iterator.hpp      |    6 +-
 include/pdal/drivers/liblas/Reader.hpp        |    4 +-
 include/pdal/drivers/oci/Common.hpp           |  184 ----------------------
 include/pdal/drivers/oci/Iterator.hpp         |    6 +-
 include/pdal/drivers/oci/Reader.hpp           |   10 +-
 include/pdal/drivers/oci/Writer.hpp           |    6 +-
 include/pdal/drivers/oci/common.hpp           |  184 ++++++++++++++++++++++
 include/pdal/drivers/qfit/Iterator.hpp        |    6 +-
 include/pdal/drivers/qfit/Reader.hpp          |   16 +-
 include/pdal/drivers/terrasolid/Iterator.hpp  |    6 +-
 include/pdal/drivers/terrasolid/Reader.hpp    |   16 +-
 include/pdal/filters/ByteSwapFilter.hpp       |    4 +-
 include/pdal/filters/CacheFilter.hpp          |    4 +-
 include/pdal/filters/Chipper.hpp              |   13 +-
 include/pdal/filters/ColorFilter.hpp          |    4 +-
 include/pdal/filters/CropFilter.hpp           |    4 +-
 include/pdal/filters/DecimationFilter.hpp     |    4 +-
 include/pdal/filters/MosaicFilter.hpp         |   14 +-
 include/pdal/filters/MosaicFilterIterator.hpp |    9 +-
 include/pdal/filters/ReprojectionFilter.hpp   |    4 +-
 include/pdal/filters/ScalingFilter.hpp        |    4 +-
 mpg-config.bat                                |   69 +++++---
 src/CMakeLists.txt                            |   16 +-
 src/Filter.cpp                                |    5 +-
 src/FilterIterator.cpp                        |   18 +-
 src/Iterator.cpp                              |  212 --------------------------
 src/MultiFilter.cpp                           |  100 ++++++++++++
 src/MultiFilterIterator.cpp                   |   79 +++++++++
 src/Options.cpp                               |   19 +-
 src/PipelineManager.cpp                       |   25 +++
 src/Reader.cpp                                |   53 ++++++
 src/ReaderIterator.cpp                        |  121 ++++++++++++++
 src/Stage.cpp                                 |   18 +-
 src/StageIterator.cpp                         |  212 ++++++++++++++++++++++++++
 src/Writer.cpp                                |    9 +-
 src/XMLSchema.cpp                             |    2 +-
 src/drivers/faux/Iterator.cpp                 |    4 +-
 src/drivers/faux/Reader.cpp                   |    8 +-
 src/drivers/faux/Writer.cpp                   |    2 +-
 src/drivers/las/Iterator.cpp                  |    4 +-
 src/drivers/las/Reader.cpp                    |    6 +-
 src/drivers/las/Writer.cpp                    |    2 +-
 src/drivers/liblas/Iterator.cpp               |    4 +-
 src/drivers/liblas/Reader.cpp                 |    6 +-
 src/drivers/liblas/Writer.cpp                 |    2 +-
 src/drivers/oci/Iterator.cpp                  |    2 +-
 src/drivers/oci/Reader.cpp                    |   20 +-
 src/drivers/oci/Writer.cpp                    |   50 +++--
 src/drivers/oci/common.cpp                    |    8 +-
 src/drivers/qfit/Iterator.cpp                 |    4 +-
 src/drivers/qfit/Reader.cpp                   |   12 +-
 src/drivers/terrasolid/Iterator.cpp           |    4 +-
 src/drivers/terrasolid/Reader.cpp             |   12 +-
 src/filters/ByteSwapFilter.cpp                |    4 +-
 src/filters/ByteSwapFilterIterator.cpp        |    2 +-
 src/filters/CacheFilter.cpp                   |    6 +-
 src/filters/Chipper.cpp                       |    8 +-
 src/filters/ChipperIterator.cpp               |    2 +-
 src/filters/ColorFilter.cpp                   |    4 +-
 src/filters/CropFilter.cpp                    |    4 +-
 src/filters/CropFilterIterator.cpp            |    2 +-
 src/filters/DecimationFilter.cpp              |    4 +-
 src/filters/DecimationFilterIterator.cpp      |    2 +-
 src/filters/MosaicFilter.cpp                  |    9 +-
 src/filters/MosaicFilterIterator.cpp          |   21 +--
 src/filters/ReprojectionFilter.cpp            |    4 +-
 src/filters/ScalingFilter.cpp                 |    6 +-
 test/unit/ByteSwapFilterTest.cpp              |    4 +-
 test/unit/CacheFilterTest.cpp                 |    6 +-
 test/unit/DecimationFilterTest.cpp            |    4 +-
 test/unit/FauxReaderTest.cpp                  |   10 +-
 test/unit/LasReaderTest.cpp                   |   26 +-
 test/unit/LiblasReaderTest.cpp                |   26 +-
 test/unit/MosaicFilterTest.cpp                |    4 +-
 test/unit/OCITest.cpp                         |    8 +-
 test/unit/OptionsTest.cpp                     |    8 +-
 test/unit/QFITReaderTest.cpp                  |   10 +-
 test/unit/ReprojectionFilterTest.cpp          |    8 +-
 test/unit/TerraSolidTest.cpp                  |    6 +-
 test/unit/XMLSchemaTest.cpp                   |    2 +-
 101 files changed, 1675 insertions(+), 933 deletions(-)

diffs (truncated from 4799 to 300 lines):

diff -r 9bcd0930b8d2 -r aca9d8c0e188 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Thu Jun 30 16:58:35 2011 -0500
+++ b/apps/pc2pc.cpp	Sun Jul 03 14:14:07 2011 -0500
@@ -148,7 +148,7 @@
         
         boost::property_tree::ptree oracle_options = load_tree.get_child("pdal.drivers.oci.writer");
     
-        pdal::Options options(oracle_options);
+        pdal::OptionsOld options(oracle_options);
         
         boost::property_tree::ptree in_srs_options = oracle_options.get_child("spatialreference");
         std::string out_wkt = in_srs_options.get<std::string>("userinput");
@@ -219,7 +219,7 @@
         bool compress = las_options.get<bool>("compress");
         
         std::string out_wkt = srs_options.get<std::string>("userinput");
-        pdal::Options options(oracle_options);
+        pdal::OptionsOld options(oracle_options);
         
         if (out_wkt.size() != 0) 
         {
diff -r 9bcd0930b8d2 -r aca9d8c0e188 apps/pcview/main.cpp
--- a/apps/pcview/main.cpp	Thu Jun 30 16:58:35 2011 -0500
+++ b/apps/pcview/main.cpp	Sun Jul 03 14:14:07 2011 -0500
@@ -51,7 +51,7 @@
 #include <pdal/SchemaLayout.hpp>
 #include <pdal/Bounds.hpp>
 #include <pdal/Dimension.hpp>
-#include <pdal/Iterator.hpp>
+#include <pdal/StageIterator.hpp>
 
 using namespace std;
 
@@ -164,7 +164,7 @@
     const pdal::Schema& schema = stage.getSchema();
     const pdal::SchemaLayout schemaLayout(schema);
 
-    pdal::SequentialIterator* iter = stage.createSequentialIterator();
+    pdal::StageSequentialIterator* iter = stage.createSequentialIterator();
     pdal::PointBuffer buffer(schemaLayout, numPoints);
     iter->skip(startPoint);
     const boost::uint32_t numRead = iter->read(buffer);
diff -r 9bcd0930b8d2 -r aca9d8c0e188 include/pdal/Dimension.hpp
--- a/include/pdal/Dimension.hpp	Thu Jun 30 16:58:35 2011 -0500
+++ b/include/pdal/Dimension.hpp	Sun Jul 03 14:14:07 2011 -0500
@@ -241,18 +241,17 @@
     }
     inline void setNumericOffset(double v)
     {
+        if ( !Utils::compare_approx(v, 0.0, (std::numeric_limits<double>::min)()))
+        {
+            m_precise = true;
+        }       
         m_numericOffset = v;
     }
 
     template<class T>
     double applyScaling(T v) const
     {
-        if ( !Utils::compare_approx(m_numericScale, 0.0, (std::numeric_limits<double>::min)()))
-            return (double)v * m_numericScale + m_numericOffset;
-        else 
-        {
-            return v;
-        }
+        return static_cast<double>(v) * m_numericScale + m_numericOffset;
     }
 
     template<class T>
@@ -273,8 +272,6 @@
         m_precise = v;
     }
 
-    /// The scaling value for this dimension as a double.  This should
-    /// be positive or negative powers of ten.
     inline EndianType getEndianness() const
     {
         return m_endian;
diff -r 9bcd0930b8d2 -r aca9d8c0e188 include/pdal/Filter.hpp
--- a/include/pdal/Filter.hpp	Thu Jun 30 16:58:35 2011 -0500
+++ b/include/pdal/Filter.hpp	Sun Jul 03 14:14:07 2011 -0500
@@ -45,7 +45,7 @@
 class PDAL_DLL Filter : public Stage
 {
 public:
-    Filter(const Stage& prevStage);
+    Filter(const Stage& prevStage, const Options& options);
 
     const Stage& getPrevStage() const;
 
diff -r 9bcd0930b8d2 -r aca9d8c0e188 include/pdal/FilterIterator.hpp
--- a/include/pdal/FilterIterator.hpp	Thu Jun 30 16:58:35 2011 -0500
+++ b/include/pdal/FilterIterator.hpp	Sun Jul 03 14:14:07 2011 -0500
@@ -37,69 +37,69 @@
 
 #include <pdal/pdal.hpp>
 
-#include <pdal/Iterator.hpp>
+#include <pdal/StageIterator.hpp>
 
 namespace pdal
 {
 class Filter;
 
-class FilterSequentialIterator : public SequentialIterator
+class FilterSequentialIterator : public StageSequentialIterator
 {
 public:
     FilterSequentialIterator(const Filter&);
     virtual ~FilterSequentialIterator();
 
 protected:
-    // from SequentialIterator
+    // from StageSequentialIterator
     virtual boost::uint32_t readImpl(PointBuffer&) = 0;
     virtual boost::uint64_t skipImpl(boost::uint64_t pointNum) = 0;
     virtual bool atEndImpl() const = 0;
 
-    SequentialIterator& getPrevIterator();
-    const SequentialIterator& getPrevIterator() const;
+    StageSequentialIterator& getPrevIterator();
+    const StageSequentialIterator& getPrevIterator() const;
 
 private:
     const Filter& m_filter;
-    SequentialIterator* m_prevIterator;
+    StageSequentialIterator* m_prevIterator;
 };
 
 
-class FilterRandomIterator : public RandomIterator
+class FilterRandomIterator : public StageRandomIterator
 {
 public:
     FilterRandomIterator(const Filter&);
     virtual ~FilterRandomIterator();
 
 protected:
-    // from RandomIterator
+    // from StageRandomIterator
     virtual boost::uint32_t readImpl(PointBuffer&) = 0;
     virtual boost::uint64_t seekImpl(boost::uint64_t pointNum) = 0;
 
-    RandomIterator& getPrevIterator();
-    const RandomIterator& getPrevIterator() const;
+    StageRandomIterator& getPrevIterator();
+    const StageRandomIterator& getPrevIterator() const;
 
 private:
     const Filter& m_filter;
-    RandomIterator* m_prevIterator;
+    StageRandomIterator* m_prevIterator;
 };
 
-class FilterBlockIterator : public BlockIterator
+class FilterBlockIterator : public StageBlockIterator
 {
 public:
     FilterBlockIterator(const Filter&);
     virtual ~FilterBlockIterator();
 
 protected:
-    // from RandomIterator
+    // from StageRandomIterator
     virtual boost::uint32_t readImpl(PointBuffer&) = 0;
     virtual boost::uint64_t seekImpl(boost::uint64_t pointNum) = 0;
 
-    BlockIterator& getPrevIterator();
-    const BlockIterator& getPrevIterator() const;
+    StageBlockIterator& getPrevIterator();
+    const StageBlockIterator& getPrevIterator() const;
 
 private:
     const Filter& m_filter;
-    BlockIterator* m_prevIterator;
+    StageBlockIterator* m_prevIterator;
 };
 
 } // namespace pdal
diff -r 9bcd0930b8d2 -r aca9d8c0e188 include/pdal/Iterator.hpp
--- a/include/pdal/Iterator.hpp	Thu Jun 30 16:58:35 2011 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following
-* conditions are met:
-*
-*     * Redistributions of source code must retain the above copyright
-*       notice, this list of conditions and the following disclaimer.
-*     * Redistributions in binary form must reproduce the above copyright
-*       notice, this list of conditions and the following disclaimer in
-*       the documentation and/or other materials provided
-*       with the distribution.
-*     * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
-*       names of its contributors may be used to endorse or promote
-*       products derived from this software without specific prior
-*       written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-* OF SUCH DAMAGE.
-****************************************************************************/
-
-#ifndef INCLUDED_ITERATOR_HPP
-#define INCLUDED_ITERATOR_HPP
-
-#include <pdal/pdal.hpp>
-
-namespace pdal
-{
-class Stage;
-class PointBuffer;
-
-
-
-class PDAL_DLL Iterator
-{
-public:
-    Iterator(const Stage& stage);
-    virtual ~Iterator();
-
-    const Stage& getStage() const;
-
-    // This reads a set of points at the current position in the file.
-    //
-    // The schema of the PointBuffer buffer we are given here might
-    // not match our own header's schema.  That's okay, though: all
-    // that matters is that the buffer we are given has the fields
-    // we need to write into.
-    //
-    // Returns the number of valid points read.
-    boost::uint32_t read(PointBuffer&);
-
-    // Returns the current point number.  The first point is 0.
-    // If this number if > getNumPoints(), then no more points
-    // may be read (and atEnd() should be true).
-    //
-    // All stages have the notion of a current point number, even for stages
-    // that are not really "oredered", in that the index just starts at zero 
-    // and increments by N every time another N points are read
-    boost::uint64_t getIndex() const;
-
-    // used to control intermediate buffering needed by some stages
-    void setChunkSize(boost::uint32_t size);
-    boost::uint32_t getChunkSize() const;
-
-protected:
-    virtual boost::uint32_t readImpl(PointBuffer&) = 0;
-
-    // This is provided as a sample implementation that some stages could use
-    // to implement their own skip or seek functions. It uses the read() call 
-    // to advance "count" points forward, so it is not at all optimal.
-    boost::uint64_t naiveSkipImpl(boost::uint64_t count);
-
-    boost::uint64_t m_index;
-
-private:
-    const Stage& m_stage;
-    boost::uint32_t m_chunkSize;
-
-    Iterator& operator=(const Iterator&); // not implemented
-    Iterator(const Iterator&); // not implemented
-};
-
-
-class PDAL_DLL SequentialIterator : public Iterator
-{
-public:
-    SequentialIterator(const Stage& stage);
-    virtual ~SequentialIterator();
-
-    // advance N points ahead in the file
-    //
-    // In some cases, this might be a very slow, painful function to call because
-    // it might entail physically reading the N points (and dropping the data on the
-    // floor)
-    //
-    // Returns the number actually skipped (which might be less than count, if the
-    // end of the stage was reached first).
-    boost::uint64_t skip(boost::uint64_t count);
-
-    // returns true after we've read all the points available to this stage
-    bool atEnd() const;
-
-protected:
-    // from Iterator


More information about the Liblas-commits mailing list