Explorar el Código

Merge remote-tracking branch 'teseo/master' into HEAD

Former-commit-id: 7006eb8e71fe1479aef9048fe571335b114e2b6d
Teseo Schneider hace 7 años
padre
commit
359b2670e0

+ 3 - 2
include/igl/opengl/glfw/Viewer.cpp

@@ -286,9 +286,10 @@ namespace glfw
   IGL_INLINE Viewer::Viewer():
   IGL_INLINE Viewer::Viewer():
     data_list(1),
     data_list(1),
     selected_data_index(0),
     selected_data_index(0),
-    next_data_id(0)
+    next_data_id(1)
   {
   {
     window = nullptr;
     window = nullptr;
+    data_list.front().id = 0;
 
 
     // Temporary variables initialization
     // Temporary variables initialization
     down = false;
     down = false;
@@ -934,7 +935,7 @@ namespace glfw
     return true;
     return true;
   }
   }
 
 
-  IGL_INLINE size_t Viewer::mesh_index(const int id) {
+  IGL_INLINE size_t Viewer::mesh_index(const int id) const {
     for (size_t i = 0; i < data_list.size(); ++i)
     for (size_t i = 0; i < data_list.size(); ++i)
     {
     {
       if (data_list[i].id == id)
       if (data_list[i].id == id)

+ 1 - 1
include/igl/opengl/glfw/Viewer.h

@@ -111,7 +111,7 @@ namespace glfw
 
 
     // Retrieve mesh index from its unique identifier
     // Retrieve mesh index from its unique identifier
     // Returns 0 if not found
     // Returns 0 if not found
-    IGL_INLINE size_t mesh_index(const int id);
+    IGL_INLINE size_t mesh_index(const int id) const;
 
 
     // Alec: I call this data_list instead of just data to avoid confusion with
     // Alec: I call this data_list instead of just data to avoid confusion with
     // old "data" variable.
     // old "data" variable.

+ 1 - 1
include/igl/opengl/glfw/imgui/ImGuiMenu.cpp

@@ -221,7 +221,7 @@ IGL_INLINE void ImGuiMenu::draw_viewer_menu()
     ImGui::DragFloat("Zoom", &(viewer->core.camera_zoom), 0.05f, 0.1f, 20.0f);
     ImGui::DragFloat("Zoom", &(viewer->core.camera_zoom), 0.05f, 0.1f, 20.0f);
 
 
     // Select rotation type
     // Select rotation type
-    static int rotation_type = static_cast<int>(viewer->core.rotation_type);
+    int rotation_type = static_cast<int>(viewer->core.rotation_type);
     static Eigen::Quaternionf trackball_angle = Eigen::Quaternionf::Identity();
     static Eigen::Quaternionf trackball_angle = Eigen::Quaternionf::Identity();
     static bool orthographic = true;
     static bool orthographic = true;
     if (ImGui::Combo("Camera Type", &rotation_type, "Trackball\0Two Axes\0002D Mode\0\0"))
     if (ImGui::Combo("Camera Type", &rotation_type, "Trackball\0Two Axes\0002D Mode\0\0"))