MCPcopy Create free account
hub / github.com/Robotips/uConfig / writeDraw

Method writeDraw

src/kicad/parser/kicadlibparser.cpp:225–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void KicadLibParser::writeDraw(Draw *draw)
226{
227 DrawRect *drawRect;
228 DrawText *drawText;
229
230 switch (draw->type())
231 {
232 case Draw::TypeDrawArc:
233 break;
234 case Draw::TypeDrawCircle:
235 break;
236 case Draw::TypeDrawPoly:
237 break;
238 case Draw::TypeDrawRect:
239 // S startx starty endx endy unit convert thickness fill
240 drawRect = static_cast<DrawRect*>(draw);
241 _stream << "S "
242 << drawRect->pos().x() << " "
243 << -drawRect->pos().y() << " "
244 << drawRect->endPos().x() << " "
245 << -drawRect->endPos().y() << " "
246 << drawRect->unit() << " "
247 << drawRect->convert() << " "
248 << drawRect->thickness() << " ";
249 switch (drawRect->filled())
250 {
251 case Draw::DrawNotFilled:
252 _stream << "N";
253 break;
254 case Draw::DrawFilledForeGround:
255 _stream << "F";
256 break;
257 case Draw::DrawFilledBackGround:
258 _stream << "f";
259 break;
260 }
261 break;
262
263 case Draw::TypeDrawText:
264 // T direction posx posy text_size text_type unit convert text text_italic text_bold text_hjustify text_vjustify
265 drawText = static_cast<DrawText*>(draw);
266 _stream << "T ";
267 if (drawText->direction() == DrawText::DirectionHorizontal)
268 _stream << "0 ";
269 else
270 _stream << "900 ";
271
272 _stream << drawText->pos().x() << " "
273 << -drawText->pos().y() << " "
274 << drawText->textSize() << " "
275 << "0 "
276 << drawText->unit() << " "
277 << drawText->convert() << " "
278 << "\"" << drawText->text()<< "\"" << " ";
279
280 if (drawText->textStyle().testFlag(DrawText::TextItalic))
281 _stream << "Italic ";
282 else

Callers

nothing calls this directly

Calls 13

endPosMethod · 0.80
unitMethod · 0.80
convertMethod · 0.80
thicknessMethod · 0.80
filledMethod · 0.80
textSizeMethod · 0.80
textMethod · 0.80
textStyleMethod · 0.80
textHJustifyMethod · 0.80
textVJustifyMethod · 0.80
typeMethod · 0.45
posMethod · 0.45

Tested by

no test coverage detected