Lumiera  0.pre.03
»edit your freedom«
stage::timeline::anonymous_namespace{stave-bracket-widget.cpp} Namespace Reference

Functions

double anchorLeft (StyleC style, double scale)
 place left anchor reference line to right side of bold bar. More...
 
double anchorLower (StyleC style, double scale, int canvasHeight)
 place bottom cap vertical anchor, mirroring top cap More...
 
double anchorUpper (StyleC style, double scale)
 place top cap vertical anchor, down from canvas upside. More...
 
double baseWidth (StyleC style)
 Setup the base metric for this bracket drawing based on CSS styling. More...
 
int calcDesiredWidth (StyleC style)
 
int calcRequiredWidth (StyleC style, int givenHeight)
 
void connect (CairoC cox, Gdk::RGBA colour, double leftX, double upperY, double lowerY, double width, double scale, std::vector< uint > connectors)
 Indicate connection to nested sub-Track scopes. More...
 
double determineScale (StyleC style, int givenHeight)
 determine the base metric, taking into account the available canvas size. More...
 
void drawBar (CairoC cox, Gdk::RGBA colour, double leftX, double upperY, double lowerY, double scale)
 draw the double bar to fit between upper and lower cap
 
void drawCap (CairoC cox, Gdk::RGBA colour, double ox, double oy, double scale, bool upside=true)
 Draw the curved end cap of the bracket, inspired by musical notation. More...
 
double getAbsoluteFontSize (StyleC style)
 Use contextual CSS style information to find out about the standard font size More...
 

Variables

const double ARC_I_END = 1.2490457723982538
 
const double ARC_I_R = 6.6978115661011230
 
const double ARC_I_TIP = 0.7853981633974485
 
const double ARC_I_XC = -2.5
 
const double ARC_I_YC = -7.3541019662496883
 
const double ARC_O_END = 1.0172219678978512
 
const double ARC_O_R = 8.0574801069408135
 
const double ARC_O_TIP = 0.5535743588970450
 
const double ARC_O_XC = -(3.0 + PHI)
 
const double ARC_O_YC = -6.8541019662496847
 
const double BAR_LEFT = -BAR_WIDTH
 
const double BAR_WIDTH = PHI_MINOR
 
const double BASE_WIDTH_PER_EM = 0.5
 
const uint FALLBACK_FONT_SIZE_px = 12.5
 
const double LIN_LEFT = PHI_MAJOR - LIN_WIDTH
 
const double LIN_WIDTH = PHI_MINSQ
 
const double ORG = 0.0
 
const double PHI = (1.0 + sqrt(5)) / 2.0
 
const double PHI_MAJOR = PHI - 1.0
 
const double PHI_MINOR = 2.0 - PHI
 
const double PHI_MINSQ = 5.0 - 3*PHI
 
const double PHISQUARE = 1.0 + PHI
 
const uint POINT_PER_INCH = 72
 
const double SQUARE_MINOR = 1.0
 
const double SQUARE_TIP_X = PHISQUARE - PHI_MINOR
 
const double SQUARE_TIP_Y = -PHISQUARE
 

Function Documentation

◆ getAbsoluteFontSize()

double stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::getAbsoluteFontSize ( StyleC  style)

Use contextual CSS style information to find out about the standard font size

Returns
absolute nominal size of the font in standard state, given in device units (px)

Definition at line 107 of file stave-bracket-widget.cpp.

Referenced by baseWidth().

+ Here is the caller graph for this function:

◆ baseWidth()

double stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::baseWidth ( StyleC  style)

Setup the base metric for this bracket drawing based on CSS styling.

Remarks
the width of the double line is used as foundation to derive further layout properties, based on the golden ratio.
Returns
scale factor to apply to the base layout

Definition at line 130 of file stave-bracket-widget.cpp.

References getAbsoluteFontSize().

Referenced by calcDesiredWidth().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineScale()

double stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::determineScale ( StyleC  style,
int  givenHeight 
)

determine the base metric, taking into account the available canvas size.

Parameters
styleCSS style context where this calculation shall apply
givenHeightthe allocated vertical space for the drawing
Returns
scale factor to apply to the design of the bracket
Remarks
the design is anchored at the line width, and other parts are related by golden ratio Φ. Notably the bounding box of the top and bottom cap is defined as Φ² times the base width. Consequently the drawing requires a minimum height of two times this bounding box (for top and bottom cap); in case the given height allocation is not sufficient, the whole design will be scaled down to fit.
See also
baseWidth(StyleC) the desired base width, as derived from font size

Definition at line 150 of file stave-bracket-widget.cpp.

Referenced by calcRequiredWidth(), and StaveBracketWidget::on_draw().

+ Here is the caller graph for this function:

◆ calcRequiredWidth()

int stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::calcRequiredWidth ( StyleC  style,
int  givenHeight 
)
Returns
width in pixels required to realise the bracket construction, taking into account the possible vertical limitation
Parameters
givenHeightvertical limitation in (device) pixels
Remarks
actually determineScale is responsible to observe limitations

Definition at line 164 of file stave-bracket-widget.cpp.

References determineScale().

Referenced by StaveBracketWidget::get_preferred_width_for_height_vfunc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calcDesiredWidth()

int stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::calcDesiredWidth ( StyleC  style)
Returns
width for the drawing, without considering height limitation

Definition at line 174 of file stave-bracket-widget.cpp.

References baseWidth().

Referenced by StaveBracketWidget::get_preferred_width_for_height_vfunc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ anchorLeft()

double stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::anchorLeft ( StyleC  style,
double  scale 
)

place left anchor reference line to right side of bold bar.

Remarks
taking into account the scale and padding

Definition at line 186 of file stave-bracket-widget.cpp.

Referenced by StaveBracketWidget::on_draw().

+ Here is the caller graph for this function:

◆ anchorUpper()

double stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::anchorUpper ( StyleC  style,
double  scale 
)

place top cap vertical anchor, down from canvas upside.

Remarks
anchored at lower side of enclosing Φ²-sized square.

Definition at line 196 of file stave-bracket-widget.cpp.

Referenced by StaveBracketWidget::on_draw().

+ Here is the caller graph for this function:

◆ anchorLower()

double stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::anchorLower ( StyleC  style,
double  scale,
int  canvasHeight 
)

place bottom cap vertical anchor, mirroring top cap

Remarks
also taking into account the overall canvas height

Definition at line 206 of file stave-bracket-widget.cpp.

Referenced by StaveBracketWidget::on_draw().

+ Here is the caller graph for this function:

◆ drawCap()

void stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::drawCap ( CairoC  cox,
Gdk::RGBA  colour,
double  ox,
double  oy,
double  scale,
bool  upside = true 
)

Draw the curved end cap of the bracket, inspired by musical notation.

Parameters
oxhorizontal offset of the anchor point; pixels in target device space
oyvertical anchor point offset, downwards is positive
scalestretch the design; default is bracket line width = 1.0
upsidewhether to draw the upper cup (true) or the lower
Remarks
See doc/devel/draw/StaveBracket.svg for explanation

Definition at line 226 of file stave-bracket-widget.cpp.

Referenced by StaveBracketWidget::on_draw().

+ Here is the caller graph for this function:

◆ connect()

void stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::connect ( CairoC  cox,
Gdk::RGBA  colour,
double  leftX,
double  upperY,
double  lowerY,
double  width,
double  scale,
std::vector< uint >  connectors 
)

Indicate connection to nested sub-Track scopes.

Draw a connector dot at each joint, and a arrow pointing towards the nested StaveBracket top.

Todo:
simplistic implementation as of 3/23; could be made expandable /collapsable

Definition at line 278 of file stave-bracket-widget.cpp.

Referenced by StaveBracketWidget::on_draw().

+ Here is the caller graph for this function: