Expand description
Drawing tools.
A drawing is a DrawingTool: anchors in data space (Anchor: time and
price), a style, and code that turns them into frame primitives through a
FrameBuilder. The DrawingManager (Chart::drawings) owns the
drawings of a chart: it creates them from DrawingData through
registered factories, keeps their z order, selection, visibility and lock
state, and records changes as commands for undo/redo.
Anchors are timestamps, not logical indices, so they survive prepend and
axis rebuilds. Times outside the data are extrapolated with the spacing of
the last (or first) two bars; times between two slots are interpolated.
Structs§
- Anchor
- A point of a drawing in data space.
- Drawing
Ctx - Coordinate conversions and measurements for
DrawingTools of one pane. - Drawing
Data - Format-independent saved form of a drawing: what
DrawingTool::savereturns and what factories build drawings from. - Drawing
Manager - The drawings of a chart (
Chart::drawings). - Drawing
Style - Colors and line settings of a drawing.
- Frame
Builder - Writes the primitives of a drawing into the frame (main layer, clipped to the pane by the caller).
- Label
- How
FrameBuilder::textdraws a text.
Enums§
- Anchor
Count - How a drawing is created.
- HitPart
- What part of a drawing a point hits.
- Param
- A tool-specific parameter of a drawing.
Constants§
- BUILTIN_
KINDS - Kinds of the built-in tools: the first batch, then the second. Long and short positions, the three pitchforks and the two Elliott waves are one tool each with several kinds.
- MAX_
ANCHORS - Most anchors of an
OpenorFreehanddrawing.
Traits§
- Drawing
Tool - A drawing tool. Built-in tools are listed in
BUILTIN_KINDS; custom tools are registered withDrawingManager::register.
Functions§
- clip_
line - The part of the line through
aandbinsiderect: froma(or from the edge ifback) tob(or to the edge ifforward).Noneif it misses the rectangle. - distance_
to_ segment - Distance from
pto the segmenta–b. - point_
in_ polygon - Whether
pis inside the polygonpts(even-odd rule).
Type Aliases§
- Drawing
Factory - Builds a drawing from its saved form.