// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 Alec Jacobson // // 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 "writeMESH.h" #include "verbose.h" #include "list_to_matrix.h" #include #include #include #include template IGL_INLINE bool igl::writeMESH( const std::string mesh_file_name, const std::vector > & V, const std::vector > & T, const std::vector > & F) { Eigen::MatrixXd mV; Eigen::MatrixXi mT,mF; bool is_rect; is_rect = list_to_matrix(V,mV); if(!is_rect) { return false; } is_rect = list_to_matrix(T,mT); if(!is_rect) { return false; } is_rect = list_to_matrix(F,mF); if(!is_rect) { return false; } return igl::writeMESH(mesh_file_name,mV,mT,mF); } template IGL_INLINE bool igl::writeMESH( const std::string str, const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & T, const Eigen::PlainObjectBase & F) { using namespace std; using namespace Eigen; //// This is (surprisingly) slower than the C-ish code below //ofstream mesh_file; //mesh_file.open(str.c_str()); //if(!mesh_file.is_open()) //{ // cerr<<"IOError: "<, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); // generated by autoexplicit.sh template bool igl::writeMESH, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); // generated by autoexplicit.sh template bool igl::writeMESH, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); // generated by autoexplicit.sh template bool igl::writeMESH, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); //template bool igl::writeMESH, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); template bool igl::writeMESH, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); template bool igl::writeMESH, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); template bool igl::writeMESH(std::basic_string, std::allocator >, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&, std::vector >, std::allocator > > > const&); #endif