[vtkusers] choosing the best tool for creating GUIs

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sat Sep 21 22:41:12 EDT 2002




>>>>> "KRS" == K R Subramanian <K.R.Subramanian> writes:

    KRS> Somewhat related qn.. is it possible to directly control the
    KRS> rendering window from C++ with Python being used to build the
    KRS> interface? I am interested in using Python to just build the
    KRS> interface and feed into commands that call C++ modules, but I
    KRS> would like to directly control the rendering from C++ (in
    KRS> other words, using Python embedding).  Especially, when you
    KRS> are reading large datasets, I would like to avoid these
    KRS> transfers between C++ and python - instead do allprocessing
    KRS> within C++ and finally feed the pipeline into the rendering
    KRS> window from C++..

Well, thats pretty much the way it works already.  The Python-VTK API
is a thin wrapper around the C++ classes.  All it does is to expose
the C++ classes to Python.  So actually, if you read a large dataset
its C++ thats doing all the dirty work.  There will be some overhead
but its usually imperceptibly small.  Ofcourse, if its a class that
you wrote and want to use you'd need to wrap that too so that Python
can see your class.  However if you really need to take a Python VTK
object and get a pointer to the C++ object that it uses you can do so.
Look at the vtkPythonGetPointerFromObject function in
Common/vtkPythonUtil.h.  Similarly you can also do the reverse.

    KRS> If anyone has done this, I certainly could use little code
    KRS> fragments illustrating this. Then I can stop fighting with
    KRS> Motif..

Alternatively you could use some other GUI toolkit that is easier to
use -- wxWindows?

regards,
prabhu
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list