How to draw a TCutG w/ fill

I cannot figure out how to programatically draw a TCutG object w/ semi-transparant fill - e.g.TCutG c(...); c.SetFillColor(2); c.SetFillStyle(3001); c.Draw(); draws a an outline only - no fill. If I use the Canvas_Editor, I can change the “Shape” to “Fill Area” (how do I do that programatically?) as is shown in the attached figure. But I cannot male the fill semi-transparent…
Note: I got the rectangle box w/TBox b; b.SetFillColor(2); b.SetFillStyle(3001); b.DrawBox(12800,527,377000,531);
I’m using win32gdk v4.02/00 on win2k. Thanks!
Ed Oltman


Hi Ed,

I used the ntuple in hsimple.root (see tutorials). I defined and draw a cut the following way

   TCutG *cutg = new TCutG("CUTG",5);
   cutg->SetFillColor(2);
   cutg->SetFillStyle(3001);
   cutg->SetPoint(0,-1.25862,0.722722);
   cutg->SetPoint(1,1.07974,1.39804);
   cutg->SetPoint(2,0.740302,-0.650424);
   cutg->SetPoint(3,-1.31519,0.655191);
   cutg->SetPoint(4,-1.25862,0.722722);
   cutg->Draw("f"); 

and I get the attached output which, I guess, is what you want.

Olivier


1 Like

Olivier,
When I use the code you sent me, the cutg is opaque. I am using gdk version 4.02/0 of root on win2k. See attachment.
Ed


Hi Ed,

I see what you mean. That’s a gdk feature. I have tested it on windows also, and you are right, the fill styles are opaque. I will submit this to the gdk driver author. Meanwhile you can use the new hatches styles I introduced recently. Try for instance 3244 . They are not opaque and look exactly the same on all platforms. See the help here:
root.cern.ch/root/htmldoc/src/TP … reaHatches

Cheers, Olivier

Hi Olivier,
Thanks - that helps. Note the problem must be TCutG specific since I do get the expected behaviorr when I draw a box w/ style=3001 (see first picture I sent)
Ed

Hi Ed,

This problem is now fixed in CVS. Boxes and polygons now behave the same with the wingdk version of ROOT. Thanks to have reported this problem.

Cheers, Olivier