Skip to content

Implement TAttMarker::GetMarkerShape() method - #22977

Open
linev wants to merge 12 commits into
root-project:masterfrom
linev:marker_shape
Open

Implement TAttMarker::GetMarkerShape() method#22977
linev wants to merge 12 commits into
root-project:masterfrom
linev:marker_shape

Conversation

@linev

@linev linev commented Jul 31, 2026

Copy link
Copy Markdown
Member

Implement in TAttMarker::GetMarkerShape() functionality to return shape points for all supported marker types.
Provided are 7 different types:

  • kShapeDot
  • kShapeCircle
  • kShapeFilledCircle
  • kShapePolyLine
  • kShapeFilledArea
  • kShapeSegments
  • kShapeTriangles

Some of the markers like 39 or 41 always provided as triangles, other marker types converted into triangles only if Bool_t prefer_triangles argument is true. This done for support of GL or image dump which are not able to correctly fill complex polygon.

Following classes now uses new method:

  • TGX11
  • TGWin32
  • TQuartz - removing multiple auxiliary methods from QuartzMarker.h
  • TGLPadPainter - removing multiple auxiliary methods from TGLPadUtils.h
  • TImageDump - with better workaround for filled circle

Will be immediately used in

  • TQt6Canvas

@linev
linev requested review from bellenot and couet July 31, 2026 13:31
@linev linev self-assigned this Jul 31, 2026
@linev
linev requested review from dpiparo and pcanal as code owners July 31, 2026 13:31
@linev
linev marked this pull request as draft July 31, 2026 13:31
@linev
linev force-pushed the marker_shape branch 2 times, most recently from 87737ac to e662b27 Compare July 31, 2026 13:55
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 1h 30m 48s ⏱️
 3 831 tests  3 829 ✅ 0 💤  2 ❌
67 757 runs  67 719 ✅ 0 💤 38 ❌

For more details on these failures, see this check.

Results for commit 2598179.

♻️ This comment has been updated with latest results.

@linev

linev commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

@couet

It is still draft, I want to use introduced method in all other places - MacOS, GL, SVG, ...
And also not clear where the best place to put code.
For now I just add TAttMarker method, but one can put it somewhere else

linev added 10 commits August 4, 2026 17:01
Better format header and implementation files
For configured marker style and size returns
marker shape - dot, circle, fillcircle, polyline, fillarea, segments.

Such method should be used in all graphical classes where
marker should be painted
For several shapes provide alternative with triangles
to correctly work in GL or with image dump.
Probably for all filled shapes can add support with triangles -
while simple renderer has problem to correctly fill complex polygons
These are complex markers with many lines crossing so
rely on the fact that rendering engine can correctly detect
fillarea is not possible.

Has to be supported in all engines where they used
Replace same code,
direcly cast TPoint to XPoint
Code is very similar to X11.
The only difference TPoint can not be used instead GdkPoint, therefore need copy
Use scaling factor
Now is not necessary to implement individual marker shapes -
just 5 different shapes to cover all markers.
Main advantage - adding new marker types will not require changing
code in graphicals engines
Here special mode with triangles is activated
It is required while GL now always capable to fill crossing lines patterns correctly
Now all variants handled in central static method.
@linev linev changed the title Provide utility to create shape for provided marker Implement TAttMarker::GetMarkerShape() method Aug 4, 2026
Prefer triangles generation while fImage not always able to correctly fill complex polygon
Drawing of circle with semi-transparent color does not work.
Before many ellipses were drawn - without filling and with line width 1
Now just create polygon and fill it.
It is much better than before
@linev
linev marked this pull request as ready for review August 4, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants