|
@@ -1,10 +1,12 @@
|
|
|
#pragma once
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+// These are not directly used but would otherwise be included in most files.
|
|
|
|
|
+// Leaving them included here.
|
|
|
#include <igl/read_triangle_mesh.h>
|
|
#include <igl/read_triangle_mesh.h>
|
|
|
-#include <igl/find.h>
|
|
|
|
|
#include <igl/readDMAT.h>
|
|
#include <igl/readDMAT.h>
|
|
|
-#include <igl/readOBJ.h>
|
|
|
|
|
|
|
+
|
|
|
|
|
+#include <igl/find.h>
|
|
|
|
|
|
|
|
#include <Eigen/Core>
|
|
#include <Eigen/Core>
|
|
|
#include <catch2/catch.hpp>
|
|
#include <catch2/catch.hpp>
|
|
@@ -21,7 +23,20 @@ namespace test_common
|
|
|
void run_test_cases(const std::vector<Param> ¶ms, Fun test_case)
|
|
void run_test_cases(const std::vector<Param> ¶ms, Fun test_case)
|
|
|
{
|
|
{
|
|
|
for(const auto &p : params)
|
|
for(const auto &p : params)
|
|
|
|
|
+ {
|
|
|
|
|
+ // Can't use INFO( p ) because we're not sure how to print p
|
|
|
test_case(p);
|
|
test_case(p);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ template<typename Fun>
|
|
|
|
|
+ void run_test_cases(const std::vector<std::string> ¶ms, Fun test_case)
|
|
|
|
|
+ {
|
|
|
|
|
+ for(const auto &p : params)
|
|
|
|
|
+ {
|
|
|
|
|
+ INFO( p );
|
|
|
|
|
+ test_case(p);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
inline std::vector<std::string> closed_genus_0_meshes()
|
|
inline std::vector<std::string> closed_genus_0_meshes()
|
|
@@ -75,47 +90,6 @@ namespace test_common
|
|
|
return std::string(LIBIGL_DATA_DIR) + "/" + s;
|
|
return std::string(LIBIGL_DATA_DIR) + "/" + s;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // TODO: this seems like a pointless indirection. Should just find and
|
|
|
|
|
- // replace test_common::load_mesh(X,...) with
|
|
|
|
|
- // igl::read_triangle_mesh(test_common::data_path(X),...)
|
|
|
|
|
- template<typename DerivedV, typename DerivedF>
|
|
|
|
|
- void load_mesh(
|
|
|
|
|
- const std::string& filename,
|
|
|
|
|
- Eigen::PlainObjectBase<DerivedV>& V,
|
|
|
|
|
- Eigen::PlainObjectBase<DerivedF>& F)
|
|
|
|
|
- {
|
|
|
|
|
- igl::read_triangle_mesh(data_path(filename), V, F);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- template<typename DerivedV, typename DerivedF>
|
|
|
|
|
- void load_obj_with_material(
|
|
|
|
|
- const std::string& filename,
|
|
|
|
|
- std::vector<std::vector<DerivedV >> & V,
|
|
|
|
|
- std::vector<std::vector<DerivedV >> & TC,
|
|
|
|
|
- std::vector<std::vector<DerivedV >> & N,
|
|
|
|
|
- std::vector<std::vector<DerivedF >> & F,
|
|
|
|
|
- std::vector<std::vector<DerivedF >> & FTC,
|
|
|
|
|
- std::vector<std::vector<DerivedF >> & FN,
|
|
|
|
|
- std::vector<std::tuple<std::string, DerivedF, DerivedF >> &FM)
|
|
|
|
|
- {
|
|
|
|
|
- igl::readOBJ(data_path(filename), V, TC, N, F, FTC, FN, FM);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // TODO: this seems like a pointless indirection. Should just find and
|
|
|
|
|
- // replace test_common::load_matrix(X,...) with
|
|
|
|
|
- // igl::readDMAT(test_common::data_path(X),...)
|
|
|
|
|
- template<typename Derived>
|
|
|
|
|
- void load_matrix(
|
|
|
|
|
- const std::string& filename,
|
|
|
|
|
- Eigen::PlainObjectBase<Derived>& M)
|
|
|
|
|
- {
|
|
|
|
|
- igl::readDMAT(data_path(filename), M);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
template <typename DerivedA, typename DerivedB>
|
|
template <typename DerivedA, typename DerivedB>
|
|
|
void assert_eq(
|
|
void assert_eq(
|
|
|
const Eigen::MatrixBase<DerivedA> & A,
|
|
const Eigen::MatrixBase<DerivedA> & A,
|