MultiGridLimit.hpp
1 #ifndef OPALS_MULTI_GRID_LIMIT_HPP_INCLUDED
2 #define OPALS_MULTI_GRID_LIMIT_HPP_INCLUDED
3 
4 #pragma once
5 
6 //STL
7 #include "opals/GridLimit.hpp"
8 #include "opals/Vector.hpp"
9 
10 namespace opals {
11 
12  /// Class describing xy-limits for grid datasets supporting multiple input datasets
13  class OPALS_API MultiGridLimit : public GridLimit, public CustomOptionType<MultiGridLimit>
14  {
15  public:
17  virtual ~MultiGridLimit();
18 
19  /// returns true if the limit denotes the common area of multiple datasets
20  bool isIntersect() const { return limType==1; };
21  /// returns true if the limit denotes the overall area of multiple datasets
22  bool isUnion() const { return limType==2; };
23  /// returns true if the limit denotes the limits of a specific dataset
24  bool isDataset() const { return limType==3; };
25 
26  /// set limit as intersection of multiple datasets
27  void setIntersect();
28  /// set limit as union of multiple datasets
29  void setUnion();
30  /// set limit as limit of a specific dataset (number)
31  void setDataset( const unsigned char &datasetNr );
32 
33  /// query number of specified dataset (in case isDataset()==true)
34  int getDatasetNr() const { return datasetId; };
35  /// query user defined limits (in case isUserDef()==true)
36  ArrayD4 getLimits ( const Vector<ArrayD4> &inLimits );
37 
38  /// \name CustomOptionType interface
39  ///@{
40  static const char * help();
41  static const char * syntax();
42  static bool exportsPythonType();
43  ///}@
44 
45  private:
46  unsigned /*char*/ datasetId;
47  };
48 }
49 
50 #endif //OPALS_MULTI_GRID_LIMIT_HPP_INCLUDED