[Liblas-commits] libpc: checkpoint

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Feb 7 14:32:45 EST 2011


details:   http://hg.liblas.orglibpc/rev/882f96ae9105
changeset: 7:882f96ae9105
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Mon Feb 07 11:32:25 2011 -0800
description:
checkpoint

diffstat:

 include/libpc/CropFilter.hpp  |   12 ++-
 include/libpc/Filter.hpp      |   59 +++++++++++++++
 include/libpc/Header.hpp      |   13 +-
 include/libpc/LasReader.hpp   |    4 +-
 include/libpc/LasWriter.hpp   |    3 +-
 include/libpc/Layout.hpp      |   64 ----------------
 include/libpc/Point.hpp       |   55 --------------
 include/libpc/PointBuffer.hpp |   59 ---------------
 include/libpc/PointData.hpp   |   18 +++-
 include/libpc/PointLayout.hpp |   72 ++++++++++++++++++
 include/libpc/Reader.hpp      |    4 +-
 include/libpc/Stage.hpp       |    9 +-
 include/libpc/Writer.hpp      |   14 ++-
 src/CropFilter.cpp            |   25 ++++++-
 src/Filter.cpp                |   52 +++++++++++++
 src/Header.cpp                |   28 +++++-
 src/LasReader.cpp             |   28 +++---
 src/LasWriter.cpp             |   19 ++++-
 src/Layout.cpp                |  139 ------------------------------------
 src/Point.cpp                 |   43 -----------
 src/PointBuffer.cpp           |   57 --------------
 src/PointData.cpp             |   59 ++++++++++++--
 src/PointLayout.cpp           |  162 ++++++++++++++++++++++++++++++++++++++++++
 src/Reader.cpp                |    6 +
 src/Stage.cpp                 |   13 +++
 src/Writer.cpp                |   10 ++-
 src/main.cpp                  |    9 +-
 src/prototype.vcxproj         |   10 +-
 28 files changed, 561 insertions(+), 485 deletions(-)

diffs (truncated from 1422 to 300 lines):

diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/CropFilter.hpp
--- a/include/libpc/CropFilter.hpp	Sat Feb 05 15:54:32 2011 -0800
+++ b/include/libpc/CropFilter.hpp	Mon Feb 07 11:32:25 2011 -0800
@@ -35,14 +35,20 @@
 #ifndef INCLUDED_CROPFILTER_HPP
 #define INCLUDED_CROPFILTER_HPP
 
-#include "libpc/Stage.hpp"
+#include "libpc/Filter.hpp"
 
-class CropFilter : public Stage
+class CropFilter : public Filter
 {
 public:
-  CropFilter();
+  CropFilter(Stage& prevStage, float minZ, float maxZ);
+  void initialize();
+
+  void readNextPoints(PointData&);
 
 private:
+  float m_minZ;
+  float m_maxZ;
+
   CropFilter& operator=(const CropFilter&); // not implemented
   CropFilter(const CropFilter&); // not implemented
 };
diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/Filter.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/Filter.hpp	Mon Feb 07 11:32:25 2011 -0800
@@ -0,0 +1,59 @@
+/******************************************************************************
+* 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_FILTER_HPP
+#define INCLUDED_FILTER_HPP
+
+#include "libpc/Stage.hpp"
+#include "libpc/header.hpp"
+
+class Filter : public Stage
+{
+public:
+  Filter(Stage& prevStage);
+  virtual void initialize() = 0;
+
+  // from Stage
+  virtual void readNextPoints(PointData&) = 0;
+
+protected:
+  int m_lastPointRead;
+  Stage& m_prevStage;
+
+private:
+  Filter& operator=(const Filter&); // not implemented
+  Filter(const Filter&); // not implemented
+};
+
+#endif
diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/Header.hpp
--- a/include/libpc/Header.hpp	Sat Feb 05 15:54:32 2011 -0800
+++ b/include/libpc/Header.hpp	Mon Feb 07 11:32:25 2011 -0800
@@ -35,14 +35,17 @@
 #ifndef INCLUDED_HEADER_HPP
 #define INCLUDED_HEADER_HPP
 
-#include "libpc/Layout.hpp"
+#include "libpc/PointLayout.hpp"
 
 class Header
 {
 public:
   Header();
-  const Layout& getConstLayout() const;
-  Layout& getLayout();
+  Header(const Header&);
+  Header& operator=(const Header&);
+
+  const PointLayout& getConstPointLayout() const;
+  PointLayout& getPointLayout();
 
   int getNumPoints() const;
   void setNumPoints(int);
@@ -50,11 +53,9 @@
   void dump() const;
 
 private:
-  Layout m_layout;
+  PointLayout m_pointLayout;
   int m_numPoints;
 
-  Header(const Header&); // not implemented
-  Header& operator=(const Header&); // not implemented
 };
 
 #endif
diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/LasReader.hpp
--- a/include/libpc/LasReader.hpp	Sat Feb 05 15:54:32 2011 -0800
+++ b/include/libpc/LasReader.hpp	Mon Feb 07 11:32:25 2011 -0800
@@ -41,9 +41,9 @@
 {
 public:
   LasReader(std::string file);
-  void open();
+  void initialize();
 
-  void readNextPoints(PointBuffer& buffer);
+  void readNextPoints(PointData& data);
 
 private:
   LasReader& operator=(const LasReader&); // not implemented
diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/LasWriter.hpp
--- a/include/libpc/LasWriter.hpp	Sat Feb 05 15:54:32 2011 -0800
+++ b/include/libpc/LasWriter.hpp	Mon Feb 07 11:32:25 2011 -0800
@@ -43,10 +43,11 @@
 {
 public:
   LasWriter(std::string filename, Stage& prevStage);
+  void initialize();
 
 private:
   void writeBegin();
-  void writeBuffer(const PointBuffer&);
+  void writeBuffer(const PointData&);
   void writeEnd();
 
   LasWriter& operator=(const LasWriter&); // not implemented
diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/Layout.hpp
--- a/include/libpc/Layout.hpp	Sat Feb 05 15:54:32 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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_LAYOUT_HPP
-#define INCLUDED_LAYOUT_HPP
-
-#include <vector>
-
-#include "libpc/Field.hpp"
-
-class Layout
-{
-public:
-  Layout();
-  Layout(const Layout&);
-  Layout& operator=(const Layout & other);
-
-  void addField(const Field& field);
-  void addFields(const std::vector<Field>& fields);
-
-  int getSizeInBytes() const;
-  int getNumFields() const;
-
-  void dump() const;
-
-  bool findField(Field::DataItem item, Field& ret) const;
-  int findFieldOffset(Field::DataItem item) const;
-
-private:
-  std::vector<Field> m_fields;
-};
-
-#endif
diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/Point.hpp
--- a/include/libpc/Point.hpp	Sat Feb 05 15:54:32 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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_POINT_HPP
-#define INCLUDED_POINT_HPP
-
-#include "PointData.hpp"
-
-
-// representation of a single point
-class Point
-{
-public:
-  Point(const Layout& layout);
-
-private:
-  Layout m_layout;
-  PointData* m_pointData;
-
-  Point(const Point&); // not implemented
-  Point& operator=(const Point&); // not implemented
-};
-
-#endif
diff -r 8d9f00786195 -r 882f96ae9105 include/libpc/PointBuffer.hpp
--- a/include/libpc/PointBuffer.hpp	Sat Feb 05 15:54:32 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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.


More information about the Liblas-commits mailing list