[Liblas-commits] r1016 - in trunk: include/liblas/detail src/detail

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Feb 11 14:31:35 EST 2009


Author: hobu
Date: Wed Feb 11 14:31:35 2009
New Revision: 1016
URL: http://liblas.org/changeset/1016

Log:
reorganize reader and writer Impl to put redundant VLR-related operations in the Reader:: and Writer:: abstract classes instead of each Impl

Modified:
   trunk/include/liblas/detail/reader.hpp
   trunk/include/liblas/detail/reader10.hpp
   trunk/include/liblas/detail/reader11.hpp
   trunk/include/liblas/detail/reader12.hpp
   trunk/include/liblas/detail/writer.hpp
   trunk/include/liblas/detail/writer10.hpp
   trunk/include/liblas/detail/writer11.hpp
   trunk/include/liblas/detail/writer12.hpp
   trunk/src/detail/reader.cpp
   trunk/src/detail/reader10.cpp
   trunk/src/detail/reader11.cpp
   trunk/src/detail/reader12.cpp
   trunk/src/detail/writer.cpp
   trunk/src/detail/writer10.cpp
   trunk/src/detail/writer11.cpp
   trunk/src/detail/writer12.cpp

Modified: trunk/include/liblas/detail/reader.hpp
==============================================================================
--- trunk/include/liblas/detail/reader.hpp	(original)
+++ trunk/include/liblas/detail/reader.hpp	Wed Feb 11 14:31:35 2009
@@ -61,9 +61,10 @@
     virtual bool ReadHeader(LASHeader& header) = 0;
     virtual bool ReadNextPoint(LASPoint& point, const LASHeader& header) = 0;
     virtual bool ReadPointAt(std::size_t n, LASPoint& point, const LASHeader& header) = 0;
-    virtual bool ReadVLR(LASHeader& header) = 0;
-    virtual bool ReadGeoreference(LASHeader& header) = 0; 
+
     std::istream& GetStream() const;
+    bool ReadVLR(LASHeader& header);
+    bool ReadGeoreference(LASHeader& header);
     
 protected:
     

Modified: trunk/include/liblas/detail/reader10.hpp
==============================================================================
--- trunk/include/liblas/detail/reader10.hpp	(original)
+++ trunk/include/liblas/detail/reader10.hpp	Wed Feb 11 14:31:35 2009
@@ -60,8 +60,6 @@
     bool ReadHeader(LASHeader& header);
     bool ReadNextPoint(LASPoint& point, const LASHeader& header);
     bool ReadPointAt(std::size_t n, LASPoint& record, const LASHeader& header);
-    bool ReadVLR(LASHeader& header);
-    bool ReadGeoreference(LASHeader& header); 
 
 };
 

Modified: trunk/include/liblas/detail/reader11.hpp
==============================================================================
--- trunk/include/liblas/detail/reader11.hpp	(original)
+++ trunk/include/liblas/detail/reader11.hpp	Wed Feb 11 14:31:35 2009
@@ -60,8 +60,6 @@
     bool ReadHeader(LASHeader& header);
     bool ReadNextPoint(LASPoint& point, const LASHeader& header);
     bool ReadPointAt(std::size_t n, LASPoint& record, const LASHeader& header);
-    bool ReadGeoreference(LASHeader& header); 
-    bool ReadVLR(LASHeader& header);
 
 };
 

Modified: trunk/include/liblas/detail/reader12.hpp
==============================================================================
--- trunk/include/liblas/detail/reader12.hpp	(original)
+++ trunk/include/liblas/detail/reader12.hpp	Wed Feb 11 14:31:35 2009
@@ -60,8 +60,6 @@
     bool ReadHeader(LASHeader& header);
     bool ReadNextPoint(LASPoint& point, const LASHeader& header);
     bool ReadPointAt(std::size_t n, LASPoint& record, const LASHeader& header);
-    bool ReadGeoreference(LASHeader& header); 
-    bool ReadVLR(LASHeader& header);
 
 };
 

Modified: trunk/include/liblas/detail/writer.hpp
==============================================================================
--- trunk/include/liblas/detail/writer.hpp	(original)
+++ trunk/include/liblas/detail/writer.hpp	Wed Feb 11 14:31:35 2009
@@ -60,8 +60,8 @@
     virtual void WriteHeader(LASHeader& header) = 0;
     virtual void UpdateHeader(LASHeader const& header) = 0;
     virtual void WritePointRecord(LASPoint const& point, const LASHeader& header) = 0;
-    virtual void WriteVLR(LASHeader const& header) = 0;
     std::ostream& GetStream() const;
+    void WriteVLR(LASHeader const& header);
 
 protected:
     PointRecord m_record;

Modified: trunk/include/liblas/detail/writer10.hpp
==============================================================================
--- trunk/include/liblas/detail/writer10.hpp	(original)
+++ trunk/include/liblas/detail/writer10.hpp	Wed Feb 11 14:31:35 2009
@@ -61,7 +61,6 @@
     void WriteHeader(LASHeader& header);
     void UpdateHeader(LASHeader const& header);
     void WritePointRecord(LASPoint const& record, const LASHeader& header);
-    void WriteVLR(LASHeader const& header);
 
 private:
 

Modified: trunk/include/liblas/detail/writer11.hpp
==============================================================================
--- trunk/include/liblas/detail/writer11.hpp	(original)
+++ trunk/include/liblas/detail/writer11.hpp	Wed Feb 11 14:31:35 2009
@@ -61,7 +61,6 @@
     void WriteHeader(LASHeader& header);
     void UpdateHeader(LASHeader const& header);
     void WritePointRecord(LASPoint const& record, const LASHeader& header);
-    void WriteVLR(LASHeader const& header);
     
 private:
     

Modified: trunk/include/liblas/detail/writer12.hpp
==============================================================================
--- trunk/include/liblas/detail/writer12.hpp	(original)
+++ trunk/include/liblas/detail/writer12.hpp	Wed Feb 11 14:31:35 2009
@@ -61,7 +61,6 @@
     void WriteHeader(LASHeader& header);
     void UpdateHeader(LASHeader const& header);
     void WritePointRecord(LASPoint const& record, const LASHeader& header);
-    void WriteVLR(LASHeader const& header);
     
 private:
 

Modified: trunk/src/detail/reader.cpp
==============================================================================
--- trunk/src/detail/reader.cpp	(original)
+++ trunk/src/detail/reader.cpp	Wed Feb 11 14:31:35 2009
@@ -46,6 +46,15 @@
 #include <liblas/lasheader.hpp>
 #include <liblas/laspoint.hpp>
 
+// GeoTIFF
+#ifdef HAVE_LIBGEOTIFF
+#include <geotiff.h>
+#include <geo_simpletags.h>
+#include "geo_normalize.h"
+#include "geo_simpletags.h"
+#include "geovalues.h"
+#endif // HAVE_LIBGEOTIFF
+
 // std
 #include <fstream>
 #include <cassert>
@@ -80,6 +89,97 @@
     point.SetPointSourceID(record.point_source_id);
 }
 
+
+bool Reader::ReadVLR(LASHeader& header)
+{
+    VLRHeader vlrh = { 0 };
+
+    m_ifs.seekg(header.GetHeaderSize(), std::ios::beg);
+    uint32_t count = header.GetRecordsCount();
+    header.SetRecordsCount(0);
+    for (uint32_t i = 0; i < count; ++i)
+    {
+        read_n(vlrh, m_ifs, sizeof(VLRHeader));
+
+        uint16_t length = vlrh.recordLengthAfterHeader;
+        if (length < 1) {
+            throw std::domain_error("VLR record length must be at least 1 byte long");
+        }
+         
+        std::vector<uint8_t> data;
+        data.resize(length);
+
+        read_n(data.front(), m_ifs, length);
+         
+        LASVLR vlr;
+        vlr.SetReserved(vlrh.reserved);
+        vlr.SetUserId(std::string(vlrh.userId));
+        vlr.SetDescription(std::string(vlrh.description));
+        vlr.SetRecordLength(vlrh.recordLengthAfterHeader);
+        vlr.SetRecordId(vlrh.recordId);
+        vlr.SetData(data);
+
+        header.AddVLR(vlr);
+    }
+
+    return true;
+}
+
+bool Reader::ReadGeoreference(LASHeader& header)
+{
+#ifndef HAVE_LIBGEOTIFF
+    UNREFERENCED_PARAMETER(header);
+#else
+
+    std::string const uid("LASF_Projection");
+
+    detail::raii_wrapper<ST_TIFF> st(ST_Create(), ST_Destroy);
+
+    for (uint16_t i = 0; i < header.GetRecordsCount(); ++i)
+    {
+        LASVLR record = header.GetVLR(i);
+        std::vector<uint8_t> data = record.GetData();
+        if (uid == record.GetUserId(true).c_str() && 34735 == record.GetRecordId())
+        {
+            int count = data.size()/sizeof(int16_t);
+            ST_SetKey(st.get(), record.GetRecordId(), count, STT_SHORT, &(data[0]));
+        }
+
+        if (uid == record.GetUserId(true).c_str() && 34736 == record.GetRecordId())
+        {
+            int count = data.size() / sizeof(double);
+            ST_SetKey(st.get(), record.GetRecordId(), count, STT_DOUBLE, &(data[0]));
+        }        
+
+        if (uid == record.GetUserId(true).c_str() && 34737 == record.GetRecordId())
+        {
+            int count = data.size()/sizeof(uint8_t);
+            ST_SetKey(st.get(), record.GetRecordId(), count, STT_ASCII, &(data[0]));
+        }
+    }
+
+    if (st.get()->key_count)
+    {
+        raii_wrapper<GTIF> gtif(GTIFNewSimpleTags(st.get()), GTIFFree);
+
+        GTIFDefn defn;
+        if (GTIFGetDefn(gtif.get(), &defn)) 
+        {
+            char* proj4def = GTIFGetProj4Defn(&defn);
+            std::string tmp(proj4def);
+            std::free(proj4def);
+
+            header.SetProj4(tmp);
+        }
+        
+        return true;
+    }
+
+#endif /* def HAVE_LIBGEOTIFF */
+
+    return false;
+}
+
 Reader* ReaderFactory::Create(std::istream& ifs)
 {
     if (!ifs)

Modified: trunk/src/detail/reader10.cpp
==============================================================================
--- trunk/src/detail/reader10.cpp	(original)
+++ trunk/src/detail/reader10.cpp	Wed Feb 11 14:31:35 2009
@@ -45,14 +45,7 @@
 #include <liblas/liblas.hpp>
 #include <liblas/lasheader.hpp>
 #include <liblas/laspoint.hpp>
-// GeoTIFF
-#ifdef HAVE_LIBGEOTIFF
-#include <geotiff.h>
-#include <geo_simpletags.h>
-#include "geo_normalize.h"
-#include "geo_simpletags.h"
-#include "geovalues.h"
-#endif // HAVE_LIBGEOTIFF
+
 // std
 #include <fstream>
 #include <iostream>
@@ -221,96 +214,6 @@
     return true;
 }
 
-bool ReaderImpl::ReadVLR(LASHeader& header)
-{
-    VLRHeader vlrh = { 0 };
-
-    m_ifs.seekg(header.GetHeaderSize(), std::ios::beg);
-    uint32_t count = header.GetRecordsCount();
-    header.SetRecordsCount(0);
-    for (uint32_t i = 0; i < count; ++i)
-    {
-        read_n(vlrh, m_ifs, sizeof(VLRHeader));
-
-        uint16_t length = vlrh.recordLengthAfterHeader;
-        if (length < 1) {
-            throw std::domain_error("VLR record length must be at least 1 byte long");
-        }
-         
-        std::vector<uint8_t> data;
-        data.resize(length);
-
-        read_n(data.front(), m_ifs, length);
-         
-        LASVLR vlr;
-        vlr.SetReserved(vlrh.reserved);
-        vlr.SetUserId(std::string(vlrh.userId));
-        vlr.SetDescription(std::string(vlrh.description));
-        vlr.SetRecordLength(vlrh.recordLengthAfterHeader);
-        vlr.SetRecordId(vlrh.recordId);
-        vlr.SetData(data);
-
-        header.AddVLR(vlr);
-    }
-
-    return true;
-}
-
-bool ReaderImpl::ReadGeoreference(LASHeader& header)
-{
-#ifndef HAVE_LIBGEOTIFF
-    UNREFERENCED_PARAMETER(header);
-#else
-
-    std::string const uid("LASF_Projection");
-
-    detail::raii_wrapper<ST_TIFF> st(ST_Create(), ST_Destroy);
-
-    for (uint16_t i = 0; i < header.GetRecordsCount(); ++i)
-    {
-        LASVLR record = header.GetVLR(i);
-        std::vector<uint8_t> data = record.GetData();
-        if (uid == record.GetUserId(true).c_str() && 34735 == record.GetRecordId())
-        {
-            int count = data.size()/sizeof(int16_t);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_SHORT, &(data[0]));
-        }
-
-        if (uid == record.GetUserId(true).c_str() && 34736 == record.GetRecordId())
-        {
-            int count = data.size() / sizeof(double);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_DOUBLE, &(data[0]));
-        }        
-
-        if (uid == record.GetUserId(true).c_str() && 34737 == record.GetRecordId())
-        {
-            int count = data.size()/sizeof(uint8_t);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_ASCII, &(data[0]));
-        }
-    }
-
-    if (st.get()->key_count)
-    {
-        raii_wrapper<GTIF> gtif(GTIFNewSimpleTags(st.get()), GTIFFree);
-
-        GTIFDefn defn;
-        if (GTIFGetDefn(gtif.get(), &defn)) 
-        {
-            char* proj4def = GTIFGetProj4Defn(&defn);
-            std::string tmp(proj4def);
-            std::free(proj4def);
-
-            header.SetProj4(tmp);
-        }
-        
-        return true;
-    }
-
-#endif /* def HAVE_LIBGEOTIFF */
-
-    return false;
-}
-
 bool ReaderImpl::ReadNextPoint(LASPoint& point, const LASHeader& header)
 {
     // Read point data record format 0

Modified: trunk/src/detail/reader11.cpp
==============================================================================
--- trunk/src/detail/reader11.cpp	(original)
+++ trunk/src/detail/reader11.cpp	Wed Feb 11 14:31:35 2009
@@ -45,14 +45,7 @@
 #include <liblas/lasheader.hpp>
 #include <liblas/laspoint.hpp>
 #include <liblas/lasrecordheader.hpp>
-// GeoTIFF
-#ifdef HAVE_LIBGEOTIFF
-#include <geotiff.h>
-#include <geo_simpletags.h>
-#include "geo_normalize.h"
-#include "geo_simpletags.h"
-#include "geovalues.h"
-#endif //  HAVE_LIBGEOTIFF
+
 // std
 #include <fstream>
 #include <iostream>
@@ -298,99 +291,5 @@
 }
 
 
-bool ReaderImpl::ReadVLR(LASHeader& header)
-{
-    VLRHeader vlrh = { 0 };
-
-    m_ifs.seekg(header.GetHeaderSize(), std::ios::beg);
-    uint32_t count = header.GetRecordsCount();
-    header.SetRecordsCount(0);
-    
-    for (uint32_t i = 0; i < count; ++i)
-    {
-
-        read_n(vlrh, m_ifs, sizeof(VLRHeader));
-        
-
-        uint16_t length = vlrh.recordLengthAfterHeader;
-        
-        if (length < 1) {
-            throw std::domain_error("VLR record length must be at least 1 byte long");
-        }
-         
-        std::vector<uint8_t> data;
-        data.resize(length);
-
-        read_n(data.front(), m_ifs, length);
-
-        LASVLR vlr;
-        vlr.SetReserved(vlrh.reserved);
-        vlr.SetUserId(std::string(vlrh.userId));
-        vlr.SetDescription(std::string(vlrh.description));
-        vlr.SetRecordLength(vlrh.recordLengthAfterHeader);
-        vlr.SetRecordId(vlrh.recordId);
-        vlr.SetData(data);
-
-        header.AddVLR(vlr);
-
-    }
-
-    return true;
-}
-bool ReaderImpl::ReadGeoreference(LASHeader& header)
-{
-#ifndef HAVE_LIBGEOTIFF
-    UNREFERENCED_PARAMETER(header);
-#else
-
-    std::string const uid("LASF_Projection");
-
-    detail::raii_wrapper<ST_TIFF> st(ST_Create(), ST_Destroy);
-
-    for (uint16_t i = 0; i < header.GetRecordsCount(); ++i)
-    {
-        LASVLR record = header.GetVLR(i);
-        std::vector<uint8_t> data = record.GetData();
-        if (uid == record.GetUserId(true).c_str() && 34735 == record.GetRecordId())
-        {
-            int count = data.size()/sizeof(int16_t);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_SHORT, &(data[0]));
-        }
-
-        if (uid == record.GetUserId(true).c_str() && 34736 == record.GetRecordId())
-        {
-            int count = data.size() / sizeof(double);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_DOUBLE, &(data[0]));
-        }        
-
-        if (uid == record.GetUserId(true).c_str() && 34737 == record.GetRecordId())
-        {
-            int count = data.size()/sizeof(uint8_t);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_ASCII, &(data[0]));
-        }
-    }
-
-    if (st.get()->key_count)
-    {
-        raii_wrapper<GTIF> gtif(GTIFNewSimpleTags(st.get()), GTIFFree);
-
-        GTIFDefn defn;
-        if (GTIFGetDefn(gtif.get(), &defn)) 
-        {
-            char* proj4def = GTIFGetProj4Defn(&defn);
-            std::string tmp(proj4def);
-            std::free(proj4def);
-
-            header.SetProj4(tmp);
-        }
-        
-        return true;
-    }
-
-#endif /* def HAVE_LIBGEOTIFF */
-
-    return false;
-}
-
 }}} // namespace liblas::detail::v11
 

Modified: trunk/src/detail/reader12.cpp
==============================================================================
--- trunk/src/detail/reader12.cpp	(original)
+++ trunk/src/detail/reader12.cpp	Wed Feb 11 14:31:35 2009
@@ -46,14 +46,7 @@
 #include <liblas/laspoint.hpp>
 #include <liblas/lasrecordheader.hpp>
 #include <liblas/lascolor.hpp>
-// GeoTIFF
-#ifdef HAVE_LIBGEOTIFF
-#include <geotiff.h>
-#include <geo_simpletags.h>
-#include "geo_normalize.h"
-#include "geo_simpletags.h"
-#include "geovalues.h"
-#endif //  HAVE_LIBGEOTIFF
+
 // std
 #include <fstream>
 #include <iostream>
@@ -347,99 +340,6 @@
     return true;
 }
 
-bool ReaderImpl::ReadVLR(LASHeader& header)
-{
-    VLRHeader vlrh = { 0 };
-
-    m_ifs.seekg(header.GetHeaderSize(), std::ios::beg);
-    uint32_t count = header.GetRecordsCount();
-    header.SetRecordsCount(0);
-    
-    for (uint32_t i = 0; i < count; ++i)
-    {
-
-        read_n(vlrh, m_ifs, sizeof(VLRHeader));
-        
-
-        uint16_t length = vlrh.recordLengthAfterHeader;
-        
-        if (length < 1) {
-            throw std::domain_error("VLR record length must be at least 1 byte long");
-        }
-         
-        std::vector<uint8_t> data;
-        data.resize(length);
-
-        read_n(data.front(), m_ifs, length);
-
-        LASVLR vlr;
-        vlr.SetReserved(vlrh.reserved);
-        vlr.SetUserId(std::string(vlrh.userId));
-        vlr.SetDescription(std::string(vlrh.description));
-        vlr.SetRecordLength(vlrh.recordLengthAfterHeader);
-        vlr.SetRecordId(vlrh.recordId);
-        vlr.SetData(data);
-
-        header.AddVLR(vlr);
-
-    }
-
-    return true;
-}
-bool ReaderImpl::ReadGeoreference(LASHeader& header)
-{
-#ifndef HAVE_LIBGEOTIFF
-    UNREFERENCED_PARAMETER(header);
-#else
-
-    std::string const uid("LASF_Projection");
-
-    detail::raii_wrapper<ST_TIFF> st(ST_Create(), ST_Destroy);
-
-    for (uint16_t i = 0; i < header.GetRecordsCount(); ++i)
-    {
-        LASVLR record = header.GetVLR(i);
-        std::vector<uint8_t> data = record.GetData();
-        if (uid == record.GetUserId(true).c_str() && 34735 == record.GetRecordId())
-        {
-            int count = data.size()/sizeof(int16_t);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_SHORT, &(data[0]));
-        }
-
-        if (uid == record.GetUserId(true).c_str() && 34736 == record.GetRecordId())
-        {
-            int count = data.size() / sizeof(double);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_DOUBLE, &(data[0]));
-        }        
-
-        if (uid == record.GetUserId(true).c_str() && 34737 == record.GetRecordId())
-        {
-            int count = data.size()/sizeof(uint8_t);
-            ST_SetKey(st.get(), record.GetRecordId(), count, STT_ASCII, &(data[0]));
-        }
-    }
-
-    if (st.get()->key_count)
-    {
-        raii_wrapper<GTIF> gtif(GTIFNewSimpleTags(st.get()), GTIFFree);
-
-        GTIFDefn defn;
-        if (GTIFGetDefn(gtif.get(), &defn)) 
-        {
-            char* proj4def = GTIFGetProj4Defn(&defn);
-            std::string tmp(proj4def);
-            std::free(proj4def);
-
-            header.SetProj4(tmp);
-        }
-        
-        return true;
-    }
-
-#endif /* def HAVE_LIBGEOTIFF */
-
-    return false;
-}
 
 }}} // namespace liblas::detail::v11
 

Modified: trunk/src/detail/writer.cpp
==============================================================================
--- trunk/src/detail/writer.cpp	(original)
+++ trunk/src/detail/writer.cpp	Wed Feb 11 14:31:35 2009
@@ -66,6 +66,7 @@
     return m_ofs;
 }
 
+
 void Writer::FillPointRecord(PointRecord& record, const LASPoint& point, const LASHeader& header) 
 {
     record.x = static_cast<int32_t>((point.GetX() - header.GetOffsetX()) / header.GetScaleX());

Modified: trunk/src/detail/writer10.cpp
==============================================================================
--- trunk/src/detail/writer10.cpp	(original)
+++ trunk/src/detail/writer10.cpp	Wed Feb 11 14:31:35 2009
@@ -243,24 +243,4 @@
     ++m_pointCount;
 }
 
-void WriterImpl::WriteVLR(LASHeader const& header) 
-{
-    m_ofs.seekp(header.GetHeaderSize(), std::ios::beg);
-
-    for (uint32_t i = 0; i < header.GetRecordsCount(); ++i)
-    {
-        LASVLR vlr = header.GetVLR(i);
-
-        detail::write_n(m_ofs, vlr.GetReserved(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetUserId(true).c_str(), 16);
-        detail::write_n(m_ofs, vlr.GetRecordId(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetRecordLength(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetDescription(true).c_str(), 32);
-        std::vector<uint8_t> const& data = vlr.GetData();
-        std::streamsize const size = static_cast<std::streamsize>(data.size());
-        detail::write_n(m_ofs, data.front(), size);
-    }
-}
-
-
 }}} // namespace liblas::detail::v10

Modified: trunk/src/detail/writer11.cpp
==============================================================================
--- trunk/src/detail/writer11.cpp	(original)
+++ trunk/src/detail/writer11.cpp	Wed Feb 11 14:31:35 2009
@@ -244,25 +244,5 @@
     ++m_pointCount;
 }
 
-
-void WriterImpl::WriteVLR(LASHeader const& header) 
-{
-    m_ofs.seekp(header.GetHeaderSize(), std::ios::beg);
- 
-    for (uint32_t i = 0; i < header.GetRecordsCount(); ++i)
-    {
-        LASVLR vlr = header.GetVLR(i);
-        
-        detail::write_n(m_ofs, vlr.GetReserved(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetUserId(true).c_str(), 16);
-        detail::write_n(m_ofs, vlr.GetRecordId(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetRecordLength(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetDescription(true).c_str(), 32);
-        std::vector<uint8_t> const& data = vlr.GetData();
-        std::streamsize const size = static_cast<std::streamsize>(data.size());
-        detail::write_n(m_ofs, data.front(), size);
-    }
-}
-
 }}} // namespace liblas::detail::v11
 

Modified: trunk/src/detail/writer12.cpp
==============================================================================
--- trunk/src/detail/writer12.cpp	(original)
+++ trunk/src/detail/writer12.cpp	Wed Feb 11 14:31:35 2009
@@ -269,25 +269,5 @@
     ++m_pointCount;
 }
 
-void WriterImpl::WriteVLR(LASHeader const& header) 
-{
-    m_ofs.seekp(header.GetHeaderSize(), std::ios::beg);
- 
-    for (uint32_t i = 0; i < header.GetRecordsCount(); ++i)
-    {
-        LASVLR vlr = header.GetVLR(i);
-        
-        detail::write_n(m_ofs, vlr.GetReserved(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetUserId(true).c_str(), 16);
-        detail::write_n(m_ofs, vlr.GetRecordId(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetRecordLength(), sizeof(uint16_t));
-        detail::write_n(m_ofs, vlr.GetDescription(true).c_str(), 32);
-        std::vector<uint8_t> const& data = vlr.GetData();
-        std::streamsize const size = static_cast<std::streamsize>(data.size());
-        detail::write_n(m_ofs, data.front(), size);
-    }
-}
-
-
 }}} // namespace liblas::detail::v12
 


More information about the Liblas-commits mailing list