[Liblas-commits] hg: back the liblas::detail::Reader::Point point reader by a sha...

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Jul 26 21:48:43 EDT 2010


changeset be85dc4a99c3 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=be85dc4a99c3
summary: back the liblas::detail::Reader::Point point reader by a shared_ptr instead of a reference

diffstat:

 include/liblas/detail/reader/point.hpp |   4 ++--
 src/detail/reader/point.cpp            |  32 ++++++++++++++++----------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diffs (109 lines):

diff -r 9b2ed4aa5cbd -r be85dc4a99c3 include/liblas/detail/reader/point.hpp
--- a/include/liblas/detail/reader/point.hpp	Mon Jul 26 14:57:47 2010 -0500
+++ b/include/liblas/detail/reader/point.hpp	Mon Jul 26 20:46:02 2010 -0500
@@ -64,7 +64,7 @@
     virtual ~Point();
 
     std::istream& GetStream() const;
-    const liblas::Point& GetPoint() const { return m_point; }
+    const liblas::Point& GetPoint() const { return *m_point; }
     void read();
     
 protected:
@@ -81,7 +81,7 @@
     
     std::istream& m_ifs;
     const liblas::Header& m_header;
-    liblas::Point m_point;
+    PointPtr m_point;
     
     Schema m_format;
     
diff -r 9b2ed4aa5cbd -r be85dc4a99c3 src/detail/reader/point.cpp
--- a/src/detail/reader/point.cpp	Mon Jul 26 14:57:47 2010 -0500
+++ b/src/detail/reader/point.cpp	Mon Jul 26 20:46:02 2010 -0500
@@ -55,7 +55,7 @@
 }
 
 Point::Point(std::istream& ifs, const liblas::Header& header) :
-    m_ifs(ifs), m_header(header), m_point(liblas::Point()), m_format(header.GetSchema())
+    m_ifs(ifs), m_header(header), m_point(PointPtr(new liblas::Point())), m_format(header.GetSchema())
 {
     setup();
 }
@@ -105,13 +105,13 @@
 
     fill(record);
     // Reader::FillPoint(record, m_point, m_header);
-    m_point.SetCoordinates(m_header, m_point.GetX(), m_point.GetY(), m_point.GetZ());
+    m_point->SetCoordinates(m_header, m_point->GetX(), m_point->GetY(), m_point->GetZ());
 
     if (m_format.HasTime()) 
     {
 
         detail::read_n(gpst, m_ifs, sizeof(double));
-        m_point.SetTime(gpst);
+        m_point->SetTime(gpst);
         bytesread += sizeof(double);
         
         if (m_format.HasColor()) 
@@ -121,7 +121,7 @@
             detail::read_n(blue, m_ifs, sizeof(uint16_t));
 
             liblas::Color color(red, green, blue);
-            m_point.SetColor(color);
+            m_point->SetColor(color);
             
             bytesread += 3 * sizeof(uint16_t);
         }
@@ -133,7 +133,7 @@
             detail::read_n(blue, m_ifs, sizeof(uint16_t));
 
             liblas::Color color(red, green, blue);
-            m_point.SetColor(color);
+            m_point->SetColor(color);
             
             bytesread += 3 * sizeof(uint16_t);
         }        
@@ -149,7 +149,7 @@
 
         detail::read_n(data.front(), m_ifs, bytesleft);
         
-        m_point.SetExtraData(data); 
+        m_point->SetExtraData(data); 
         
         bytesread = bytesread + bytesleft;
 
@@ -165,22 +165,22 @@
         
     }
     
-    m_point.SetHeader(m_header);
+    m_point->SetHeader(m_header);
 }
 
 
 void Point::fill(PointRecord& record) 
 {
 
-    m_point.SetX(record.x);
-    m_point.SetY(record.y);
-    m_point.SetZ(record.z);
+    m_point->SetX(record.x);
+    m_point->SetY(record.y);
+    m_point->SetZ(record.z);
 
-    m_point.SetIntensity(record.intensity);
-    m_point.SetScanFlags(record.flags);
-    m_point.SetClassification((record.classification));
-    m_point.SetScanAngleRank(record.scan_angle_rank);
-    m_point.SetUserData(record.user_data);
-    m_point.SetPointSourceID(record.point_source_id);
+    m_point->SetIntensity(record.intensity);
+    m_point->SetScanFlags(record.flags);
+    m_point->SetClassification((record.classification));
+    m_point->SetScanAngleRank(record.scan_angle_rank);
+    m_point->SetUserData(record.user_data);
+    m_point->SetPointSourceID(record.point_source_id);
 }
 }}} // namespace liblas::detail::reader


More information about the Liblas-commits mailing list