ESyS-Particle  4.0.1
GeometryInfo.h
1 
2 // //
3 // Copyright (c) 2003-2011 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
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_LSMGEOMETRYINFO_H
15 #define ESYS_LSMGEOMETRYINFO_H
16 
17 #include "Foundation/vec3.h"
18 
19 #include <vector>
20 #include <iostream>
21 
22 namespace esys
23 {
24  namespace lsm
25  {
26  typedef std::vector<bool> BoolVector;
27  typedef std::vector<Vec3> Vec3Vector;
28  typedef std::vector<int> IntVector;
29 
34  {
35  public:
39  GeometryInfo();
40 
45  float version,
46  const Vec3 &bBoxMin,
47  const Vec3 &bBoxMax,
48  const BoolVector &periodicDimensions,
49  bool is2d = false
50  );
51 
52  GeometryInfo(const GeometryInfo &geoInfo);
53 
54  GeometryInfo &operator=(const GeometryInfo &geoInfo);
55 
56  ~GeometryInfo();
57 
58  bool operator==(const GeometryInfo &geoInfo) const;
59 
63  void setBBox(const Vec3 &min, const Vec3 &max);
64 
69  bool hasAnyPeriodicDimensions() const;
70 
74  bool is2d() const;
75 
80  void set_is2d(bool do2d);
81 
85  Vec3Vector getBBoxCorners() const;
86  Vec3 getMinBBoxCorner() const;
87  Vec3 getMaxBBoxCorner() const;
88 
92  IntVector getPeriodicDimensions() const;
93 
97  void setPeriodicDimensions(BoolVector periodicDimensions);
98 
102  void setLsmGeoVersion(float version);
103 
107  void read(std::istream &iStream);
108 
113  void write(std::ostream &oStream) const;
114 
115  private:
116  class Impl;
117 
118  Impl *m_pImpl;
119  };
120 
121  std::ostream &operator<<(std::ostream &oStream, const GeometryInfo &geoInfo);
122  std::istream &operator<<(std::istream &iStream, GeometryInfo &geoInfo);
123  };
124 };
125 
126 #endif