Dune Core Modules (2.9.0)

Default options class to write SVG matrices. More...

#include <dune/istl/io.hh>

Public Member Functions

template<class RowPrefix , class ColPrefix >
std::string blockStyleClass (const RowPrefix &row_prefix, const ColPrefix &col_prefix) const
 Helper function that returns an style class for a given prefix. More...
 
template<class Stream , class RowPrefix , class ColPrefix , class Block >
void writeBlockTitle (Stream &out, const RowPrefix &row_prefix, const ColPrefix &col_prefix, const Block &block) const
 Helper function writes a title for a given block and prefix. More...
 
template<class Stream , class RowPrefix , class ColPrefix , class Block >
void writeSVGBlock (Stream &out, const RowPrefix &row_prefix, const ColPrefix &col_prefix, const Block block, const std::array< std::size_t, 4 > &svg_box) const
 Write an SVG object for a given block/value in the matrix. More...
 

Public Attributes

std::size_t block_size = 10
 size (pixels) of the deepst block/value of the matrix
 
std::size_t interspace = 5
 size (pixels) of the interspace between blocks
 
std::size_t width = 500
 Final width size (pixels) of the SVG header. If 0, size is automatic.
 
std::size_t height = 0
 Final height size (pixels) of the SVG header. If 0, size is automatic.
 
bool write_header = true
 Whether to write the SVG header.
 
std::string style
 CSS style block to write in header.
 
std::function< std::string(const double &)> color_fill
 Color fill for default options. More...
 
bool write_block_title = true
 (Helper) Whether to write a title on the rectangle value
 

Detailed Description

Default options class to write SVG matrices.

This object is intended customize the output of the SVG writer for matrices writeSVGMatrix.

Member Function Documentation

◆ blockStyleClass()

template<class RowPrefix , class ColPrefix >
std::string Dune::DefaultSVGMatrixOptions::blockStyleClass ( const RowPrefix &  row_prefix,
const ColPrefix &  col_prefix 
) const
inline

Helper function that returns an style class for a given prefix.

Note
This function is only a helper to the default writeSVGBlock and is not required for custom options classes.

Referenced by writeSVGBlock().

◆ writeBlockTitle()

template<class Stream , class RowPrefix , class ColPrefix , class Block >
void Dune::DefaultSVGMatrixOptions::writeBlockTitle ( Stream &  out,
const RowPrefix &  row_prefix,
const ColPrefix &  col_prefix,
const Block &  block 
) const
inline

Helper function writes a title for a given block and prefix.

Note
This function is only a helper to the default writeSVGBlock and is not required for custom options classes.

Referenced by writeSVGBlock().

◆ writeSVGBlock()

template<class Stream , class RowPrefix , class ColPrefix , class Block >
void Dune::DefaultSVGMatrixOptions::writeSVGBlock ( Stream &  out,
const RowPrefix &  row_prefix,
const ColPrefix &  col_prefix,
const Block  block,
const std::array< std::size_t, 4 > &  svg_box 
) const
inline

Write an SVG object for a given block/value in the matrix.

This function is called for every matrix block; that includes root and intermediate nested blocks of matrices. SVG blocks are written from outer to inner matrix blocks, this means that in case of overlaps in the SVG objects, the more nested blocks take precedence.

Warning
If the SVG bounding box is not respected, the content may be ommited in the final SVG view.
Note
This function signature is required for any custom options class.
Template Parameters
StreamAn ostream type (possibly a NullStream!)
RowPrefixA ReservedVector
ColPrefixA ReservedVector
BlockThe type of the current block
Parameters
outAn stream to send SVG object to
row_prefixA multindex of indices to access current row
col_prefixA multindex of indices to access current column
blockThe current matrix/sub-block/value
svg_boxSVG object bounding box (position and sizes).

References blockStyleClass(), color_fill, height, width, and writeBlockTitle().

Member Data Documentation

◆ color_fill

std::function<std::string(const double&)> Dune::DefaultSVGMatrixOptions::color_fill

Color fill for default options.

Example:

opts.color_fill = [max,min](const double& val){
auto percentage = (val-min)/(max-min)*100;
return "hsl(348, " + std::to_string(precentage) + "%, 41%)";};
};
auto min(ADLTag< 0 >, const V &v1, const V &v2)
implements binary Simd::min()
Definition: defaults.hh:89
auto max(ADLTag< 0 >, const V &v1, const V &v2)
implements binary Simd::max()
Definition: defaults.hh:81

Referenced by writeSVGBlock().


The documentation for this struct was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 20, 23:31, 2024)