<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">So I am a newcomer to PDAL, and I am attempting to implement GUI wrappers around various PDAL functionality using the C++ API.  For now this is typically a user-determined combination of readers, decimation filters, crop filters, merge filters, reprojection filters, and a writer.  Functionally its all working fine so far (with very limited testing).  However since the user can kick off time-consuming operations in this manner its really desirable to have an active progress bar.  So far the best I have managed in that regard is to stick a callbackfilter at the very end of the pipeline which updates my progress count (see below).  This works nicely... save that in order to accurately space out the progress bar it requires that I know ahead of time how many points are going to make it through all the filters.  I can make a passable guess based on initial quicklook analysis of the source files and knowing what the user set up, but it would be a lot easier and more dependable if there were a way to inject callbacks earlier in the stream to update the estimated count of points that pass the filters.  Does anybody know a good way to accomplish that?  From the outside looking in being able to simply pass in a reference to a counter variable with a filter - so that it updates a "points I've passed" count variable that I can monitor from another thread - would be perfect.  But just a mid-stream callback filter could also work.  I supposed I could implement some sort of custom filter that maintains a count for me, but that seems like a rather roundabout and overly complex way to accomplish it.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div><div><span style="white-space: pre-wrap;"><br></span></div><div dir="ltr" data-setdir="false"><div><div><span style="white-space: pre-wrap;">                  </span>pdal::Stage* merger = myFactory.createStage("filters.merge");</div><div><span style="white-space: pre-wrap;">                        </span>double totPtsEstimate = 0;</div><div><br></div></div><div dir="ltr" data-setdir="false">                        for each source file<br></div><div dir="ltr" data-setdir="false">                            - add a reader stage</div><div dir="ltr" data-setdir="false">                            - add filter stages<br></div></div><div><span style="white-space: pre-wrap;"><br></span></div><div dir="ltr" data-setdir="false"><span style="white-space: pre-wrap;">                        - add a merge stage<br></span></div><div dir="ltr" data-setdir="false">                        - add a writer stage<br></div><div><span style="white-space: pre-wrap;"><br></span></div><div><span style="white-space: pre-wrap;">                       </span>auto cb = [&](pdal::PointRef& point) {<br></div><div dir="ltr" data-setdir="false"><span style="white-space: pre-wrap;">                             </span>return updateProgressBarCountByOne();</div><div><span style="white-space: pre-wrap;">                  </span>};</div><div><br></div><div dir="ltr" data-setdir="false"><span>                        pdal::FixedPointTable t(1000);</span><br></div><div><span style="white-space: pre-wrap;">                  </span>pdal::StreamCallbackFilter scf;</div><div><span style="white-space: pre-wrap;">                        </span>scf.setCallback(cb);</div><div><span style="white-space: pre-wrap;">                   </span>scf.setInput(*(writer));</div><div><span style="white-space: pre-wrap;">                       </span>scf.prepare(t);</div><div><span style="white-space: pre-wrap;">                        </span>scf.execute(t);</div><div><br></div></div></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Regards,</div><div dir="ltr" data-setdir="false">Kevin Murphy</div></div></body></html>