@@ -341,6 +341,34 @@ int main()
341341 VIBES_TEST ( vibes::axisAuto () );
342342
343343
344+ // Notes on ZValues:
345+ // ZValues have to be seen as a tree structure:
346+ // groups are drawn by ascending ZValue order
347+ // items with no groups are treated as groups (with only one item)
348+ // in a group, items are drawn by ascending ZValue order
349+ // In definitive, Qt looks at the lowest ZValue group (or solo item), then draws it or all its items by ascending ZValue order,
350+ // then goes to the second lowest ZValue group, etc.
351+ // Default ZValue is 0
352+
353+ VIBES_TEST ( vibes::newFigure (" ZValues" ) );
354+
355+ VIBES_TEST ( vibes::drawBox (-1 ,0.5 ,0 ,1 ,vibesParams (" ZValue" ,5 ," FaceColor" ," red" ," EdgeColor" ," black" )) );
356+ VIBES_TEST ( vibes::drawBox (-0.5 ,0.7 ,-0.5 ,0.5 ,vibesParams (" ZValue" ,4.9 ," FaceColor" ," green" ," EdgeColor" ," black" )) );
357+
358+ VIBES_TEST ( vibes::newGroup (" circles" ,vibesParams (" ZValue" ,4.5 )));
359+ VIBES_TEST ( vibes::drawCircle (0 ,0 ,1 ,vibesParams (" ZValue" ,10 ," FaceColor" ," yellow" ," EdgeColor" ," black" ," group" ," circles" )) );
360+ VIBES_TEST ( vibes::drawCircle (0.8 ,0 ,0.5 ,vibesParams (" ZValue" ,4 ," FaceColor" ," cyan" ," EdgeColor" ," black" ," group" ," circles" )) );
361+
362+ VIBES_TEST ( vibes::newGroup (" circles_behind" ,vibesParams (" ZValue" ,0 ))); // lowest than "circle" Zvalue, so it is "hidden" behind
363+ VIBES_TEST ( vibes::drawCircle (0 ,0.05 ,1 ,vibesParams (" ZValue" ,15 ," FaceColor" ," red" ," EdgeColor" ," black" ," group" ," circles_behind" )) );
364+ VIBES_TEST ( vibes::drawCircle (0.8 ,0.05 ,0.5 ,vibesParams (" ZValue" ,4 ," FaceColor" ," green" ," EdgeColor" ," black" ," group" ," circles_behind" )) );
365+
366+ // ZValue is 0, so it is behind the red and green boxes (ZValue 5 and 4.9) and the "circles" group (ZValue 4.5)
367+ // but in front of the "circles_behind" group (ZValue 0) because they have the same ZValue, and it was drawn last
368+ VIBES_TEST ( vibes::drawBox (0 ,0.8 ,0 ,0.8 ,vibesParams (" FaceColor" ," blue" ," EdgeColor" ," black" )) );
369+ VIBES_TEST ( vibes::axisAuto () );
370+
371+
344372 /* vibes::Params p2 = vibesParams("action", "draw",
345373 "figure", "fig_name",
346374 "shape", vibesParams("LineWidth",5,
0 commit comments