// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 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 "writeWRL.h" #include #include template IGL_INLINE bool igl::writeWRL( const std::string & str, const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & F) { using namespace std; using namespace Eigen; assert(V.cols() == 3 && "V should have 3 columns"); assert(F.cols() == 3 && "F should have 3 columns"); ofstream s(str); if(!s.is_open()) { cerr<<"IOError: writeWRL() could not open "< FF(F.rows(),4); FF.leftCols(3) = F; FF.col(3).setConstant(-1); s< IGL_INLINE bool igl::writeWRL( const std::string & str, const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & F, const Eigen::PlainObjectBase & C) { using namespace std; using namespace Eigen; assert(V.cols() == 3 && "V should have 3 columns"); assert(F.cols() == 3 && "F should have 3 columns"); ofstream s(str); if(!s.is_open()) { cerr<<"IOError: writeWRL() could not open "< FF(F.rows(),4); FF.leftCols(3) = F; FF.col(3).setConstant(-1); //Check if RGB values are in the range [0..1] or [0..255] double rgbScale = (C.maxCoeff() <= 1.0)?1.0:1.0/255.0; Eigen::MatrixXd RGB = rgbScale * C; s<, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); // generated by autoexplicit.sh template bool igl::writeWRL, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); // generated by autoexplicit.sh template bool igl::writeWRL, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); // generated by autoexplicit.sh template bool igl::writeWRL, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); template bool igl::writeWRL, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); template bool igl::writeWRL, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&); #endif