From: Luca Heltai Date: Sat, 16 Sep 2017 14:53:33 +0000 (+0200) Subject: Add quick-test for Assimp. X-Git-Tag: v9.0.0-rc1~1050^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5ad63e95af320d3037c517da6fd4cc5c74eafb9;p=dealii.git Add quick-test for Assimp. --- diff --git a/tests/quick_tests/CMakeLists.txt b/tests/quick_tests/CMakeLists.txt index 9ceed73315..13c1d65716 100644 --- a/tests/quick_tests/CMakeLists.txt +++ b/tests/quick_tests/CMakeLists.txt @@ -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 index 0000000000..5d4270168f --- /dev/null +++ b/tests/quick_tests/assimp.cc @@ -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 +#include +#include + +#include + +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; +}