GridLimit.hpp
1 #pragma once
2 
3 //OPALS
4 #include "opals/config.hpp"
5 #include "opals/Array.hpp"
6 #include "opals/CustomOptionType.hpp"
7 
8 namespace opals {
9 
10  /// Class describing xy-limits for grid datasets
11  class OPALS_API GridLimit : public CustomOptionType<GridLimit>
12  {
13  public:
14  typedef opals::Array<double,4> ArrayD4; ///< limit coordinate array
15 
16  public:
17  GridLimit();
18  virtual ~GridLimit();
19 
20  /// returns true if limit refers to pixel corner
21  bool isPixelCorner() const { return pixRef==0; };
22  /// returns true if limit refers to pixel center
23  bool isPixelCenter() const { return pixRef==1; };
24  /// returns true if a user defined limit is set
25  bool isUserDef() const { return limType==0; };
26  // returns true if rounding of the limits required
27  bool isRoundLimits() const { return forceRound; };
28 
29  /// set limit reference to pixel corner
30  void setPixelCorner();
31  /// set limit reference to pixel center
32  void setPixelCenter();
33  /// set limit as intersection of multiple datasets
34  /// set user defined limits
35  void setForceRound( const bool& Irb_active );
36  /// set/reset the force round flag
37  void setUserLimits( const ArrayD4& lim );
38 
39  ArrayD4 getUserLimits() const { return userLim; };
40  /// query limits of given input limits with respect to the class attributes (intersection/union/dataset)
41 
42  /// \name CustomOptionType interface
43  ///@{
44  static const char * help(bool);
45  static const char * syntax();
46  static bool exportsPythonType();
47  ///@}
48 
49  protected:
50  ArrayD4 userLim;
51  unsigned /*char*/ pixRef, limType;
52  bool forceRound;
53  };
54 }
bool isPixelCenter() const
returns true if limit refers to pixel center
Definition: GridLimit.hpp:23
Base class for all custom parameter types.
Definition: CustomOptionType.hpp:39
Class describing xy-limits for grid datasets.
Definition: GridLimit.hpp:11
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
opals::Array< double, 4 > ArrayD4
limit coordinate array
Definition: GridLimit.hpp:14
bool isUserDef() const
returns true if a user defined limit is set
Definition: GridLimit.hpp:25
@ help
print this usage screen: help on parameters specific to this module
bool isPixelCorner() const
returns true if limit refers to pixel corner
Definition: GridLimit.hpp:21