Go to the documentation of this file.00001
00002
00003
00004 #ifndef graphMeshMatlab_hh
00005 #define graphMeshMatlab_hh
00006
00007 #include <string>
00008 #include <fstream>
00009 #include <memory>
00010 #include "basics/typedefs.hh"
00011 #include "basics/vectorsMatricesForward.hh"
00012 #include "basics/exceptions.hh"
00013 #include "toolbox/dynArray.hh"
00014 #include "space/postProcess.hh"
00015
00016 namespace concepts {
00017
00018 class Mesh2;
00019 class Mesh3;
00020 }
00021
00022 namespace graphics {
00023
00024 using concepts::Real;
00025
00026
00027
00048 template<typename F>
00049 class MeshMatlab {
00050 public:
00053 MeshMatlab(concepts::Mesh& msh, std::string filename);
00056 MeshMatlab(concepts::Space<F>& spc, std::string filename);
00057 ~MeshMatlab();
00058 private:
00060 void createStreams_(std::string filename);
00062 void closeStreams_();
00064 std::auto_ptr<std::ofstream> ofs1_, ofs2_, ofs3_;
00065 };
00066
00070 void drawMeshMatlab(concepts::Mesh& msh, std::string filename);
00071
00075 template<class F>
00076 void drawMeshMatlab(concepts::Space<F>& spc, std::string filename);
00077
00078
00079
00094 template<typename F>
00095 class MeshMatlabCell : public concepts::CellPostprocess<F> {
00096 public:
00098 MeshMatlabCell(std::ostream* os1, std::ostream* os2, std::ostream* os3);
00099 virtual ~MeshMatlabCell();
00100 virtual void operator() (const concepts::Element<F>& elm)
00101 throw(concepts::MissingFeature);
00102 virtual void operator() (const concepts::Cell& cell)
00103 throw(concepts::MissingFeature);
00104 private:
00106 std::ostream *os1_, *os2_, *os3_;
00108 std::auto_ptr<concepts::DynArray<uint> > map_;
00110 uint cnt_;
00111 };
00112
00113 }
00114
00115 #endif // graphMeshMatlab_hh