Default options class to write SVG matrices.
More...
#include <dune/istl/io.hh>
|
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...
|
|
|
std::size_t | block_size = 10 |
| size (pixels) of the deepst block/value of the matrix More...
|
|
std::size_t | interspace = 5 |
| size (pixels) of the interspace between blocks More...
|
|
std::size_t | width = 500 |
| Final width size (pixels) of the SVG header. If 0, size is automatic. More...
|
|
std::size_t | height = 0 |
| Final height size (pixels) of the SVG header. If 0, size is automatic. More...
|
|
bool | write_header = true |
| Whether to write the SVG header. More...
|
|
std::string | style |
| CSS style block to write in header. More...
|
|
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 More...
|
|
Default options class to write SVG matrices.
This object is intended customize the output of the SVG writer for matrices writeSVGMatrix.
◆ 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.
◆ 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.
◆ 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
-
Stream | An ostream type (possibly a NullStream!) |
RowPrefix | A ReservedVector |
ColPrefix | A ReservedVector |
Block | The type of the current block |
- Parameters
-
out | An stream to send SVG object to |
row_prefix | A multindex of indices to access current row |
col_prefix | A multindex of indices to access current column |
block | The current matrix/sub-block/value |
svg_box | SVG object bounding box (position and sizes). |
◆ block_size
std::size_t Dune::DefaultSVGMatrixOptions::block_size = 10 |
size (pixels) of the deepst block/value of the matrix
◆ 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%)";};
};
◆ height
std::size_t Dune::DefaultSVGMatrixOptions::height = 0 |
Final height size (pixels) of the SVG header. If 0, size is automatic.
◆ interspace
std::size_t Dune::DefaultSVGMatrixOptions::interspace = 5 |
size (pixels) of the interspace between blocks
◆ style
std::string Dune::DefaultSVGMatrixOptions::style |
Initial value:= " .matrix-block {\n"
" fill: cornflowerblue;\n"
" fill-opacity: 0.4;\n"
" stroke-width: 2;\n"
" stroke: black;\n"
" stroke-opacity: 0.5;\n"
" }\n"
" .matrix-block:hover {\n"
" fill: lightcoral;\n"
" fill-opacity: 0.4;\n"
" stroke-opacity: 1;\n"
" }\n"
CSS style block to write in header.
◆ width
std::size_t Dune::DefaultSVGMatrixOptions::width = 500 |
Final width size (pixels) of the SVG header. If 0, size is automatic.
◆ write_block_title
bool Dune::DefaultSVGMatrixOptions::write_block_title = true |
(Helper) Whether to write a title on the rectangle value
◆ write_header
bool Dune::DefaultSVGMatrixOptions::write_header = true |
Whether to write the SVG header.
The documentation for this struct was generated from the following file: