Go to the documentation of this file.00001
00002
00003
00004 #ifndef graphMeshDAT_hh
00005 #define graphMeshDAT_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
00032 template<typename F>
00033 class MeshDAT {
00034 public:
00036 MeshDAT(concepts::Mesh& msh, const std::string& filename);
00038 MeshDAT(concepts::Space<F>& spc, const std::string& filename);
00039 private:
00040 std::string coordFilename_, boundFilename_, elmFilename_;
00041 void createFilenames_(const std::string& filename);
00042 };
00043
00047 void drawMeshDAT(concepts::Mesh& msh, const std::string& filename);
00048
00052 template<typename F>
00053 void drawMeshDAT(concepts::Space<F>& spc, const std::string& filename);
00054
00055
00056
00060 template<typename F>
00061 class MeshDATCell : public concepts::CellPostprocess<F> {
00062 public:
00064 MeshDATCell(const std::string& coordFilename,
00065 const std::string& boundFilename,
00066 const std::string& elmFilename);
00067 virtual ~MeshDATCell();
00068 virtual void operator() (const concepts::Element<F>& elm)
00069 throw(concepts::MissingFeature);
00070 virtual void operator() (const concepts::Cell& cell)
00071 throw(concepts::MissingFeature);
00072 private:
00073 std::ofstream coordFile_, boundFile_, elmFile_;
00074
00076 std::map<uint, uint> vtxList_;
00077 std::map<uint, concepts::Real3d> vtxCoord_;
00078 concepts::DynArray<bool> vtxBndNotDone_, edgBndNotDone_;
00079
00081 uint vtxCnt_, bndCnt_, elmCnt_;
00082
00083 uint getVertexNumber_(const uint key, const concepts::Real3d* coord = 0);
00084 };
00085
00086 }
00087
00088 #endif // graphMeshDAT_hh