meshEPS.hh

Go to the documentation of this file.
1 
6 #ifndef graphMeshEPS_hh
7 #define graphMeshEPS_hh
8 
9 #include <string>
10 #include "basics/typedefs.hh"
12 #include "basics/exceptions.hh"
13 #include "space/postProcess.hh"
14 
15 namespace concepts {
16  // forward declartions
17  class Mesh2;
18 } // namespace concepts
19 
20 namespace graphics {
21 
22  using concepts::Real;
23 
24  // *************************************************************** MeshEPS **
25 
38  template<class F = Real>
39  class MeshEPS {
40  public:
44  MeshEPS(concepts::Mesh& msh, std::string filename,
45  const Real scale = 100, const Real greyscale = 1.0,
46  const unsigned int nPoints = 20);
47 
51  MeshEPS(concepts::Space<F>& spc, std::string filename,
52  const Real scale = 100, const Real greyscale = 1.0,
53  const unsigned int nPoints = 20);
54  private:
57 
60  };
61 
68 // template<class F>
69  MeshEPS<Real> drawMeshEPS(concepts::Mesh& msh, std::string filename,
70  const Real scale = 100, const Real greyscale = 1.0,
71  const unsigned int nPoints = 2);
72 
79  template<class F>
80  MeshEPS<F> drawMeshEPS(concepts::Space<F>& spc, std::string filename,
81  const Real scale = 100, const Real greyscale = 1.0,
82  const unsigned int nPoints = 20);
83 
84  // *********************************************************** MeshEPSCell **
85 
97  template<class F>
98  class MeshEPSCell : public concepts::CellPostprocess<Real> {
99  public:
107  MeshEPSCell(std::ostream& os, concepts::Mesh2& msh,
108  const Real scale = 100, const Real greyscale = 1.0,
109  const unsigned int nPoints = 20)
110  throw(concepts::MissingFeature);
111 
119  MeshEPSCell(std::ostream& os, concepts::Space<F>& spc,
120  const Real scale = 100, const Real greyscale = 1.0,
121  const unsigned int nPoints = 20)
122  throw(concepts::MissingFeature);
123 
124  virtual void operator() (const concepts::Element<Real>& elm)
125  throw(concepts::MissingFeature);
126  virtual void operator() (const concepts::Cell& cell)
127  throw(concepts::MissingFeature);
128  void offsetMin(const concepts::Real2d& x);
129  void maxMax(const concepts::Real2d& x);
130  private:
132  std::ostream& os_;
133 
136 
139 
142 
145 
147  unsigned int nPoints_;
148 
149  void EPSheader_(const concepts::Real2d max, std::ostream& os) const;
150  };
151 
152 } // namespace graphics
153 
154 #endif // graphMeshEPS_hh
Real greyscale_
Greyscaling factor.
Definition: meshEPS.hh:138
Draws a picture of a mesh in EPS.
Definition: meshEPS.hh:98
Abstract class for a space.
concepts::Real2d offset_
Offset of the bottom left corner from the origin.
Definition: meshEPS.hh:141
Point< Real, 2 > Real2d
MeshEPS< Real > drawMeshEPS(concepts::Mesh &msh, std::string filename, const Real scale=100, const Real greyscale=1.0, const unsigned int nPoints=2)
Trampoline function to create a MeshEPS.
GenericElement< KarniadakisMixin< F > > Element
template aliases for backwards compatibility
Definition: element.hh:270
Real scale_
Scaling factor.
Definition: meshEPS.hh:135
void maxMax(const concepts::Real2d &x)
concepts::Mesh * msh_
The mesh.
Definition: meshEPS.hh:59
MeshEPS(concepts::Mesh &msh, std::string filename, const Real scale=100, const Real greyscale=1.0, const unsigned int nPoints=20)
Constructor.
void EPSheader_(const concepts::Real2d max, std::ostream &os) const
MeshEPSCell(std::ostream &os, concepts::Mesh2 &msh, const Real scale=100, const Real greyscale=1.0, const unsigned int nPoints=20)
Constructor.
void offsetMin(const concepts::Real2d &x)
Graphics.
Definition: basis.hh:33
concepts::Space< F > * spc_
The space.
Definition: meshEPS.hh:56
concepts::Real2d max_
Offset of the top right corner from the origin.
Definition: meshEPS.hh:144
unsigned int nPoints_
Number of points per edge to be drawn.
Definition: meshEPS.hh:147
An abstract class for 2D meshes.
Definition: mesh.hh:103
An abstract class for meshes.
Definition: mesh.hh:76
std::ostream & os_
Output stream.
Definition: meshEPS.hh:132
MeshEPS(concepts::Space< F > &spc, std::string filename, const Real scale=100, const Real greyscale=1.0, const unsigned int nPoints=20)
Constructor.
Abstract class for per cell postprocessing.
Definition: postProcess.hh:38
Draws a picture of a mesh in EPS format and stores the result in a file.
Definition: meshEPS.hh:39
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich