33#ifndef RACK_GRAPHICS_PANEL
34#define RACK_GRAPHICS_PANEL
37#include <drain/image/FilePng.h>
38#include <drain/image/TreeSVG.h>
39#include <drain/prog/Command.h>
40#include <drain/prog/CommandInstaller.h>
41#include <drain/prog/CommandBank.h>
42#include <drain/util/Output.h>
43#include <drain/image/TreeSVG.h>
44#include "data/SourceODIM.h"
48#include "graphics-radar.h"
49#include "graphics-panel.h"
104 drain::image::TreeSVG & getOnLoadScript(
RackContext & ctx);
127 const std::string &
guessFormat(
const std::string & key);
138 drain::image::TreeSVG & getCurrentAlignedGroup(
RackContext & ctx);
151 drain::image::TreeSVG &
getAdapterGroup(drain::image::TreeSVG & group);
184 drain::image::TreeSVG &
addTitleBox(
const ConfSVG & conf, drain::image::TreeSVG &
object, RackSVG::ElemClass elemClass);
190 drain::image::TreeSVG &
appendTitleElements(
const ConfSVG &conf, drain::image::TreeSVG &group,
const std::string &anchor, RackSVG::ElemClass elemClass);
193 drain::image::TreeSVG &
appendTitleElements(
const ConfSVG &conf, drain::image::TreeSVG &group,
const char * anchor, RackSVG::ElemClass elemClass){
199 drain::image::TreeSVG &
appendTitleElements(
const ConfSVG &conf, drain::image::TreeSVG &group,
const T & anchorId, RackSVG::ElemClass elemClass){
217 drain::image::TreeSVG &
addImageBorder(drain::image::TreeSVG & imagePanel);
231DRAIN_ENUM_DICT(rack::RackSVG::ElemClass);
232DRAIN_ENUM_OSTREAM(rack::RackSVG::ElemClass);
234DRAIN_XML_ENUM_KEY(image::TreeSVG, rack::RackSVG::ElemClass);
242template <> // for T (Tree class)
243template <> // for K (path elem arg)
244const image::TreeSVG & image::TreeSVG::operator[](const rack::RackSVG::ElemClass & value) const;
247template <> // for T (Tree class)
248template <> // for K (path elem arg)
249image::TreeSVG & image::TreeSVG::operator[](const rack::RackSVG::ElemClass & key);
320 int visitPostfix(TreeSVG &root,
const TreeSVG::path_t &path)
override;
341 getParameters().link(
"orientation", orientation=
"HORZ",
343 getParameters().link(
"direction", direction=
"INCR",
349 getParameters().
copyStruct(cmd.getParameters(), cmd, *
this);
354 void exec()
const override;
358 typedef drain::image::AlignBase::Axis orientation_enum;
363 std::string orientation;
367 std::string direction;
400 getParameters().link(
"position", position,
407 getParameters().link(
"anchor", anchor.str(),
410 getParameters().link(
"anchorHorz", anchorHorz.str(),
413 getParameters().link(
"anchorVert", anchorVert.str(),
424 void exec()
const override;
428 std::string position;
472 template <
class T,
size_t N=2>
476 double defaultValue = decay * tuple[0];
484 for (
double & s: tuple){
485 defaultValue = 0.1 * ::round(10.0 * defaultValue);
491 if (s > defaultValue){
496 defaultValue *= decay;
517 void exec()
const override;
531 void exec()
const override;
543 void exec()
const override;
566 void exec()
const override;
590 mout.
accept<LOG_WARNING>(
"new value: ", ctx.svgPanelConf.groupIdentifier);
628 getParameters().link(
"title", ctx.svgPanelConf.mainTitle,
"<empty>|<string>|'auto'");
684 void exec()
const override;
Simple implementation of Command: adds name , description and parameters .
Definition Command.h:445
Extracts and stores directory path, base filename and extension.
Definition FilePath.h:58
Something that has width and height.
Definition Frame.h:55
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition Log.h:313
Logger & accept(const TT &... args)
Some input has been accepted, for example by a syntax.
Definition Log.h:583
void copyStruct(const ReferenceMap &m, const T &src, T &dst, extLinkPolicy policy=RESERVE)
Experimental. Copies references and values of a structure to another.
Definition ReferenceMap.h:415
@ LINK
Definition ReferenceMap.h:400
A single-parameter command.
Definition Command.h:469
char separator
Default character used for splitting input and output. See setValues.
Definition SmartMap.h:85
Default implementation of a tree visitor (concept) compatible TreeUtils::traverser()
Definition TreeUtils.h:270
Tuple of N elements of type T.
Definition UniTuple.h:65
VariableT is a final class applied through typedefs Variable, Reference and FlexibleVariable.
Definition VariableT.h:87
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition Image.h:193
Direction
Direction for "Stacked", horziontally or vertically sequentially aligned layout.
Definition LayoutSVG.h:65
"Virtual" command base for FontSizes and HeaderSizes
Definition graphics-panel.h:464
Definition graphics-panel.h:382
virtual void exec() const override
Definition graphics-panel.cpp:1059
Definition graphics-panel.h:508
virtual void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1138
Definition graphics-panel.h:570
void exec() const override
Run the command with current parameter values.
Definition graphics-panel.h:584
Definition graphics-panel.h:550
void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1197
Definition graphics-panel.h:676
void exec() const override
Definition graphics-panel.cpp:1299
Definition graphics-panel.h:335
virtual void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1032
Definition graphics-panel.h:535
void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1165
Definition graphics-panel.h:522
virtual void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1148
Definition graphics-panel.h:618
Resources provided separately for each thread.
Definition resources.h:67
SVG support for creating aligned image panels.
Definition graphics-panel.h:58
static drain::image::TreeSVG & addTitleBox(const ConfSVG &conf, drain::image::TreeSVG &object, RackSVG::ElemClass elemClass)
Create a title from background rectangle and TEXT elements (MAINTITLE, LOCATION, TIME,...
Definition graphics-panel.cpp:709
static drain::image::TreeSVG & appendTitleElements(const ConfSVG &conf, drain::image::TreeSVG &group, const std::string &anchor, RackSVG::ElemClass elemClass)
Add title elements in given group, to "reserve slots" for actual text content to be added later.
Definition graphics-panel.cpp:741
static drain::image::TreeSVG & addJavaScripsDef(RackContext &ctx, const std::string &key, const std::string §ion="cls")
key => Rack.cls.key = 'key';
Definition graphics-panel.cpp:283
static drain::image::TreeSVG & getImagePanelGroup(RackContext &ctx, const drain::FilePath &filepath)
For each image an own group is created (for clarity, to contain also title TEXT's etc)
Definition graphics-panel.cpp:554
static drain::image::TreeSVG & getMainGroup(RackContext &ctx)
Top-level GROUP used by Rack. All the graphic elements will be created inside this element.
Definition graphics-panel.cpp:414
static drain::image::TreeSVG & addImageBorder(drain::image::TreeSVG &imagePanel)
Add.
Definition graphics-panel.cpp:698
static drain::image::TreeSVG & getJavaScriptDefs(RackContext &ctx)
Definition graphics-panel.cpp:266
static drain::image::TreeSVG & addRectangleGroup(RackContext &ctx, const drain::Frame2D< double > &frame={200, 200})
Add rectangle.
static const std::string & guessFormat(const std::string &key)
returns timeformat
Definition graphics-panel.cpp:299
static drain::image::TreeSVG & getAdapterGroup(drain::image::TreeSVG &group)
Return current row or column of image panels.
Definition graphics-panel.cpp:463
static void addImage(RackContext &ctx, const drain::image::Image &src, const drain::FilePath &filepath)
Add pixel image (PNG).
Definition graphics-panel.cpp:597
static void consumeAlignRequest(RackContext &ctx, drain::image::NodeSVG &node)
Apply an alignment, to next object only.
Definition graphics-panel.cpp:329
static drain::image::TreeSVG & getStyle(RackContext &ctx)
Some SVG style classes. Identifiers for IMAGE and RECT elements over which TEXT elements will be alig...
Definition graphics-panel.cpp:114
Formats titles from metadata. Invoked by drain::TreeUtils::traverse()
Definition graphics-panel.h:292
void formatTitle(TreeSVG &group, const NodeSVG::map_t &attributes) const
Definition graphics-panel.cpp:839
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:1277
Definition DataSelector.cpp:44
A container for a static dictionary of enumeration values.
Definition Enum.h:51
Definition AlignAnchorSVG.h:77
Definition resources-image.h:56