![]() |
Verovio
Source code documentation
|
This class calculates the bounding box of the object being drawn. More...
#include <bboxdevicecontext.h>
Public Member Functions | |
void | DrawPlaceholder (int x, int y) override |
Special method for forcing bounding boxes to be updated Used for invisible elements (e.g., <space>) that needs to be take into account in spacing. | |
bool | UpdateHorizontalValues () |
bool | UpdateVerticalValues () |
Constructors, destructors, and other standard methods | |
BBoxDeviceContext (View *view, int width, int height, unsigned char update=BBOX_BOTH) | |
virtual | ~BBoxDeviceContext () |
Setters | |
void | SetBackground (int color, int style=PEN_SOLID) override |
void | SetBackgroundImage (void *image, double opacity=1.0) override |
void | SetBackgroundMode (int mode) override |
void | SetTextForeground (int color) override |
void | SetTextBackground (int color) override |
void | SetLogicalOrigin (int x, int y) override |
void | SetUserScale (double xScale, double yScale) |
Getters | |
Point | GetLogicalOrigin () override |
Drawing methods | |
void | DrawQuadBezierPath (Point bezier[3]) override |
void | DrawCubicBezierPath (Point bezier[4]) override |
void | DrawCubicBezierPathFilled (Point bezier1[4], Point bezier2[4]) override |
void | DrawBentParallelogramFilled (Point side[4], int height) override |
void | DrawCircle (int x, int y, int radius) override |
void | DrawEllipse (int x, int y, int width, int height) override |
void | DrawEllipticArc (int x, int y, int width, int height, double start, double end) override |
void | DrawLine (int x1, int y1, int x2, int y2) override |
void | DrawPolyline (int n, Point points[], bool close) override |
void | DrawPolygon (int n, Point points[]) override |
void | DrawRectangle (int x, int y, int width, int height) override |
void | DrawRotatedText (const std::string &text, int x, int y, double angle) override |
void | DrawRoundedRectangle (int x, int y, int width, int height, int radius) override |
void | DrawText (const std::string &text, const std::u32string &wtext=U"", int x=VRV_UNSET, int y=VRV_UNSET, int width=VRV_UNSET, int height=VRV_UNSET) override |
void | DrawMusicText (const std::u32string &text, int x, int y, bool setSmuflGlyph=false) override |
void | DrawSpline (int n, Point points[]) override |
void | DrawGraphicUri (int x, int y, int width, int height, const std::string &uri) override |
void | DrawSvgShape (int x, int y, int width, int height, double scale, pugi::xml_node svg) override |
void | DrawBackgroundImage (int x=0, int y=0) override |
Method for starting and ending a text | |
void | StartText (int x, int y, data_HORIZONTALALIGNMENT alignment=HORIZONTALALIGNMENT_left) override |
void | EndText () override |
Move a text to the specified position, for example when starting a new line. | |
void | MoveTextTo (int x, int y, data_HORIZONTALALIGNMENT alignment) override |
void | MoveTextVerticallyTo (int y) override |
Method for starting and ending a graphic | |
void | StartGraphic (Object *object, const std::string &gClass, const std::string &gId, GraphicID graphicID=PRIMARY, bool prepend=false) override |
void | EndGraphic (Object *object, View *view) override |
Methods for re-starting and ending a graphic for objects drawn in separate steps | |
void | ResumeGraphic (Object *object, std::string gId) override |
void | EndResumedGraphic (Object *object, View *view) override |
Method for rotating a graphic (clockwise). | |
void | RotateGraphic (Point const &orig, double angle) override |
Method for starting and ending page | |
void | StartPage () override |
void | EndPage () override |
Method for adding description element | |
void | AddDescription (const std::string &text) override |
![]() | |
virtual void | SetCustomGraphicColor (const std::string &color) |
Method for changing the color of a custom graphic. | |
virtual void | SetCustomGraphicAttributes (const std::string &data, const std::string &value) |
Method for adding custom graphic data-* attributes. | |
virtual bool | UseGlobalStyling () |
Method indicating if default global styling is used. More... | |
DeviceContext () | |
DeviceContext (ClassId classId) | |
virtual | ~DeviceContext () |
ClassId | GetClassId () const |
bool | Is (ClassId classId) const |
const Resources * | GetResources (bool showWarning=false) const |
bool | HasResources () const |
void | SetResources (const Resources *resources) |
void | ResetResources () |
void | SetWidth (int width) |
void | SetHeight (int height) |
void | SetContentHeight (int height) |
void | SetUserScale (double scaleX, double scaleY) |
void | SetBaseSize (int width, int height) |
void | SetViewBoxFactor (double ppuFactor) |
int | GetWidth () const |
int | GetHeight () const |
int | GetContentHeight () const |
double | GetUserScaleX () |
double | GetUserScaleY () |
std::pair< int, int > | GetBaseSize () const |
double | GetViewBoxFactor () const |
void | SetBrush (float opacity, int color=COLOR_NONE) |
void | SetPen (int width, PenStyle style, int dashLength=0, int gapLength=0, LineCapStyle lineCap=LINECAP_DEFAULT, LineJoinStyle lineJoin=LINEJOIN_DEFAULT, float opacity=1.0, int color=COLOR_NONE) |
void | SetFont (FontInfo *font) |
void | SetPushBack () |
void | ResetBrush () |
void | ResetPen () |
void | ResetFont () |
void | ResetPushBack () |
FontInfo * | GetFont () |
bool | HasFont () const |
virtual void | GetTextExtent (const std::string &string, TextExtend *extend, bool typeSize) |
virtual void | GetTextExtent (const std::u32string &string, TextExtend *extend, bool typeSize) |
virtual void | GetSmuflTextExtent (const std::u32string &string, TextExtend *extend) |
void | DeactivateGraphic () |
void | DeactivateGraphicX () |
void | DeactivateGraphicY () |
void | ReactivateGraphic () |
virtual void | StartCustomGraphic (const std::string &name, std::string gClass="", std::string gId="") |
virtual void | EndCustomGraphic () |
virtual void | StartTextGraphic (Object *object, const std::string &gClass, const std::string &gId) |
virtual void | EndTextGraphic (Object *object, View *view) |
Additional Inherited Members | |
![]() | |
static int | RGB2Int (char red, char green, char blue) |
Color conversion method. | |
![]() | |
std::stack< Pen > | m_penStack |
std::stack< Brush > | m_brushStack |
std::stack< FontInfo * > | m_fontStack |
bool | m_isDeactivatedX |
flag for indicating if the graphic is deactivated | |
bool | m_isDeactivatedY |
bool | m_pushBack |
push back mode | |
Zone * | m_facsimile = NULL |
This class calculates the bounding box of the object being drawn.
It can be used when doing the layout of the object in order to manage object spacing. The drawing primitives do not draw anything but update the bounding box values of the layout objects currently drawn. The layout objects store their own bounding box and a bounding box of their content. The own bounding box is updated only for the object being drawn (the top one on the stack). The content bounding box is updated for all objects on the stack