Line attributes in lego1 & lego2

Ok, committed.
I am now looking at your other post about negative stacks… tricky …

[quote]oups … sorry … I think you are right it does not make sense when you have hidden surface.[/quote]Nope, it does! Don’t rely on the crap png file above. Run the example, it perfectly works.
The patch to be applied was lego_attline_patch.gitdiff2.tgz.
So now just apply that one
TPainter3dAlgorithms.cxx.2.diff (1.27 KB)and everything will be ok :smiley:
Thx,
Z

[quote]Don’t rely on the crap png file above[/quote]The output is exactly the same in gif (just as bad).
Here’s the corresponding “correct” pdf file (canvas->SaveAs(“canvas.pdf”)).canvas_pal53_contour99.pdf (20.3 KB)The transparency artefact decreases with the number of contours used. canvas_pal53_contour20.pdf (16.7 KB)Any ideas on how to avoid this? (I’ve tried several pdf readers and convert tools in vain).

Cheers,
Z

Now in the trunk.

How did you get this transparency ? you what it or it is something which showed up suddenly ?

The is a new parameter is SetPalette:

root.cern.ch/root/html534/TStyle … SetPalette

void SetPalette(Int_t ncolors = 0, Int_t* colors = 0, Float_t alpha = 1.)

The default value is 1. which means “opaque”. Unless you change this value to something smaller than 1.
I do not see how you could get the transparency.

Not to mix up everything, I propose we carry on this discussion in a new post.

Cheers,
Z

[quote]it does not make sense when you have hidden surface.[/quote]I now understand what you meant.
Here’s what’s displayed with the current patch :frowning:


canvas_s1w1_patch2.pdf (79.2 KB)
This is not acceptable.

Again I’ve been mislead by a too simple example (your c1.png above (no offense)) :angry:
[color=#FF0000]So here’s a new patch (hopefully the last one) fixing this[/color] (git diff against trunk rev 2fa236059378392c87f53e4821adb7593ad3955e).TPainter3dAlgorithms.cxx.3.diff (1.12 KB)
It keeps using TPad::PaintFillArea() not to be annoyed with the hidden surface algorithm
and superimposes a TPad::PaintPolyLine().
Of course if the line style is >1, the line width should be >1 for the style to be visible.


canvas_s2w2_patch3.pdf (96.3 KB)
This is the best we can do for now without deep changes I reckon.
Thx for commiting this change.

Cheers,
Z

PS: Further attachment (patch3.tgz): macro used + outputs for different (style,width) couples, before (patch2) and after (patch3) applying this last patch
patch3.tgz (1.35 MB)

[quote]This is the best we can do for now without deep changes I reckon.[/quote]Unless a DrawFillAreaWithBorders() method exist or be implemented.
Unfortunately this does not seem to be the case

// TVirtualX // Semi-Abstract base class defining a generic interface to the // underlying, low level, graphics system (X11, Win32, MacOS).
Cheers,
Z

Hi again,

In order to be complete attached’s an extension of the last patch that also:

The archive ztest.tgz contains the programs used to generate these outputs.
Run ztest.max (it will compile and execute stack0.cpp & stack1.cpp).

The diff files attached (THistPainter.cxx.diff & TPainter3dAlgorithms.cxx.diff) were generated against trunk rev 2fa236059378392c87f53e4821adb7593ad3955e.
So TPainter3dAlgorithms.cxx.diff cancels and replaces TPainter3dAlgorithms.cxx.3.diff above.

Enjoy! :slight_smile:
Z
TPainter3dAlgorithms.cxx.diff (17.1 KB)
THistPainter.cxx.diff (1.61 KB)
ztest.tgz (3.6 KB)

Hello,

I was away last week. Give me time to recover my emails and I will look at this.

Olivier

A bit of time this week?
Cheers,
Z

Yep, but this THistPainter patch is not appropriate now. I get:

imaccouet:roottrunk couet$ patch  -p1 < /Users/couet/Downloads/THistPainter.cxx.diff
patching file hist/histpainter/src/THistPainter.cxx
Hunk #1 succeeded at 6604 (offset 10 lines).
Hunk #2 succeeded at 7768 (offset 15 lines).
Hunk #3 succeeded at 7845 (offset 15 lines).
Hunk #4 succeeded at 7929 (offset 15 lines).

Can you provide a diff against the latest version ?
Thanks :slight_smile:

Here we go.
Could you please run ztest.max (see ztest.tgz above) and make sure you get the same plots as above?
Cheers,
Z
THistPainter.cxx.5.diff (1.61 KB)

I will :slight_smile:

Ok it seems fine. Sorry to ask you but I lost a bit the tracks of your mods now. Can you provide me a small
piece of text for the release notes explaining what this patches are supposed to do ?

also, In you code I see:

   for (i=0;i<fNStack;i++) { fColorMain[i] = 1; fColorDark[i] = 1; fEdgeColor[i] = kMagenta; fEdgeStyle[i] = 10; fEdgeWidth[i] = 10; }  /// default foolish values for errors to be spotted easily

That’s sounds a bit like a dirty trick, specially with a just comment :frowning: … I do not like this too much …

[quote]Can you provide me a small piece of text for the release notes explaining what these patches are supposed to do ?[/quote]This patch allows to take into account line attributes (color, style, width) when drawing a TH2 in lego or surf mode whatever the coordinate system used (car, pol, cyl, sph, (and psr)). It also handles THStack (lego only).

[quote]for (i=0;i<fNStack;i++) { fColorMain[i] = 1; fColorDark[i] = 1; fEdgeColor[i] = kMagenta; fEdgeStyle[i] = 10; fEdgeWidth[i] = 10; } /// default foolish values for errors to be spotted easilyThat sounds a bit like a dirty trick, specially with a just comment :frowning: … I do not like this too much …[/quote]Not at all. These were just the default values I used to make sure eveything was going fine i.e. no apparition of huge (width=10) “dotted” (style=10) magenta (color=kMagenta) lines on screen. You can set everything to 1 and remove the comment safely.

Cheers,
Z

You can set everything to 1 and remove the comment safely.

I will go that way. That kind of comment becomes very quickly very obscure with time
and does not help developers coming after.

Patch applied. Let me know if ok.

Your last mods generate a big bug in surface plotting.
See the result of the SURF3 option in the attached plot.
Can you fix that please ?
sg35.pdf (152 KB)

the way to reproduce it is:

TH2D * histo = new TH2D ("histo","histo",20,-5.,5.,20,-5.,5.) ;
histo->FillRandom("gaus",1000) ;
histo->SetStats(kFALSE) ;
histo->SetFillColor(kRed) ;
histo->SetLineColor(kBlack) ;
histo->Draw("surf3");