ESyS-Particle  4.0.1
GeometryInfo.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 
00014 #ifndef ESYS_LSMGEOMETRYINFO_H
00015 #define ESYS_LSMGEOMETRYINFO_H
00016 
00017 #include "Foundation/vec3.h"
00018 
00019 #include <vector>
00020 #include <iostream>
00021 
00022 namespace esys
00023 {
00024   namespace lsm
00025   {
00026     typedef std::vector<bool> BoolVector;
00027     typedef std::vector<Vec3> Vec3Vector;
00028     typedef std::vector<int>  IntVector;
00029 
00033     class GeometryInfo
00034     {
00035     public:
00039       GeometryInfo();
00040 
00044       GeometryInfo(
00045         float            version,
00046         const Vec3       &bBoxMin,
00047         const Vec3       &bBoxMax,
00048         const BoolVector &periodicDimensions,
00049         bool             is2d = false
00050       );
00051 
00052       GeometryInfo(const GeometryInfo &geoInfo);
00053 
00054       GeometryInfo &operator=(const GeometryInfo &geoInfo);
00055 
00056       ~GeometryInfo();
00057 
00058       bool operator==(const GeometryInfo &geoInfo) const;
00059 
00063       void setBBox(const Vec3 &min, const Vec3 &max);
00064 
00069       bool hasAnyPeriodicDimensions() const;
00070 
00074       bool is2d() const;
00075 
00080       void set_is2d(bool do2d);
00081       
00085       Vec3Vector getBBoxCorners() const;
00086       Vec3 getMinBBoxCorner() const;
00087       Vec3 getMaxBBoxCorner() const;
00088 
00092       IntVector getPeriodicDimensions() const;
00093 
00097       void setPeriodicDimensions(BoolVector periodicDimensions);
00098 
00102       void setLsmGeoVersion(float version);
00103       
00107       void read(std::istream &iStream);
00108 
00113       void write(std::ostream &oStream) const;
00114       
00115     private:
00116       class Impl;
00117       
00118       Impl *m_pImpl;
00119     };
00120     
00121     std::ostream &operator<<(std::ostream &oStream, const GeometryInfo &geoInfo);
00122     std::istream &operator<<(std::istream &iStream, GeometryInfo &geoInfo);
00123   };
00124 };
00125 
00126 #endif