ESyS-Particle  2.3.2
VtkXmlWriter.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 
14 #ifndef ESYS_LSMVTKXMLWRITER_H
15 #define ESYS_LSMVTKXMLWRITER_H
16 
19 
20 #include <iostream>
21 #include <boost/shared_ptr.hpp>
22 
23 namespace esys
24 {
25  namespace lsm
26  {
28  {
31  public:
33 
34  void visitSimpleParticle(const Particle &particle);
35 
36  void visitParticle(const Particle &particle);
37 
38  void visitBasicInteraction(const Connection &connection);
39 
40  void visitConnection(const Connection &connection);
41 
42  size_t getNumParticles() const;
43 
44  size_t getNumConnections() const;
45 
46  int getIndex(int particleId) const;
47 
48  void writeCentrePoints(std::ostream &oStream) const;
49 
50  void writeRadii(std::ostream &oStream) const;
51 
52  void writeTags(std::ostream &oStream) const;
53 
54  void writeIds(std::ostream &oStream) const;
55 
56  void writeParticleIndexConnections(std::ostream &oStream) const;
57 
58  void writeConnectionTags(std::ostream &oStream) const;
59 
60  private:
61  class Impl;
62  typedef boost::shared_ptr<Impl> ImplPtr;
64  };
65 
70  {
71  public:
72  VtkXmlWriter();
73 
74  virtual ~VtkXmlWriter();
75 
76  void setData(const ParticleDataVisitor &particleData);
77 
78  size_t getNumParticles() const;
79 
80  size_t getNumConnections() const;
81 
82  virtual void writePoints(std::ostream &oStream);
83  virtual void writePointData(std::ostream &oStream);
84  virtual void writeCells(std::ostream &oStream);
85  virtual void writeCellData(std::ostream &oStream);
86 
87  virtual void write(std::ostream &oStream);
88 
89  virtual void writeToFile(const std::string &fileName);
90 
91  private:
92 
93  class Impl;
94  typedef boost::shared_ptr<Impl> ImplPtr;
96  };
97  }
98 }
99 
100 #endif