[Liblas-commits] hg-main-tree: add bool suppo0rtsIterator(StageIteratorType t) me...

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Mar 25 13:15:24 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/dcff623083ba
changeset: 456:dcff623083ba
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Mar 25 12:15:16 2011 -0500
description:
add bool suppo0rtsIterator(StageIteratorType t) method and remove other junk :)

diffstat:

 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/Reader.hpp       |  14 +++++---------
 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 ++++------
 src/drivers/faux/Reader.cpp                |   9 ---------
 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 ++----
 22 files changed, 53 insertions(+), 155 deletions(-)

diffs (truncated from 449 to 300 lines):

diff -r 689ad51ea693 -r dcff623083ba 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 12:15:16 2011 -0500
@@ -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 dcff623083ba 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 12:15:16 2011 -0500
@@ -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 dcff623083ba 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 12:15:16 2011 -0500
@@ -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 dcff623083ba 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 12:15:16 2011 -0500
@@ -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 dcff623083ba 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 12:15:16 2011 -0500
@@ -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 dcff623083ba 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 12:15:16 2011 -0500
@@ -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;
     }
-
-    // libpc::Iterator* createIterator(StageIteratorType t) const;
     
 private:
 
diff -r 689ad51ea693 -r dcff623083ba include/libpc/filters/CacheFilter.hpp
--- a/include/libpc/filters/CacheFilter.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/filters/CacheFilter.hpp	Fri Mar 25 12:15:16 2011 -0500
@@ -86,15 +86,13 @@
                        boost::uint64_t& numCacheInsertMisses,
                        boost::uint64_t& numCacheInsertHits) 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; }
diff -r 689ad51ea693 -r dcff623083ba include/libpc/filters/ColorFilter.hpp
--- a/include/libpc/filters/ColorFilter.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/filters/ColorFilter.hpp	Fri Mar 25 12:15:16 2011 -0500
@@ -62,15 +62,13 @@
 
     void getColor(float value, boost::uint8_t& red, boost::uint8_t& green, boost::uint8_t& blue) const;
 
-    inline boost::uint8_t getIteratorSupport () const
+    bool supportsIterator (StageIteratorType t) 
     {   
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+
+        return false;
     }
 
-    libpc::Iterator* createIterator(StageIteratorType t) const;
-
     bool supportsSequentialIterator() const { return true; }
     bool supportsRandomIterator() const { return false; }
     libpc::SequentialIterator* createSequentialIterator() const;
diff -r 689ad51ea693 -r dcff623083ba include/libpc/filters/CropFilter.hpp
--- a/include/libpc/filters/CropFilter.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/filters/CropFilter.hpp	Fri Mar 25 12:15:16 2011 -0500
@@ -59,19 +59,16 @@
 
     const std::string& getName() const;
 
-    inline boost::uint8_t getIteratorSupport () 
+    bool supportsIterator (StageIteratorType t) 
     {   
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+
+        return false;
     }
-    
 
     bool supportsSequentialIterator() const { return true; }
     bool supportsRandomIterator() const { return false; }
     
-    libpc::Iterator* createIterator(StageIteratorType type) const;
-    
     libpc::SequentialIterator* createSequentialIterator() const;
     libpc::RandomIterator* createRandomIterator() const { return NULL; }
 
diff -r 689ad51ea693 -r dcff623083ba include/libpc/filters/DecimationFilter.hpp
--- a/include/libpc/filters/DecimationFilter.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/filters/DecimationFilter.hpp	Fri Mar 25 12:15:16 2011 -0500
@@ -57,15 +57,13 @@
 
     const std::string& getName() const;
 
-    inline boost::uint8_t getIteratorSupport () const
+    bool supportsIterator (StageIteratorType t) 
     {   
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+
+        return false;
     }
     
-    libpc::Iterator* createIterator(StageIteratorType t) const;
-    
     bool supportsSequentialIterator() const { return true; }
     bool supportsRandomIterator() const { return false; }
     libpc::SequentialIterator* createSequentialIterator() const;
diff -r 689ad51ea693 -r dcff623083ba include/libpc/filters/MosaicFilter.hpp
--- a/include/libpc/filters/MosaicFilter.hpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/include/libpc/filters/MosaicFilter.hpp	Fri Mar 25 12:15:16 2011 -0500
@@ -59,15 +59,13 @@
 
     const std::vector<const Stage*>& getPrevStages() const;
 
-    inline boost::uint8_t getIteratorSupport () const
+    bool supportsIterator (StageIteratorType t) 
     {   
-        boost::uint8_t mask(0); 
-        mask |= StageIterator_Sequential;  
-        return mask;
+        if (t == StageIterator_Sequential ) return true;
+
+        return false;
     }
     
-    libpc::Iterator* createIterator(StageIteratorType t) const;
-    
     bool supportsSequentialIterator() const { return true; }
     bool supportsRandomIterator() const { return false; }  // BUG: could be true
     libpc::SequentialIterator* createSequentialIterator() const;
diff -r 689ad51ea693 -r dcff623083ba src/drivers/faux/Reader.cpp
--- a/src/drivers/faux/Reader.cpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/src/drivers/faux/Reader.cpp	Fri Mar 25 12:15:16 2011 -0500
@@ -111,15 +111,6 @@
     return new RandomIterator(*this);
 }
 
-libpc::Iterator* Reader::createIterator(StageIteratorType t) const
-{
-    if (t == StageIterator_Sequential)
-        return new SequentialIterator(*this);
-    if (t == StageIterator_Random)
-        return new RandomIterator(*this);
-    return 0;
-}
-
 
 boost::uint32_t Reader::processBuffer(PointBuffer& data, boost::uint64_t index) const
 {
diff -r 689ad51ea693 -r dcff623083ba src/drivers/las/Reader.cpp
--- a/src/drivers/las/Reader.cpp	Fri Mar 25 09:56:02 2011 -0700
+++ b/src/drivers/las/Reader.cpp	Fri Mar 25 12:15:16 2011 -0500
@@ -98,14 +98,6 @@
     return new RandomIterator(*this);
 }
 
-libpc::Iterator* LasReader::createIterator(StageIteratorType t) const
-{
-    if (t == StageIterator_Sequential)
-        return new SequentialIterator(*this);
-    if (t == StageIterator_Random)
-        return new RandomIterator(*this);
-    return 0;
-}
 
 boost::uint32_t LasReader::processBuffer(PointBuffer& data, std::istream& stream) const
 {


More information about the Liblas-commits mailing list