#ifndef _UTILS_H #define _UTILS_H #include "proj.h" class Gl_Win; class Panel; // if a is close to a target bool CLOSE_TO( double a, double target); void set_light( const GLfloat light_pos[3] ); // init an input button's label align and assign init val void init_int_input_button(Fl_Int_Input *b, int align, int init_val); // a quick and dirty hack for rotating the eyepoint // Gleicher's code void orbit(int mx, int my, double lx, double ly, double lz, double ex, double ey, double ez, double& rx, double& ry, double& rz); // if mouse stroke to left: zoomOut; to right: zoomIn void zoom(int mouseDragXdist, double &fieldOfView); void ik_springCB(Fl_Value_Slider *s, Gl_Win *gl); void ik_dampCB(Fl_Value_Slider *s, Gl_Win *gl); void ik_sensitiveCB(Fl_Value_Slider *s, Gl_Win *gl); // remove all keys void key_clearCB(Fl_Widget* wid, Fl_Widget *container); // remove this key void key_rmvCB(Fl_Widget* wid, Fl_Widget *container); // print all keys void key_printCB(Fl_Widget* wid, Fl_Widget *container); // key every nth frame. void key_nthCB(Fl_Widget* wid, Fl_Widget *container); // key the frame slider is at void key_addCB(Fl_Widget* wid, Fl_Widget *container); // begin frame button cb void beginCB(Fl_Widget* wid, Fl_Widget *container); // end frame button cb void endCB(Fl_Widget* wid, Fl_Widget *container); // switch bw real time and const spd play back void play_modeCB(Fl_Widget* wid, Fl_Widget *container); //in out files void in_bvhCB(Fl_Menu_*, Panel *win); void in_qbvhCB(Fl_Menu_*, Panel *win); void out_qbvhCB(Fl_Menu_*, Panel *win); // choose euler interp options and invoke appropriate interp routine void euler_browserCB(Fl_Widget* wid, Fl_Widget *container); // choose quat interp options and invoke appropriate interp routine void quat_browserCB(Fl_Widget* wid, Fl_Widget *container); // choose exp map interp options and invoke appropriate interp routine void emap_browserCB(Fl_Widget* wid, Fl_Widget *container); // load marker request file void in_marker_fileCB(Fl_Widget* wid, Gl_Win *win); // write marker coord to file void out_marker_fileCB(Fl_Widget* wid, Gl_Win *win); // choose whether and how to show markers (which rotation to use) void marker_rotType_browserCB(Fl_Widget* wid, Fl_Widget *container); // sel markers to be drawn void marker_sel_browserCB(Fl_Widget* wid, Fl_Widget *container); // turn on the light src void lightCB(Fl_Widget* in_slider, Fl_Widget* in_wind); // draw the floor void floorCB(Fl_Widget* in_slider, Fl_Widget* in_wind); // sel camera view void cameraCB(Fl_Round_Button *b, Gl_Win *win); void camera_omin(int frame_cnt, double *trans, double look[3], double eye[3]); void adjust_follow_theta(int mouseDragXdist, double &follow_theta); void adjust_follow_phi(int mouseDragYdist, double &follow_phi); void adjust_follow_lag(int mouseDragXdist, double &follow_lag); #endif