[Liblas-commits] hg-main-tree: moved Iterator to StageIterator;
added Reader clas...
liblas-commits at liblas.org
liblas-commits at liblas.org
Sat Jul 2 11:44:39 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/a8c7c14954b3
changeset: 829:a8c7c14954b3
user: Michael P. Gerlek <mpg at flaxen.com>
date: Thu Jun 30 20:33:15 2011 -0400
description:
moved Iterator to StageIterator; added Reader class, derived from Stage; add MultiFilter, but not used yet
Subject: hg-main-tree: merge
details: http://hg.libpc.orghg-main-tree/rev/2236fc705776
changeset: 830:2236fc705776
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Jul 01 15:34:42 2011 -0400
description:
merge
Subject: hg-main-tree: turned on multifilter (which doesn't really work)
details: http://hg.libpc.orghg-main-tree/rev/72e27a7353b5
changeset: 831:72e27a7353b5
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Jul 01 16:30:01 2011 -0400
description:
turned on multifilter (which doesn't really work)
Subject: hg-main-tree: sync Stage changes to OCI classes
details: http://hg.libpc.orghg-main-tree/rev/5bbc66167aba
changeset: 832:5bbc66167aba
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Jul 01 16:27:13 2011 -0700
description:
sync Stage changes to OCI classes
Subject: hg-main-tree: renamed Hobo's old Options class to OptionsOld, and renamed my new OptionsNew class to Options
details: http://hg.libpc.orghg-main-tree/rev/3c7d27b8372b
changeset: 833:3c7d27b8372b
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Jul 01 17:10:20 2011 -0700
description:
renamed Hobo's old Options class to OptionsOld, and renamed my new OptionsNew class to Options
Subject: hg-main-tree: fixing capitalization
details: http://hg.libpc.orghg-main-tree/rev/e887be7eedd2
changeset: 834:e887be7eedd2
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Jul 01 17:11:12 2011 -0700
description:
fixing capitalization
Subject: hg-main-tree: fixing capitalization
details: http://hg.libpc.orghg-main-tree/rev/da835823203c
changeset: 835:da835823203c
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Jul 01 17:12:15 2011 -0700
description:
fixing capitalization
Subject: hg-main-tree: added Options param up and down the Stage class hierarchy
details: http://hg.libpc.orghg-main-tree/rev/b5e815a30ae7
changeset: 836:b5e815a30ae7
user: Michael P. Gerlek <mpg at flaxen.com>
date: Fri Jul 01 18:01:56 2011 -0700
description:
added Options param up and down the Stage class hierarchy
Subject: hg-main-tree: mpg
details: http://hg.libpc.orghg-main-tree/rev/5148d6373985
changeset: 837:5148d6373985
user: Michael P. Gerlek <mpg at flaxen.com>
date: Sat Jul 02 08:44:24 2011 -0700
description:
mpg
diffstat:
apps/pc2pc.cpp | 14 +-
apps/pcview/main.cpp | 4 +-
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/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 | 92 ++++++----
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 +-
99 files changed, 1665 insertions(+), 945 deletions(-)
diffs (truncated from 4792 to 300 lines):
diff -r 475963785a2f -r 5148d6373985 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp Thu Jun 30 17:22:26 2011 -0400
+++ b/apps/pc2pc.cpp Sat Jul 02 08:44:24 2011 -0700
@@ -148,14 +148,15 @@
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 in_wkt = in_srs_options.get<std::string>("userinput");
-
+ std::string out_wkt = in_srs_options.get<std::string>("userinput");
boost::property_tree::ptree las_options = load_tree.get_child("pdal.drivers.las");
boost::property_tree::ptree out_srs_options = las_options.get_child("spatialreference");
- std::string out_wkt = out_srs_options.get<std::string>("userinput");
+ std::string in_wkt = out_srs_options.get<std::string>("userinput");
+ pdal::SpatialReference in_ref(in_wkt);
+ pdal::SpatialReference out_ref(out_wkt);
boost::property_tree::ptree& tree = options.GetPTree();
@@ -166,8 +167,7 @@
pdal::filters::Chipper chipper(cache, capacity);
pdal::filters::ByteSwapFilter swapper(chipper);
- pdal::SpatialReference in_ref(in_wkt);
- pdal::SpatialReference out_ref(out_wkt);
+
pdal::filters::ScalingFilter scalingFilter(swapper, false);
pdal::filters::ReprojectionFilter reprojectionFilter(scalingFilter, in_ref, out_ref);
@@ -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 475963785a2f -r 5148d6373985 apps/pcview/main.cpp
--- a/apps/pcview/main.cpp Thu Jun 30 17:22:26 2011 -0400
+++ b/apps/pcview/main.cpp Sat Jul 02 08:44:24 2011 -0700
@@ -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 475963785a2f -r 5148d6373985 include/pdal/Filter.hpp
--- a/include/pdal/Filter.hpp Thu Jun 30 17:22:26 2011 -0400
+++ b/include/pdal/Filter.hpp Sat Jul 02 08:44:24 2011 -0700
@@ -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 475963785a2f -r 5148d6373985 include/pdal/FilterIterator.hpp
--- a/include/pdal/FilterIterator.hpp Thu Jun 30 17:22:26 2011 -0400
+++ b/include/pdal/FilterIterator.hpp Sat Jul 02 08:44:24 2011 -0700
@@ -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 475963785a2f -r 5148d6373985 include/pdal/Iterator.hpp
--- a/include/pdal/Iterator.hpp Thu Jun 30 17:22:26 2011 -0400
+++ /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
- virtual boost::uint32_t readImpl(PointBuffer&) = 0;
-
- virtual boost::uint64_t skipImpl(boost::uint64_t pointNum) = 0;
- virtual bool atEndImpl() const = 0;
-};
-
-
-class PDAL_DLL RandomIterator : public Iterator
-{
-public:
- RandomIterator(const Stage& stage);
- virtual ~RandomIterator();
-
- // seek to point N (an absolute value)
- //
More information about the Liblas-commits
mailing list