void FourView::update_anttweakbar_visibility(igl::anttweakbar::ReTwBar & rebar) const { using namespace igl; for(int vp = 0;vp<NUM_VIEWPORTS;vp++) { if(vp == m_down_vp) { rebar.TwSetParam(C_STR("Viewport["<<vp<<"]"), "visible", TW_PARAM_INT32, 1, &INT_ONE); }else { rebar.TwSetParam(C_STR("Viewport["<<vp<<"]"), "visible", TW_PARAM_INT32, 1, &INT_ZERO); } } }
void FourView::add_to_reanttweakbar(igl::anttweakbar::ReTwBar & rebar) { using namespace igl; using namespace igl::anttweakbar; // loop over viewports for(int vp = 0;vp<NUM_VIEWPORTS;vp++) { //rebar.TwAddVarRW(C_STR("viewport_"<<vp<<"_zoom"),TW_TYPE_DOUBLE,&m_viewports[vp].camera.zoom,C_STR( // "group='Viewport["<<vp<<"]' " // "label='zoom' " // "step=0.01 min="<<min_zoom<<" max="<<max_zoom<<" " // "help='Zoom viewing camera in and out' " // )); rebar.TwAddVarRW(C_STR("viewport_"<<vp<<"_rotation"),TW_TYPE_QUAT4D, m_viewports[vp].camera.m_rotation_conj.coeffs().data(), C_STR("group='Viewport["<<vp<<"]' " "label='rotation' " "open " "help='Rotate viewing camera (0 0 0 1 = identity)' " )); //rebar.TwAddVarRW( // C_STR("viewport_"<<vp<<"_translation"),TW_TYPE_DIR3D, // m_viewports[vp].camera.m_translation.data(), "visible=false"); //rebar.TwAddVarRW(C_STR("viewport_"<<vp<<"_angle"),TW_TYPE_DOUBLE,&m_viewports[vp].camera.angle, // C_STR("group='Viewport["<<vp<<"]' " // "label='angle' " // "help='Perspective viewing angle (45-natural, 0-ortho)' " // "max=90 min=0") // ); rebar.TwSetParam(C_STR("Viewport["<<vp<<"]"), "opened", TW_PARAM_INT32, 1, &INT_ZERO); rebar.TwSetParam(C_STR("Viewport["<<vp<<"]"), "visible", TW_PARAM_INT32, 1, &INT_ZERO); } // so these are remembered rebar.TwAddVarRW("horiz",TW_TYPE_DOUBLE,&m_horiz,"visible=false"); rebar.TwAddVarRW("vert",TW_TYPE_DOUBLE,&m_vert,"visible=false"); }