瀏覽代碼

compile static build, templates, missing inlcudes

Former-commit-id: 3de5c820e1ee2840d01de0c2a4937eebb8ee4d9e
Alec Jacobson 9 年之前
父節點
當前提交
8020d39e8d

+ 10 - 0
include/igl/ambient_occlusion.cpp

@@ -123,3 +123,13 @@ IGL_INLINE void igl::ambient_occlusion(
   aabb.init(V,F);
   return ambient_occlusion(aabb,V,F,P,N,num_samples,S);
 }
+
+#ifdef IGL_STATIC_LIBRARY
+// Explicit template specialization
+// generated by autoexplicit.sh
+template void igl::ambient_occlusion<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::__1::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+// generated by autoexplicit.sh
+template void igl::ambient_occlusion<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::__1::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+// generated by autoexplicit.sh
+template void igl::ambient_occlusion<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::__1::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+#endif

+ 1 - 0
include/igl/xml/XMLSerializable.h

@@ -1,6 +1,7 @@
 #ifndef IGL_XML_XMLSERIALIZABLE_H
 #define IGL_XML_XMLSERIALIZABLE_H
 
+#include "serialize_xml.h"
 #include "../igl_inline.h"
 #include "../serialize.h"
 

+ 2 - 1
include/igl/xml/serialization_test.cpp

@@ -8,7 +8,8 @@
 //#define IGL_SERIALIZATION_TEST_H
 
 //#include <igl/Timer.h>
-#include <igl/xml/serialize_xml.h>
+#include "serialize_xml.h"
+#include "XMLSerializable.h"
 
 namespace igl
 {

+ 1 - 0
include/igl/xml/serialize_xml.cpp

@@ -9,6 +9,7 @@
 #include "serialize_xml.h"
 #include "../STR.h"
 #include "../serialize.h"
+#include "XMLSerializable.h"
 
 #include <iterator>
 #include <limits>

+ 1 - 1
include/igl/xml/serialize_xml.h

@@ -17,7 +17,6 @@
 
 #include "../igl_inline.h"
 
-#include "XMLSerializable.h"
 
 #include <Eigen/Dense>
 #include <Eigen/Sparse>
@@ -38,6 +37,7 @@ namespace igl
 {
   namespace xml
   {
+    struct XMLSerializableBase;
     // serializes the given object either to a xml file or to the provided doc data
     //
     // Templates:

+ 16 - 16
tutorial/601_Serialization/main.cpp

@@ -8,22 +8,22 @@
 Eigen::MatrixXd V;
 Eigen::MatrixXi F;
 
-//// derive from igl::Serializable to serialize your own type
-//struct State : public igl::Serializable
-//{
-//  Eigen::MatrixXd V;
-//  Eigen::MatrixXi F;
-//  std::vector<int> ids;
-//
-//  // You have to define this function to
-//  // register the fields you want to serialize
-//  void InitSerialization()
-//  {
-//    this->Add(V  , "V");
-//    this->Add(F  , "F");
-//    this->Add(ids, "ids");
-//  }
-//};
+// derive from igl::Serializable to serialize your own type
+struct State : public igl::Serializable
+{
+  Eigen::MatrixXd V;
+  Eigen::MatrixXi F;
+  std::vector<int> ids;
+
+  // You have to define this function to
+  // register the fields you want to serialize
+  void InitSerialization()
+  {
+    this->Add(V  , "V");
+    this->Add(F  , "F");
+    this->Add(ids, "ids");
+  }
+};
 
 //// alternatively you can do it like the following to have
 //// a non-intrusive serialization:

+ 5 - 0
tutorial/cmake/FindMATLAB.cmake

@@ -203,6 +203,11 @@ SET(MATLAB_LIBRARIES
 
 IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
   SET(MATLAB_FOUND 1)
+  message(STATUS "Found MATLAB: ${MATLAB_INCLUDE_DIR}")
+else()
+  if (NOT MATLAB_FIND_QUIETLY)
+    message(FATAL_ERROR "could NOT find MATLAB")
+  endif (NOT MATLAB_FIND_QUIETLY)
 ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
 
 MARK_AS_ADVANCED(