]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add quick-test for Assimp.
authorLuca Heltai <luca.heltai@sissa.it>
Sat, 16 Sep 2017 14:53:33 +0000 (16:53 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Sat, 16 Sep 2017 14:57:35 +0000 (16:57 +0200)
tests/quick_tests/CMakeLists.txt
tests/quick_tests/assimp.cc [new file with mode: 0644]

index 9ceed73315dbf267bbf5b45132e602704bf1a196..13c1d6571632e24df615af696df7f73d55f5e6c6 100644 (file)
@@ -156,6 +156,12 @@ IF (DEAL_II_WITH_SUNDIALS)
   make_quicktest("sundials-ida" ${_mybuild} "")
 ENDIF()
 
+# Test Assimp
+IF (DEAL_II_WITH_ASSIMP)
+  make_quicktest("assimp" ${_mybuild} "")
+ENDIF()
+
+
 # A custom test target:
 ADD_CUSTOM_TARGET(test
   COMMAND ${CMAKE_COMMAND} -D ALL_TESTS="${ALL_TESTS}" -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake
diff --git a/tests/quick_tests/assimp.cc b/tests/quick_tests/assimp.cc
new file mode 100644 (file)
index 0000000..5d42701
--- /dev/null
@@ -0,0 +1,45 @@
+//-----------------------------------------------------------
+//
+//    Copyright (C) 2017 by the deal.II authors
+//
+//    This file is part of the deal.II library.
+//
+//    The deal.II library is free software; you can use it, redistribute
+//    it, and/or modify it under the terms of the GNU Lesser General
+//    Public License as published by the Free Software Foundation; either
+//    version 2.1 of the License, or (at your option) any later version.
+//    The full text of the license can be found in the file LICENSE at
+//    the top level of the deal.II distribution.
+//
+//-----------------------------------------------------------
+
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/grid_in.h>
+#include <deal.II/grid/grid_out.h>
+
+#include <fstream>
+
+using namespace dealii;
+
+int main ()
+{
+  Triangulation<2,3> tria;
+  GridIn<2,3> gridin;
+  gridin.attach_triangulation(tria);
+
+  {
+    std::ofstream ofile("plane.obj");
+    ofile << "mtllib plane.mtl"               << std::endl
+          << "o Plane"                        << std::endl
+          << "v -1.000000 0.000000 1.000000"  << std::endl
+          << "v 1.000000 0.000000 1.000000"   << std::endl
+          << "v -1.000000 0.000000 -1.000000" << std::endl
+          << "v 1.000000 0.000000 -1.000000"  << std::endl
+          << "vn 0.0000 1.0000 0.0000"        << std::endl
+          << "usemtl None"                    << std::endl
+          << "s off"                          << std::endl
+          << "f 1//1 2//1 4//1 3//1"          << std::endl;
+  }
+  gridin.read_assimp("plane.obj", -1, true, 1e-3);
+  return 0;
+}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.