File: plotMapLayer.h

package info (click to toggle)
groops 0%2Bgit20250907%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 11,140 kB
  • sloc: cpp: 135,607; fortran: 1,603; makefile: 20
file content (85 lines) | stat: -rw-r--r-- 2,917 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/***********************************************/
/**
* @file plotMapLayer.h
*
* @brief plot layers of maps.
*
* @author Andreas Kvas
* @author Torsten Mayer-Guerr
* @date 2015-10-23
*
*/
/***********************************************/

#ifndef __GROOPS_PLOTMAPLAYER__
#define __GROOPS_PLOTMAPLAYER__

#include "base/import.h"
#include "config/config.h"

/** @addtogroup plotGroup */
/// @{

/***** CLASS ***********************************/

// Latex documentation
#ifdef DOCSTRING_PlotMapLayer
static const char *docstringPlotMapLayer = R"(
\section{PlotMapLayer}\label{plotMapLayerType}
Defines the content of a map of \program{PlotMap}. Multiple layers are are plotted sequentially.
)";
#endif

/***** TYPES ***********************************/

class PlotMapLayer;
typedef std::shared_ptr<PlotMapLayer> PlotMapLayerPtr;

/***** CLASS ***********************************/

/** @brief Layers for maps.
* An Instance of this class can be created by @ref readConfig. */
class PlotMapLayer
{
protected:
  FileName              dataFileName;
  std::vector<Vector3d> points;
  std::vector<Double>   areas;
  Matrix                data;
  Angle                 bufferLon, bufferLat;

public:
  virtual ~PlotMapLayer() {}

  virtual Bool requiresColorBar() const {return FALSE;}
  virtual void boundary(const Ellipsoid &ellipsoid, Angle &minL, Angle &maxL, Angle &minB, Angle &maxB) const;
  virtual void getIntervalZ(Bool isLogarithmic, Double &minZ, Double &maxZ) const;
  virtual void writeDataFile(const Ellipsoid &ellipsoid, const FileName &workingDirectory, UInt idxLayer);
  virtual std::string scriptStatisticsInfo(UInt fontSize, Double width, const FileName &workingDirectory, UInt idxLayer) const;
  virtual std::string scriptEntry() const = 0;
  virtual std::string legendEntry(const FileName &workingDirectory, UInt idxLayer) const;

  /** @brief creates an derived instance of this class. */
  static PlotMapLayerPtr create(Config &config, const std::string &name);
};

/***** FUNCTIONS *******************************/

/** @brief Creates a class PlotMapLayer.
* Search for a node with @a name in the Config node.
* if @a name is not found the function returns FALSE and @a plotMapLayer is untouched.
* @param config The config node which includes the node with the options for this class
* @param name Tag name in the config.
* @param[out] plotMapLayer Created class.
* @param mustSet If is MUSTSET and @a name is not found, this function throws an exception instead of returning with FALSE.
* @param defaultValue Ignored at the moment.
* @param annotation Description of the function of this class.
* @relates PlotMapLayer */
template<> Bool readConfig(Config &config, const std::string &name, PlotMapLayerPtr &plotMapLayer, Config::Appearance mustSet, const std::string &defaultValue, const std::string &annotation);

/// @}

/***********************************************/


#endif /* __GROOPS__ */