CloudResult.cc
Go to the documentation of this file.
1 
9 #include "CloudResult.h"
10 #include <string>
11 #include <sstream>
12 #include <iomanip>
13 
14 
15 using namespace atm;
16 using namespace std;
17 
19  fIsValid(false),
20  fHaveLidar(false),
21  fCloudCoverage(0.)
22 { }
23 
24 CloudResult::CloudResult(const float coverage, const bool hasLidar, const bool isValid) :
25  fHaveLidar(hasLidar),
26  fCloudCoverage(coverage)
27 {
28  if (!isValid || coverage < 0. || coverage > 1.)
29  fIsValid = false;
30  else
31  fIsValid = true;
32 }
33 
34 std::string
36  const
37 {
38  if (!IsValid())
39  return string("No valid pixel-cloud coverage data available");
40 
41  ostringstream os;
42  os << setprecision(1)
43  << setw(3) << fCloudCoverage
44  << "% pixel coverage";
45 
46  if (fCloudCoverage < 0.1)
47  os << " (\"clear\")";
48 
49  if (!HaveLidar())
50  os << " (no lidar data)";
51 
52  return os.str();
53 }
54 
bool IsValid() const
Definition: CloudResult.h:51
bool HaveLidar() const
Definition: CloudResult.h:52
float fCloudCoverage
Definition: CloudResult.h:60
std::string GetCoverageString() const
Definition: CloudResult.cc:35

, generated on Tue Sep 26 2023.