[vtkusers] vtkDataSet interface in wrapped language

Gerrick Bivins Gerrick.Bivins at halliburton.com
Thu Jun 27 09:17:50 EDT 2013


Thanks Sebastien.
This is good info. Upon some further digging, I've found it may be possible for me to implement some
interfaces on my side that wrap the vtk objects and the vtk pipelines.
I'll have to do a translation of the output polydata from the pipelines to render but I may still be able
to avoid the initial input copy.
Gerrick

From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com]
Sent: Wednesday, June 26, 2013 8:42 AM
To: Gerrick Bivins
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkDataSet interface in wrapped language

Hi Gerrick,

their is no way to my knowledge in Java to make the C++ layer use your data structure. (At least easily with what is available within VTK)
The vtkProgrammable* are used to embed your filter/source logic into VTK pipeline, but it still require you to create a vtkDataObject anyway...

It will be easier to do it the other way around. Make Java use a VTK/C++ data structure.

Seb

On Wed, Jun 26, 2013 at 8:44 AM, Gerrick Bivins <Gerrick.Bivins at halliburton.com<mailto:Gerrick.Bivins at halliburton.com>> wrote:
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.

_______________________________________________
Powered by www.kitware.com<http://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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130627/e5fa74e3/attachment.htm>


More information about the vtkusers mailing list