Sfoglia il codice sorgente

clang fixes

Former-commit-id: d850428994be9799f9992f367d7e12cf3846ba02
Daniele Panozzo 9 anni fa
parent
commit
be3d07e067
5 ha cambiato i file con 54 aggiunte e 56 eliminazioni
  1. 8 7
      cmake/CMakeLists.txt
  2. 11 27
      include/igl/bbw/bbw.cpp
  3. 28 15
      include/igl/bbw/bbw.h
  4. 2 1
      optional/CMakeLists.txt
  5. 5 6
      tutorial/CMakeLists.txt

+ 8 - 7
cmake/CMakeLists.txt

@@ -43,12 +43,6 @@ if(LIBIGL_USE_STATIC_LIBRARY)
   list(APPEND LIBIGL_DEFINITIONS "-DIGL_STATIC_LIBRARY")
 endif()
 
-if(LIBIGL_WITH_VIEWER)
-  add_definitions(-DIGL_VIEWER_WITH_NANOGUI)
-  list(APPEND LIBIGL_DEFINITIONS "-DIGL_VIEWER_WITH_NANOGUI")
-endif()
-
-
 ### macro definition ###
 set(LIBIGL_ROOT "${PROJECT_SOURCE_DIR}/..")
 set(LIBIGL_SOURCE_DIR "${LIBIGL_ROOT}/include")
@@ -119,7 +113,6 @@ if(LIBIGL_WITH_BBW)
   endif()
 endif()
 
-
 #Compile CoMISo
 # NOTE: this cmakefile works only with the
 # comiso available here: https://github.com/libigl/CoMISo
@@ -278,7 +271,15 @@ endif()
 
 ### Compile the viewer ###
 if(LIBIGL_WITH_VIEWER) # to finish cleaning
+
   add_definitions(-DIGL_VIEWER_WITH_NANOGUI)
+  list(APPEND LIBIGL_DEFINITIONS "-DIGL_VIEWER_WITH_NANOGUI")
+
+  #-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
+  if (APPLE)
+    list(APPEND LIBIGL_EXTRA_LIBRARIES "-framework OpenGL" "-framework Cocoa" "-framework IOKit" "-framework CoreVideo") #"glfw" ${GLFW_LIBRARIES})
+  endif()
+
   set(NANOGUI_DIR "${LIBIGL_EXTERNAL}/nanogui")
   set(NANOGUI_INCLUDE_DIRS
     "${NANOGUI_DIR}/include"

+ 11 - 27
include/igl/bbw/bbw.cpp

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "bbw.h"
 
@@ -14,27 +14,11 @@
 #include <igl/slice_into.h>
 #include <igl/min_quad_with_fixed.h>
 
-#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
 #include <Eigen/Sparse>
 
 #include <iostream>
 #include <cstdio>
 
-
-igl::bbw::BBWData::BBWData():
-  partition_unity(false),
-  W0(),
-#ifndef IGL_NO_MOSEK
-  mosek_data(),
-#endif
-  active_set_params(),
-  qp_solver(QP_SOLVER_IGL_ACTIVE_SET),
-  verbosity(0)
-{
-  // We know that the Bilaplacian is positive semi-definite
-  active_set_params.Auu_pd = true;
-}
-
 void igl::bbw::BBWData::print()
 {
   using namespace std;
@@ -45,16 +29,16 @@ void igl::bbw::BBWData::print()
 
 
 template <
-  typename DerivedV, 
-  typename DerivedEle, 
+  typename DerivedV,
+  typename DerivedEle,
   typename Derivedb,
-  typename Derivedbc, 
+  typename Derivedbc,
   typename DerivedW>
 IGL_INLINE bool igl::bbw::bbw(
-  const Eigen::PlainObjectBase<DerivedV> & V, 
-  const Eigen::PlainObjectBase<DerivedEle> & Ele, 
-  const Eigen::PlainObjectBase<Derivedb> & b, 
-  const Eigen::PlainObjectBase<Derivedbc> & bc, 
+  const Eigen::PlainObjectBase<DerivedV> & V,
+  const Eigen::PlainObjectBase<DerivedEle> & Ele,
+  const Eigen::PlainObjectBase<Derivedb> & b,
+  const Eigen::PlainObjectBase<Derivedbc> & bc,
   igl::bbw::BBWData & data,
   Eigen::PlainObjectBase<DerivedW> & W
   )

+ 28 - 15
include/igl/bbw/bbw.h

@@ -1,9 +1,9 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
+//
+// This Source Code Form is subject to the terms of the Mozilla Public License
+// v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_BBW_BBW_H
 #define IGL_BBW_BBW_H
@@ -51,7 +51,20 @@ namespace igl
         // 2: louder
         int verbosity;
       public:
-        inline BBWData();
+        inline BBWData():
+          partition_unity(false),
+          W0(),
+        #ifndef IGL_NO_MOSEK
+          mosek_data(),
+        #endif
+          active_set_params(),
+          qp_solver(QP_SOLVER_IGL_ACTIVE_SET),
+          verbosity(0)
+        {
+          // We know that the Bilaplacian is positive semi-definite
+          active_set_params.Auu_pd = true;
+        }
+
         // Print current state of object
         inline void print();
     };
@@ -72,25 +85,25 @@ namespace igl
     //   bc #b by #W list of boundary values
     //   data  object containing options, intial guess --> solution and results
     // Outputs:
-    //   W  #V by #W list of *unnormalized* weights to normalize use 
-    //    igl::normalize_row_sums(W,W); 
+    //   W  #V by #W list of *unnormalized* weights to normalize use
+    //    igl::normalize_row_sums(W,W);
     // Returns true on success, false on failure
     template <
-      typename DerivedV, 
-               typename DerivedEle, 
+      typename DerivedV,
+               typename DerivedEle,
                typename Derivedb,
-               typename Derivedbc, 
+               typename Derivedbc,
                typename DerivedW>
                  IGL_INLINE bool bbw(
-                     const Eigen::PlainObjectBase<DerivedV> & V, 
-                     const Eigen::PlainObjectBase<DerivedEle> & Ele, 
-                     const Eigen::PlainObjectBase<Derivedb> & b, 
-                     const Eigen::PlainObjectBase<Derivedbc> & bc, 
+                     const Eigen::PlainObjectBase<DerivedV> & V,
+                     const Eigen::PlainObjectBase<DerivedEle> & Ele,
+                     const Eigen::PlainObjectBase<Derivedb> & b,
+                     const Eigen::PlainObjectBase<Derivedbc> & bc,
                      BBWData & data,
                      Eigen::PlainObjectBase<DerivedW> & W);
   }
 }
-  
+
 #ifndef IGL_STATIC_LIBRARY
 #  include "bbw.cpp"
 #endif

+ 2 - 1
optional/CMakeLists.txt

@@ -9,7 +9,8 @@ if(MSVC)
 else()
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") #### Libigl requires a modern C++ compiler that supports c++11
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../" )
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter -Wno-deprecated-register -Wno-return-type-c-linkage")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter -Wno-deprecated-register -Wno-return-type-c-linkage")
 endif()
 
 

+ 5 - 6
tutorial/CMakeLists.txt

@@ -9,7 +9,8 @@ if(MSVC)
 else()
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") #### Libigl requires a modern C++ compiler that supports c++11
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../" )
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wunused-parameter")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter -Wno-deprecated-register -Wno-return-type-c-linkage")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter -Wno-deprecated-register -Wno-return-type-c-linkage")
 endif()
 
 ### libIGL options: choose between header only and compiled static library
@@ -25,12 +26,10 @@ option(LIBIGL_WITH_TETGEN      "Use Tetgen"         ON)
 option(LIBIGL_WITH_TRIANGLE    "Use Triangle"       ON)
 option(LIBIGL_WITH_XML         "Use XML"            ON)
 option(LIBIGL_WITH_LIM         "Use LIM"            ON)
-option(LIBIGL_WITH_BOOLEAN     "Use Cork boolean"   OFF) # This option is not supported yet
 option(LIBIGL_WITH_COMISO      "Use CoMiso"         ON)
-
-### Start to be tested ----
-#option(LIBIGL_WITH_MATLAB      "Use Matlab"         OFF)
-#option(LIBIGL_WITH_MOSEK       "Use MOSEK"          OFF)
+option(LIBIGL_WITH_BOOLEAN     "Use Cork boolean"   OFF) # This option is not supported yet
+option(LIBIGL_WITH_MATLAB      "Use Matlab"         OFF) # This option is not supported yet
+option(LIBIGL_WITH_MOSEK       "Use MOSEK"          OFF) # This option is not supported yet
 ### End   to be tested ----
 
 ### libIGL options: decide if you want to use the functionalities that depends on cgal