Просмотр исходного кода

tutorial compilation fixes

Former-commit-id: ae620d83d088b7ce131072fc695edac866fd03ee
Daniele Panozzo 11 лет назад
Родитель
Сommit
eb2279fdbb

+ 47 - 43
include/igl/viewer/Viewer.cpp

@@ -333,22 +333,22 @@ namespace igl
     TwAddButton(bar,"Center object", align_camera_center_cb, this,
                 " group='Viewing Options'"
                 " label='Center object' key=A help='Set the center of the camera to the mesh center.'");
-    TwAddVarRW(bar, "Zoom", TW_TYPE_FLOAT, &(options.camera_zoom),
+    TwAddVarRW(bar, "Zoom", TW_TYPE_FLOAT, &(core.camera_zoom),
                " min=0.05 max=50 step=0.1 keyIncr=+ keyDecr=- help='Scale the object (1=original size).' group='Scene'");
     TwAddButton(bar,"SnapView", snap_to_canonical_quaternion_cb, this,
                 " group='Scene'"
                 " label='Snap to canonical view' key=Z "
                 " help='Snaps view to nearest canonical view.'");
-    TwAddVarRW(bar,"LightDir", TW_TYPE_DIR3F, options.light_position.data(),
+    TwAddVarRW(bar,"LightDir", TW_TYPE_DIR3F, core.light_position.data(),
                " group='Scene'"
                " label='Light direction' open help='Change the light direction.' ");
 
     // ---------------------- DRAW OPTIONS ----------------------
-    TwAddVarRW(bar, "ToggleOrthographic", TW_TYPE_BOOLCPP, &(options.orthographic),
+    TwAddVarRW(bar, "ToggleOrthographic", TW_TYPE_BOOLCPP, &(core.orthographic),
                " group='Viewing Options'"
                " label='Orthographic view' "
                " help='Toggles orthographic / perspective view. Default: perspective.'");
-    TwAddVarRW(bar, "Rotation", TW_TYPE_QUAT4F, &(options.trackball_angle),
+    TwAddVarRW(bar, "Rotation", TW_TYPE_QUAT4F, &(core.trackball_angle),
       " group='Viewing Options'"
       " label='Rotation'"
       " help='Rotates view.'");
@@ -356,45 +356,45 @@ namespace igl
                " group='Draw options'"
                " label='Face-based' key=T help='Toggle per face shading/colors.' ");
 
-    TwAddVarRW(bar,"Show texture", TW_TYPE_BOOLCPP, &(options.show_texture),
+    TwAddVarRW(bar,"Show texture", TW_TYPE_BOOLCPP, &(core.show_texture),
                " group='Draw options'");
 
     TwAddVarCB(bar,"Invert Normals", TW_TYPE_BOOLCPP, set_invert_normals_cb, get_invert_normals_cb, this,
                " group='Draw options'"
                " label='Invert normals' key=i help='Invert normal directions for inside out meshes.' ");
 
-    TwAddVarRW(bar,"ShowOverlay", TW_TYPE_BOOLCPP, &(options.show_overlay),
+    TwAddVarRW(bar,"ShowOverlay", TW_TYPE_BOOLCPP, &(core.show_overlay),
                " group='Draw options'"
                " label='Show overlay' key=o help='Show the overlay layers.' ");
-    TwAddVarRW(bar,"ShowOverlayDepth", TW_TYPE_BOOLCPP, &(options.show_overlay_depth),
+    TwAddVarRW(bar,"ShowOverlayDepth", TW_TYPE_BOOLCPP, &(core.show_overlay_depth),
                " group='Draw options'"
                " label='Show overlay depth test' help='Enable the depth test for overlay layer.' ");
     TwAddVarRW(bar,"Background color", TW_TYPE_COLOR3F,
-               options.background_color.data(),
+               core.background_color.data(),
                " help='Select a background color' colormode=hls group='Draw options'");
     TwAddVarRW(bar, "LineColor", TW_TYPE_COLOR3F,
-               options.line_color.data(),
+               core.line_color.data(),
                " label='Line color' help='Select a outline color' group='Draw options'");
-    TwAddVarRW(bar,"Shininess",TW_TYPE_FLOAT,&options.shininess," group='Draw options'"
+    TwAddVarRW(bar,"Shininess",TW_TYPE_FLOAT,&core.shininess," group='Draw options'"
                " min=1 max=128");
 
     // ---------------------- Overlays ----------------------
 
-    TwAddVarRW(bar,"Wireframe", TW_TYPE_BOOLCPP, &(options.show_lines),
+    TwAddVarRW(bar,"Wireframe", TW_TYPE_BOOLCPP, &(core.show_lines),
                " group='Overlays'"
                " label='Wireframe' key=l help='Toggle wire frame of mesh'");
-    TwAddVarRW(bar,"Fill", TW_TYPE_BOOLCPP, &(options.show_faces),
+    TwAddVarRW(bar,"Fill", TW_TYPE_BOOLCPP, &(core.show_faces),
                " group='Overlays'"
                " label='Fill' key=t help='Display filled polygons of mesh'");
-    TwAddVarRW(bar,"ShowVertexId", TW_TYPE_BOOLCPP, &(options.show_vertid),
+    TwAddVarRW(bar,"ShowVertexId", TW_TYPE_BOOLCPP, &(core.show_vertid),
                " group='Overlays'"
                " label='Show Vertex Labels' key=';' help='Toggle vertex indices'");
-    TwAddVarRW(bar,"ShowFaceId", TW_TYPE_BOOLCPP, &(options.show_faceid),
+    TwAddVarRW(bar,"ShowFaceId", TW_TYPE_BOOLCPP, &(core.show_faceid),
                " group='Overlays'"
                " label='Show Faces Labels' key='CTRL+;' help='Toggle face"
                " indices'");
 
-    options.init();
+    core.init();
     init_plugins();
   }
 
@@ -497,7 +497,7 @@ namespace igl
     if (data.V_uv.rows() == 0)
       data.grid_texture();
 
-    options.align_camera_center(data.V);
+    core.align_camera_center(data.V);
 
     for (unsigned int i = 0; i<plugins.size(); ++i)
       if (plugins[i]->post_load())
@@ -570,13 +570,13 @@ namespace igl
 
     // Why aren't these handled view AntTweakBar?
     if (key == 'z') // Don't use 'Z' because that clobbers snap_to_canonical_view_quat
-      options.trackball_angle << 0.0f, 0.0f, 0.0f, 1.0f;
+      core.trackball_angle << 0.0f, 0.0f, 0.0f, 1.0f;
 
     if (key == 'y')
-      options.trackball_angle << -sqrt(2.0f)/2.0f, 0.0f, 0.0f, sqrt(2.0f)/2.0f;
+      core.trackball_angle << -sqrt(2.0f)/2.0f, 0.0f, 0.0f, sqrt(2.0f)/2.0f;
 
     if (key == 'x')
-      options.trackball_angle << -0.5f, -0.5f, -0.5f, 0.5f;
+      core.trackball_angle << -0.5f, -0.5f, -0.5f, 0.5f;
 
 
     return false;
@@ -609,7 +609,7 @@ namespace igl
 
     down_mouse_x = current_mouse_x;
     down_mouse_y = current_mouse_y;
-    down_translation = options.model_translation;
+    down_translation = core.model_translation;
 
 
     // Initialization code for the trackball
@@ -619,9 +619,9 @@ namespace igl
     else
       center = data.V.colwise().sum()/data.V.rows();
 
-    Eigen::Vector3f coord = igl::project(Eigen::Vector3f(center(0),center(1),center(2)), options.view * options.model, options.proj, options.viewport);
+    Eigen::Vector3f coord = igl::project(Eigen::Vector3f(center(0),center(1),center(2)), core.view * core.model, core.proj, core.viewport);
     down_mouse_z = coord[2];
-    down_rotation = options.trackball_angle;
+    down_rotation = core.trackball_angle;
 
     mouse_mode = ROTATION;
 
@@ -685,16 +685,16 @@ namespace igl
       {
         case ROTATION :
         {
-          igl::trackball(options.viewport(2),
-                         options.viewport(3),
+          igl::trackball(core.viewport(2),
+                         core.viewport(3),
                          2.0f,
                          down_rotation.data(),
                          down_mouse_x,
                          down_mouse_y,
                          mouse_x,
                          mouse_y,
-                         options.trackball_angle.data());
-          //Eigen::Vector4f snapq = options.trackball_angle;
+                         core.trackball_angle.data());
+          //Eigen::Vector4f snapq = core.trackball_angle;
 
           break;
         }
@@ -702,11 +702,11 @@ namespace igl
         case TRANSLATE:
         {
           //translation
-          Eigen::Vector3f pos1 = igl::unproject(Eigen::Vector3f(mouse_x, options.viewport[3] - mouse_y, down_mouse_z), options.view * options.model, options.proj, options.viewport);
-          Eigen::Vector3f pos0 = igl::unproject(Eigen::Vector3f(down_mouse_x, options.viewport[3] - down_mouse_y, down_mouse_z), options.view * options.model, options.proj, options.viewport);
+          Eigen::Vector3f pos1 = igl::unproject(Eigen::Vector3f(mouse_x, core.viewport[3] - mouse_y, down_mouse_z), core.view * core.model, core.proj, core.viewport);
+          Eigen::Vector3f pos0 = igl::unproject(Eigen::Vector3f(down_mouse_x, core.viewport[3] - down_mouse_y, down_mouse_z), core.view * core.model, core.proj, core.viewport);
 
           Eigen::Vector3f diff = pos1 - pos0;
-          options.model_translation = down_translation + Eigen::Vector3f(diff[0],diff[1],diff[2]);
+          core.model_translation = down_translation + Eigen::Vector3f(diff[0],diff[1],diff[2]);
 
           break;
         }
@@ -714,7 +714,7 @@ namespace igl
         {
           //float delta = 0.001f * (mouse_x - down_mouse_x + mouse_y - down_mouse_y);
           float delta = 0.001f * (mouse_x - down_mouse_x + mouse_y - down_mouse_y);
-          options.camera_zoom *= 1 + delta;
+          core.camera_zoom *= 1 + delta;
           down_mouse_x = mouse_x;
           down_mouse_y = mouse_y;
           break;
@@ -744,7 +744,7 @@ namespace igl
     {
       float mult = (1.0+((delta_y>0)?1.:-1.)*0.05);
       const float min_zoom = 0.1f;
-      options.camera_zoom = (options.camera_zoom * mult > min_zoom ? options.camera_zoom * mult : min_zoom);
+      core.camera_zoom = (core.camera_zoom * mult > min_zoom ? core.camera_zoom * mult : min_zoom);
     }
     return true;
   }
@@ -754,7 +754,7 @@ namespace igl
     using namespace std;
     using namespace Eigen;
 
-    options.clear_framebuffers();
+    core.clear_framebuffers();
 
     if (callback_pre_draw)
       if (callback_pre_draw(*this))
@@ -764,7 +764,7 @@ namespace igl
       if (plugins[i]->pre_draw())
         return;
 
-    options.draw(data,opengl);
+    core.draw(data,opengl);
 
     if (callback_post_draw)
       if (callback_post_draw(*this))
@@ -821,17 +821,17 @@ namespace igl
 
   void Viewer::resize(int w, int h)
   {
-    options.viewport = Eigen::Vector4f(0,0,w,h);
+    core.viewport = Eigen::Vector4f(0,0,w,h);
   }
 
   void TW_CALL Viewer::snap_to_canonical_quaternion_cb(void *clientData)
   {
-    Eigen::Vector4f snapq = static_cast<Viewer *>(clientData)->options.trackball_angle;
-    igl::snap_to_canonical_view_quat<float>(snapq.data(),1,static_cast<Viewer *>(clientData)->options.trackball_angle.data());
+    Eigen::Vector4f snapq = static_cast<Viewer *>(clientData)->core.trackball_angle;
+    igl::snap_to_canonical_view_quat<float>(snapq.data(),1,static_cast<Viewer *>(clientData)->core.trackball_angle.data());
   }
   void TW_CALL Viewer::align_camera_center_cb(void *clientData)
   {
-    static_cast<Viewer *>(clientData)->options.align_camera_center(static_cast<Viewer *>(clientData)->data.V);
+    static_cast<Viewer *>(clientData)->core.align_camera_center(static_cast<Viewer *>(clientData)->data.V);
   }
 
   void TW_CALL Viewer::save_scene_cb(void *clientData)
@@ -848,12 +848,12 @@ namespace igl
   {
     Viewer *viewer = static_cast<Viewer *>(clientData);
     viewer->data.dirty |= ViewerData::DIRTY_NORMAL;
-    viewer->options.invert_normals = *((bool *) param);
+    viewer->core.invert_normals = *((bool *) param);
   }
 
   void TW_CALL Viewer::get_invert_normals_cb(void *param, void *clientData)
   {
-    *((bool *) param) = static_cast<Viewer *>(clientData)->options.invert_normals;
+    *((bool *) param) = static_cast<Viewer *>(clientData)->core.invert_normals;
   }
 
   void TW_CALL Viewer::set_face_based_cb(const void *param, void *clientData)
@@ -887,11 +887,15 @@ namespace igl
     data.compute_normals();
   }
 
+  void Viewer::align_camera_center()
+  {
+    core.align_camera_center(data.V);
+  }
 
   void Viewer::set_mesh(const Eigen::MatrixXd& V, const Eigen::MatrixXi& F)
   {
     data.set_mesh(V,F);
-    options.align_camera_center(V);
+    core.align_camera_center(V);
   }
 
   void Viewer::set_vertices(const Eigen::MatrixXd& V)
@@ -1032,12 +1036,12 @@ namespace igl
       draw();
 
       glfwSwapBuffers(window);
-      if(options.is_animating)
+      if(core.is_animating)
       {
         glfwPollEvents();
         // In microseconds
         double duration = 1000000.*(get_seconds()-tic);
-        const double min_duration = 1000000./options.animation_max_fps;
+        const double min_duration = 1000000./core.animation_max_fps;
         if(duration<min_duration)
         {
           // TODO: windows equivalent
@@ -1051,7 +1055,7 @@ namespace igl
     }
 
     opengl.free();
-    options.shut();
+    core.shut();
 
     shutdown_plugins();
 

+ 3 - 1
include/igl/viewer/Viewer.h

@@ -37,7 +37,7 @@ namespace igl
     void init();
 
     // Stores all the viewing options
-    igl::ViewerCore options;
+    igl::ViewerCore core;
 
     // Stores all the data that should be visualized
     igl::ViewerData data;
@@ -70,6 +70,8 @@ namespace igl
     // Wrapper for ViewerData::compute_normals()
     void compute_normals();
 
+    void align_camera_center();
+
     void clear();      // Clear the mesh data
 
     // Change the visualization mode, invalidating the cache if necessary

+ 2 - 0
include/igl/viewer/ViewerCore.h

@@ -3,6 +3,8 @@
 
 #include <igl/igl_inline.h>
 #include <igl/viewer/TextRenderer.h>
+#include <igl/viewer/ViewerData.h>
+#include <igl/viewer/OpenGL_state.h>
 
 namespace igl
 {

+ 0 - 3
tutorial/105_Overlays/main.cpp

@@ -59,9 +59,6 @@ int main(int argc, char *argv[])
       Eigen::RowVector3d(1,0,0)
     );
 
-  // Increase the thickness of the lines
-  viewer.options.line_width = 2.0f;
-
   // Plot labels with the coordinates of bounding box vertices
   std::stringstream l1;
   l1 << m(0) << ", " << m(1) << ", " << m(2);

+ 1 - 1
tutorial/106_Picking/main.cpp

@@ -65,6 +65,6 @@ int main(int argc, char *argv[])
   viewer.set_mesh(V, F);
   viewer.callback_mouse_down = &mouse_down;
   viewer.set_colors(C);
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
   viewer.launch();
 }

+ 1 - 1
tutorial/201_Normals/main.cpp

@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
   // Plot the mesh
   igl::Viewer viewer;
   viewer.callback_key_down = &key_down;
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
   viewer.set_mesh(V, F);
   viewer.set_normals(N_vertices);
   viewer.launch();

+ 1 - 1
tutorial/203_CurvatureDirections/main.cpp

@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
   viewer.add_edges(V + PD2*avg, V - PD2*avg, blue);
 
   // Hide wireframe
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
 
   viewer.launch();
 }

+ 1 - 1
tutorial/204_Gradient/main.cpp

@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
   viewer.add_edges(BC,BC+max_size*GU, black);
 
   // Hide wireframe
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
 
   viewer.launch();
 }

+ 1 - 1
tutorial/303_LaplaceEquation/main.cpp

@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
   // Plot the mesh with pseudocolors
   igl::Viewer viewer;
   viewer.set_mesh(V, F);
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
   viewer.set_colors(C);
   viewer.launch();
 }

+ 1 - 1
tutorial/304_LinearEqualityConstraints/main.cpp

@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
   // Plot the mesh with pseudocolors
   igl::Viewer viewer;
   viewer.set_mesh(V, F);
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
   viewer.set_colors(data.C);
 
   viewer.callback_key_down = 

+ 1 - 1
tutorial/305_QuadraticProgramming/main.cpp

@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
   // Plot the mesh
   igl::Viewer viewer;
   viewer.set_mesh(V, F);
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
   viewer.callback_key_down = &key_down;
 
   // One fixed point

+ 7 - 7
tutorial/401_BiharmonicDeformation/main.cpp

@@ -18,7 +18,7 @@ bool pre_draw(igl::Viewer & viewer)
 {
   using namespace Eigen;
   // Determine boundary conditions
-  if(viewer.options.is_animating)
+  if(viewer.core.is_animating)
   {
     bc_frac += bc_dir;
     bc_dir *= (bc_frac>=1.0 || bc_frac<=0.0?-1.0:1.0);
@@ -45,7 +45,7 @@ bool key_down(igl::Viewer &viewer, unsigned char key, int mods)
   switch(key)
   {
     case ' ':
-      viewer.options.is_animating = !viewer.options.is_animating;
+      viewer.core.is_animating = !viewer.core.is_animating;
       break;
     case 'D':
     case 'd':
@@ -109,13 +109,13 @@ int main(int argc, char *argv[])
   // Plot the mesh with pseudocolors
   igl::Viewer viewer;
   viewer.set_mesh(U, F);
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
   viewer.set_colors(C);
-  viewer.options.trackball_angle << 0,sqrt(2.0),0,sqrt(2.0);
-  viewer.options.trackball_angle.normalize();
+  viewer.core.trackball_angle << 0,sqrt(2.0),0,sqrt(2.0);
+  viewer.core.trackball_angle.normalize();
   viewer.callback_pre_draw = &pre_draw;
   viewer.callback_key_down = &key_down;
-  //viewer.options.is_animating = true;
-  viewer.options.animation_max_fps = 30.;
+  //viewer.core.is_animating = true;
+  viewer.core.animation_max_fps = 30.;
   viewer.launch();
 }

+ 7 - 7
tutorial/402_PolyharmonicDeformation/main.cpp

@@ -26,7 +26,7 @@ bool pre_draw(igl::Viewer & viewer)
   U.col(2) = z_max*Z;
   viewer.set_vertices(U);
   viewer.compute_normals();
-  if(viewer.options.is_animating)
+  if(viewer.core.is_animating)
   {
     z_max += z_dir;
     z_dir *= (z_max>=1.0 || z_max<=0.0?-1.0:1.0);
@@ -39,7 +39,7 @@ bool key_down(igl::Viewer &viewer, unsigned char key, int mods)
   switch(key)
   {
     case ' ':
-      viewer.options.is_animating = !viewer.options.is_animating;
+      viewer.core.is_animating = !viewer.core.is_animating;
       break;
     case '.':
       k++;
@@ -93,13 +93,13 @@ int main(int argc, char *argv[])
   // Plot the mesh with pseudocolors
   igl::Viewer viewer;
   viewer.set_mesh(U, F);
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
   viewer.set_colors(C);
-  viewer.options.trackball_angle << -0.58,-0.03,-0.03,0.81;
-  viewer.options.trackball_angle.normalize();
+  viewer.core.trackball_angle << -0.58,-0.03,-0.03,0.81;
+  viewer.core.trackball_angle.normalize();
   viewer.callback_pre_draw = &pre_draw;
   viewer.callback_key_down = &key_down;
-  viewer.options.is_animating = true;
-  viewer.options.animation_max_fps = 30.;
+  viewer.core.is_animating = true;
+  viewer.core.animation_max_fps = 30.;
   viewer.launch();
 }

+ 8 - 8
tutorial/403_BoundedBiharmonicWeights/main.cpp

@@ -40,7 +40,7 @@ bool pre_draw(igl::Viewer & viewer)
 {
   using namespace Eigen;
   using namespace std;
-  if(viewer.options.is_animating)
+  if(viewer.core.is_animating)
   {
     // Interpolate pose and identity
     RotationList anim_pose(pose.size());
@@ -91,7 +91,7 @@ bool key_down(igl::Viewer &viewer, unsigned char key, int mods)
   switch(key)
   {
     case ' ':
-      viewer.options.is_animating = !viewer.options.is_animating;
+      viewer.core.is_animating = !viewer.core.is_animating;
       break;
     case '.':
       selected++;
@@ -157,13 +157,13 @@ int main(int argc, char *argv[])
   viewer.set_mesh(U, F);
   set_color(viewer);
   viewer.set_edges(C,BE,sea_green);
-  viewer.options.show_lines = false;
-  viewer.options.show_overlay_depth = false;
-  viewer.options.line_width = 1;
-  viewer.options.trackball_angle.normalize();
+  viewer.core.show_lines = false;
+  viewer.core.show_overlay_depth = false;
+  viewer.core.line_width = 1;
+  viewer.core.trackball_angle.normalize();
   viewer.callback_pre_draw = &pre_draw;
   viewer.callback_key_down = &key_down;
-  viewer.options.is_animating = false;
-  viewer.options.animation_max_fps = 30.;
+  viewer.core.is_animating = false;
+  viewer.core.animation_max_fps = 30.;
   viewer.launch();
 }

+ 2 - 2
tutorial/501_HarmonicParam/main.cpp

@@ -48,10 +48,10 @@ int main(int argc, char *argv[])
   viewer.callback_key_down = &key_down;
 
   // Disable wireframe
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
 
   // Draw checkerboard texture
-  viewer.options.show_texture = true;
+  viewer.core.show_texture = true;
 
   // Launch the viewer
   viewer.launch();

+ 2 - 2
tutorial/502_LSCMParam/main.cpp

@@ -52,10 +52,10 @@ int main(int argc, char *argv[])
   viewer.callback_key_down = &key_down;
 
   // Disable wireframe
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
 
   // Draw checkerboard texture
-  viewer.options.show_texture = true;
+  viewer.core.show_texture = true;
 
   // Launch the viewer
   viewer.launch();

+ 2 - 2
tutorial/503_ARAPParam/main.cpp

@@ -74,10 +74,10 @@ int main(int argc, char *argv[])
   viewer.callback_key_down = &key_down;
 
   // Disable wireframe
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
 
   // Draw checkerboard texture
-  viewer.options.show_texture = true;
+  viewer.core.show_texture = true;
 
   // Launch the viewer
   viewer.launch();

+ 1 - 1
tutorial/504_NRosyDesign/main.cpp

@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
   viewer.callback_key_down = &key_down;
 
   // Disable wireframe
-  viewer.options.show_lines = false;
+  viewer.core.show_lines = false;
 
   // Launch the viewer
   viewer.launch();

+ 5 - 5
tutorial/505_MIQ/main.cpp

@@ -74,8 +74,8 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
     return false;
 
   viewer.clear();
-  viewer.options.show_lines = false;
-  viewer.options.show_texture = false;
+  viewer.core.show_lines = false;
+  viewer.core.show_texture = false;
 
   if (key == '1')
   {
@@ -180,7 +180,7 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
     // Global parametrization UV
     viewer.set_mesh(UV, FUV);
     viewer.set_uv(UV);
-    viewer.options.show_lines = true;
+    viewer.core.show_lines = true;
   }
 
   if (key == '7')
@@ -188,7 +188,7 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
     // Global parametrization in 3D
     viewer.set_mesh(V, F);
     viewer.set_uv(UV,FUV);
-    viewer.options.show_texture = true;
+    viewer.core.show_texture = true;
   }
 
   if (key == '8')
@@ -196,7 +196,7 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
     // Global parametrization in 3D with seams
     viewer.set_mesh(V, F);
     viewer.set_uv(UV_seams,FUV_seams);
-    viewer.options.show_texture = true;
+    viewer.core.show_texture = true;
   }
 
   viewer.set_colors(Eigen::RowVector3d(1,1,1));

+ 4 - 4
tutorial/506_FrameField/main.cpp

@@ -73,8 +73,8 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
     return false;
 
   viewer.clear();
-  viewer.options.show_lines = false;
-  viewer.options.show_texture = false;
+  viewer.core.show_lines = false;
+  viewer.core.show_texture = false;
 
   if (key == '1')
   {
@@ -149,7 +149,7 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
     viewer.set_mesh(V_deformed, F);
     viewer.set_uv(V_uv,F_uv);
     viewer.set_colors(RowVector3d(1,1,1));
-    viewer.options.show_texture = true;
+    viewer.core.show_texture = true;
   }
 
   if (key == '6')
@@ -158,7 +158,7 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
     viewer.set_mesh(V, F);
     viewer.set_uv(V_uv,F_uv);
     viewer.set_colors(RowVector3d(1,1,1));
-    viewer.options.show_texture = true;
+    viewer.core.show_texture = true;
   }
 
   // Replace the standard texture with an integer shift invariant texture

+ 6 - 6
tutorial/606_AmbientOcclusion/main.cpp

@@ -34,15 +34,15 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier)
       break;
     }
     case '.':
-      viewer.options.lighting_factor += 0.1;
+      viewer.core.lighting_factor += 0.1;
       break;
     case ',':
-      viewer.options.lighting_factor -= 0.1;
+      viewer.core.lighting_factor -= 0.1;
       break;
     default: break;
   }
-  viewer.options.lighting_factor = 
-    std::min(std::max(viewer.options.lighting_factor,0.f),1.f);
+  viewer.core.lighting_factor = 
+    std::min(std::max(viewer.core.lighting_factor,0.f),1.f);
 
   return false;
 }
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
   viewer.set_mesh(V, F);
   viewer.callback_key_down = &key_down;
   key_down(viewer,'2',0);
-  viewer.options.show_lines = false;
-  viewer.options.lighting_factor = 0.0f;
+  viewer.core.show_lines = false;
+  viewer.core.lighting_factor = 0.0f;
   viewer.launch();
 }