[Paraview] Isosurface and slicing with Catalyst in C++

Andy Bauer andy.bauer at kitware.com
Wed Sep 2 18:20:57 EDT 2015


Yes, I sometimes forget that the C++ pipeline can be done from ParaView
abstractions instead of through VTK. And yes, that will be much easier if
you're looking to generate .pngs. The example that you should look at for
that is at
https://github.com/Kitware/ParaViewCatalystExampleCode/tree/master/CxxPVSMPipelineExample.
The vtkCPPVSMPipeline class doesn't create images but it does create a
slice filter and then writes out the result using the parallel XML polydata
writer.

If you want to try that out on your own, I'd suggest looking closely at
that example. If you want to try Berk's suggestion of getting it working in
Python, we can certainly help with converting it to C++.

On Wed, Sep 2, 2015 at 5:23 PM, Berk Geveci <berk.geveci at kitware.com> wrote:

> One thing I want to clarify with respect to what Andy said. Figuring out
> parallel rendering in VTK is tricky but from ParaView be it C++ or Python,
> it is much easier. We are here to provide help.
>
> Having said this, if you think that you will be changing your in situ
> functionality regularly, I would also highly recommend the Python route. If
> you are planning to build in a relatively fix in situ capability, C++ is a
> decent option. I would still recommend getting there through the Python
> route.  Once you have everything figured out, we can help convert things to
> C++.
>
> Best,
> -berk
>
> On Wed, Sep 2, 2015 at 12:01 PM, Andy Bauer <andy.bauer at kitware.com>
> wrote:
>
>> Hi Matthieu,
>>
>> I would strongly recommend that you use a ParaView GUI generated Python
>> Catalyst pipeline script instead of hand-written C++ Catalyst pipeliine to
>> do what you want. There are a surprising amount of settings required to
>> output images from VTK. If you want to do that in parallel the complexity
>> goes up even more due to parallel compositing of the images. Everyone that
>> I've run across that wanted to avoid Python with their Catalyst
>> instrumented code quickly changed their mind after trying out the Python
>> generated scripts. The overhead of using Python really is negligible
>> compared to a pure C++ description of the Catalyst pipeline. Also, the
>> Catalyst Live and Cinema output are all driven by Python code as well.
>>
>> The last and only time I tried doing rendering in parallel in VTK it took
>> me about 5 days and that was with constantly asking questions from other
>> people here at Kitware that knew how to do that.
>>
>> That being said, if after reading this you're still set on doing all of
>> this in C++ then let us know and we'll see what can be done.
>>
>> Regards,
>> Andy
>>
>>
>> On Wed, Sep 2, 2015 at 2:38 PM, Dorier, Matthieu <mdorier at anl.gov> wrote:
>>
>>> Hi,
>>>
>>> I'm diving into Catalyst and try to build a pipeline in C++ for an
>>> simple example code. My use case is the following:
>>> I have a uniform 3D grid (converted into vtkImageData) on which I map a
>>> field of double values (wrapped into a vtkDoubleArray).
>>> By looking at the examples I managed to make the adaptor that creates
>>> the grid and maps the field on it. Now I would like to build pipelines for
>>> 2 scenarios:
>>> - slicing the grid horizontally at a given level, apply a color map, and
>>> output the result in a PNG file;
>>> - building an isosurface from the 3d grid (with configurable isovalue)
>>> and print the result in a PNG file.
>>> In both cases I don't know which classes to look at in the Doxygen of
>>> VTK. Besides, I suppose for the second case there should be some concept of
>>> camera position and parameters...
>>>
>>> Any hint or examples would be appreciated.
>>> Thanks,
>>>
>>> Matthieu Dorier
>>>
>>> _______________________________________________
>>> 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 ParaView Wiki at:
>>> http://paraview.org/Wiki/ParaView
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>
>> _______________________________________________
>> 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 ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/paraview
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150902/0b55a35f/attachment.html>


More information about the ParaView mailing list