[vtkusers] choosing the best tool for creating GUIs

K.R.Subramanian krs at cs.uncc.edu
Sat Sep 21 14:40:41 EDT 2002


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

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

    -- krs



Prabhu Ramachandran wrote:

> >>>>> "TD" == Thomas Deschamps <tdeschamps at lbl.gov> writes:
>
>     >> You'd need to be more specific.
>     TD> I have C++ routines, with lots of classes, namespaces, and
>     TD> templates.  This code is mostly image processing code,
>     TD> filtering, segmentation, etc...  I want to build a GUI
>     TD> interface that will take care of the input of the parameters
>     TD> to my routines (number of iterations of processes, but also
>     TD> interaction with the vtkRenderWindow where I pick some
>     TD> locations.  I have no experience with the interfaces, and I
>     TD> would like to know if it is really needed to wrap my code in
>     TD> another language like python. Is there another way to call
>
> You only need to wrap those calls that you need to make from the
> scripting interface.
>
>     TD> directly the C++ routines fron an interface.  What is the gain
>     TD> from using a scipting language? Is there a huge tradeoff in
>
>   1. Rapid application development and prototyping.
>
>   2. Dynamic typing of Python is a huge advantage.  You wont realize
>   how useful it is until you start using it.
>
>   3. Scriptability of your code.  i.e. it is easy to extend the code
>   and use it from the Python interpreter.
>
>   4. Advanced and easy to use data types.
>
>   5. Large set of standard libaries.
>
> The possibilities are enormous.  The minus side is that you should not
> write cpu intensive stuff in the scripted language (that too is
> changing slowly but I wont go down that track right now).
>
> So usually a scripting languages biggest plus is that it is extremely
> useful as 'glue' language.
>
> Also consider reading this:
>
>   http://www.scriptics.com/doc/scripting.html
>
> Its a very nice article.
>
>     TD> the capabilities of the GUIs?  I know scripts are useful in
>     TD> terms of developments and tests because you don't need to
>     TD> compile them, etc... but not in terms of GUI.  Why PyQt and
>     TD> not directly Qt for example?
>
> Why not?
>
> You could always write it in C++ but then again you could write it in
> C.  Fortran?  Assembly? :-D
>
> The Python layer is usually very thin and allows you to build nice
> GUI's.  Plus there is so much choice.
>
> 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

--
K.R.Subramanian                        Phone: (704) 687-4872
Department of Computer Science         FAX:   (704) 687-4893
UNC Charlotte, CARC 311                Email: krs at cs.uncc.edu
Charlotte, NC 28223-0001               Web: http://www.cs.uncc.edu/~krs






More information about the vtkusers mailing list