[Liblas-commits] hg-main-tree: #1: now using consistent LIBPC_* macros, fixed som...

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Mar 25 13:39:06 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/76e24ad4bfde
changeset: 457:76e24ad4bfde
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Mar 25 10:38:47 2011 -0700
description:
#1: now using consistent LIBPC_* macros, fixed some old ones
Subject: hg-main-tree: merge

details:   http://hg.libpc.orghg-main-tree/rev/cc6156bfe890
changeset: 458:cc6156bfe890
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Mar 25 10:38:57 2011 -0700
description:
merge

diffstat:

 CMakeLists.txt                             |  18 +++++++++++++++++-
 apps/Application.hpp                       |   4 ++--
 apps/pc2pc.cpp                             |   4 ++--
 apps/pcinfo.cpp                            |   4 ++--
 include/libpc/Bounds.hpp                   |   2 +-
 include/libpc/PointBufferCache.hpp         |   4 ++--
 include/libpc/Stage.hpp                    |   4 +---
 include/libpc/drivers/faux/Reader.hpp      |  14 ++++++--------
 include/libpc/drivers/las/Reader.hpp       |  12 +++++-------
 include/libpc/drivers/liblas/Reader.hpp    |  12 +++++-------
 include/libpc/drivers/mrsid/Reader.hpp     |  14 ++++++--------
 include/libpc/drivers/oci/Common.hpp       |   2 +-
 include/libpc/drivers/oci/Reader.hpp       |  14 +++++---------
 include/libpc/export.hpp                   |   8 +++++---
 include/libpc/filters/CacheFilter.hpp      |  12 +++++-------
 include/libpc/filters/ColorFilter.hpp      |  10 ++++------
 include/libpc/filters/CropFilter.hpp       |  11 ++++-------
 include/libpc/filters/DecimationFilter.hpp |  10 ++++------
 include/libpc/filters/MosaicFilter.hpp     |  10 ++++------
 libpc_defines.h.in                         |  24 ++++++++++++++++++++++--
 src/CMakeLists.txt                         |  26 +++++++++++++++++++-------
 src/Utils.cpp                              |   6 +++---
 src/drivers/faux/Reader.cpp                |   9 ---------
 src/drivers/las/LasHeaderReader.cpp        |   2 +-
 src/drivers/las/Reader.cpp                 |   8 --------
 src/drivers/liblas/Reader.cpp              |   8 --------
 src/drivers/mrsid/Reader.cpp               |   5 -----
 src/filters/CacheFilter.cpp                |   9 ---------
 src/filters/ColorFilter.cpp                |   8 --------
 src/filters/CropFilter.cpp                 |   8 --------
 src/filters/DecimationFilter.cpp           |  10 ----------
 src/filters/MosaicFilter.cpp               |   9 ---------
 test/unit/FauxReaderTest.cpp               |   5 ++---
 test/unit/LiblasReaderTest.cpp             |   6 ++----
 34 files changed, 130 insertions(+), 182 deletions(-)

diffs (truncated from 776 to 300 lines):

diff -r 689ad51ea693 -r cc6156bfe890 CMakeLists.txt
--- a/CMakeLists.txt	Fri Mar 25 09:56:02 2011 -0700
+++ b/CMakeLists.txt	Fri Mar 25 10:38:57 2011 -0700
@@ -118,6 +118,15 @@
       add_definitions(-D_CRT_SECURE_NO_WARNINGS)
       add_definitions(-D_CRT_NONSTDC_NO_WARNING)
       add_definitions(-D_SCL_SECURE_NO_WARNINGS)
+
+      set(LIBPC_COMPILER_MSVC 1)
+      if (MSVC10)
+        set(LIBPC_COMPILER_VC10 1)
+      elseif (MSVC9)
+        set(LIBPC_COMPILER_VC9 1)
+      elseif (MSVC8)
+        set(LIBPC_COMPILER_VC8 1)
+      endif()
     endif()
     
     if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
@@ -131,6 +140,8 @@
   set(CMAKE_INCLUDE_PATH c:/osgeo4w/include;$ENV{CMAKE_INCLUDE_PATH})
   set(CMAKE_LIBRARY_PATH c:/osgeo4w/lib;$ENV{CMAKE_LIBRARY_PATH})
 
+  set(LIBPC_OS_WIN32 1)
+
 else()
   # not WIN32
 
@@ -145,9 +156,12 @@
     if (CMAKE_COMPILER_IS_GNUCXX)
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
     endif()
-
+    
+    set(LIBPC_COMPILER_GCC 1)
+    
   elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER}" MATCHES "clang")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBPC_COMMON_CXX_FLAGS}")
+    set(LIBPC_COMPILER_CLANG 1)
   endif()
 endif(WIN32)
 
@@ -292,6 +306,7 @@
   if(ORACLE_FOUND)
     include_directories(${ORACLE_INCLUDE_DIR})
     add_definitions(-DHAVE_ORACLE=1)
+    set(LIBPC_HAVE_ORACLE 1)
   endif()
 endif()
 
@@ -343,6 +358,7 @@
         set(CMAKE_REQUIRED_LIBRARIES ${MRSID_LIBRARY})
         include_directories(${MRSID_INCLUDE_DIR})
         add_definitions(-DHAVE_MRSID=1)
+        set(LIBPC_HAVE_MRSID 1)
     endif()
 endif()
 
diff -r 689ad51ea693 -r cc6156bfe890 apps/Application.hpp
--- a/apps/Application.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/apps/Application.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -38,12 +38,12 @@
 #include <iosfwd>
 
 
-#ifdef _MSC_VER
+#ifdef LIBPC_COMPILER_MSVC
 #  pragma warning(push)
 #  pragma warning(disable: 4512)  // assignment operator could not be generated
 #endif
 #include <boost/program_options.hpp>
-#ifdef _MSC_VER
+#ifdef LIBPC_COMPILER_MSVC
 #  pragma warning(pop)
 #endif
 
diff -r 689ad51ea693 -r cc6156bfe890 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/apps/pc2pc.cpp	Fri Mar 25 10:38:57 2011 -0700
@@ -31,7 +31,7 @@
 #include <libpc/drivers/liblas/writer.hpp>
 #include <libpc/drivers/liblas/reader.hpp>
 
-#ifdef HAVE_ORACLE
+#ifdef LIBPC_HAVE_ORACLE
 #include <libpc/drivers/oci/writer.hpp>
 #endif
 
@@ -123,7 +123,7 @@
 
     else if (hasOption("oracle"))
     {
-#ifdef HAVE_ORACLE
+#ifdef LIBPC_HAVE_ORACLE
         libpc::drivers::liblas::LiblasReader reader(m_inputFile);
     
         const boost::uint64_t numPoints = reader.getHeader().getNumPoints();
diff -r 689ad51ea693 -r cc6156bfe890 apps/pcinfo.cpp
--- a/apps/pcinfo.cpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/apps/pcinfo.cpp	Fri Mar 25 10:38:57 2011 -0700
@@ -13,7 +13,7 @@
 #include <libpc/drivers/las/Reader.hpp>
 #include <libpc/drivers/liblas/Reader.hpp>
 #include <libpc/Utils.hpp>
-#ifdef HAVE_MRSID
+#ifdef LIBPC_HAVE_MRSID
 #include <libpc/drivers/mrsid/Reader.hpp>
 #endif
 
@@ -97,7 +97,7 @@
                 reader = new libpc::drivers::liblas::LiblasReader(m_inputFile);
             }
         }
-#ifdef HAVE_MRSID
+#ifdef LIBPC_HAVE_MRSID
         else if (!m_inputFile.substr(ext).compare("sid"))
         {
             reader = new libpc::drivers::mrsid::Reader(m_inputFile.c_str());
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/Bounds.hpp
--- a/include/libpc/Bounds.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/Bounds.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -443,7 +443,7 @@
 } // namespace libpc
 
 // Needed for C++ DLL exports
-#ifdef _MSC_VER
+#ifdef LIBPC_COMPILER_MSVC
 template class LIBPC_DLL libpc::Range<double>;
 template class LIBPC_DLL libpc::Bounds<double>;
 #endif
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/PointBufferCache.hpp
--- a/include/libpc/PointBufferCache.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/PointBufferCache.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -25,7 +25,7 @@
 #include <libpc/libpc.hpp>
 
 
-#ifdef _MSC_VER
+#ifdef LIBPC_COMPILER_MSVC
 #  pragma warning(push)
 #  pragma warning(disable: 4512)  // assignment operator could not be generated
 #endif
@@ -33,7 +33,7 @@
 #include <boost/bimap/list_of.hpp>
 //#include <boost/bimap/set_of.hpp>
 //#include <boost/function.hpp>
-#ifdef _MSC_VER
+#ifdef LIBPC_COMPILER_MSVC
 #  pragma warning(pop)
 #endif
 
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/Stage.hpp
--- a/include/libpc/Stage.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/Stage.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -67,9 +67,7 @@
     const Header& getHeader() const;
     Header& getHeader();
 
-    virtual boost::uint8_t getIteratorSupport () const { return 0; }
-    
-    virtual libpc::Iterator* createIterator(StageIteratorType) const { return NULL; }
+    virtual bool supportsIterator (StageIteratorType) const { return false; }
     
     virtual bool supportsSequentialIterator() const { return false; }
     virtual bool supportsRandomIterator() const { return false; }
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/drivers/faux/Reader.hpp
--- a/include/libpc/drivers/faux/Reader.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/drivers/faux/Reader.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -81,16 +81,14 @@
 
     Mode getMode() const;
     
-    boost::uint8_t getIteratorSupport () 
+    bool supportsIterator (StageIteratorType t) 
     {   
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        mask |= StageIterator_Random; 
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+        if (t == StageIterator_Random ) return true;
+        
+        return false;
     }
-    
-    libpc::Iterator* createIterator(StageIteratorType t) const;
-    
+
     bool supportsSequentialIterator() const { return true; }
     bool supportsRandomIterator() const { return true; }
     libpc::SequentialIterator* createSequentialIterator() const;
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/drivers/las/Reader.hpp
--- a/include/libpc/drivers/las/Reader.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/drivers/las/Reader.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -60,16 +60,14 @@
 
     const LasHeader& getLasHeader() const;
 
-    boost::uint8_t getIteratorSupport () const
+    bool supportsIterator (StageIteratorType t) 
     {   
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        mask |= StageIterator_Random; 
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+        if (t == StageIterator_Random ) return true;
+        
+        return false;
     }
 
-    libpc::Iterator* createIterator(StageIteratorType t) const;
-    
     bool supportsSequentialIterator() const { return true; }
     bool supportsRandomIterator() const { return true; }
     libpc::SequentialIterator* createSequentialIterator() const;
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/drivers/liblas/Reader.hpp
--- a/include/libpc/drivers/liblas/Reader.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/drivers/liblas/Reader.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -72,16 +72,14 @@
     bool hasColorData() const;
     bool hasWaveData() const;
 
-    boost::uint8_t getIteratorSupport () const
+    bool supportsIterator (StageIteratorType t) 
     {   
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        mask |= StageIterator_Random; 
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+        if (t == StageIterator_Random ) return true;
+        
+        return false;
     }
 
-    libpc::Iterator* createIterator(StageIteratorType t) const;
-
     bool supportsSequentialIterator() const { return true; }
     bool supportsRandomIterator() const { return true; }
     libpc::SequentialIterator* createSequentialIterator() const;
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/drivers/mrsid/Reader.hpp
--- a/include/libpc/drivers/mrsid/Reader.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/drivers/mrsid/Reader.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -59,17 +59,15 @@
     const std::string& getName() const;
 
     void seekToPoint(boost::uint64_t pointNum);
-    Iterator* createIterator(const Bounds<double>& bounds);
 
-    boost::uint8_t getIteratorSupport () const
+    bool supportsIterator (StageIteratorType t) 
     {   
-        // FIXME: make this represent what this reader actually supports!
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        mask |= StageIterator_Random; 
-        mask |= StageIterator_Block; 
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+        if (t == StageIterator_Random ) return true;
+        if (t == StageIterator_Block ) return true;
+        return false;
     }
+
     
 protected:
     boost::uint32_t readBuffer(PointBuffer&);
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/drivers/oci/Common.hpp
--- a/include/libpc/drivers/oci/Common.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/drivers/oci/Common.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -57,7 +57,7 @@
 
 
 
-#ifdef _WIN32
+#ifdef LIBPC_COMPILER_MSVC
 #define compare_no_case(a,b,n)  _strnicmp( (a), (b), (n) )
 #else
 #define compare_no_case(a,b,n)  strncasecmp( (a), (b), (n) )
diff -r 689ad51ea693 -r cc6156bfe890 include/libpc/drivers/oci/Reader.hpp
--- a/include/libpc/drivers/oci/Reader.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/drivers/oci/Reader.hpp	Fri Mar 25 10:38:57 2011 -0700
@@ -60,17 +60,13 @@
  
     void seekToPoint(boost::uint64_t pointNum);
 
-    boost::uint8_t getIteratorSupport () const
+    bool supportsIterator (StageIteratorType t) 
     {   
-        // FIXME: make this represent what this reader actually supports!
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        mask |= StageIterator_Random; 
-        mask |= StageIterator_Block; 
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+        if (t == StageIterator_Random ) return true;
+        if (t == StageIterator_Block ) return true;
+        return false;


More information about the Liblas-commits mailing list