diff --git a/Common/Context.h b/Common/Context.h index be32ec637b8cfccc108c088f52322463a0f3136f..780417d272e9790d1a3296dd85352586c67cc912 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -128,7 +128,7 @@ class CTX { // generation ->only for geo/post) double lc; // double buffer/antialias/stereo graphics? - int db, antialiasing, stereo; + int db, antialiasing, stereo , camera; // orthogonal projection? int ortho; // draw the bounding boxes and the rot center? diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 297bcc2246f473af6789daafafb5c9ccde70e472..c3eaea45513b2746fa880cbba807f5c9df59b04b 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -592,7 +592,13 @@ StringXNumber GeneralOptions_Number[] = { "Enable expert mode (to disable all the messages meant for inexperienced " "users)" }, - { F|O, "FastRedraw" , opt_general_fast_redraw, 0. , + { F|O, "Stereo" , opt_general_stereo_mode, 0. , + "Enable stereo mode" }, + + { F|O, "Camera" , opt_general_camera_mode, 0. , + "Enable camera view mode" }, + + { F|O, "FastRedraw" , opt_general_fast_redraw, 0. , "Draw simplified model while rotating, panning and zooming" }, { F|S, "FieldPositionX" , opt_general_field_position0 , 650. , "Horizontal position (in pixels) of the upper left corner of the field window" }, @@ -834,6 +840,8 @@ StringXNumber GeneralOptions_Number[] = { " window" }, { F|O, "Stereo" , opt_general_stereo , 0. , "Use stereo rendering" }, + { F|O, "Camera" , opt_general_camera , 0. , + "Use a camera" }, { F|S, "SystemMenuBar" , opt_general_system_menu_bar , 1. , "Use the system menu bar on Mac OS X?" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index d7ee48ee728f8883489b4526844132c03c48fceb..f9ab7f8362f49e3a1376b795a0a05d77441143ee 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -3513,6 +3513,14 @@ double opt_general_stereo(OPT_ARGS_NUM) return CTX::instance()->stereo; } +double opt_general_camera(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) { + CTX::instance()->camera = (int)val; + } + return CTX::instance()->camera; +} + double opt_general_alpha_blending(OPT_ARGS_NUM) { if(action & GMSH_SET) @@ -3684,6 +3692,24 @@ double opt_general_expert_mode(OPT_ARGS_NUM) return CTX::instance()->expertMode; } + +double opt_general_stereo_mode(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->stereo = (int)val; + + return CTX::instance()->stereo ; +} + +double opt_general_camera_mode(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->camera = (int)val; + + return CTX::instance()->camera ; +} + + double opt_general_clip0a(OPT_ARGS_NUM) { if(action & GMSH_SET) diff --git a/Common/Options.h b/Common/Options.h index db1d7616f815f44a2757d32126c597a47da3eb22..538953fbd5e97c2931bd0bdb9eb44746d62a7df9 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -340,6 +340,7 @@ double opt_general_quadric_subdivisions(OPT_ARGS_NUM); double opt_general_double_buffer(OPT_ARGS_NUM); double opt_general_antialiasing(OPT_ARGS_NUM); double opt_general_stereo(OPT_ARGS_NUM); +double opt_general_camera(OPT_ARGS_NUM); double opt_general_alpha_blending(OPT_ARGS_NUM); double opt_general_vector_type(OPT_ARGS_NUM); double opt_general_arrow_head_radius(OPT_ARGS_NUM); @@ -349,6 +350,8 @@ double opt_general_trackball(OPT_ARGS_NUM); double opt_general_rotation_center_cg(OPT_ARGS_NUM); double opt_general_zoom_factor(OPT_ARGS_NUM); double opt_general_expert_mode(OPT_ARGS_NUM); +double opt_general_stereo_mode(OPT_ARGS_NUM); +double opt_general_camera_mode(OPT_ARGS_NUM); double opt_general_clip0a(OPT_ARGS_NUM); double opt_general_clip0b(OPT_ARGS_NUM); double opt_general_clip0c(OPT_ARGS_NUM);