[vtkusers] vtk+wxWindows+Diffpack=AAAARRGGHHHH!!

Gopalakrishnan, Gowri Gowri.Gopalakrishnan at inteq.com
Wed Nov 28 05:16:44 EST 2001


Hi 

I recently started with integrating vtk+wxwindows. I use the 
wxvtkwindow class of David D. Marshall & Brian Todd to initialize the
vtk window, instead of doing renwin->setparentId((hwnd) frame). The class
wxVTKWindow does this inside. 

Therefore i do the following: In my c++ project include the wxvtkwindows.cpp
and in the code 
I use a panel inside the frame.

panel = new wxPanel(frame, -1, wxPoint(0,0), wxSize(400,400))	
wxVTKWindow *win = new wxVTKWindow(panel, ID_VTK,wxPoint(0,0),
wxSize(400,400));
win ->SetRenderWindow(myVTK->renWin);

I attach  the cpp and header files for wxvtkwindow. So that you can move
ahead with it quickly. If you are interested you can go through this to 
find out what initialisation you are missing. If you look in the Onpaint
method of wxvtkwindow you can see that renwin->setparentid is done there.

hope this helps. I also tried to do exactly what you tried and the frame
came up but the rendering part of the window was not there. I did not get
any error.

Regards
Gowri


-----Original Message-----
From: stefano mininel [mailto:mininel.ml at gnbts.univ.trieste.it]
Sent: Wednesday, November 28, 2001 9:56 AM
To: vtkusers at public.kitware.com
Subject: [vtkusers] vtk+wxWindows+Diffpack=AAAARRGGHHHH!!


Hi everyone. A brief introduction: I'm trying to obtain a "menage a
trois" with vtk, wxWindows (cross-platform GUI libraries, freeware&open
source) and Diffpack (C++ classes and libraries for partial differences
solution, commercial) in VC++ 6.0.
It's not terribly easy (and I'm really not an informatics "guru") so
this is probably only the first of several questions I'll ask you about
the more vtk-related problems.
Now the question:

I declare a wxWindows frame:
"class MyFrame : public wxFrame"

create it:
"MyFrame *frame = new MyFrame("Minimal wxWindows App", wxPoint(50, 50),
wxSize(500, 500));"

create a vtk window and assign her the wxFrame HWND:
"vtkWin32OpenGLRenderWindow *renWin = vtkWin32OpenGLRenderWindow::New();

     renWin->SetWindowId(HWND(frame));"

and then do all the other things of the graphics pipeline.
No problems in the compiling/linking, but when I run the executable the
frame appears but immediately after that I receive a "ChoosePixelFormat
failed" message and application closes after "OKing" the message..
Have I done something terribly wrong/naive or in general this should do
well but there are some subtle adjustments to be done?
Thanks for any help or tip!

    Stefano Mininel

_______________________________________________
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wxVTKWindow.cpp
Type: application/octet-stream
Size: 7472 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20011128/894a6891/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wxVTKWindow.h
Type: application/octet-stream
Size: 2181 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20011128/894a6891/attachment-0001.obj>


More information about the vtkusers mailing list