[Paraview-developers] polygon selection on image under slice representation

giavi73 at libero.it giavi73 at libero.it
Fri May 30 05:58:10 EDT 2014


Hi,
i want to implement polygon selection on images under "slice" representation (because switching to "surface" representation is RAM consuming).I'm able to catch polygon point draw on interface using selectedCustomPolygon signal of pqRenderViewSelectionReaction.I'm able to select the id of image points contained in the polygon.I have two problems:1) I don't understand the correct way to create selection (vtkSelection) object starting from ids:

 vtkSmartPointer<vtkSelectionNode> selectionNode = vtkSmartPointer<vtkSelectionNode>::New();
  selectionNode->SetFieldType(vtkSelectionNode::POINT);
  selectionNode->SetContentType(vtkSelectionNode::INDICES);  selectionNode->GetProperties()->Set(vtkSelectionNode::PROCESS_ID(),????); selectionNode->GetProperties()->Set(vtkSelectionNode::SOURCE(), ????);  selectionNode->SetSelectionList(ids);

  vtkSmartPointer<vtkSelection> selection = vtkSmartPointer<vtkSelection>::New();

  selection->AddNode(selectionNode);
how can I get PROCESS_ID and SOURCE key? 
2) I don't know how to make the selection available  (set as second input) to "ExtractSelection" filter. I try with:
pqActiveObjects* actObj = &pqActiveObjects::instance();
vtkSMProxy *sourceSel = vtkSMSelectionHelper::NewSelectionSourceFromSelection(actObj->activeServer()->session(), selection, true);vtkSMSourceProxy::SafeDownCast(actObj->activeSource()->getProxy())->SetSelectionInput(0,(vtkSMSourceProxy*)sourceSel,1);
but nothing happens i.e. after selection and "ExtractSelection" invokation the widget "Copied Selection" remains empty.
Thanks,Best Regards,Vincenzo

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140530/38106f24/attachment.html>


More information about the Paraview-developers mailing list