[vtkusers] vtkDataSet interface in wrapped language

Gerrick Bivins Gerrick.Bivins at halliburton.com
Wed Jun 26 08:44:15 EDT 2013


Hi all,
I have some data that I'd like to process/visualize using VTK pipelines.
At the moment, I'm investigating structured data but eventually I would like to use unstructured.
Anyway, I have access to the data through Java API's and I'm trying to understand the proper approach. For example,
if I want to use VTK to generate a slice through this data it feels like I need to do something like:

       Object javaGrid;// = ...;
        vtkDataSet dataset;// = ...;

        //translate javaGrid to vtkDataSet
        vtkPoints points;// = ...;
        dataset.setPoints(points);
        ///copy points
        for(javaGrid.getNumberOfPoints())
        {
            points.insertNextPoint(javaGrid.getPoint(i)[0], javaGrid.getPoint(i)[1], javaGrid.getPoint(i)[2]))
        }
        ...
        //topology
        for(cell:javaGrid.getNumberOfCells())
        {
              vtkCell translatedCell = getVTKCellFromJavaGridCell(cell);
              dataset.insertNextCell(cell.getType(),cell.getIds());
         }
         ///attributes
         for(attribute:javaGrid.getPointBasedAttributes())
         {
            vtkDataArray translatedArray = getVTKArrayFromJavaGridArray(attribute);
           dataset.getPointData().addArray(translatedArray);
         }
...
//Set up pipeline from dataset to generate slice

..



You, get the idea, brute force translation to vtkDataSet and then proceed as normal for VTK processing.

Ideally, what I would prefer to do in Java is implement some interface or extend some abstract class that makes my data look like a vtkDataSet

w/o translating. I saw the vtkGenericDataSet class but I'm not sure if it's intended for what I'm wanting to do or if it works in a wrapped language.



For example, if I have data that represents a structured grid, I really only need to specify my dx,dy,dz and origin and the attributes but it looks like there is much more in the vtkGenericDataSet to implement than that.



I also looked at some of the vtkProgrammable* classes but those seem to be more of a "translation".



Is it possible to do something like this with the existing API? If not, what are the suggested approaches to achieving something like this?



Gerrick

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130626/c3fbbbd3/attachment.htm>


More information about the vtkusers mailing list