Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
RackSVG Class Reference

SVG panel utils. More...

#include <graphics.h>

Static Public Member Functions

static drain::image::TreeSVG & getStyle (RackContext &ctx)
 Some SVG style classes. Identifiers for IMAGE and RECT elements over which TEXT elements will be aligned.
 
static const std::string & guessFormat (const std::string &key)
 returns timeformat
 
static drain::image::TreeSVG & getMainGroup (RackContext &ctx)
 Top-level GROUP used by Rack. All the graphic elements will be created inside this element.
 
static drain::image::TreeSVG & getCurrentAlignedGroup (RackContext &ctx)
 
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)
 
static drain::image::TreeSVG & getImagePanelGroup (RackContext &ctx)
 
static void consumeAlignRequest (RackContext &ctx, drain::image::NodeSVG &node)
 Apply an alignment, to next object only.
 
static bool applyInclusion (RackContext &cxt, const drain::FilePath &filepath)
 
static void addImage (RackContext &ctx, const drain::image::Image &src, const drain::FilePath &filepath)
 Add pixel image (PNG).
 
static void addImage (RackContext &ctx, const drain::image::TreeSVG &svg, const drain::FilePath &filepath)
 Currently, uses file link (does not embed)
 
static void addImage (RackContext &ctx, const drain::Frame2D< drain::image::svg::coord_t > &frame, const drain::FilePath &filepath, const std::string &styleClass="")
 Add external image from a file path.
 
static drain::image::TreeSVG & addTitleBox (const PanelConfSVG &conf, drain::image::TreeSVG &object, PanelConfSVG::ElemClass elemClass)
 Create a title from background rectangle and TEXT elements (MAINTITLE, LOCATION, TIME, GENERAL)
 
static drain::image::TreeSVG & appendTitleElements (const PanelConfSVG &conf, drain::image::TreeSVG &group, const std::string &anchor, PanelConfSVG::ElemClass elemClass)
 Add title elements in given group, to "reserve slots" for actual text content to be added later.
 
static drain::image::TreeSVG & addRectangleGroup (RackContext &ctx, const drain::Frame2D< double > &frame={200, 200})
 Add rectangle.
 
static drain::image::TreeSVG & addImageBorder (drain::image::TreeSVG &imagePanel)
 Add.
 

Static Public Attributes

static const std::string BACKGROUND_RECT = "bgRect"
 Group identifiers for elements which be automatically aligned (stacked horizontally or vertically)
 

Detailed Description

SVG panel utils.

Member Function Documentation

◆ addImage() [1/3]

void addImage ( RackContext ctx,
const drain::Frame2D< drain::image::svg::coord_t > &  frame,
const drain::FilePath filepath,
const std::string &  styleClass = "" 
)
static

Add external image from a file path.

Add pixel image (PNG)

Parameters
styleClass- optional style class, possibly FLOAT

◆ addImage() [2/3]

void addImage ( RackContext ctx,
const drain::image::Image src,
const drain::FilePath filepath 
)
static

Add pixel image (PNG).

Idea: keep this minimal, add components only upon (eventual) saving of the SVG file.

◆ addImage() [3/3]

void addImage ( RackContext ctx,
const drain::image::TreeSVG &  svg,
const drain::FilePath filepath 
)
static

Currently, uses file link (does not embed)

Add SVG image.

◆ addImageBorder()

drain::image::TreeSVG & addImageBorder ( drain::image::TreeSVG &  imagePanel)
static

Add.

Parameters
imagePanel

◆ addTitleBox()

drain::image::TreeSVG & addTitleBox ( const PanelConfSVG conf,
drain::image::TreeSVG &  object,
PanelConfSVG::ElemClass  elemClass 
)
static

Create a title from background rectangle and TEXT elements (MAINTITLE, LOCATION, TIME, GENERAL)

Returns
TEXT element located at child(GENERAL)

◆ appendTitleElements()

drain::image::TreeSVG & appendTitleElements ( const PanelConfSVG conf,
drain::image::TreeSVG &  group,
const std::string &  anchor,
PanelConfSVG::ElemClass  elemClass 
)
static

Add title elements in given group, to "reserve slots" for actual text content to be added later.

TODO const double fontSize = // getStyleValue(root, RackSVG::TITLE, "font-size", 12.5); root[drain::image::svg::STYLE][elemClass]->get("font-size", 12.5);

◆ getStyle()

drain::image::TreeSVG & getStyle ( RackContext ctx)
static

Some SVG style classes. Identifiers for IMAGE and RECT elements over which TEXT elements will be aligned.

Initialize styles, if undone.


The documentation for this class was generated from the following files: