[vtkusers] Activiz and C, design question

David Cole dlrdave at aol.com
Wed Jul 24 12:39:11 EDT 2013


> I have some visualization code that are using vtk, written in C++. I 
> have created a C wrapper to this code, and 'it' works. This  C API, 
> allow me to hand externally created renderwindows, 
> renderwindowinteractors and renderers handles, i.e. void* pointers to 
> concrete objects, allowing my underlying vtkobjects, that are created 
> through the C API, to be rendered.
> 
> My question is, if I use activiz, together with my code (that I would 
> need to give a C# wrapper), will I be able to hand my library those 
> handles from activiz, so my code can use activiz to render?



If you have objects that you have created in ActiViz in a C# program, you should be able to call “GetCppThis()” on any of them and use the “.Handle” property on that to get the “void *” pointer values you would need to pass to your C layer.


The method is implemented in Kitware.mummy.Runtime.WrappedObject, the parent class of all ActiViz vtkObject-derived classes. [ code here: http://public.kitware.com/gitweb?p=mummy.git;a=blob;f=Runtime/WrappedObject.cs;h=6060cad5;#l69 ]


You will have to be mindful/careful about lifetime management and reference counting issues using this from a plain C implementation, but I’m sure you’re already aware of that.



HTH,

David C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130724/21447bdf/attachment.htm>


More information about the vtkusers mailing list