MCPcopy Create free account
hub / github.com/LibreCAD/LibreCAD / rsPyAddLine

Function rsPyAddLine

librecad/src/lib/scripting/rs_simplepython.cpp:116–128  ·  view source on GitHub ↗

* Adds a line to the current graphic document. */

Source from the content-addressed store, hash-verified

114 * Adds a line to the current graphic document.
115 */
116void rsPyAddLine(double x1, double y1, double x2, double y2) {
117 //printf("c: addLine called\n");
118 //printf("c: parameter from python: %f\n", x1);
119
120 RS_Graphic* graphic = RS_SIMPLEPYTHON->getGraphic();
121 if (graphic) {
122 graphic->addEntity(new RS_Line(graphic,
123 RS_LineData(RS_Vector(x1, y1),
124 RS_Vector(x2, y2))));
125 } else {
126 std::cerr << "rsPyAddLine: No graphic object set.\n";
127 }
128}
129
130/**
131 * Python wrapper.

Callers 1

py_rsPyAddLineFunction · 0.85

Calls 4

RS_LineDataClass · 0.50
RS_VectorClass · 0.50
getGraphicMethod · 0.45
addEntityMethod · 0.45

Tested by

no test coverage detected