Re: Clipping og polylines

Rene Brun (Rene.Brun@cern.ch)
Wed, 20 May 1998 16:54:37 +0200


Cyril Broude wrote:
>
> --
> Hi,
>
> When painting TCutG's in line mode on a TH2 in a pad, everything is fine
> when all
> of the polyline is within the range of the pad or it is completely
> outside of the range. However, if only some of the points are in the
> pad, then TGraph::PaintGraph discards all of the external points and
> happily joins up those which are inside. This would be alright for
> PolyMarkers but not for PolyLines.
>
> What I would like to do is remove the above feature and add the
> capability for
> user SetClipRectangles to clip on the frame of the histogramme. Any
> comments?
>

You are right about the expected TGraph behaviour. However, a correct
clipping algorithm should work in the following situations:
- polyline mode
- polymarker mode
- fill area mode
- smooth mode for the 3 cases above
- Graph with errors (in x and y)
- Graph with associated fits.
- histogram frame or not
- clip by necessity (log scales)
- clip on screen & Postscript

The current "naive" algorithm is a minimum implementation
for all cases above. Better algorithms will come with time.

Rene Brun