I still haven't figured this out.<br><br>When I look at my original datasets, I notice that the GlobalID array does not exist. I assmed that when I used vtkPointPIcker (with x,y,z=1) coordinates, vtkPointPicker::GetPointID() returns the global ID? I'm guessing it isnt; however trying with INDICES and PEDIGREEID yeilded empty extractions as well!<br>
<br><div class="gmail_quote">On Wed, Jul 8, 2009 at 12:46 AM, John Platt <span dir="ltr"><<a href="mailto:jcplatt@dsl.pipex.com">jcplatt@dsl.pipex.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2">Hi,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Try changing your selection array from vtkIntArray
to vtkIdTypeArray and check that the filters copy the GLOBALIDS (the default is
not to copy or interpolate).</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">John.</font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div><div></div><div class="h5">
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b>
<a title="remywendy@gmail.com" href="mailto:remywendy@gmail.com" target="_blank">da xu</a>
</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="vtkusers@vtk.org" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Wednesday, July 08, 2009 8:12
AM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> [vtkusers] vtkSelection with
GLOBALIDS,vtkExtractSelection returns empty</div>
<div><br></div>Hey all,<br><br>I am trying to extract a section of my datasets
using vtkSelection. I currently have a GUI that the user clicks on to select a
start and end point using vtkPointPicker, returning the PointID. With a
starting POINTID and ending POINTID, i then use a vtkSelection with field type
POINT, ContentType GLOBALIDS to extract a dataset containing the points (with
vtkSelectionNode's SetSelectionList correctly set I believe). However, I
always end up extracting an empty grid.<br><br>I can't figure out
if:<br> My vtkSelectionNode is set up incorrectly<br> I'm using
vtkExtractSelection incorrectly.<br> The vtkPointPicker doesnt actually
get GLOBALIDS ?<br> Missing an update somewhere?<br><br>Here is the
code:<br><br>// Set up vtkSelectionNode<br> vtkSelection*
selection = vtkSelection::New();<br> vtkSelectionNode*
selectionNode = vtkSelectionNode::New();<br>
selectionNode->SetFieldType(
<div>vtkSelectionNode::POINT);<br>
selectionNode->SetContentType(vtkSelectionNode::GLOBALIDS);<br><br>//
Populate the selection node with our GLOBALIDS (obtained from
vtkPointPicker)<br> vtkIntArray* intarray =
vtkIntArray::New();<br> for (int a = first; a < second;
a++)<br> {<br>
intarray->InsertNextValue(a);<br> }<br>
selectionNode->SetSelectionList(intarray);<br>
selection->AddNode(selectionNode);<br><br>// Some setup stuff, Our source
data is from a multiblock data set<br> vtkMultiBlockDataSet
*extractFrom = vtkMultiBlockDataSet::SafeDownCast(<a href="http://m_v_modules.at/" target="_blank">m_v_modules.at</a>(0)->getDataObject());<br>
int nblocks = extractFrom->GetNumberOfBlocks();<br><br>
vtkGeometryFilter *filter = vtkGeometryFilter::New();<br>
vtkDataSetMapper *mapper = vtkDataSetMapper::New();<br> int
counter=0;<br> vtkExtractSelection* extractSelection =
vtkExtractSelection::New();<br><br>// Iterate through our datasets (structured
grids) and apply vtkExtractSelection to them. Always extracts
empty!<br> vtkCompositeDataIterator *iter =
extractFrom->NewIterator();<br>
iter->InitTraversal();<br><br> int totalpoints =
0;<br> while
(!iter->IsDoneWithTraversal())<br>
{<br> vtkDataSet* ds =
vtkDataSet::SafeDownCast(iter->GetCurrentDataObject());<br>
if (ds)<br>
{<br> const char* name
= ds->GetClassName(); /// Temp
debugger<br>
extractSelection->RemoveAllInputs();<br>
extractSelection->SetInput(0,
ds); /// Set the vtkDataSet for
extraction<br>
extractSelection->SetInput(1, selection); /// Set the
vtkSelection for extraction<br>
vtkDataObject* extracted =
extractSelection->GetOutput();<br>
extractSelection->Update();<br>
const char* name2 =
extracted->GetClassName(); /// Temp
debugger<br>
<br>
vtkUnstructuredGrid* unstructGridTest =
vtkUnstructuredGrid::SafeDownCast(extracted);<br>
int ntemp1 =
unstructGridTest->GetNumberOfPoints();<br>
totalpoints +=
ntemp1;<br>
counter++;<br> }<br>
iter->GoToNextItem();<br> }<br></div>
</div></div><p>
</p><hr>
<p></p>_______________________________________________<br>Powered by
<a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages
on-topic and check the VTK FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to
subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div>
</blockquote></div><br>