[vtkusers] Using vtkMarchingCubes3D with vtkContourWidget

Karthik Krishnan karthik.krishnan at kitware.com
Sat Nov 6 12:05:10 EDT 2010


Jonathan:

Use the other signature of the method GetNextCell. [ int
GetNextCell(vtkIdList *pts) ]That should be wrapped...

The code to re-order the points based on the connectivity information
would be written in java as :

  vtkIdList idlist = new vtkIdList();
  unorderedPolyData.GetLines().GetNextCell(idlist);
  npts = idlist.GetNumberOfIds();
  for ( int i = 0;  i < ( npts-1 );  i ++)
    {
    points.InsertPoint(i, unorderedPolyData.GetPoints().GetPoint(pts[i]));
    }

--
karthik

On Wed, Nov 3, 2010 at 7:29 AM, Jonathan Morra <jonmorra at gmail.com> wrote:
> I have a 3D vtkPolyData mesh that I wish to convert into 2D
> vtkContourWidgets.  The poly data was generated with vtkMarchingCubes3D.  My
> process is to run vtkCutter on each slice of the poly data and use that as
> seed data to create my contour widgets.  However, when I create my contour
> widgets the points are all out of order.  I found the following post that
> seems to be stating what I want to do
> http://vtk.1045678.n5.nabble.com/question-about-vtkContourWidget-vtkContourRepresentation-td1255118.html#a3247766
> however, this example is written in C++ and I'm working in Java, and there
> doesn't appear to be any vtkCellArray.GetNextCell() method in Java's VTK.
> 1.  Is this the solution to my problem?
> 2.  If so can someone please translate this code into Java, and if this
> isn't the solution I'm looking for, can someone suggest one?
> Thanks
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list