[Liblas-commits] libpc: unused

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 15 13:44:35 EDT 2011


details:   http://hg.liblas.orglibpc/rev/03e610e04788
changeset: 231:03e610e04788
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Mon Mar 14 11:30:00 2011 -0700
description:
unused
Subject: libpc: make less chatty; fix libpc/liblas typo

details:   http://hg.liblas.orglibpc/rev/c65135ad4d3f
changeset: 232:c65135ad4d3f
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Mon Mar 14 11:39:07 2011 -0700
description:
make less chatty; fix libpc/liblas typo
Subject: libpc: start to add swig build

details:   http://hg.liblas.orglibpc/rev/aa919b5074fc
changeset: 233:aa919b5074fc
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Mon Mar 14 11:42:10 2011 -0700
description:
start to add swig build
Subject: libpc: merge

details:   http://hg.liblas.orglibpc/rev/87ccbec1b512
changeset: 234:87ccbec1b512
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Mon Mar 14 13:39:47 2011 -0700
description:
merge
Subject: libpc: fix boost version; tweak mpg builds

details:   http://hg.liblas.orglibpc/rev/298237820520
changeset: 235:298237820520
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Tue Mar 15 13:44:03 2011 -0400
description:
fix boost version; tweak mpg builds

diffstat:

 CMakeLists.txt                             |   24 +-
 apps/Application.cpp                       |   48 +-
 apps/Application.hpp                       |    2 +
 apps/pc2pc.cpp                             |   42 +-
 apps/pcinfo.cpp                            |   59 ++
 cmake/libPC.vcproj.user.template           |  121 -----
 cmake/modules/FindGDAL.cmake               |    4 +-
 cmake/modules/FindGeoTIFF.cmake            |    4 +-
 cmake/modules/FindLASzip.cmake             |    4 +-
 cmake/modules/FindLibLAS.cmake             |   22 +-
 csharp/CMakeLists.txt                      |    1 +
 doc/model/ClassDiagram.classdiagram        |  215 ----------
 doc/model/ClassDiagram.classdiagram.layout |  193 ---------
 doc/model/ModelDefinition/ModelProject.uml |  596 +++++++++++++++++++++++-----
 doc/model/ModelProject.modelproj           |   13 +-
 doc/model/PointData.classdiagram           |  182 ++++++++
 doc/model/PointData.classdiagram.layout    |  103 +++++
 doc/model/Stage.classdiagram               |  182 ++++++++
 doc/model/Stage.classdiagram.layout        |  111 +++++
 doc/sprint/libpc-design.pptx               |    0 
 doc/sprint/libpc-implementation.pptx       |    0 
 doc/sprint/notes.txt                       |   68 +++
 include/libpc/CacheFilter.hpp              |   29 +-
 include/libpc/Dimension.hpp                |    2 +-
 include/libpc/FauxReader.hpp               |    2 +-
 include/libpc/Filter.hpp                   |   10 +-
 include/libpc/Header.hpp                   |    2 +
 include/libpc/LasReader.hpp                |    2 +-
 include/libpc/PointDataCache.hpp           |  199 +++++++++
 include/libpc/Producer.hpp                 |   13 +-
 include/libpc/SchemaLayout.hpp             |    4 +-
 include/libpc/Stage.hpp                    |   36 +-
 include/libpc/chipper.hpp                  |    3 +
 mpg-config.bat                             |   10 +-
 src/CMakeLists.txt                         |    2 +
 src/CacheFilter.cpp                        |  119 +++--
 src/CropFilter.cpp                         |    6 +-
 src/Dimension.cpp                          |    2 +-
 src/FauxReader.cpp                         |    6 +-
 src/Filter.cpp                             |   20 -
 src/Header.cpp                             |    6 +
 src/LasHeader.cpp                          |    2 +-
 src/LasReader.cpp                          |   10 +-
 src/LasWriter.cpp                          |    6 +-
 src/PointData.cpp                          |    4 +-
 src/PointDataCache.cpp                     |   16 +
 src/Producer.cpp                           |   27 -
 src/Stage.cpp                              |   27 +-
 src/chipper.cpp                            |    2 +
 src/drivers/liblas/reader.cpp              |   14 +-
 src/drivers/liblas/reader.hpp              |    4 +-
 src/drivers/liblas/writer.cpp              |    6 +-
 src/drivers/oci/CMakeLists.txt             |    3 +-
 src/drivers/oci/block.cpp                  |   53 --
 src/drivers/oci/block.hpp                  |   65 ---
 src/drivers/oci/common.cpp                 |  150 +++++++
 src/drivers/oci/common.hpp                 |   92 ++++
 src/drivers/oci/reader.cpp                 |   76 +++
 src/drivers/oci/reader.hpp                 |   74 +++
 src/drivers/oci/writer.cpp                 |  479 ++++++++++++++++++-----
 src/drivers/oci/writer.hpp                 |   53 +-
 test/unit/CMakeLists.txt                   |    1 +
 test/unit/CacheFilterTest.cpp              |   53 +-
 test/unit/DecimationFilterTest.cpp         |    2 +-
 test/unit/FauxReaderTest.cpp               |    4 +-
 test/unit/MosaicFilterTest.cpp             |    2 +-
 test/unit/PointDataCacheTest.cpp           |   92 ++++
 67 files changed, 2618 insertions(+), 1166 deletions(-)

diffs (truncated from 5011 to 300 lines):

diff -r ca3ff449d03a -r 298237820520 CMakeLists.txt
--- a/CMakeLists.txt	Wed Mar 09 14:04:43 2011 -0600
+++ b/CMakeLists.txt	Tue Mar 15 13:44:03 2011 -0400
@@ -178,7 +178,7 @@
 endif(WIN32)
 
 # BUG: are there other Boost components we're using?
-find_package(Boost 1.45 COMPONENTS program_options thread iostreams filesystem system unit_test_framework REQUIRED)
+find_package(Boost 1.44 COMPONENTS program_options thread iostreams filesystem system unit_test_framework REQUIRED)
 
 if(Boost_FOUND AND Boost_PROGRAM_OPTIONS_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
@@ -245,6 +245,24 @@
 # settings for other 3rd party dependencies
 #------------------------------------------------------------------------------
 
+# swig support
+if (WIN32)
+  set(WITH_SWIG_CSHARP TRUE CACHE BOOL "Choose if you want to make C# bindings via Swig")
+else()
+  set(WITH_SWIG_CSHARP FALSE CACHE BOOL "Choose if you want to make C# bindings via Swig")
+endif()
+
+if(WITH_SWIG_CSHARP)
+    find_package(swig 2.0.1)
+    if(SWIG_FOUND)
+        add_subdirectory(csharp)
+        set(LIBPC_HAVE_SWIG_CSHARP 1)
+		message(STATUS "Found Swig version ${SWIG_VERSION}")
+	else()
+		message(FATAL_ERROR "Swig not found (required for C# bindings)")
+    endif()
+endif()
+
 # libxml2 support - optional, default=ON
 set(WITH_LIBXML2 FALSE CACHE BOOL "Choose if libxml2 support should be built ")
 
@@ -266,7 +284,7 @@
 
   if(ORACLE_FOUND)
     include_directories(${ORACLE_INCLUDE_DIR})
-        set(LIBPC_HAVE_ORACLE 1)
+    add_definitions(-DHAVE_ORACLE=1)
   endif()
 endif()
 
@@ -355,7 +373,7 @@
 # installation commands
 #------------------------------------------------------------------------------
 
-install(FILES AUTHORS COPYING INSTALL LICENSE.txt README.txt
+install(FILES AUTHORS.txt LICENSE.txt
   DESTINATION ${LIBPC_DATA_DIR}/doc)
 
 
diff -r ca3ff449d03a -r 298237820520 apps/Application.cpp
--- a/apps/Application.cpp	Wed Mar 09 14:04:43 2011 -0600
+++ b/apps/Application.cpp	Tue Mar 15 13:44:03 2011 -0400
@@ -90,21 +90,21 @@
     // call derived function
     int status = 0;
     
-    try
-    {
+    // try
+    // {
         status = execute();
-    }
-    catch (std::exception e)
-    {
-        const std::string s(e.what());
-        runtimeError("Caught exception: " + s);
-        status = 1;
-    }
-    catch (...)
-    {
-        runtimeError("Caught unknown exception");
-        status = 1;
-    }
+    // }
+    // catch (std::exception e)
+    // {
+    //     const std::string s(e.what());
+    //     runtimeError("Caught exception: " + s);
+    //     status = 1;
+    // }
+    // catch (...)
+    // {
+    //     runtimeError("Caught unknown exception");
+    //     status = 1;
+    // }
 
     if (status == 0 && hasOption("timer"))
     {
@@ -144,10 +144,17 @@
 
 void Application::addOptionSet(po::options_description* options)
 {
+    if (!options) return;
     m_options.push_back(options);
 }
 
 
+void Application::addPositionalOption(const char* name, int max_count)
+{
+    m_positionalOptions.add(name, max_count);
+}
+
+
 void Application::outputHelp()
 {
     outputVersion();
@@ -200,19 +207,16 @@
 {
     po::options_description options;
 
-    std::vector<po::options_description*>::iterator iter;
-    for (iter = m_options.begin(); iter != m_options.end(); ++iter)
+    std::vector<po::options_description*>::iterator iter1;
+    for (iter1 = m_options.begin(); iter1 != m_options.end(); ++iter1)
     {
-        po::options_description* sub_options = *iter;
+        po::options_description* sub_options = *iter1;
         options.add(*sub_options);
     }
 
-    //po::positional_options_description p;
-    //p.add("input", 1);
-    //p.add("output", 1);
-
     po::store(po::command_line_parser(m_argc, m_argv).
-        options(options)/*.positional(p)*/.run(), m_variablesMap);
+        options(options).positional(m_positionalOptions).run(), 
+        m_variablesMap);
 
     po::notify(m_variablesMap);
 
diff -r ca3ff449d03a -r 298237820520 apps/Application.hpp
--- a/apps/Application.hpp	Wed Mar 09 14:04:43 2011 -0600
+++ b/apps/Application.hpp	Tue Mar 15 13:44:03 2011 -0400
@@ -75,6 +75,7 @@
 protected:
     Application(int argc, char* argv[], const std::string& appName);
     void addOptionSet(boost::program_options::options_description* options);
+    void addPositionalOption(const char* name, int max_count);
     bool isVerbose() const;
     bool hasOption(const std::string& name);
     void usageError(const std::string&);
@@ -92,6 +93,7 @@
     const std::string m_appName;
 
     std::vector<boost::program_options::options_description*> m_options;
+    boost::program_options::positional_options_description m_positionalOptions;
     boost::program_options::variables_map m_variablesMap;
 
     Application& operator=(const Application&); // not implemented
diff -r ca3ff449d03a -r 298237820520 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Wed Mar 09 14:04:43 2011 -0600
+++ b/apps/pc2pc.cpp	Tue Mar 15 13:44:03 2011 -0400
@@ -12,7 +12,7 @@
 
 #include <iostream>
 
-//#include "libpc/exceptions.hpp"
+#include "libpc/exceptions.hpp"
 //#include "libpc/libpc_config.hpp"
 //#include "libpc/Bounds.hpp"
 //#include "libpc/Color.hpp"
@@ -26,10 +26,14 @@
 #include "libpc/LasReader.hpp"
 //#include "libpc/LasHeader.hpp"
 #include "libpc/LasWriter.hpp"
+#include "libpc/CacheFilter.hpp"
 
 #include "libpc/../../src/drivers/liblas/writer.hpp"
 #include "libpc/../../src/drivers/liblas/reader.hpp"
 
+#ifdef HAVE_ORACLE
+#include "libpc/../../src/drivers/oci/writer.hpp"
+#endif
 
 #include "Application.hpp"
 
@@ -84,6 +88,7 @@
         ("input,i", po::value<std::string>(&m_inputFile), "input file name")
         ("output,o", po::value<std::string>(&m_outputFile), "output file name")
         ("native", "use native LAS classes (not liblas)")
+        ("oracle", "oracle test")
         ;
 
     addOptionSet(file_options);
@@ -116,6 +121,41 @@
         assert(numPoints == np); // BUG
         writer.write(np);
     }
+
+#ifdef HAVE_ORACLE
+
+    else if (hasOption("oracle"))
+    {
+#ifdef HAVE_ORACLE
+        LiblasReader reader(*ifs);
+    
+        const boost::uint64_t numPoints = reader.getHeader().getNumPoints();
+        
+        libpc::driver::oci::Options options;
+        boost::property_tree::ptree& tree = options.GetPTree();
+        
+        tree.put("capacity", 15);
+        tree.put("connection", "lidar/lidar at oracle.hobu.biz/crrel");
+        tree.put("debug", true);
+        tree.put("verbose", true);
+        
+        CacheFilter cache(reader, 1, 1024);
+        
+        libpc::driver::oci::Writer writer(cache, options);
+        
+        
+        //BUG: handle laz writer.setCompressed(false);
+
+        //writer.setPointFormat( reader.getPointFormatNumber() );
+
+        size_t np = (size_t)numPoints;
+        assert(numPoints == np); // BUG
+        writer.write(np);
+#else
+        throw configuration_error("libPC not compiled with Oracle support");
+#endif
+    }    
+#endif
     else
     {
         LiblasReader reader(*ifs);
diff -r ca3ff449d03a -r 298237820520 apps/pcinfo.cpp
--- a/apps/pcinfo.cpp	Wed Mar 09 14:04:43 2011 -0600
+++ b/apps/pcinfo.cpp	Tue Mar 15 13:44:03 2011 -0400
@@ -10,10 +10,15 @@
  **************************************************************************/
 
 
+#include "libpc/LasReader.hpp"
+#include "libpc/../../src/drivers/liblas/reader.hpp"
+
 #include <iostream>
 
 #include "Application.hpp"
 
+using namespace libpc;
+namespace po = boost::program_options;
 
 class Application_pcinfo : public Application
 {
@@ -22,6 +27,9 @@
     int execute();
 private:
     void addOptions();
+    bool validateOptions();
+
+    std::string m_inputFile;
 };
 
 
@@ -31,12 +39,63 @@
 }
 
 
+bool Application_pcinfo::validateOptions()
+{
+    if (!hasOption("input"))
+    {
+        usageError("input file name required");
+        return false;
+    }
+
+    return true;
+}
+
+
 void Application_pcinfo::addOptions()
 {
+    po::options_description* file_options = new po::options_description("file options");
+
+    file_options->add_options()
+        ("input,i", po::value<std::string>(&m_inputFile), "input file name")
+        ("native", "use native LAS classes (not liblas)")
+        ;
+
+    addOptionSet(file_options);
+
+    addPositionalOption("input", 1);
+
+    return;
 }
 
+
 int Application_pcinfo::execute()
 {
+    if (!Utils::fileExists(m_inputFile))
+    {
+        runtimeError("file not found: " + m_inputFile);


More information about the Liblas-commits mailing list