- sclgraf.shq [c+]
[..] La fonction [shq] drawPointshq
Code
int drawpoint_shq_xpl(){
scltracefa(§, ƒ, ∅);
scltracefc("scl-%s (%s) : %s\n\n", sclver(), sclsec(), temps_char(0));
shq::beginDrawing(PRM_BEGINDRAWING_SHQ); // <Initializes the
"connection"
shq::newFigure("drawpoint_shq"); // <Creates a new
figure
int tirn=400, tiri;
double rx, ry;
scltracefc("rande=%d\n", ∞ns);
double r=/*(double)RAND_MAX*/100;
char *faceclr=∅, *edgeclr=∅;
shq::Params prms;
char tp[3] = /*"26"*//*"4d"*//*"73"*/"80";
for(tiri=0;tiri<tirn;tiri++){
rx=((double)rand())/((double)∞ns)*r;
ry=((double)rand())/((double)∞ns)*r;
liou_a_zeu(&faceclr, &edgeclr);
/*scltracefc("faceclr='%s'\n", faceclr);*/ //🔬
/*scltracefc("edgeclr='%s'\n", edgeclr);*/ //🔬
if(tiri%4==0){
prms.clear();
prms["Radius"]=(int)(r/6); /* prms["Draggable"]=true;*/
/*prms["FixedScale"]=false;*/
prms["FaceColor"] = std::string(faceclr) + tp;
prms["EdgeColor"] = std::string(edgeclr) + tp;
shq::drawPoint( r+rx, r+ry, prms);
}
else if(tiri%4==1){
prms.clear();
prms["Radius"]=(int)(r/6); /* prms["Draggable"]=true;*/
/*prms["FixedScale"]=false;*/
prms["FaceColor"] = std::string(faceclr) + tp;
prms["EdgeColor"] = std::string(edgeclr) + tp;
shq::drawPoint(-r-rx, r+ry, prms);
}
else if(tiri%4==2) {
prms.clear();
prms["Radius"]=(int)(r/6); /* prms["Draggable"]=true;*/
/*prms["FixedScale"]=false;*/
prms["FaceColor"] = std::string(faceclr) + tp;
prms["EdgeColor"] = std::string(edgeclr) + tp;
shq::drawPoint(-r-rx, -r-ry, prms);
}
else{
prms.clear();
prms["Radius"]=(int)(r/6); /* prms["Draggable"]=true;*/
/*prms["FixedScale"]=false;*/
prms["FaceColor"] = std::string(faceclr) + tp;
prms["EdgeColor"] = std::string(edgeclr) + tp;
shq::drawPoint( r+rx,-r-ry, prms);
}
}
shq::axisAuto("drawpoint_shq");
shq::axisEqual("drawpoint_shq");
shq::axisLabels("[m]", "[m]", "drawpoint_shq");
shq::saveImage("./srt/drawpoint_shq.svg");
shq::endDrawing(); // <Closes the
"connection"
scltracefe(§, ƒ, ∅);
return 0;
}
/* ƒ décorée par
le 08-06-2025 10:08:26 */
Sortie
[>..\xpl\src\sclgraf.shq.xpl.cpp.drawpoint_shq_xpl]
scl-25.06 (gwin64) : 08-06-2025 10:08:26
rande=32767
[<..\xpl\src\sclgraf.shq.xpl.cpp.drawpoint_shq_xpl]