$extrastylesheet
00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_POSTSCRIPT_IO_H 00021 #define LIBMESH_POSTSCRIPT_IO_H 00022 00023 // Local includes 00024 #include "libmesh/libmesh_common.h" 00025 #include "libmesh/mesh_output.h" 00026 //#include "libmesh/dense_matrix.h" 00027 #include "libmesh/point.h" 00028 00029 // C++ includes 00030 #include <fstream> 00031 #include <sstream> 00032 #include <vector> 00033 00034 namespace libMesh 00035 { 00036 00037 // Forward declarations 00038 class MeshBase; 00039 class Elem; 00040 00052 class PostscriptIO : public MeshOutput<MeshBase> 00053 { 00054 public: 00058 explicit 00059 PostscriptIO (const MeshBase& mesh); 00060 00064 virtual ~PostscriptIO (); 00065 00069 virtual void write (const std::string& ); 00070 00079 Real shade_value; 00080 00087 Real line_width; 00088 00092 void plot_quadratic_elem(const Elem* elem); 00093 00097 void plot_linear_elem(const Elem* elem); 00098 00099 private: 00105 void _compute_edge_bezier_coeffs(const Elem* elem); 00106 00112 //DenseMatrix<float> _M; 00113 static const float _bezier_transform[3][3]; 00114 00119 std::vector<Point> _bezier_coeffs; 00120 00124 Point _offset; 00125 00129 Real _scale; 00130 00134 Point _current_point; 00135 00141 std::ostringstream _cell_string; 00142 00146 std::ofstream _out; 00147 }; 00148 00149 } // namespace libMesh 00150 00151 #endif // LIBMESH_POSTSCRIPT_IO_H