Loading...
Searching...
No Matches
DrawingOp.h
1/*
2
3MIT License
4
5Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30*/
31
32#ifndef RACK_DrawingOP
33#define RACK_DrawingOP
34
35#include "PolarProductOp.h"
36#include "radar/PolarWindow.h"
37
38namespace rack {
39
40
42
49class DrawingOp : public PolarProductOp {
50public:
51
52 DrawingOp(const std::string & name, const std::string &description) : PolarProductOp(name, description){
53 dataSelector.setQuantities("");
54 }
55
56 DrawingOp() : PolarProductOp("DrawingOp", "Visualise a direction[azm,r,r2], range[r,r2], sector[azm,azm2,r,r2] or arc[azm,azm2,r].") {
57 parameters.link("shape", shape = "direction", "[direction|range|sector|arc]");
58 parameters.link("p1", p1 = 0.0);
59 parameters.link("p2", p2 = 0.0);
60 parameters.link("p3", p3 = 0.0);
61 parameters.link("p4", p4 = 0.0);
62 /*
63 link("azm1", w.azm1, 0.0, "deg");
64 link("range1", w.range1, 0, "km");
65 link("azm2", w.azm2, 0.0, "deg");
66 link("range2", w.range2, 0, "km");
67 link("ray1", w.ray1, 0, "index");
68 link("bin1", w.bin1, 0, "index");
69 link("ray2", w.ray2, 0, "index");
70 link("bin2", w.bin2, 0, "index");
71 */
72 parameters.link("marker", this->marker = 255, "intensity");
73 dataSelector.setQuantities("");
74 dataSelector.setMaxCount(1);
75 };
76
77 virtual ~DrawingOp();
78
79
80
81protected:
82
83 std::string shape;
84 double p1,p2,p3,p4;
85
86 int marker;
87
88
89 // Potentially a general utility. rack::Geometry / ODIM?
90 //void deriveWindow(const PolarODIM srcOdim, int & ray1, int & ray2, int & bin1, int & bin2) const ;
91
92 // void drawWindow(int ray1, int ray2, int bin1, int bin2, int marker, PlainData<PolarDst> & dstData) const;
93
94 virtual
95 void processDataSet(const DataSet<PolarSrc> & srcSweep, DataSet<PolarDst> & dstProduct) const ;
96
97
98 // virtual void processData(const Data<PolarSrc> & srcData, Data<PolarDst> & dstData) const ;
99
100
101};
102
103
104} // namespace rack
105
106
107#endif /* RACKOP_H_ */
108
109// Rack
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:282
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1215
Select and visualise a direction, range, sector or arc.
Definition DrawingOp.h:49
Base class for flat (2D) products computed in the polar coordinate system. Volume is used as input.
Definition PolarProductOp.h:59
Definition DataSelector.cpp:44