IndexDescription.hpp
1 #ifndef OPALS_INDEX_DESCRIPTION_HPP_INCLUDED
2 #define OPALS_INDEX_DESCRIPTION_HPP_INCLUDED
3 
4 #pragma once
5 
6 #include "opals/config.hpp"
7 #include "opals/String.hpp"
8 #include "opals/IndexType.hpp"
9 
10 namespace opals
11 {
12 
13  /// \brief IndexDescription provides generic information about a spatial index (used by DataSetStats).
14  ///
15  /// If a specific information is really set, can be retrieved by the corresponding isSet function.
16  /// Depending on the data type a specific no data value is used to indicate unset values.
17  ///
18  /// \author JO
19  /// \date 20.06.2012
20  class OPALS_API IndexDescription
21  {
22  public:
24  virtual ~IndexDescription();
25 
26  void reset();
27 
28  bool isSetDimension() const;
29  bool isSetType() const;
30  bool isSetDepth() const;
31  bool isSetCountNode() const;
32  bool isSetCountLeaf() const;
33  bool isSetTileSize() const;
34  bool isSetObjectsInLeafMin() const;
35  bool isSetObjectsInLeafMax() const;
36  bool isSetObjectsInLeafMean() const;
37  bool isSetObjectsInLeafStd() const;
38 
39  bool containsPoints() const;
40  bool containsLines() const;
41  bool containsPolygons() const;
42 
43  int getDimension() const;
44  IndexType::Type getType() const;
45  int getDepth() const;
46  int getCountNode() const;
47  int getCountLeaf() const;
48  double getTileSize() const;
49  long long getObjectsInLeafMin() const;
50  long long getObjectsInLeafMax() const;
51  double getObjectsInLeafMean() const;
52  double getObjectsInLeafStd() const;
53 
54  void setGeometries(bool ContainsPoints, bool ContainsLines, bool ContainsPolygons);
55 
56  void setDimension(const int &Dim);
57  void setType(const IndexType::Type &Type);
58  void setDepth(const int& Depth);
59  void setCountNode(const int& LeafCount);
60  void setCountLeaf(const int& LeafCount);
61  void setTileSize(const double& TileSize);
62  void setObjectsInLeafMin(const long long& min);
63  void setObjectsInLeafMax(const long long& max);
64  void setObjectsInLeafMean(const double& mean);
65  void setObjectsInLeafStd(const double& stddev);
66 
67  // output functions
68  String logIndexDescription() const; ///< for xml output
69  String printIndexDescription() const; ///< for log output (in more readable format)
70 
71  static String printIndexHeader(); ///< for log the header line
72 
73  private:
74  int dimension;
75  IndexType::Type type;
76  int depth;
77  bool hasPoints;
78  bool hasLines;
79  bool hasPolygons;
80  int countLeaf;
81  int countNode;
82  double tileSize;
83  long long objectsInLeafMin;
84  long long objectsInLeafMax;
85  double objectsInLeafMean;
86  double objectsInLeafStd;
87  };
88 }
89 
90 #endif //OPALS_INDEX_DESCRIPTION_HPP_INCLUDED