[Liblas-commits] hg: both compressed and capacity can't be -c. In our case, we'l...

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Jan 13 09:17:46 EST 2011


details:   http://hg.liblas.orghg/rev/fecc2fb1ef2a
changeset: 2746:fecc2fb1ef2a
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Jan 13 08:17:17 2011 -0600
description:
both compressed and capacity can't be -c.  In our case, we'll keep capacity's short, which had precedence.
Subject: hg: merge

details:   http://hg.liblas.orghg/rev/f8ae92d489ba
changeset: 2747:f8ae92d489ba
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Jan 13 08:17:27 2011 -0600
description:
merge

diffstat:

 apps/lasblock.cpp                                   |    2 +-
 csharp-new/liblas_swig_cpp/liblas.i                 |   65 +++++--
 csharp-new/liblas_swig_cpp/liblas_swig_cpp.vcxproj  |   32 +--
 csharp-new/liblas_swig_cs/liblas_swig_cs.csproj     |    5 +-
 csharp-new/liblas_swig_test/Program.cs              |  168 ++++++++++++++++---
 csharp-new/liblas_swig_test/TestGuid.cs             |   35 ++++
 csharp-new/liblas_swig_test/TestHeader.cs           |   74 ++++++++
 csharp-new/liblas_swig_test/TestPoint.cs            |   46 +++++
 csharp-new/liblas_swig_test/TestReader.cs           |   31 +++
 csharp-new/liblas_swig_test/TestSpatialReference.cs |   23 ++
 csharp-new/liblas_swig_test/TestVariableRecord.cs   |   47 +++++
 csharp-new/liblas_swig_test/liblas_swig_test.csproj |    5 +-
 include/liblas/factory.hpp                          |    2 +
 src/detail/writer/header.cpp                        |    1 +
 src/detail/zippoint.cpp                             |    3 +
 src/factory.cpp                                     |   18 ++
 16 files changed, 481 insertions(+), 76 deletions(-)

diffs (truncated from 830 to 300 lines):

diff -r c69c66976907 -r f8ae92d489ba apps/lasblock.cpp
--- a/apps/lasblock.cpp	Wed Jan 12 14:32:23 2011 -0600
+++ b/apps/lasblock.cpp	Thu Jan 13 08:17:27 2011 -0600
@@ -248,7 +248,7 @@
             ("precision,p", po::value<long>(&precision)->default_value(8), "Number of decimal points to write for each bbox")
             ("stdout", po::value<bool>(&bUseStdout)->zero_tokens()->implicit_value(true), "Output data to stdout")
             ("write-points", po::value<bool>(&tiling)->zero_tokens()->implicit_value(true), "Write .las files for each block instead of an index file")
-            ("compressed,c", po::value<bool>(&bCompressed)->zero_tokens()->implicit_value(true), "Produce .laz compressed data for --write-points tiles")
+            ("compressed", po::value<bool>(&bCompressed)->zero_tokens()->implicit_value(true), "Produce .laz compressed data for --write-points tiles")
 
             ("input,i", po::value< std::string >(), "input LAS file")
             ("output,o", po::value< std::string >(&output)->default_value(""), "The output .kdx file (defaults to input filename + .kdx)")
diff -r c69c66976907 -r f8ae92d489ba csharp-new/liblas_swig_cpp/liblas.i
--- a/csharp-new/liblas_swig_cpp/liblas.i	Wed Jan 12 14:32:23 2011 -0600
+++ b/csharp-new/liblas_swig_cpp/liblas.i	Thu Jan 13 08:17:27 2011 -0600
@@ -38,12 +38,13 @@
  * OF SUCH DAMAGE.
  ****************************************************************************/
  
-%module WrapperCpp
+%module liblas_swig_cpp
 
 %{
 #include "liblas/liblas.hpp"
 #include "liblas/version.hpp"
 #include "liblas/reader.hpp"
+#include "liblas/writer.hpp"
 #include "liblas/classification.hpp"
 #include "liblas/header.hpp"
 #include "liblas/point.hpp"
@@ -105,8 +106,8 @@
 class guid
 {
 public:
-    std::string to_string() const;
-    //void output_data(boost::uint32_t& d1, boost::uint16_t& d2, boost::uint16_t& d3, boost::uint8_t (&d4)[8]) const;
+    guid(char const* const str);
+    std::string to_string() const;
 };
 
 
@@ -175,13 +176,11 @@
 class VariableRecord
 {
 public:
-    boost::uint16_t GetReserved() const;
-    std::string GetUserId(bool pad ) const;
+    std::string GetUserId(bool pad) const;
     boost::uint16_t GetRecordId() const;
     boost::uint16_t GetRecordLength() const;
-    std::string GetDescription(bool pad ) const;
+    std::string GetDescription(bool pad) const;
     std::vector<boost::uint8_t> const& GetData() const;
-    std::size_t GetTotalSize() const;
 };
 
 
@@ -213,17 +212,30 @@
 class Header
 {
 public:
+    Header(Header const& other);
+
     std::string GetFileSignature() const;
     boost::uint16_t GetFileSourceId() const;
+    void SetFileSourceId(boost::uint16_t v);
     guid GetProjectId() const;
+    void SetProjectId(guid const& v);
     boost::uint8_t GetVersionMajor() const;
+    void SetVersionMajor(boost::uint8_t v);
     boost::uint8_t GetVersionMinor() const;
+    void SetVersionMinor(boost::uint8_t v);
     std::string GetSystemId(bool pad = false) const;
+    void SetSystemId(std::string const& v);
     std::string GetSoftwareId(bool pad = false) const;
+    void SetSoftwareId(std::string const& v);
     boost::uint16_t GetCreationDOY() const;
+    void SetCreationDOY(boost::uint16_t v);
     boost::uint16_t GetCreationYear() const;
+    void SetCreationYear(boost::uint16_t v);
+
+    PointFormatName GetDataFormatId() const;
+    void SetDataFormatId(PointFormatName v);
+
     boost::uint32_t GetRecordsCount() const;
-    PointFormatName GetDataFormatId() const;
     boost::uint32_t GetPointRecordsCount() const;
 
     double GetScaleX() const;
@@ -238,12 +250,17 @@
     double GetMinY() const;
     double GetMaxZ() const;
     double GetMinZ() const;
+    void SetScale(double x, double y, double z);
+    void SetOffset(double x, double y, double z);
+    void SetMax(double x, double y, double z);
+    void SetMin(double x, double y, double z);
 
     const std::vector<VariableRecord>& GetVLRs() const;
 
     SpatialReference GetSRS() const;
 
     bool Compressed() const;
+    void SetCompressed(bool b);
 };
 
 
@@ -266,30 +283,34 @@
 
 //---------------------------------------------------------------------------
 
+class Writer
+{
+public:
+    Writer(std::ostream& ofs, Header const& header);
+    Header const& GetHeader() const;
+    bool WritePoint(Point const& point);
+    //void WriteHeader(Header& header);
+    //void SetFilters(std::vector<liblas::FilterPtr> const& filters);
+    //void SetTransforms(std::vector<liblas::TransformPtr> const& transforms);
+};
+
+//---------------------------------------------------------------------------
+
+
 class ReaderFactory
 {
 public:
     Reader CreateCached(std::istream& stream, boost::uint32_t cache_size);
     Reader CreateWithStream(std::istream& stream);
     static std::istream* FileOpen(std::string const& filename);
+    static void FileClose(std::istream*);
 };
 
-
-//---------------------------------------------------------------------------
-
 class WriterFactory
 {
 public:
-    enum FileType
-    {
-        FileType_Unknown,
-        FileType_LAS,
-        FileType_LAZ
-    };
-
-    //static WriterIPtr CreateWithStream(std::ostream& stream, Header const& header); 
-    static FileType InferFileTypeFromExtension(const std::string&);
-    static std::ostream* WriterFactory::FileCreate(std::string const& filename);
+    static std::ostream* FileCreate(std::string const& filename);
+    static void FileClose(std::ostream*);
 };
 
-}; // end namespace
+}; // namespace
diff -r c69c66976907 -r f8ae92d489ba csharp-new/liblas_swig_cpp/liblas_swig_cpp.vcxproj
--- a/csharp-new/liblas_swig_cpp/liblas_swig_cpp.vcxproj	Wed Jan 12 14:32:23 2011 -0600
+++ b/csharp-new/liblas_swig_cpp/liblas_swig_cpp.vcxproj	Thu Jan 13 08:17:27 2011 -0600
@@ -23,34 +23,28 @@
       <FileType>Document</FileType>
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">swig.exe -c++ -csharp -outdir ../liblas_swig_cs -namespace Liblas -o liblas_wrap.cpp "%(FullPath)"
 </Command>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo Invoking SWIG...
-echo on
-..\..\..\swig.exe -csharp "%(FullPath)"
-%40echo off
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">swig.exe -c++ -csharp -outdir ../liblas_swig_cs -namespace Liblas -o liblas_wrap.cpp "%(FullPath)"
 </Command>
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
       </AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo Invoking SWIG...
-echo on
-..\..\..\swig.exe -csharp "%(FullPath)"
-%40echo off
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">swig.exe -c++ -csharp -outdir ../liblas_swig_cs -namespace Liblas -o liblas_wrap.cpp "%(FullPath)"
 </Command>
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
       </AdditionalInputs>
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
       </AdditionalInputs>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo Invoking SWIG...
-echo on
-..\..\..\swig.exe -csharp "%(FullPath)"
-%40echo off
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">swig.exe -c++ -csharp -outdir ../liblas_swig_cs -namespace Liblas -o liblas_wrap.cpp "%(FullPath)"
 </Command>
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
       </AdditionalInputs>
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Filename)_wrap.cpp;%(Outputs)</Outputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)_wrap.c;%(Outputs)</Outputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)_wrap.c;%(Outputs)</Outputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Filename)_wrap.c;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)_wrap.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)_wrap.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Filename)_wrap.cpp;%(Outputs)</Outputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Invoking SWIG...</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Invoking SWIG...</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Invoking SWIG...</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Invoking SWIG...</Message>
     </CustomBuild>
   </ItemGroup>
   <ItemGroup>
@@ -130,9 +124,9 @@
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>C:\Program Files (x86)\boost\boost_1_44\lib\libboost_program_options-vc100-mt-gd-1_44.lib;%(AdditionalDependencies);C:\Program Files (x86)\boost\boost_1_44\lib\libboost_serialization-vc100-mt-gd-1_44.lib;c:\dev\liblas\bin\RelWithDebInfo\Debug\liblas.lib</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies);c:\dev\liblas\bin\Debug\Debug\liblas.lib</AdditionalDependencies>
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>C:/Program Files (x86)/boost/boost_1_44/lib;C:/Program Files (x86)/boost/boost_1_44/lib/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -148,7 +142,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <AdditionalDependencies>%(AdditionalDependencies);c:\dev\liblas\bin\Debug\Debug\liblas.lib</AdditionalDependencies>
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
-      <AdditionalLibraryDirectories>C:/Program Files (x86)/boost/boost_1_44/lib;C:/Program Files (x86)/boost/boost_1_44/lib/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>C:\Program Files (x86)\boost\boost_1_44\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -162,6 +156,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>%(AdditionalDependencies);c:\dev\liblas\bin\Release\Release\liblas.lib</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -175,6 +170,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>%(AdditionalDependencies);c:\dev\liblas\bin\Release\Release\liblas.lib</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff -r c69c66976907 -r f8ae92d489ba csharp-new/liblas_swig_cs/liblas_swig_cs.csproj
--- a/csharp-new/liblas_swig_cs/liblas_swig_cs.csproj	Wed Jan 12 14:32:23 2011 -0600
+++ b/csharp-new/liblas_swig_cs/liblas_swig_cs.csproj	Thu Jan 13 08:17:27 2011 -0600
@@ -91,6 +91,8 @@
     <Compile Include="Color.cs" />
     <Compile Include="guid.cs" />
     <Compile Include="Header.cs" />
+    <Compile Include="liblas_swig_cpp.cs" />
+    <Compile Include="liblas_swig_cppPINVOKE.cs" />
     <Compile Include="Point.cs" />
     <Compile Include="PointFormatName.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -103,8 +105,7 @@
     <Compile Include="VectorU32.cs" />
     <Compile Include="VectorU8.cs" />
     <Compile Include="VectorVariableRecord.cs" />
-    <Compile Include="WrapperCpp.cs" />
-    <Compile Include="WrapperCppPINVOKE.cs" />
+    <Compile Include="Writer.cs" />
     <Compile Include="WriterFactory.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
diff -r c69c66976907 -r f8ae92d489ba csharp-new/liblas_swig_test/Program.cs
--- a/csharp-new/liblas_swig_test/Program.cs	Wed Jan 12 14:32:23 2011 -0600
+++ b/csharp-new/liblas_swig_test/Program.cs	Thu Jan 13 08:17:27 2011 -0600
@@ -50,6 +50,10 @@
 {
    public class Program
    {
+      static string fileA = @"..\..\test\data\1.2-with-color.las";
+      static string fileB = @"..\..\test\data\1.2-with-color.laz";
+      static string fileT = @"tmp.laz";
+      
       static public bool IsApprox(double a, double b, double tol)
       {
          double min = Math.Min(a, b);
@@ -62,43 +66,143 @@
 
       static int Main(string[] args)
       {
-         string fileA = @"..\..\test\data\1.2-with-color.las";
-         string fileB = @"..\..\test\data\1.2-with-color.laz";
-         ReaderFactory factory = new ReaderFactory();
+         // reader tests for A
+         Test_ReadA();
 
-         // tests for A
-         {
-            SWIGTYPE_p_std__istream ifs = Liblas.ReaderFactory.FileOpen(fileA);
+         // reader tests for B
+         Test_ReadB();
 
-            Reader reader = factory.CreateWithStream(ifs);
-            TestReader.Test_A(reader);
+         // writer tests
+         Test_WriteT();
 
-            Header header = reader.GetHeader();
-            TestHeader.Test_A(header);
-


More information about the Liblas-commits mailing list