<div dir="ltr">Hi Rahul,<div>Downcasting is a c++ term for converting (casting) a parent class to an inherited class. In c++ you can always use (for public inheritance, anyway) a child class in place of a parent class (called upcasting, i.e. moving up the inheritance chain). If you want to use a parent class in a place where a child class is required you must downcast the parent (i.e. move down the inheritance chain). safeDownCast() give you a safe way to do this.</div>
<div><br></div><div>I searched "downcast upcast c++" on google and got a number of good explanations with example code.</div><div><br></div><div>Cheers,</div><div>Seth</div><div class="gmail_extra"><br clear="all">
<div><i>Seth Gilchrist, MASc, PhD Candidate<br><span style="font-family:courier new,monospace">+---------------------------------------+</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Orthopaedic and Injury Biomechanics Group<br>
UBC Department of Mechanical Engineering</span><span style="font-family:courier new,monospace"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">6th Floor-2635 Laurel Street</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">Vancouver, BC V5Z-1M9<br></span><span style="font-family:courier new,monospace">+---------------------------------------+<br><a href="mailto:seth@mech.ubc.ca" target="_blank">seth@mech.ubc.ca</a><br>
Fax 604-675-2576</span></i><br></div>
<br><br><div class="gmail_quote">On Thu, Jul 11, 2013 at 1:05 PM, rahul indoria <span dir="ltr"><<a href="mailto:rahulindoria5@gmail.com" target="_blank">rahulindoria5@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Hi All,</span>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> I just want to ask, what is purpose of function safeDownCast(), as it is not described ???</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br>
</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br>
</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br>
</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px">Looking forward your reply soon.</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br>
</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px">rahul indoria</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, Jul 11, 2013 at 6:19 PM, Seth Gilchrist <span dir="ltr">
<<a href="mailto:seth@mech.ubc.ca" target="_blank">seth@mech.ubc.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div dir="ltr">Hi Rahul,</div>
<div dir="ltr">It seems that you want to provide x,y,z coordinates and get the index of the point back. Once you have the index, you can use polydata's "GetPointData" method to access the point data.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">To do this, you can use the vtkKdTreePointLocator which as methods like "FindClosestPoint", "FindNClosestPoints", and "FindPointsWithinRadius". There are a few examples of how to use this class at <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx#KD-Tree" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx#KD-Tree</a>.
There are other classes like vtkPointLocator, vtkOctreePointLocator which you can look at too.</div>
<div dir="ltr">
<div><br>
</div>
<div>Cheers,</div>
<div>Seth</div>
<div><br>
</div>
<span style="font-style:italic">Seth Gilchrist, MASc, PhD Candidate</span><br style="font-style:italic">
<span style="font-style:italic;font-family:'courier new',monospace">+---------------------------------------+</span><br style="font-style:italic;font-family:'courier new',monospace">
<span style="font-style:italic;font-family:'courier new',monospace">Orthopaedic and Injury Biomechanics Group<br>
UBC Department of Mechanical Engineering</span><span style="font-style:italic;font-family:'courier new',monospace"></span><br style="font-style:italic;font-family:'courier new',monospace">
<span style="font-style:italic;font-family:'courier new',monospace">6th Floor-2635 Laurel Street</span><br style="font-style:italic;font-family:'courier new',monospace">
<span style="font-style:italic;font-family:'courier new',monospace">Vancouver, BC V5Z-1M9<br>
</span><span style="font-style:italic;font-family:'courier new',monospace">+---------------------------------------+<br>
<a href="mailto:seth@mech.ubc.ca" target="_blank">seth@mech.ubc.ca</a><br>
Fax <a href="tel:604-675-2576" value="+16046752576" target="_blank">604-675-2576</a></span></div><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888">
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr"><span style="color:rgb(0,0,255)"><b>Best Regards<br>
Rahul Indoria<br>
Mobile No: <a href="tel:%2B49-157-35652212" value="+4915735652212" target="_blank">+49-157-35652212</a></b></span><br>
</div>
</font></span></div>
</div>
</div>
</blockquote></div><br></div></div>