[Liblas-commits] hg: actually filter to keep last-return-only

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Dec 6 15:49:23 EST 2010


changeset 19a9c7034517 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=19a9c7034517
summary: actually filter to keep last-return-only

diffstat:

 src/lasfilter.cpp |  19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diffs (35 lines):

diff -r 25add9edaaf1 -r 19a9c7034517 src/lasfilter.cpp
--- a/src/lasfilter.cpp	Mon Dec 06 10:36:17 2010 -0600
+++ b/src/lasfilter.cpp	Mon Dec 06 14:49:12 2010 -0600
@@ -142,24 +142,19 @@
 
 bool ReturnFilter::filter(const Point& p)
 {
+
     if (last_only) {
-        bool output = false;
-        if (p.GetReturnNumber() == p.GetNumberOfReturns()) {
-            output = true;
-        }
-
+        bool isLast = p.GetReturnNumber() == p.GetNumberOfReturns();
+        
         // If the type is switched to eExclusion, we'll throw out all last returns.
-        if (GetType() == eExclusion && output == true) {
-            output = false;
-        } else {
-            output = true;
-        }
-        return output;
+        if (GetType() == eExclusion)
+            isLast = false;
+        return isLast;
     }
     
     uint16_t r = p.GetReturnNumber();
     
-    // If the user gave us an empty set of classes to filter
+    // If the user gave us an empty set of returns to filter
     // we're going to return true regardless
     bool output = true;
     for (return_list_type::const_iterator it = m_returns.begin(); it != m_returns.end(); ++it) {


More information about the Liblas-commits mailing list