- sclgraf.shq [c+]
[..] La fonction [shq] drawEllipseshq
Code
int drawellipse_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("drawellipse_shq"); // <Creates a new
figure
int tirn=40, tiri;
double rx, ry, ra, rb, rot_deg;
scltracefc("rande=%d\n", ∞ns);
shq::newGroup("Bagad Gwer",/*"[vert]darkGreen"*/"[#00CC0026]darkGreen"); //vert transparence 15%
shq::newGroup("Bagad Melen",/*"darkYellow[carotte]"*/"darkYellow[#FFC00026]"); //carotte transparence 15%
shq::newGroup("Bagad Glaz",/*"[bleu]darkBlue"*/"[#0066FF26]darkBlue"); //bleu transparence 15%
shq::newGroup("Bagad Ruz",/*"darkRed[chaire]"*/"darkRed[#C0000026]"); //chaire transparence 15%
double r=/*(double)RAND_MAX*/100;
for(tiri=0;tiri<tirn;tiri++){
rx=((double)rand())/((double)∞ns)*r;
ry=((double)rand())/((double)∞ns)*r;
ra=((double)rand())/((double)∞ns)*r;
rb=((double)rand())/((double)∞ns)*r;
/*if(rb<ra){ rp=rb; rb=ra; ra=rp; }
if(ra<rb*0.80){ ra=rb*0.80; }*/
rot_deg=((double)rand())/((double)∞ns)*360;
if(tiri%4==0){
shq::drawEllipse( r+rx, r+ry, ra, rb, rot_deg,
shq::Params("group","Bagad Gwer"));
}
else if(tiri%4==1){
shq::drawEllipse(-r-rx, r+ry, ra, rb, rot_deg,
shq::Params("group","Bagad Melen"));
}
else if(tiri%4==2) {
shq::drawEllipse(-r-rx,-r-ry, ra, rb, rot_deg,
shq::Params("group","Bagad Glaz"));
}
else{
shq::drawEllipse( r+rx,-r-ry, ra, rb, rot_deg,
shq::Params("group","Bagad Ruz"));
}
}
shq::axisAuto("drawellipse_shq");
shq::axisEqual("drawellipse_shq");
shq::axisLabels("[m]", "[m]", "drawellipse_shq");
shq::saveImage("./srt/drawellipse_shq.svg");
shq::endDrawing(); // <Closes the
"connection"
scltracefe(§, ƒ, ∅);
return 0;
}
/* ƒ décorée par
le 07-06-2025 09:56:29 */
Sortie
[>..\xpl\src\sclgraf.shq.xpl.cpp.drawellipse_shq_xpl]
scl-25.06 (gwin64) : 07-06-2025 09:56:29
rande=32767
[<..\xpl\src\sclgraf.shq.xpl.cpp.drawellipse_shq_xpl]