[vtkusers] how to subclass a vtk class

Dan Lipsa dan.lipsa at kitware.com
Thu Feb 22 09:09:10 EST 2018


Guy,
I would advise to use vtk fields inside your Qt classes instead of using
subclassing. You would need to subclass a vtk class only if you do vtk
development.
If you want o see how it is done the best place to look at is the vtk
source code. For instance vtkCylinderSource is derived from
vtkPolyDataAlgorithm.

There are Qt examples you can take a look at here

https://lorensen.github.io/VTKExamples/site/Cxx/#qt

Dan


On Wed, Feb 21, 2018 at 8:52 PM, Walter Rhoden via vtkusers <
vtkusers at vtk.org> wrote:

>
> I am looking for guidance on how to correctly subclass a vtk class.  I
> have seen a number of older examples (vtk 5 or earlier) that all seem to
> fail now for various reasons.  I attempted to debug a number of them but
> this was an endeavor in frustration and I gave up in disgust.
>
> Does anyone know of a good up to date guide document and/or simple example
> that illustrates the basics?
>
> I am working in C++ and with QT.  I have the basics down pretty good.  I
> am looking to subclass some of the basic geometry classes such as
> vtkcylindersource and similar with the idea of added some additional
> methods specific to the overall function of my QT program/project.
> Obviously this is not as simple as calling out the vtk class as the
> inherited class.
>
> Any help/guidance would be greatly appreciated.
>
> Thanks,
>
> Guy
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180222/2a830e7e/attachment.html>


More information about the vtkusers mailing list