37 enum class SymbolMode { SHEET, EDIT, EDIT_PREVIEW };
39 void update(
const class Sheet &sheet);
40 void update(
const class Padstack &padstack,
bool edit =
true);
41 void update(
const class Package &pkg,
bool edit =
true);
42 enum class PanelMode { INCLUDE, SKIP };
43 void update(
const class Board &brd, PanelMode mode = PanelMode::INCLUDE);
44 void update(
const class Frame &fr,
bool edit =
true);
45 void update(
const class Decal &dec,
bool edit =
true);
46 void update(
const class BlockSymbol &sym,
bool edit =
true);
48 ObjectRef add_line(
const std::deque<Coordi> &pts, int64_t width, ColorP color,
int layer);
54 void set_flags(
const ObjectRef &r, uint8_t mask_set, uint8_t mask_clear);
55 void set_flags_all(uint8_t mask_set, uint8_t mask_clear);
58 void set_color2(
const ObjectRef &r, uint8_t color);
62 virtual void update_markers()
67 void set_layer_display(
int index,
const LayerDisplay &ld);
68 void set_layer_color(
int layer,
const Color &color);
70 bool layer_is_visible(
int layer)
const;
73 bool show_all_junctions_in_schematic =
false;
74 bool show_text_in_tracks =
false;
75 bool show_text_in_vias =
false;
76 ShowViaSpan show_via_span = ShowViaSpan::BLIND_BURIED;
78 bool add_pad_bbox_targets =
false;
80 virtual bool get_flip_view()
const
85 virtual float get_view_angle()
const
90 std::pair<Coordf, Coordf> get_bbox(
bool visible_only =
true)
const;
92 static const int first_overlay_layer = 30000;
95 std::map<int, vector_pair<Triangle, TriangleInfo>> triangles;
96 std::list<CanvasPicture> pictures;
97 void add_triangle(
int layer,
const Coordf &p0,
const Coordf &p1,
const Coordf &p2, ColorP co, uint8_t flg = 0,
100 using ObjectRefIdx = std::map<int, std::pair<size_t, size_t>>;
101 std::unordered_map<ObjectRef, ObjectRefIdx> object_refs;
102 void begin_group(
int layer);
104 std::vector<ObjectRef> object_refs_current;
105 std::vector<ObjectRefIdx *> object_ref_idx;
106 void object_ref_push(
const ObjectRef &ref);
107 template <
typename... Args>
void object_ref_push(Args... args)
111 void object_ref_pop();
113 void render(
const class Symbol &sym, SymbolMode mode = SymbolMode::SHEET,
bool smashed =
false,
114 ColorP co = ColorP::FROM_LAYER);
115 void render(
const class Junction &junc,
bool interactive =
true, ObjectType mode = ObjectType::INVALID);
117 void render(
const class Line &line,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
118 void render(
const class SymbolPin &pin, SymbolMode mode = SymbolMode::EDIT, ColorP co = ColorP::FROM_LAYER);
119 void render(
const class Arc &arc,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
120 void render(
const class Sheet &sheet);
122 void render(
const class LineNet &line);
123 void render(
const class NetLabel &label);
124 void render(
const class BusLabel &label);
125 void render(
const class Warning &warn);
127 void render(
const class BusRipper &ripper);
128 void render(
const class Text &text,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
129 void render(
const class Padstack &padstack,
bool interactive =
true);
130 void render(
const class Polygon &polygon,
bool interactive =
true, ColorP co = ColorP::FROM_LAYER);
131 void render(
const class Shape &shape,
bool interactive =
true);
132 void render(
const class Hole &hole,
bool interactive =
true);
133 void render(
const class Package &package,
bool interactive =
true,
bool smashed =
false,
134 bool omit_silkscreen =
false,
bool omit_outline =
false,
bool on_panel =
false);
135 void render_pad_overlay(
const class Pad &pad,
bool interactive);
136 void render(
const class Pad &pad);
137 enum class OutlineMode { INCLUDE, OMIT };
138 void render(
const class Board &brd,
bool interactive =
true, PanelMode mode = PanelMode::INCLUDE,
139 OutlineMode outline_mode = OutlineMode::INCLUDE);
140 void render(
const class BoardPackage &pkg,
bool interactive =
true);
141 void render(
const class BoardHole &hole,
bool interactive =
true);
142 void render(
const class Track &track,
bool interactive =
true);
143 void render(
const class Via &via,
bool interactive =
true);
145 void render(
const class Frame &frame,
bool on_sheet =
false);
148 void render(
const class Picture &pic,
bool interactive =
true);
149 void render(
const class Decal &decal,
bool interactive =
true);
150 void render(
const class BoardDecal &decal,
bool interactive =
true);
151 void render(
const class BlockSymbol &sym,
bool on_sheet =
false);
152 void render(
const class BlockSymbolPort &port,
bool interactive =
true);
155 void render(
const class BoardNetTie &tie,
bool interactive =
true);
157 bool needs_push =
true;
158 virtual void request_push() = 0;
159 virtual void push() = 0;
161 void set_lod_size(
float size);
164 bool tr =
true, uint64_t width = 0);
165 void draw_cross(
const Coord<float> &o,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
166 bool tr =
true, uint64_t width = 0);
167 void draw_plus(
const Coord<float> &o,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
168 bool tr =
true, uint64_t width = 0);
169 void draw_box(
const Coord<float> &o,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
170 bool tr =
true, uint64_t width = 0);
171 void draw_circle(
const Coord<float> ¢er,
float radius, ColorP color = ColorP::FROM_LAYER,
int layer = 10000);
172 void draw_arc0(
const Coord<float> ¢er,
float radius0,
float a0,
float a1, ColorP color,
int layer,
174 void draw_arc(
const Coordf &from,
const Coordf &to,
const Coordf ¢er, ColorP color,
int layer, uint64_t width);
177 std::pair<Coordf, Coordf> draw_text(
const Coordf &p,
float size,
const std::string &rtext,
int angle,
180 virtual void draw_bitmap_text(
const Coordf &p,
float scale,
const std::string &rtext,
int angle, ColorP color,
185 virtual std::pair<Coordf, Coordf> measure_bitmap_text(
const std::string &text)
const
187 return {{0, 0}, {0, 0}};
190 enum class TextBoxMode { FULL, LOWER, UPPER };
192 virtual void draw_bitmap_text_box(
const Placement &q,
float width,
float height,
const std::string &s, ColorP color,
193 int layer, TextBoxMode mode)
197 void draw_error(
const Coordf ¢er,
float scale,
const std::string &text,
bool tr =
true);
198 std::tuple<Coordf, Coordf, Coordi> draw_flag(
const Coordf &position,
const std::string &txt, int64_t size,
199 Orientation orientation, ColorP color = ColorP::FROM_LAYER);
200 void draw_lock(
const Coordf ¢er,
float size, ColorP color = ColorP::FROM_LAYER,
int layer = 10000,
203 virtual bool img_layer_is_visible(
const LayerRange &layer)
const
207 virtual void img_net(
const class Net *net)
210 virtual void img_polygon(
const Polygon &poly,
bool tr =
true)
213 virtual void img_padstack(
const Padstack &ps)
216 virtual void img_set_padstack(
bool v)
219 virtual void img_line(
const Coordi &p0,
const Coordi &p1,
const uint64_t width,
int layer = 10000,
bool tr =
true);
220 virtual void img_arc(
const Coordi &from,
const Coordi &to,
const Coordi ¢er,
const uint64_t width,
int layer);
221 virtual void img_hole(
const Hole &hole)
224 virtual void img_text(
const Text *text)
227 virtual void img_patch_type(PatchType type)
230 virtual void img_draw_text(
const Coordf &p,
float size,
const std::string &rtext,
int angle,
bool flip,
231 TextOrigin origin,
int layer = 10000, uint64_t width = 0,
232 TextData::Font font = TextData::Font::SIMPLEX,
bool center =
false,
bool mirror =
false)
235 bool img_mode =
false;
236 bool img_auto_line =
false;
239 void transform_save();
240 void transform_restore();
241 std::vector<Placement> transforms;
244 std::vector<Target> targets;
248 std::map<int, Color> layer_colors;
249 Color get_layer_color(
int layer)
const;
251 std::map<int, LayerDisplay> layer_display;
253 TriangleInfo::Type triangle_type_current = TriangleInfo::Type::NONE;
255 std::map<std::pair<LayerRange, bool>,
int> overlay_layers;
256 int overlay_layer_current = first_overlay_layer;
257 int get_overlay_layer(
const LayerRange &layer,
bool ignore_flip =
false);
258 bool is_overlay_layer(
int overlay_layer,
int layer)
const;
263 uint8_t lod_current = 0;
267 size_t group_size = 0;
269 void draw_direction(Pin::Direction dir, ColorP color);
Used wherever a user-editable text is needed.
Definition text.hpp:15