OverlapDef.hpp
1 #pragma once
2 
3 //OPALS
4 #include "opals/config.hpp"
5 #include "opals/String.hpp"
6 
7 namespace opals {
8 
9  /// Class implementing the potential specification of overlap areas as relative and/or absolute measures
10  class OPALS_API OverlapDef
11  {
12  public:
13  OverlapDef() : relArea(0.), absArea(0.), logAnd(true) {};
14  virtual ~OverlapDef() {};
15 
16  /// returns the minimum relative Area
17  double getRelArea() const { return relArea; };
18  /// returns the minimum absolute area
19  double getAbsArea() const { return absArea; };
20  /// returns true if a user defined limit is set
21  opals::String getLogOperator() const { return logAnd ? "and" : "or"; };
22 
23  /// set minimum relative area
24  void setRelArea( const double& area );
25  /// set minimum absolute area
26  void setAbsArea( const double& area );
27  /// set logical operator
28  void setLogOperator( const opals::String& logOp ) { logAnd = logOp == "and" ? true : false; };
29 
30  /// validate two polygon areas and their respective overlap area
31  /// returns true if the overlap area fullfills the minimum absolute and relative area
32  /// of 'this '
33  bool b_checkOverlap( const double& area1,
34  const double& area2,
35  const double& area3 ) const;
36 
37  protected:
38  bool logAnd;
39  double relArea, absArea;
40  };
41 }
double getRelArea() const
returns the minimum relative Area
Definition: OverlapDef.hpp:17
void setLogOperator(const opals::String &logOp)
set logical operator
Definition: OverlapDef.hpp:28
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
Class implementing the potential specification of overlap areas as relative and/or absolute measures.
Definition: OverlapDef.hpp:10
opals::String getLogOperator() const
returns true if a user defined limit is set
Definition: OverlapDef.hpp:21
double getAbsArea() const
returns the minimum absolute area
Definition: OverlapDef.hpp:19
A dynamic character string whose interface conforms to STL's std::string.
Definition: String.hpp:35