8 #ifndef __VRV_BBOX_DC_H__
9 #define __VRV_BBOX_DC_H__
15 #include "devicecontext.h"
18 #define BBOX_HORIZONTAL_ONLY 1
19 #define BBOX_VERTICAL_ONLY 2
52 void SetBackground(
int color,
int style = PEN_SOLID)
override;
53 void SetBackgroundImage(
void *image,
double opacity = 1.0)
override {};
54 void SetBackgroundMode(
int mode)
override;
55 void SetTextForeground(
int color)
override;
56 void SetTextBackground(
int color)
override;
57 void SetLogicalOrigin(
int x,
int y)
override;
58 void SetUserScale(
double xScale,
double yScale);
65 Point GetLogicalOrigin()
override;
72 void DrawQuadBezierPath(
Point bezier[3])
override;
73 void DrawCubicBezierPath(
Point bezier[4])
override;
74 void DrawCubicBezierPathFilled(
Point bezier1[4],
Point bezier2[4])
override;
75 void DrawBentParallelogramFilled(
Point side[4],
int height)
override;
76 void DrawCircle(
int x,
int y,
int radius)
override;
77 void DrawEllipse(
int x,
int y,
int width,
int height)
override;
78 void DrawEllipticArc(
int x,
int y,
int width,
int height,
double start,
double end)
override;
79 void DrawLine(
int x1,
int y1,
int x2,
int y2)
override;
80 void DrawPolyline(
int n,
Point points[],
bool close)
override;
81 void DrawPolygon(
int n,
Point points[])
override;
82 void DrawRectangle(
int x,
int y,
int width,
int height)
override;
83 void DrawRotatedText(
const std::string &text,
int x,
int y,
double angle)
override;
84 void DrawRoundedRectangle(
int x,
int y,
int width,
int height,
int radius)
override;
85 void DrawText(
const std::string &text,
const std::u32string &wtext = U
"",
int x = VRV_UNSET,
int y = VRV_UNSET,
86 int width = VRV_UNSET,
int height = VRV_UNSET)
override;
87 void DrawMusicText(
const std::u32string &text,
int x,
int y,
bool setSmuflGlyph =
false)
override;
88 void DrawSpline(
int n,
Point points[])
override;
89 void DrawGraphicUri(
int x,
int y,
int width,
int height,
const std::string &uri)
override;
90 void DrawSvgShape(
int x,
int y,
int width,
int height,
double scale, pugi::xml_node svg)
override;
91 void DrawBackgroundImage(
int x = 0,
int y = 0)
override {};
104 void StartText(
int x,
int y, data_HORIZONTALALIGNMENT alignment = HORIZONTALALIGNMENT_left)
override;
105 void EndText()
override;
111 void MoveTextTo(
int x,
int y, data_HORIZONTALALIGNMENT alignment)
override;
112 void MoveTextVerticallyTo(
int y)
override;
119 void StartGraphic(
Object *
object,
const std::string &gClass,
const std::string &gId, GraphicID graphicID = PRIMARY,
120 bool prepend =
false)
override;
121 void EndGraphic(
Object *
object,
View *view)
override;
128 void ResumeGraphic(
Object *
object, std::string gId)
override;
129 void EndResumedGraphic(
Object *
object,
View *view)
override;
136 void RotateGraphic(
Point const &orig,
double angle)
override;
143 void StartPage()
override;
144 void EndPage()
override;
147 bool UpdateHorizontalValues() {
return (m_update != BBOX_VERTICAL_ONLY); }
148 bool UpdateVerticalValues() {
return (m_update != BBOX_HORIZONTAL_ONLY); }
154 void AddDescription(
const std::string &text)
override {};
161 void ResetGraphicRotation();
166 std::pair<int, int> GetPenWidthOverlap()
const;
175 int m_width, m_height;
176 double m_userScaleX, m_userScaleY;
182 unsigned char m_update;
188 Point m_rotationOrigin;
189 double m_rotationAngle;
196 int m_textX, m_textY, m_textWidth, m_textHeight, m_textAscent, m_textDescent;
198 data_HORIZONTALALIGNMENT m_textAlignment;
203 std::vector<Object *> m_objects;
210 void UpdateBB(
int x1,
int y1,
int x2,
int y2, char32_t glyph = 0);
This class calculates the bounding box of the object being drawn.
Definition: bboxdevicecontext.h:38
void DrawPlaceholder(int x, int y) override
Special method for forcing bounding boxes to be updated Used for invisible elements (e....
This class is an abstract device context.
Definition: devicecontext.h:57
This class represents a basic object.
Definition: object.h:61
Simple class for representing points.
Definition: devicecontextbase.h:203
This class is a drawing context and corresponds to the view of a MVC design pattern.
Definition: view.h:106