Thread: [wxVTK] Small render window issue
Brought to you by:
malat
From: Jason G. <jg...@ui...> - 2007-03-22 03:56:22
|
Okay, so I've gotten things running finally. But now I have two problems. wxVTK decides to render on only a small portion of the panel I gave it to render on.and/or if I set the size of it explicitly to the size of the panel it takes up the whole panel BUT the mousemotion stuff results in my object disappearing altogether. I'm making my own frame, but my VTK scene is the same scene as in the wxSample.proj file included with wxVTK. It's just the cone that spins. Here's what I'm doing in the constructor of my main wxFrame: wxMedVisFrame::wxMedVisFrame( wxWindow *parent ) : MainFrame( parent ) { DisplayPanel* displayPanel = new DisplayPanel( this ); displayPanel->SetInitialSize( this->GetSize() ); // register this panel with wxVTKRenderWindowInteractor this->vtkDisplayInteractor = new wxVTKRenderWindowInteractor( displayPanel, ID_VTK_RENDER_INTERACTOR ); this->vtkDisplayInteractor->UseCaptureMouseOn(); // initialize VTK scene this->InitVTK(); } // THE CODE BELOW SETS UP A SIZER THAT I DON'T USE JUST YET. // IT'S THERE SO I CAN HAVE A "WINDOWED" MODE LATER, CURRENTLY IT STARTS WITH STYLE = WXMAXIMIZE MainFrame::MainFrame( wxWindow* parent, int id, wxString title, wxPoint pos, wxSize size, int style ) : wxFrame( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxFlexGridSizer* MainFrameSizer; MainFrameSizer = new wxFlexGridSizer( 2, 2, 0, 0 ); MainFrameSizer->AddGrowableCol( 0 ); MainFrameSizer->AddGrowableRow( 1 ); MainFrameSizer->SetFlexibleDirection( wxBOTH ); MainFrameSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); this->SetSizer( MainFrameSizer ); this->Layout(); } DisplayPanel::DisplayPanel( wxWindow* parent, int id, wxPoint pos, wxSize size, int style ) : wxPanel( parent, id, pos, size, style ) { this->SetBackgroundColour( wxColour( 0, 0, 0 ) ); } This code results in the panel taking up my entire frame (I know this because my panels background is black and my frames is gray) but wxVTK only renders to a small square in the upper left corner. If I explicitly set the size of wxVTKRenderWindowInteractor to the size of my frame, or even my panel, then it renders to the whole thing but the mouse interaction is doing something weird because the cone just disappears. The wxSample works fine. Does it have something to do with the constructor for wxVTKRenderWindowInteractor? Jason Gorski University of Illinois at Chicago Masters in Computer Science <mailto:jg...@ui...> jg...@ui... |
From: Mathieu M. <mat...@gm...> - 2007-03-29 14:47:05
|
Hi Jason, Sorry I can't help you right now (very limited internet access and no access to wxVTK at all). Anybody else here has any clue what is going on ? -M On 3/22/07, Jason Gorski <jg...@ui...> wrote: > > > > > Okay, so I've gotten things running finally. But now I have two problems= =85 > wxVTK decides to render on only a small portion of the panel I gave it to > render on=85and/or if I set the size of it explicitly to the size of the = panel > it takes up the whole panel BUT the mousemotion stuff results in my objec= t > disappearing altogether. > > > > I'm making my own frame, but my VTK scene is the same scene as in the > wxSample.proj file included with wxVTK. It's just the cone that spins. > > > > Here's what I'm doing in the constructor of my main wxFrame: > > > > wxMedVisFrame::wxMedVisFrame( wxWindow *parent ) > > : MainFrame( parent ) > > { > > DisplayPanel* displayPanel =3D new DisplayPanel( this ); > > displayPanel->SetInitialSize( this->GetSize() ); > > > > // register this panel with wxVTKRenderWindowInteractor > > this->vtkDisplayInteractor =3D new wxVTKRenderWindowInteractor( > displayPanel, ID_VTK_RENDER_INTERACTOR ); > > this->vtkDisplayInteractor->UseCaptureMouseOn(); > > > > // initialize VTK scene > > this->InitVTK(); > > } > > > > // THE CODE BELOW SETS UP A SIZER THAT I DON'T USE JUST YET. > > // IT'S THERE SO I CAN HAVE A "WINDOWED" MODE LATER, CURRENTLY IT STARTS > WITH STYLE =3D WXMAXIMIZE > > MainFrame::MainFrame( wxWindow* parent, int id, wxString title, wxPoint p= os, > wxSize size, int style ) : wxFrame( parent, id, title, pos, size, style ) > > { > > this->SetSizeHints( wxDefaultSize, wxDefaultSize ); > > > > wxFlexGridSizer* MainFrameSizer; > > MainFrameSizer =3D new wxFlexGridSizer( 2, 2, 0, 0 ); > > MainFrameSizer->AddGrowableCol( 0 ); > > MainFrameSizer->AddGrowableRow( 1 ); > > MainFrameSizer->SetFlexibleDirection( wxBOTH ); > > MainFrameSizer->SetNonFlexibleGrowMode( > wxFLEX_GROWMODE_SPECIFIED ); > > > > this->SetSizer( MainFrameSizer ); > > this->Layout(); > > } > > > > DisplayPanel::DisplayPanel( wxWindow* parent, int id, wxPoint pos, wxSize > size, int style ) : wxPanel( parent, id, pos, size, style ) > > { > > this->SetBackgroundColour( wxColour( 0, 0, 0 ) ); > > > > > } > > > > This code results in the panel taking up my entire frame (I know this > because my panels background is black and my frames is gray) but wxVTK on= ly > renders to a small square in the upper left corner. > > > > If I explicitly set the size of wxVTKRenderWindowInteractor to the size o= f > my frame, or even my panel, then it renders to the whole thing but the mo= use > interaction is doing something weird because the cone just disappears. > > > > The wxSample works fine. > > > > Does it have something to do with the constructor for > wxVTKRenderWindowInteractor? > > > > Jason Gorski > University of Illinois at Chicago > Masters in Computer Science > jg...@ui... > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Wxvtk-users mailing list > Wxv...@li... > https://lists.sourceforge.net/lists/listinfo/wxvtk-users > > --=20 Mathieu |