[Liblas-commits] hg-main-tree: undo PointBuffer stuff, let's try a different way

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Mar 23 12:29:29 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/e77f25ec440b
changeset: 404:e77f25ec440b
user:      Howard Butler <hobu.inc at gmail.com>
date:      Wed Mar 23 11:29:23 2011 -0500
description:
undo PointBuffer stuff, let's try a different way

diffstat:

 include/libpc/Chipper.hpp |  27 ++-------------------------
 src/Chipper.cpp           |  10 +++++-----
 2 files changed, 7 insertions(+), 30 deletions(-)

diffs (82 lines):

diff -r 7dd22518e8a2 -r e77f25ec440b include/libpc/Chipper.hpp
--- a/include/libpc/Chipper.hpp	Wed Mar 23 09:10:46 2011 -0700
+++ b/include/libpc/Chipper.hpp	Wed Mar 23 11:29:23 2011 -0500
@@ -29,37 +29,14 @@
 {
     
 public:
-    PtRef(PointBuffer& buffer) :m_data(buffer) {};
-
-    // PtRef(PointBuffer const& data) : m_data(0), m_pointSize(data.getSchemaLayout().getByteSize()) {};
     double m_pos;
     boost::uint32_t m_ptindex;
     boost::uint32_t m_oindex;
-    PointBuffer m_data;
     boost::uint32_t m_pointSize;
 
     bool operator < (const PtRef& pt) const
         { return m_pos < pt.m_pos; }
 
-    PtRef(const PtRef& other) : 
-        m_pos(other.m_pos), 
-        m_ptindex(other.m_ptindex), 
-        m_oindex(other.m_oindex),
-        m_data(other.m_data) 
-    {}
-
-    PtRef& operator=(const PtRef& rhs)
-    {
-        if (&rhs != this)
-        {
-            m_pos = rhs.m_pos;
-            m_ptindex = rhs.m_ptindex;
-            m_oindex = rhs.m_oindex;
-            m_data = rhs.m_data;
-        }
-        return *this;
-    }
-    // ~PtRef() { if (m_data) delete m_data; }
 };
 
 struct LIBPC_DLL RefList
@@ -74,8 +51,8 @@
         { return m_vec.size(); }
     void reserve(std::vector<PtRef>::size_type n)
         { m_vec.reserve(n); }
-    // void resize(std::vector<PtRef>::size_type n)
-    //     { m_vec.resize(n); }
+    void resize(std::vector<PtRef>::size_type n)
+        { m_vec.resize(n); }
     void push_back(const PtRef& ref)
         { m_vec.push_back(ref); }
     std::vector<PtRef>::iterator begin()
diff -r 7dd22518e8a2 -r e77f25ec440b src/Chipper.cpp
--- a/src/Chipper.cpp	Wed Mar 23 09:10:46 2011 -0700
+++ b/src/Chipper.cpp	Wed Mar 23 11:29:23 2011 -0500
@@ -121,13 +121,14 @@
    
     libpc::Header const& header = m_stage.getHeader();
     libpc::Schema const& schema = header.getSchema();
-    libpc::SchemaLayout const& layout = SchemaLayout(schema);
-    
-    
+
+
+    PtRef ref;
+
     boost::uint64_t count = header.getNumPoints();
     xvec.reserve(count);
     yvec.reserve(count);
-    spare.reserve(count);
+    spare.resize(count);
     
     // boost::uint32_t chunks = count/m_threshold;
 
@@ -165,7 +166,6 @@
         {
             PointBuffer data(buffer.getSchemaLayout(), 1);            
             data.copyPointFast(0, j, buffer);
-            PtRef ref(data);
             
             if (j == num_to_read) break; // we're outta here
 


More information about the Liblas-commits mailing list