28 friend class SelectionFilter;
29 friend class CanvasAnnotation;
30 friend CanvasTextRenderer;
38 enum class SymbolMode { SHEET, EDIT, EDIT_PREVIEW };
40 void update(
const class Sheet &sheet);
41 void update(
const class Padstack &padstack,
bool edit =
true);
42 void update(
const class Package &pkg,
bool edit =
true);
43 enum class PanelMode { INCLUDE, SKIP };
44 void update(
const class Board &brd, PanelMode mode = PanelMode::INCLUDE);
45 void update(
const class Frame &fr,
bool edit =
true);
46 void update(
const class Decal &dec,
bool edit =
true);
47 void update(
const class BlockSymbol &sym,
bool edit =
true);
49 ObjectRef add_line(
const std::deque<Coordi> &pts, int64_t width, ColorP color,
int layer);
50 ObjectRef add_arc(
const Coordi &from,
const Coordi &to,
const Coordi ¢er, int64_t width, ColorP color,
55 void set_flags(
const ObjectRef &r, uint8_t mask_set, uint8_t mask_clear);
56 void set_flags_all(uint8_t mask_set, uint8_t mask_clear);
59 void set_color2(
const ObjectRef &r, uint8_t color);
63 virtual void update_markers()
68 void set_layer_display(
int index,
const LayerDisplay &ld);
69 void set_layer_color(
int layer,
const Color &color);
71 bool layer_is_visible(
int layer)
const;
74 bool show_all_junctions_in_schematic =
false;
75 bool show_text_in_tracks =
false;
76 bool show_text_in_vias =
false;
77 ShowViaSpan show_via_span = ShowViaSpan::BLIND_BURIED;
79 bool add_pad_bbox_targets =
false;
81 virtual bool get_flip_view()
const
86 virtual float get_view_angle()
const
91 std::pair<Coordf, Coordf> get_bbox(
bool visible_only =
true)
const;
93 static const int first_overlay_layer = 30000;
96 std::map<int, vector_pair<Triangle, TriangleInfo>> triangles;
97 std::list<CanvasPicture> pictures;
98 void add_triangle(
int layer,
const Coordf &p0,
const Coordf &p1,
const Coordf &p2, ColorP co, uint8_t flg = 0,
101 using ObjectRefIdx = std::map<int, std::pair<size_t, size_t>>;
102 std::unordered_map<ObjectRef, ObjectRefIdx> object_refs;
103 void begin_group(
int layer);
105 std::vector<ObjectRef> object_refs_current;
106 std::vector<ObjectRefIdx *> object_ref_idx;
107 void object_ref_push(
const ObjectRef &ref);
108 template <
typename... Args>
void object_ref_push(Args... args)
112 void object_ref_pop();
114 void render(
const class Symbol &sym, SymbolMode mode = SymbolMode::SHEET,
bool smashed =
false,
115 ColorP co = ColorP::FROM_LAYER);
116 void render(
const class Junction &junc,
bool interactive =
true, ObjectType mode = ObjectType::INVALID);
118 void render(
const class Line &line,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
119 void render(
const class SymbolPin &pin, SymbolMode mode = SymbolMode::EDIT, ColorP co = ColorP::FROM_LAYER);
120 void render(
const class Arc &arc,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
121 void render(
const class Sheet &sheet);
123 void render(
const class LineNet &line);
124 void render(
const class NetLabel &label);
125 void render(
const class BusLabel &label);
126 void render(
const class Warning &warn);
128 void render(
const class BusRipper &ripper);
129 void render(
const class Text &text,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
130 void render(
const class Padstack &padstack,
bool interactive =
true);
131 void render(
const class Polygon &polygon,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
132 void render(
const class Shape &shape,
bool interactive =
true);
133 void render(
const class Hole &hole,
bool interactive =
true);
134 void render(
const class Package &package,
bool interactive =
true,
bool smashed =
false,
135 bool omit_silkscreen =
false,
bool omit_outline =
false,
bool on_panel =
false);
136 void render_pad_overlay(
const class Pad &pad,
bool interactive);
137 void render(
const class Pad &pad);
138 enum class OutlineMode { INCLUDE, OMIT };
139 void render(
const class Board &brd,
bool interactive =
true, PanelMode mode = PanelMode::INCLUDE,
140 OutlineMode outline_mode = OutlineMode::INCLUDE);
141 void render(
const class BoardPackage &pkg,
bool interactive =
true);
142 void render(
const class BoardHole &hole,
bool interactive =
true);
143 void render(
const class Track &track,
bool interactive =
true);
144 void render(
const class Via &via,
bool interactive =
true);
146 void render(
const class Frame &frame,
bool on_sheet =
false);
149 void render(
const class Picture &pic,
bool interactive =
true);
150 void render(
const class Decal &decal,
bool interactive =
true);
151 void render(
const class BoardDecal &decal,
bool interactive =
true);
152 void render(
const class BlockSymbol &sym,
bool on_sheet =
false);
153 void render(
const class BlockSymbolPort &port,
bool interactive =
true);
156 void render(
const class BoardNetTie &tie,
bool interactive =
true);
158 bool needs_push =
true;
159 virtual void request_push() = 0;
160 virtual void push() = 0;
162 void set_lod_size(
float size);
165 bool tr =
true, uint64_t width = 0);
166 void draw_cross(
const Coord<float> &o,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
167 bool tr =
true, uint64_t width = 0);
168 void draw_plus(
const Coord<float> &o,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
169 bool tr =
true, uint64_t width = 0);
170 void draw_box(
const Coord<float> &o,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
171 bool tr =
true, uint64_t width = 0);
172 void draw_circle(
const Coord<float> ¢er,
float radius, ColorP color = ColorP::FROM_LAYER,
int layer = 10000);
173 void draw_arc0(
const Coord<float> ¢er,
float radius0,
float a0,
float a1, ColorP color,
int layer,
175 void draw_arc(
const Coordf &from,
const Coordf &to,
const Coordf ¢er, ColorP color,
int layer, uint64_t width);
178 std::pair<Coordf, Coordf> draw_text(
const Coordf &p,
float size,
const std::string &rtext,
int angle,
181 virtual void draw_bitmap_text(
const Coordf &p,
float scale,
const std::string &rtext,
int angle, ColorP color,
186 virtual std::pair<Coordf, Coordf> measure_bitmap_text(
const std::string &text)
const
188 return {{0, 0}, {0, 0}};
191 enum class TextBoxMode { FULL, LOWER, UPPER };
193 virtual void draw_bitmap_text_box(
const Placement &q,
float width,
float height,
const std::string &s, ColorP color,
194 int layer, TextBoxMode mode)
198 void draw_error(
const Coordf ¢er,
float scale,
const std::string &text,
bool tr =
true);
199 std::tuple<Coordf, Coordf, Coordi> draw_flag(
const Coordf &position,
const std::string &txt, int64_t size,
200 Orientation orientation, ColorP color = ColorP::FROM_LAYER);
201 void draw_lock(
const Coordf ¢er,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
204 virtual bool img_layer_is_visible(
const LayerRange &layer)
const
208 virtual void img_net(
const class Net *net)
211 virtual void img_polygon(
const Polygon &poly,
bool tr =
true)
214 virtual void img_padstack(
const Padstack &ps)
217 virtual void img_set_padstack(
bool v)
220 virtual void img_line(
const Coordi &p0,
const Coordi &p1,
const uint64_t width,
int layer = 10000,
bool tr =
true);
221 virtual void img_arc(
const Coordi &from,
const Coordi &to,
const Coordi ¢er,
const uint64_t width,
int layer);
222 virtual void img_hole(
const Hole &hole)
225 virtual void img_text(
const Text *text)
228 virtual void img_patch_type(PatchType type)
231 virtual void img_draw_text(
const Coordf &p,
float size,
const std::string &rtext,
int angle,
bool flip,
232 TextOrigin origin,
int layer = 10000, uint64_t width = 0,
233 TextData::Font font = TextData::Font::SIMPLEX,
bool center =
false,
bool mirror =
false)
236 bool img_mode =
false;
237 bool img_auto_line =
false;
240 void transform_save();
241 void transform_restore();
242 std::vector<Placement> transforms;
244 Selectables selectables;
245 std::vector<Target> targets;
249 std::map<int, Color> layer_colors;
250 Color get_layer_color(
int layer)
const;
252 std::map<int, LayerDisplay> layer_display;
254 TriangleInfo::Type triangle_type_current = TriangleInfo::Type::NONE;
256 std::map<std::pair<LayerRange, bool>,
int> overlay_layers;
257 int overlay_layer_current = first_overlay_layer;
258 int get_overlay_layer(
const LayerRange &layer,
bool ignore_flip =
false);
259 bool is_overlay_layer(
int overlay_layer,
int layer)
const;
264 uint8_t lod_current = 0;
268 size_t group_size = 0;
270 void draw_direction(Pin::Direction dir, ColorP color);
272 CanvasTextRenderer text_renderer;
Used wherever a user-editable text is needed.
Definition text.hpp:15