[vtkusers] FLTK and vtk questions

Steve Woolsey woolsr at inel.gov
Wed Feb 7 14:55:17 EST 2001


A couple of issues in using vtk with FLTK.  I downloaded John Shalf's
vtkFlWindow stuff, and got things working ok.  Now I have multiple FLTK
windows, each with a vtk subwindow.  The main window comes up ok, and I
have a vtk area which renders fine.  When I try to spawn a second
window, from a menu option in the main window, I get a seg fault when on
exit from my CrossSection3D::Show function (see below).  It is identical
to the one I used for the main window, but here it doesn't work. If I
comment out the vtk stuff, the window comes up fine.  Do I need to do
something special with this FLTK/VTK stuff to get multiple windows? 
Some of my code follows.  I know that FLTK isn't "officially" supported,
but am hoping someone out there has run into this problem before.  Any
help would be greatly appreciated.

Steve



Fl_Menu_Item CrossSection3D::menu_CrossSectionMenuBar[] = {
 {"Options", 0,  0, 0, 192, 0, 0, 14, 0},
 {"Close", 0,  0, 0, 0, 0, 0, 14, 0},
 {0},
 {0}
};
Fl_Menu_Item* CrossSection3D::crossSectionMenuOptions =
CrossSection3D::menu_CrossSectionMenuBar + 0;
Fl_Menu_Item* CrossSection3D::MenuOptionClose =
CrossSection3D::menu_CrossSectionMenuBar + 1;

CrossSection3D::CrossSection3D() {
  Fl_Window* w;
  { Fl_Window* o = View3D = new Fl_Window(813, 850, "Lithography v0.5 -
3D Cross-Section");
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(0, 0, 813, 850);
      { Fl_Menu_Bar* o = CrossSectionMenuBar = new Fl_Menu_Bar(0, 0,
800, 25);
        o->menu(menu_CrossSectionMenuBar);
      }
      { Fl_Slider* o = sliderScaleZ = new Fl_Slider(65, 825, 735, 25,
"Z-Scale");
        o->type(5);
        o->align(FL_ALIGN_LEFT);
      }
      { renWin2 = vtkFlRenderWindow::New();
        ren2 = vtkRenderer::New();
        renWin2->AddRenderer(ren2);
      }
      o->end();
    }
    o->end();
  }
}

void CrossSection3D::Show() {
  View3D->show();
  View3D->begin();
  vtkWin2 = new Fl_vtk_Window(renWin2, 0, 25, 800, 800);
  vtkWin2->show();
  View3D->end();
}  //****Seg faults at the exit of this function.




-- 
-------------------------------------------------------------------
Steven Woolsey                         Engineer/Scientist
Bechtel BWXT Idaho, LLC                Visualization Engineer
Idaho National Engineering Lab.        EMAIL: woolsr at inel.gov
P.O. Box 1625, M.S. 3605
Idaho Falls, ID  83415-3605
-------------------------------------------------------------------




More information about the vtkusers mailing list