[vtkusers] FLUID and vtkFlRenderWindowInteractor

Charl P. Botha c.p.botha at ewi.tudelft.nl
Wed Dec 10 08:08:04 EST 2003


On Wed, 2003-12-10 at 13:43, Lucas Peetz Dulley wrote:
> Does anyone have an example on how to use vtkFlRenderWindowInteractor 
> with FLUID?
> 
> I cannot figure it out on my own.

You can name your own classes in FLUID.  See the attached example fl
file.  It was made with a 1.0.x fluid, so you might have to put in some
effort to get it to work with a 1.1.x fluid.

This .fl comes from a much larger project.  I unfortunately don't have a
simpler one of which I can supply the complete source code.

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/

-------------- next part --------------
# data file for the Fltk User Interface Designer (fluid)
version 1.0011 
header_name {.h} 
code_name {.cxx} 
gridx 5 
gridy 5 
snap 3
decl {class vtkFlRenderWindowInteractor;} {public
} 

decl {\#include "event_codes.h"} {} 

decl {\#include <vtkFlRenderWindowInteractor.h>} {} 

class model_window_t {open
} {
  Function {model_window_t()} {open
  } {
    Fl_Window window {
      label {Modely-Viewy-Windowy-Thingy} open
      xywh {384 85 486 475} resizable visible
    } {
      Fl_Box fl_vtk_window {
        label {fl_vtk_window here}
        xywh {15 25 455 435} resizable
        class vtkFlRenderWindowInteractor
      }
      Fl_Menu_Bar {} {open
        xywh {0 0 485 25}
      } {
        submenu {} {
          label {&File} open
          xywh {0 0 100 20}
        } {
          menuitem {} {
            label {&Save scene}
            user_data MWMB_SAVE_SCENE
            callback mw_menubar_cb
            xywh {0 0 100 20}
          }
          menuitem {} {
            label {Save &Rotation Sequence}
            user_data MWMB_SAVE_ROT_SEQ
            callback mw_menubar_cb selected
            xywh {0 0 100 20}
          }
        }
        submenu {} {
          label {&Interaction} open
          xywh {0 0 100 20}
        } {
          submenu {} {
            label {&Style} open
            xywh {0 0 100 20}
          } {
            menuitem {} {
              label {&Trackball}
              user_data MWMB_TRACKBALL_STYLE
              callback mw_menubar_cb
              xywh {5 5 100 20} value 1
            }
            menuitem {} {
              label {&Joystick}
              user_data MWMB_JOYSTICK_STYLE
              callback mw_menubar_cb
              xywh {5 5 100 20}
            }
          }
          submenu {} {
            label {&Mode} open
            xywh {0 0 100 20}
          } {
            menuitem {} {
              label {&Camera}
              user_data MWMB_CAMERA_MODE
              callback mw_menubar_cb
              xywh {5 5 100 20} shortcut 0x80063 value 1
            }
            menuitem {} {
              label {&Actor}
              user_data MWMB_ACTOR_MODE
              callback mw_menubar_cb
              xywh {5 5 100 20} shortcut 0x80061
            }
          }
        }
        submenu {} {
          label {&View} open
          xywh {0 0 100 20}
        } {
          menuitem {} {
            label {&Spawn}
            user_data MWMB_SPAWN
            callback mw_menubar_cb
            xywh {0 0 100 20}
          }
          menuitem {} {
            label {Ortho &Z}
            user_data MWMB_ORTHO_Z
            callback mw_menubar_cb
            xywh {0 0 100 20} shortcut 0x40031
          }
          menuitem {} {
            label {Ortho &X}
            user_data MWMB_ORTHO_X
            callback mw_menubar_cb
            xywh {0 0 100 20} shortcut 0x40033
          }
          menuitem {} {
            label {Ortho &Y}
            user_data MWMB_ORTHO_Y
            callback mw_menubar_cb
            xywh {0 0 100 20} shortcut 0x40037
          }
          menuitem {} {
            label {&Low detail}
            user_data MWMB_LOW_DETAIL
            callback mw_menubar_cb
            xywh {0 0 100 20}
          }
          menuitem {} {
            label {&High detail}
            user_data MWMB_HIGH_DETAIL
            callback mw_menubar_cb
            xywh {10 10 100 20}
          }
        }
      }
    }
  }
  Function {~model_window_t()} {open
  } {
    code {// we have to Delete() the fl_vtk_window; it's destructor will remove it from its parent
fl_vtk_window->Delete();
// and it's obvious that we shouldn't forget to delete the fltk parent window
delete window;} {}
  }
} 


More information about the vtkusers mailing list