Thanks a bunch, Dean! Changing "double * fweights" to "double fweights[8]" solved my problem!<br><br>Thanks again!<br>-Jake<br><br><div class="gmail_quote">On Jan 23, 2008 3:41 PM, <<a href="mailto:dean.inglis@camris.ca">
dean.inglis@camris.ca</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Jake,<br><br>could be segfaulting due to<br>double * fweights;
<br>which can be fixed with<br><br>double fweights[8];<br><br>see how vtkImageData calls FindCell at line 747...<br><br>Dean<br><div><div></div><div class="Wj3C7c"><br><br>/********************begin code**********************/
<br>...<br> //double p[3] is initialized<br>...<br> vtkEmptyCell * femptycell = vtkEmptyCell::New();<br> vtkCell * fcell = femptycell->NewInstance();<br> vtkIdType fcellID;<br> double ftol2;<br> int fsubId;<br> double fpcoords[3];
<br> double * fweights;<br><br> vtkIdType fFindCell = [instance of vtkImageData *]->FindCell(p, fcell,<br>fcellID, ftol2, fsubId, fpcoords, fweights);<br><br> std::cout << "cellID returned from FindCell() = " << fFindCell <<
<br>std::endl;<br>/********************end code**********************/<br><br>When I click on one of the orthogonal slices, my application successfully<br>prints out the cellId, for instance:<br><br>"cellID returned from FindCell() = 42196578"
<br><br>However, it then crashes with a Segmentation Fault. I have narrowed the<br>problem down to this chunk of code because when I replace it with similar<br>code to compute the cell ID (pasted below), it runs fine without any seg
<br>fault.<br></div></div></blockquote></div><br>