Loading...
Searching...
No Matches
graphics-panel.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
33#ifndef RACK_GRAPHICS_PANEL
34#define RACK_GRAPHICS_PANEL
35
36
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" // for NOD
45
46#include "resources.h"
47//#include "fileio-svg.h"
48#include "graphics-radar.h"
49#include "graphics-panel.h"
50//#include "resources-image.h"
51
52
53namespace rack {
54
55
56
58class RackSVG {
59
60
61public:
62
63 //typedef drain::StyleSelectorXML<NodeSVG> Select;
64
65 // Identifier for the anchor background
66 // static const std::string BACKGROUND_RECT; // = "mainRect";
67
68 enum ElemClass {
69 NONE = 0,
70 MAIN_TITLE = 1, // Main title in SVG image
71 GROUP_TITLE = 2, // Group title
72 IMAGE_TITLE = 4, // Image title: small text (time, location) in corners of radar images
73 // Topical
74 TIME = 8, // Date and time attributes
75 LOCATION = 16, // Place (coordinates, municipality)
76 GENERAL = 32, // Default type
77 ALL = (63),
78 // MAIN,
79 IMAGE_PANEL,
80 IMAGE_BORDER, // RECT surrounding the image, potentially also a COORD_TRACKER
81 BACKGROUND_RECT, // invisible RECT used for aligning
82 SIDE_PANEL,
83 BORDER, // Overall image border (RECT), invisible by default
84 // --
85 MOUSE, // A group marked for mouse event listeners
86 MOUSE_TRACKER, // Area inside which mouse events will be tracked.
87 MONITOR, // Display of interactive operations
88 SELECTOR, // Interactive element illustrating a selection by the user
89 DATA_ARRAY, // Image used as data array only, not to be displayed
90 // SHARED_METADATA, // Something that should not be repeated in panels.
91 // --- unused ? ---
92 // TITLE, // Default title
93 };
94
95
97
100 static
101 drain::image::TreeSVG & getStyle(RackContext & ctx);
102
103 static
104 drain::image::TreeSVG & getOnLoadScript(RackContext & ctx);
105
114 static
115 drain::image::TreeSVG & getJavaScriptDefs(RackContext & ctx); //, const std::string & section="cls");
116
118
121 static
122 drain::image::TreeSVG & addJavaScripsDef(RackContext & ctx, const std::string & key, const std::string & section="cls");
123
124
126 static
127 const std::string & guessFormat(const std::string & key);
128
130
134 static
135 drain::image::TreeSVG & getMainGroup(RackContext & ctx);
136
137 static
138 drain::image::TreeSVG & getCurrentAlignedGroup(RackContext & ctx);
139
140 static
141 drain::image::TreeSVG & getImagePanelGroup(RackContext & ctx, const drain::FilePath & filepath);
142
143 static
144 drain::image::TreeSVG & getImagePanelGroup(RackContext & ctx);
145
146
150 static
151 drain::image::TreeSVG & getAdapterGroup(drain::image::TreeSVG & group);
152
153
154 static
155 //void applyAlignment(RackContext & ctx, drain::image::TreeSVG & group);
157
158 static
159 bool applyInclusion(RackContext & cxt, const drain::FilePath & filepath); // , IncludePolicy fileFormat);
160
161 static
162 // drain::image::TreeSVG &
163 void addImage(RackContext & ctx, const drain::image::Image & src, const drain::FilePath & filepath);
164
166 static
167 // drain::image::TreeSVG &
168 void addImage(RackContext & ctx, const drain::image::TreeSVG & svg, const drain::FilePath & filepath);
169
171
174 static
175 // drain::image::TreeSVG &
176 void addImage(RackContext & ctx, const drain::Frame2D<drain::image::svg::coord_t> & frame, const drain::FilePath & filepath, const std::string & styleClass = "");
177
178
180
183 static
184 drain::image::TreeSVG & addTitleBox(const ConfSVG & conf, drain::image::TreeSVG & object, RackSVG::ElemClass elemClass);
185
186 // TODO: title area "filling order", by group class.
188
189 static
190 drain::image::TreeSVG & appendTitleElements(const ConfSVG &conf, drain::image::TreeSVG &group, const std::string &anchor, RackSVG::ElemClass elemClass);
191
192 static inline
193 drain::image::TreeSVG & appendTitleElements(const ConfSVG &conf, drain::image::TreeSVG &group, const char * anchor, RackSVG::ElemClass elemClass){
194 return appendTitleElements(conf, group, std::string(anchor), elemClass);
195 }
196
197 template <class T>
198 static inline
199 drain::image::TreeSVG & appendTitleElements(const ConfSVG &conf, drain::image::TreeSVG &group, const T & anchorId, RackSVG::ElemClass elemClass){
200 //const drain::StringWrapper<T> anchor(anchorId);
201 const drain::EnumWrapper<T> anchor(anchorId);
202 // const std::string & s = anchor;
203 return appendTitleElements(conf, group, (const std::string &)anchor, elemClass);
204 }
205
206
208 static
209 drain::image::TreeSVG & addRectangleGroup(RackContext & ctx, const drain::Frame2D<double> & frame = {200,200});
210
211
213
216 static
217 drain::image::TreeSVG & addImageBorder(drain::image::TreeSVG & imagePanel); // , const drain::Frame2D<double> & frame = {200,200});
218
219
220protected:
221
222
223};
224
225} // rack
226
227
228
229namespace drain {
230
231DRAIN_ENUM_DICT(rack::RackSVG::ElemClass);
232DRAIN_ENUM_OSTREAM(rack::RackSVG::ElemClass);
233
234DRAIN_XML_ENUM_KEY(image::TreeSVG, rack::RackSVG::ElemClass);
235
236/*
237template <> // for T (Tree class)
238template <> // for K (path elem arg)
239bool image::TreeSVG::hasChild(const rack::RackSVG::ElemClass & key) const ;
240
242template <> // for T (Tree class)
243template <> // for K (path elem arg)
244const image::TreeSVG & image::TreeSVG::operator[](const rack::RackSVG::ElemClass & value) const;
245
246
247template <> // for T (Tree class)
248template <> // for K (path elem arg)
249image::TreeSVG & image::TreeSVG::operator[](const rack::RackSVG::ElemClass & key);
250*/
251
252//
253/*
254template <> // for T (Tree class)
255template <> // for K (path elem arg)
256image::TreeSVG & image::TreeSVG::operator[](const rack::GraphicsContext::ElemClass &x);
257*/
258
260
268//template <>
269//const drain::Enum<RackSVG::TitleClass>::dict_t drain::Enum<RackSVG::TitleClass>::dict;
270
271/*
272template <>
273const std::string std::static_cast<std::string>(const RackSVG::ElemClass & e){
274 return drain::Enum<RackSVG::ElemClass>::dict.getKey(e);
275}
276*/
277
278}
279
280
281namespace rack {
282
283using namespace drain::image;
284// Move to graphics.h ?
285
287
292class TitleCreatorSVG : public drain::TreeVisitor<TreeSVG> {
293
294public:
295
296
297 inline
298 TitleCreatorSVG(const ConfSVG & svgConf) : svgConf(svgConf) {
299 //titles.set(0xff);
300 /*
301 if (!svgConf.mainTitle.empty()){
302 titles.set(PanelConfSVG::ElemClass::MAIN_TITLE);
303 }
304
305 if (!svgConf.groupTitleSyntax.empty()){
306 titles.set(PanelConfSVG::ElemClass::GROUP_TITLE);
307 }
308
309 titles.set(PanelConfSVG::ElemClass::IMAGE_TITLE);
310 */
311 /*
312 if (!svgConf.groupNameSyntax.empty()){
313 titles.set(RackSVG::ElemClass::GROUP_TITLE);
314 }
315 */
316 };
317
320 int visitPostfix(TreeSVG &root, const TreeSVG::path_t &path) override;
321
325 void formatTitle(TreeSVG & group, const NodeSVG::map_t & attributes) const;
326
327 const ConfSVG & svgConf;
328
329
330};
331
332
333// ....
334
336
337public:
338
339 CmdLayout() : drain::BasicCommand(__FUNCTION__, "Set main panel alignment"){
340
341 getParameters().link("orientation", orientation="HORZ",
342 drain::sprinter(drain::Enum<orientation_enum>::dict.getKeys(), {"|"}).str());
343 getParameters().link("directionVert", directionVert="DOWN",
344 drain::sprinter(drain::Enum<dir_vert_enum>::dict.getKeys(), {"|"}).str());
345 getParameters().link("directionHorz", directionHorz="RIGHT",
346 drain::sprinter(drain::Enum<dir_horz_enum>::dict.getKeys(), {"|"}).str());
347
348 }
349
350 CmdLayout(const CmdLayout & cmd) : drain::BasicCommand(cmd) {
351 getParameters().copyStruct(cmd.getParameters(), cmd, *this);
352 };
353
354
355 virtual
356 void exec() const override;
357
358protected:
359
360 typedef drain::image::AlignBase::Axis orientation_enum;
361 typedef drain::image::LayoutSVG::DirectionVert dir_vert_enum;
362 typedef drain::image::LayoutSVG::DirectionHorz dir_horz_enum;
363
364 //volatile
365 mutable
366 std::string orientation;
367
368 // volatile
369 mutable
370 std::string directionVert;
371
372 mutable
373 std::string directionHorz;
374
375
376};
377
387//class CmdAlign : public drain::SimpleCommand<std::string> {
389
390public:
391
392 /*
393 CmdAlign() : drain::SimpleCommand<std::string>(__FUNCTION__, "Alignment of the next element", "topology", "",
394 drain::sprinter(drain::Enum<AlignSVG::Topol>::dict.getKeys(), {"|"}).str() + ':' +
395 drain::sprinter(drain::Enum<AlignSVG::HorzAlign>::dict.getKeys(), {"|"}).str() + ',' +
396 drain::sprinter(drain::Enum<AlignSVG::Topol>::dict.getKeys(), {"|"}).str() + ':' +
397 drain::sprinter(drain::Enum<AlignSVG::VertAlign>::dict.getKeys(), {"|"}).str()
398 ){
399 //getParameters().link("", x, drain::StringBuilder<':'>());
400 }
401 */
402
403
404 CmdAlign() : drain::BasicCommand(__FUNCTION__, "Alignment of the next element"){
405
406 getParameters().link("position", position,
407 drain::sprinter(drain::Enum<MutualAlign::Topol>::dict.getKeys(), {"|"}).str() + ':' +
408 drain::sprinter(drain::Enum<AlignSVG::HorzAlign>::dict.getKeys(), {"|"}).str() + ',' +
409 drain::sprinter(drain::Enum<MutualAlign::Topol>::dict.getKeys(), {"|"}).str() + ':' +
410 drain::sprinter(drain::Enum<AlignSVG::VertAlign>::dict.getKeys(), {"|"}).str()
411 ).setSeparator(':');
412
413 getParameters().link("anchor", anchor.str(),
414 std::string("<name>|<empty>") + drain::sprinter(drain::Enum<drain::image::AnchorElem::Anchor>::dict.getKeys(), {"|"}).str()
415 );
416 getParameters().link("anchorHorz", anchorHorz.str(),
417 "..."
418 );
419 getParameters().link("anchorVert", anchorVert.str(),
420 "..."
421 );
422 }
423
424 CmdAlign(const CmdAlign & cmd) : drain::BasicCommand(cmd){
425 getParameters().copyStruct(cmd.getParameters(), cmd, *this, drain::ReferenceMap::LINK);
426 };
427
428
429 virtual
430 void exec() const override;
431
432protected:
433
434 std::string position;
435
436 mutable
438
439 mutable
440 drain::image::AnchorElem anchorHorz;
441
442 mutable
443 drain::image::AnchorElem anchorVert;
444
445};
446
447/*
448class CmdAnchor : public drain::SimpleCommand<std::string> {
449
450public:
451
452 inline
453 CmdAnchor() : drain::SimpleCommand<std::string>(__FUNCTION__, "Alignment of the next element", "topology", "",
454 drain::sprinter(drain::Enum<drain::image::AnchorElem::Anchor>::dict.getKeys(), {"|"}).str()
455 ){
456 //getParameters().link("", x, drain::StringBuilder<':'>());
457 }
458
459 virtual
460 void exec() const override {
461
462 RackContext & ctx = getContext<RackContext>();
463 drain::Logger mout(ctx.log, __FUNCTION__, getName());
464
465 }
466};
467 */
468
470class CmdAdjustSizes : public drain::SimpleCommand<std::string> {
471
472public:
473
474 CmdAdjustSizes(const std::string & name, const std::string & description) : drain::SimpleCommand<std::string>(name, description) {
475 // getParameters().link("sizes", fontSizes);
476 }
477
478 template <class T, size_t N=2>
479 void adjust(drain::UniTuple<T,N> & tuple, float decay = 0.8) const{
480
481
482 double defaultValue = decay * tuple[0];
483
484 tuple.clear();
485
486 drain::Reference ref(tuple);
487 ref.setFill(false);
488 ref = value;
489
490 for (double & s: tuple){
491 defaultValue = 0.1 * ::round(10.0 * defaultValue);
492 // mout.attention("font size ", s, ", [", defaultValue, "]");
493 if (s == 0.0){
494 s = defaultValue;
495 }
496 else {
497 if (s > defaultValue){
498 // mout.suspicious<LOG_WARNING>("font size increasing (", s, '>', defaultValue, ") unexpectedly");
499 }
500 defaultValue = s;
501 }
502 defaultValue *= decay;
503 }
504 // mout.accept<LOG_WARNING>("new values: ", ctx.svgPanelConf.fontSizes);
505
506
507 }
508
509
510};
511
512
513// class CmdFontSizes : public drain::BasicCommand {
515
516public:
517
518 inline
519 CmdFontSizes() : CmdAdjustSizes(__FUNCTION__, "Adjust font sizes in CSS style section.") {
520 }
521
522 virtual
523 void exec() const override;
524
525};
526
527
529
530public:
531
532 inline
533 CmdTitleHeights() : CmdAdjustSizes(__FUNCTION__, "Set title box heights and adjust font sizes. See --gFontSizes") {
534 }
535
536 virtual
537 void exec() const override;
538
539};
540
541class CmdLinkImage : public drain::SimpleCommand<std::string> {
542
543public:
544
545 inline
546 CmdLinkImage() : drain::SimpleCommand<std::string>(__FUNCTION__, "Link arbitrary external image (PNG).") {
547 }
548
549 void exec() const override;
550
551};
552
553
554
555//class CmdGroupTitle : public drain::BasicCommand {
556class CmdGroupTitle : public drain::SimpleCommand<std::string> {
557
558public:
559
560 inline
561 CmdGroupTitle() : drain::SimpleCommand<std::string>(__FUNCTION__, "Set titles, supporting variables", "syntax") {
562 // RackContext & ctx = getContext<RackContext>();
563 getParameters().separator = 0;
564 // getParameters().link("syntax", ctx.svgPanelConf.groupTitleSyntax, "example: '${what:date|%Y%m} ${NOD}'");
565 }
566
567 inline
568 CmdGroupTitle(const CmdGroupTitle & cmd) : drain::SimpleCommand<std::string>(cmd) { // drain::BasicCommand(cmd) {
569 // getParameters().copyStruct(cmd.getParameters(), cmd, *this, drain::ReferenceMap::LINK);
570 }
571
572 void exec() const override;
573
574};
575
576class CmdGroupId : public drain::SimpleCommand<std::string> {
577
578public:
579
580 //CmdGroupTitle() : drain::BasicCommand(__FUNCTION__, "Set titles automatically") {
581 CmdGroupId() : drain::SimpleCommand<std::string>(__FUNCTION__, "Set grouping criterion based on variables", "syntax") {
582 getParameters().separator = 0;
583 }
584
585 CmdGroupId(const CmdGroupId & cmd) : drain::SimpleCommand<std::string>(cmd) { // drain::BasicCommand(cmd) {
586 // getParameters().copyStruct(cmd.getParameters(), cmd, *this, drain::ReferenceMap::LINK);
587 }
588
589 inline
590 void exec() const override {
591 RackContext & ctx = getContext<RackContext>();
592 drain::Logger mout(ctx.log, __FILE__, __FUNCTION__);
593 // mout.accept<LOG_WARNING>("old value: ", value);
594 drain::StringTools::replace(value, '/', '-', ctx.svgPanelConf.groupIdentifier);
595 // notice if pruned/modified?
596 mout.accept<LOG_WARNING>("new value: ", ctx.svgPanelConf.groupIdentifier);
597 }
598
599};
600
601
602/*
603class CmdImageTitle : public drain::BasicCommand {
604
605public:
606
607 CmdImageTitle() : drain::BasicCommand(__FUNCTION__, "Set titles automatically") {
608 RackContext & ctx = getContext<RackContext>();
609 getParameters().link("title", ctx.svgPanelConf.imageTitle, "'TIME'|'LOCATION'|'GENERAL'");
610 }
611
612 CmdImageTitle(const CmdImageTitle & cmd) : drain::BasicCommand(cmd) {
613 getParameters().copyStruct(cmd.getParameters(), cmd, *this, drain::ReferenceMap::LINK);
614 }
615
616 void exec() const override {
617 RackContext & ctx = getContext<RackContext>();
618 drain::Logger mout(ctx.log, __FILE__, __FUNCTION__);
619 }
620
621};
622*/
623
625
626public:
627
628 // TODO: use unlinked SimpleCommand,
629
630 inline
631 CmdTitle() : drain::BasicCommand(__FUNCTION__, "Set main title") {
632 RackContext & ctx = getContext<RackContext>();
633 getParameters().separator = 0;
634 getParameters().link("title", ctx.svgPanelConf.mainTitle, "<empty>|<string>|'auto'");
635 }
636
637 inline
638 CmdTitle(const CmdTitle & cmd) : drain::BasicCommand(cmd) {
639 getParameters().copyStruct(cmd.getParameters(), cmd, *this, drain::ReferenceMap::LINK);
640 }
641
642};
643
662/*
663class CmdTitles : public drain::BasicCommand {
664
665public:
666
667 CmdTitles() : drain::BasicCommand(__FUNCTION__, "Set titles automatically") {
668 RackContext & ctx = getContext<RackContext>();
669 getParameters().link("main", ctx.svgPanelConf.mainTitle, "NONE|AUTO|USER");
670 getParameters().link("group", ctx.svgPanelConf.mainTitle, "NONE|AUTO|USER");
671 getParameters().link("image", ctx.svgPanelConf.mainTitle, "NONE|TIME|LOCATION|GENERAL");
672 }
673
674 CmdTitles(const CmdTitles & cmd) : drain::BasicCommand(cmd) {
675 getParameters().copyStruct(cmd.getParameters(), cmd, *this, drain::ReferenceMap::LINK);
676 }
677
678};
679 */
680
681
682class CmdInclude : public drain::SimpleCommand<std::string> {
683
684public:
685
686 CmdInclude() : drain::SimpleCommand<std::string>(__FUNCTION__, "Select images to include in SVG panel", "include",
687 drain::sprinter(drain::Enum<drain::image::FileSVG::IncludePolicy>::dict.getKeys(), '|').str()) {
688 }
689
690 void exec() const override;
691
692};
693
694
695/*
696class CmdTitles : public drain::SimpleCommand<std::string> {
697public:
698
699 CmdTitles() : drain::SimpleCommand<std::string>(__FUNCTION__, "Set titles automatically", "[MAINTITLE|TIME|LOCATION|GENERAL]") {
700 }
701
702 void exec() const {
703
704 RackContext & ctx = getContext<RackContext>();
705 drain::Logger mout(ctx.log, __FILE__, __FUNCTION__);
706
707 mout.unimplemented<LOG_ERR>(__FILE__, __FUNCTION__);
708 //ctx.svgPanelConf.svgTitles.set(value);
709
710 }
711
712};
713 */
714
715
716} // rack::
717
718
719#endif
Simple implementation of Command: adds name , description and parameters .
Definition Command.h:443
Definition Enum.h:236
Extracts and stores directory path, base filename and extension.
Definition FilePath.h:54
Something that has width and height.
Definition Frame.h:53
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:467
char separator
Default character used for splitting input and output. See setValues.
Definition SmartMap.h:81
static void replace(const std::string &src, char search, char repl, std::ostream &ostr)
Replaces instances of 'search' to 'repl' in src.
Definition StringTools.cpp:93
Default implementation of a tree visitor (concept) compatible TreeUtils::traverser()
Definition TreeUtils.h:265
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:183
Definition TreeSVG.h:182
"Virtual" command base for FontSizes and HeaderSizes
Definition graphics-panel.h:470
Definition graphics-panel.h:388
virtual void exec() const override
Definition graphics-panel.cpp:1067
Definition graphics-panel.h:514
virtual void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1146
Definition graphics-panel.h:576
void exec() const override
Run the command with current parameter values.
Definition graphics-panel.h:590
Definition graphics-panel.h:556
void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1213
Definition graphics-panel.h:682
void exec() const override
Definition graphics-panel.cpp:1315
Definition graphics-panel.h:335
virtual void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1008
Definition graphics-panel.h:541
void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1173
Definition graphics-panel.h:528
virtual void exec() const override
Run the command with current parameter values.
Definition graphics-panel.cpp:1156
Definition graphics-panel.h:624
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:685
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:717
static drain::image::TreeSVG & addJavaScripsDef(RackContext &ctx, const std::string &key, const std::string &section="cls")
key => Rack.cls.key = 'key';
Definition graphics-panel.cpp:254
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:530
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:385
static drain::image::TreeSVG & addImageBorder(drain::image::TreeSVG &imagePanel)
Add.
Definition graphics-panel.cpp:674
static drain::image::TreeSVG & getJavaScriptDefs(RackContext &ctx)
Definition graphics-panel.cpp:237
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:270
static drain::image::TreeSVG & getAdapterGroup(drain::image::TreeSVG &group)
Return current row or column of image panels.
Definition graphics-panel.cpp:434
static void addImage(RackContext &ctx, const drain::image::Image &src, const drain::FilePath &filepath)
Add pixel image (PNG).
Definition graphics-panel.cpp:573
static void consumeAlignRequest(RackContext &ctx, drain::image::NodeSVG &node)
Apply an alignment, to next object only.
Definition graphics-panel.cpp:300
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:81
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:815
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 TreeSVG.h:104
Definition resources-image.h:57