[vtkusers] Fwd: Division of vtkPolyData - please help me ...

Hila Hiler hilahiler at gmail.com
Tue May 8 06:26:22 EDT 2012


Hi All,

I hope somebody will answer me this time :-)
actualy, my question is very simple:

In order to divide my polyData- I simply divided it to buckets such that
each bucket will contain X number of cells in this way:


 unsigned int cell_num = poly->GetNumberOfCells();

// building vtkCellLocator
 vtkSmartPointer<vtkCellLocator> cellLocator =
vtkSmartPointer<vtkCellLocator>::New();
 cellLocator->SetDataSet(poly);
 cellLocator->BuildLocator();
 cellLocator->SetNumberOfCellsPerBucket(cell_num/numOfRequiredRegions);
 cellLocator->Update();

//build a list of indexes for each region
 vtkSmartPointer<vtkIdList> listOfIndexesInBucket =
vtkSmartPointer<vtkIdList>::New();
 vtkIdType curIdx;

 //go over each bucket
 for(int i=1; i<numOfRequiredRegions; i++)
  {
   *listOfIndexesInBucket = cellLocator->GetCells(i);*
      for(vtkIdType id=1; id<cell_num; id++) //go over each cell in bucket
         curIdx = listOfIndexesInBucket->GetId(id); //get the index in each
cell
  }


Unfortunately, there is a RT error in the marked line above and the
folowing code + massage are represented the error:

unhandled exeption acces violaion reading location ...
and the code is:

void vtkSmartPointerBase::Register()
{
  // Add a reference only if the object is not NULL.
  if(this->Object)
    {
    this->Object->Register(0);
    }
}

Any Idea ?


Thanks.


---------- Forwarded message ----------
From: Hila Hiler <hilahiler at gmail.com>
Date: Mon, May 7, 2012 at 7:35 PM
Subject: Division of vtkPolyData
To: "<vtkusers at vtk.org>" <vtkusers at vtk.org>


Hi all,

I have a vtkPolyData and would like to:
1. divide it to regions/areas/pieces
2. get the indexes/cells/array from that division to further processing

Visually, I'd like to get
this<http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/OBBDicer>division
BUT to use the indexes that this division returns.
(if you look at the attached link, I'd like to get the points that each
piece has)
I know OBBDicer won't return the required data, but which can?

ANY help, I'm lost ...
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120508/2ad882b7/attachment.htm>


More information about the vtkusers mailing list