[vtkusers] New bug : Issue #17101 - vtkConnectivityFilter - SetExtractionModeToSpecifiedRegions keep points from other regions.
    Jonathan Borduas 
    jonathan.borduas at caboma.com
       
    Wed Aug  9 15:06:39 EDT 2017
    
    
  
Hi everyone,
I added a new bug on the gitlab repo: Issue #17101
The GetNumberOfPoints is the same as before the extraction (bad), while the GetNumberOfCells has only the cell count of the specified regions (good).
Example code:
vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivity = vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();
connectivity->SetInputData(inputpolydata->GetOutput());
connectivity->SetExtractionModeToAllRegions();
connectivity->Update();
for (int i = 0; i < connectivity->GetNumberOfExtractedRegions(); ++i)
{
  connectivity->SetExtractionModeToSpecifiedRegions();
  connectivity->InitializeSpecifiedRegionList();
  connectivity->AddSpecifiedRegion(i);
  connectivity->Modified();
  connectivity->Update();
  vtkSmartPointer<vtkPolyData> extractedRegion = vtkSmartPointer<vtkPolyData>::New();
  extractedRegion->DeepCopy(connectivity->GetOutput());
  cout << "points extracted region: " << extractedRegion->GetNumberOfPoints() << endl;
  cout << "cells extracted region: " << extractedRegion->GetNumberOfCells() << endl;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170809/9891bd37/attachment.html>
    
    
More information about the vtkusers
mailing list