<html><head></head><body bgcolor="#FFFFFF"><div><div>I did cc you, but your address bounced -- writing on a smartphone has its limitations, I guess...</div><div><br></div><div>See below.<br><br>Regards, Peder</div><div>:<br><br></div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><b>Från:</b> Peder Axensten <<a href="mailto:Peder.Axensten@slu.se">Peder.Axensten@slu.se</a>><br><b>Datum:</b> <a href="x-apple-data-detectors://1" x-apple-data-detectors="true" x-apple-data-detectors-result="1">25 oktober 2011</a> 22:23:29 CEST<br><b>Till:</b> Mateusz Łoskot <<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>><br><b>Kopia:</b> "<a href="mailto:hobu.inv@gmail.com">hobu.inv@gmail.com</a>" <<a href="mailto:hobu.inv@gmail.com">hobu.inv@gmail.com</a>><br><b>Ämne:</b> <b>Re: [Liblas-devel] GetClassification() et al.</b><br><br></font></div></blockquote><div></div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000">I am really sorry Mateusz, I did indeed read your mail to quickly.<br><br>I think we agree that Point.GetClassification() and Point.SetClassification( ... ) should not filter the Classification in any way?<br>(I don't really understand why there are 3 SetClassification() as Classification has constructors to cover the other two cases, but never mind.)<br><br>I would think that the bug is that the right hand assignment expression of the various Point.SetClassification(...) is Classification(...).GetClass(). The correct would be static_cast<bitset>(Classification(...)) or something similar. Do you agree?<br><br>As of retrieving all bits from a Classification object I had not noticed the operator bitset() member function. I guess static_cast<uint8_t>(static_cast<bitset>( p.GetClassification() ) ) will work for me, with no execution overhead.<br><br>Although I'd be tempted to add an operator uint8_t() member function, for symmetry, as there is such a constructor.<br><br>Best regards <br>Peder<br><br>25 okt 2011 kl. 21:15 skrev "Mateusz Łoskot" <<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>>:<br><br></font><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span><a href="x-apple-data-detectors://8" x-apple-data-detectors="true" x-apple-data-detectors-result="8">2011/10/25</a> Peder Axensten <<a href="mailto:Peder.Axensten@slu.se">Peder.Axensten@slu.se</a>>:</span><br></font></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>I need a GetRawClassification() to be able to quickly copy the all the classification info when I copy a Point to a different point format.</span><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Using three IsXxx() is unnecessarily slow, since getting the raw classification is one copy and</span><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>doing it in the present way means 4 copies, 4 and:s, 4 or:s, and 3 if:s. At least.</span><br></font></blockquote></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Peder, you *can* do what you want to do and in the way you want it to do.</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Please, re-read previous post.</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>For clarity, repeated below this is how you do it now</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>std:;bitset<8> allbits = p.GetClassification();</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>You get *all* eight bits of classification flags, not only first 5</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>bits of index in classification</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>table (we call it class index for clarity).</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span></span><br></font></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Howard asked me to suggest a fix to the SetClassification bug and an implementation of GetRawClassification.</span><br></font></blockquote></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>There is no need for clunky GetRawClassification, the current</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>interface allows you to do what you want.</span><br></font></blockquote><font class="Apple-style-span" color="#000000"><br>I now see your point and I agree.<br><br></font><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Though, the bug in misuse of GetClass() still has to be fixed.</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Best regards,</span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>-- </span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Mateusz Loskot, <a href="http://mateusz.loskot.net/">http://mateusz.loskot.net</a></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000"><span>Charter Member of OSGeo,<a href="http://osgeo.org/">http://osgeo.org</a></span><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" color="#000000">Member of ACCU, <a href="http://accu.org/">http://accu.org</a></font></blockquote></div></blockquote><br></div><div><br>25 okt 2011 kl. 22:49 skrev "Howard Butler" <<a href="mailto:hobu.inc@gmail.com">hobu.inc@gmail.com</a>>:<br><br></div><div></div><blockquote type="cite"><div><span></span><br><span>On Oct 25, 2011, at 2:15 PM, Mateusz Łoskot wrote:</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Though, the bug in misuse of GetClass() still has to be fixed.</span><br></blockquote><span></span><br><span>In libLAS? Or in Peder's code? I guess I'm not following closely enough here... sorry.</span><br><span></span><br><span>Howard_______________________________________________</span><br><span>Liblas-devel mailing list</span><br><span><a href="mailto:Liblas-devel@lists.osgeo.org">Liblas-devel@lists.osgeo.org</a></span><br><span><a href="http://lists.osgeo.org/mailman/listinfo/liblas-devel">http://lists.osgeo.org/mailman/listinfo/liblas-devel</a></span><br></div></blockquote></body></html>