Fl_Window * make_window() { Fl_Window * w; { Fl_Window * o = main_window = new Fl_Window(741, 622, "ASF/AMC Motion Capture Player"); w = o; { Fl_Group * o = new Fl_Group(10, 485, 615, 140); { Fl_Button * o = loadSkeleton_button = new Fl_Button(10, 495, 120, 40, "Load Skeleton");//*** o->callback((Fl_Callback *)load_callback); } { Fl_Button * o = loadMotion_button = new Fl_Button(140, 495, 120, 40, "Load Motion"); //*** o->callback((Fl_Callback *)load_callback); } // "Reload motion" always reload the last skeleton loaded { Fl_Button * o = reloadMotion_button = new Fl_Button(270, 495, 120, 40, "Reload Motion");//*** o->callback((Fl_Callback *)reload_callback); } { Fl_Button * o = resetScene_button = new Fl_Button(400, 495, 120, 40, "Reset Scene"); o->callback((Fl_Callback *)resetScene_callback); } { Fl_Light_Button* o = record_button = new Fl_Light_Button(380, 575, 40, 25, "R"); o->callback((Fl_Callback *)record_callback, (void*)(0)); } { Fl_Button * o = screenShot_button = new Fl_Button(280, 575, 90, 25, "ScreenShot"); o->callback((Fl_Callback *)saveScreenToFile_callback); } { Fl_Button * o = pause_button = new Fl_Button(430, 575, 35, 25, "@||"); o->labeltype(FL_SYMBOL_LABEL); o->labelsize(12); o->callback((Fl_Callback *)play_callback); } { Fl_Button* o = rewind_button = new Fl_Button(465, 575, 35, 25, "@|<"); o->labeltype(FL_SYMBOL_LABEL); o->labelsize(12); o->callback((Fl_Callback *)play_callback); } { Fl_Button* o = play_button = new Fl_Button(500, 575, 35, 25, "@>"); o->labeltype(FL_SYMBOL_LABEL); o->labelsize(12); o->callback((Fl_Callback *)play_callback, (void*)(0)); } { Fl_Button* o = minusOne_button = new Fl_Button(535, 575, 35, 25, "-1"); o->labeltype(FL_SYMBOL_LABEL); o->labelsize(12); o->callback((Fl_Callback *)play_callback, (void*)(0)); } { Fl_Button* o = plusOne_button = new Fl_Button(570, 575, 35, 25, "+1"); o->labeltype(FL_SYMBOL_LABEL); o->labelsize(12); o->callback((Fl_Callback *)play_callback, (void*)(0)); } { Fl_Button* o = repeat_button = new Fl_Button(605, 575, 35, 25, "@<->"); o->labeltype(FL_SYMBOL_LABEL); o->labelsize(12); o->callback((Fl_Callback *)play_callback, (void*)(0)); } o->end(); } // FL_group { Player_Gl_Window * o = glwindow = new Player_Gl_Window(5, 5, 640, 480, "label"); o->box(FL_DOWN_FRAME); o->labeltype(FL_NO_LABEL); } { Fl_Value_Slider* o = frame_slider = new Fl_Value_Slider(10, 545, 630, 20); // slider o->type(5); o->labelsize(18); o->minimum(1); o->maximum(60000); o->step(1); o->callback((Fl_Callback*)fslider_callback, (void*)(0)); o->align(197); } { Fl_Value_Input* o = speedUp = new Fl_Value_Input(65, 575, 40, 25, "Speed"); o->minimum(0); o->value(1); o->callback((Fl_Callback*)playSpeed_callback); } { Fl_Value_Input * o = sub_input = new Fl_Value_Input(690, 55, 45, 25, "Skeleton ID:"); o->callback((Fl_Callback*)skeletonID_callback); sub_input->align(Fl_Align(FL_ALIGN_TOP_RIGHT)); } { Fl_Value_Input * o = tx_input = new Fl_Value_Input(690, 95, 45, 25, "tx:"); o->callback((Fl_Callback*)tx_callback); } { Fl_Value_Input * o = ty_input = new Fl_Value_Input(690, 122, 45, 25, "ty:"); o->callback((Fl_Callback*)ty_callback); } { Fl_Value_Input * o = tz_input = new Fl_Value_Input(690, 152, 45, 25, "tz:"); o->callback((Fl_Callback*)tz_callback); } { Fl_Value_Input * o = rx_input = new Fl_Value_Input(690, 190, 45, 25, "rx:"); o->callback((Fl_Callback*)rx_callback); } { Fl_Value_Input * o = ry_input = new Fl_Value_Input(690, 217, 45, 25, "ry:"); o->callback((Fl_Callback*)ry_callback); } { Fl_Value_Input * o = rz_input = new Fl_Value_Input(690, 247, 45, 25, "rz:"); o->callback((Fl_Callback*)rz_callback); } { Fl_Value_Input * o = joint_idx = new Fl_Value_Input(195, 575, 45, 25, "Show Joint"); o->maximum(30); o->step(1); o->value(-1); o->callback((Fl_Callback*)spotJoint_callback); } { Fl_Light_Button * o = groundPlane_button = new Fl_Light_Button(650, 315, 85, 25, "Ground"); o->callback((Fl_Callback*)renderGroundPlane_callback, (void*)(0)); o->align(FL_ALIGN_INSIDE); } { Fl_Light_Button * o = fog_button = new Fl_Light_Button(650, 345, 85, 25, "Fog"); o->callback((Fl_Callback*)useFog_callback, (void*)(0)); o->align(FL_ALIGN_INSIDE); } { Fl_Light_Button * o = worldAxes_button = new Fl_Light_Button(650, 375, 85, 25, "Axes"); o->callback((Fl_Callback*)renderWorldAxes_callback, (void*)(0)); o->align(FL_ALIGN_INSIDE); } { Fl_Button * o = aboutPlayer_button = new Fl_Button(650, 420, 85, 25, "About"); o->callback((Fl_Callback *)aboutPlayer_callback); o->align(FL_ALIGN_INSIDE); } o->end(); } return w; }
void ModelerApplication::Init(ModelerViewCreator_f createView, const ModelerControl controls[], unsigned numControls) { int i; m_animating = false; m_numControls = numControls; // ******************************************************** // Create the FLTK user interface // ******************************************************** m_ui = new ModelerUserInterface(); // Store pointers to the controls for manipulation m_controlLabelBoxes = new Fl_Box*[numControls]; m_controlValueSliders = new Fl_Value_Slider*[numControls]; // Constants for user interface setup const int textHeight = 20; const int sliderHeight = 20; const int packWidth = m_ui->m_controlsPack->w(); m_ui->m_controlsPack->begin(); // For each control, add appropriate objects to the user interface for (i=0; i<m_numControls; i++) { // Add the entry to the selection box m_ui->m_controlsBrowser->add(controls[i].m_name); // Add the label (but make it invisible for now) Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, controls[i].m_name); box->labelsize(12); box->hide(); box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu) m_controlLabelBoxes[i] = box; // Add the slider (but make it invisible for now) Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, packWidth, sliderHeight,0); slider->type(FL_HOR_NICE_SLIDER); slider->range(controls[i].m_minimum, controls[i].m_maximum); slider->step(((int)(controls[i].m_stepsize * 100)) / 100.0); slider->value(controls[i].m_value); slider->labelsize(13); slider->align(FL_ALIGN_RIGHT); slider->hide(); m_controlValueSliders[i] = slider; slider->callback((Fl_Callback*)ModelerApplication::SliderCallback); } m_ui->m_controlsPack->end(); // Make sure that we remove the view from the // Fl_Group, otherwise, it'll blow up // THIS BUG FIXED 04-18-01 ehsu m_ui->m_modelerWindow->remove(*(m_ui->m_modelerView)); delete m_ui->m_modelerView; m_ui->m_modelerWindow->begin(); m_ui->m_modelerView = createView(0, 0, m_ui->m_modelerWindow->w(), m_ui->m_modelerWindow->h() ,NULL); Fl_Group::current()->resizable(m_ui->m_modelerView); m_ui->m_modelerWindow->end(); }