TH3 & voxels

Thanks Timur.

[quote] Color palette I’ve shown you is alredy result of such “play with palette colors”. This is palette I defined myself. [/quote]OK. As I said, I would prefer the usual “gStyle->SetPalette(1) color gradient”. Would it be possible ?

[quote]Palette position is fixed (and that’s not a problem, as soon as it’s semi-transparent)[/quote]But that’s a problem when it is not as in “opaque.jpg”. Would it be possible to play with it ?

[quote]I do not understand this. [/quote]I was talking about SetXtitle(""), SetYtitle("") and SetZtitle("") but it’s ok since it’s a TH3.

[quote]These are not axes, these are controls to move cut cube inside a plot. So, I cannot remove them, definitly. [/quote]How about just hiding them ?

[quote]Since I’m not sure about its usefulness, this type of plot is not in ROOT yet, I have it only in my version of ROOT. I can prepare diff file for you.[/quote]Please.

[quote]Well, it’s how it works right now in ROOT with glbox option.[/quote] Yes, but with your interpolation method. I’d like the person seeing the plot coud visualize the voxel size to have an idea about the mesh quality/relevance.

Thanks in advance,
M

If I can define palette myself, I can use gStyle->SetPalette(1) or gStyle->SetPalette(2) … etc.

What do you mean by “when it is not as in …” and “play with it”?

I cannot hide them, since they are handlers to move the cube.

[quote]Since I’m not sure about its usefulness, this type of plot is not in ROOT yet, I have it only in my version of ROOT. I can prepare diff file for you. Please.
[/quote]
Ok, may be tomorrow.

[quote]Palette position is fixed (and that’s not a problem, as soon as it’s semi-transparent)[quote][So] that’s a problem when it is not as in your “opaque.jpg”. Would it be possible to play with it ? [quote]What do you mean by “when it is not as in …” and “play with it”? [/quote][/quote][/quote]… when the palette is not transparent, as in your plot “opaque.jpg”.
So, would it be possible to change the position of the palette if needed ?

[quote] Quote: How about just hiding them ?[quote]I cannot hide them, since they are handlers to move the cube. [/quote] [/quote]Humm… Could it be possible not to save the handlers when saving the canvas ?
Another way could be to “freeze” the plot once the user is pleased with the view. The handlers should then disappear at freezing time.

Thanks, Z

Palette is always transparent.

[quote]Humm… Could it be possible not to save the handlers when saving the canvas ?
Another way could be to “freeze” the plot once the user is pleased with the view. The handlers should then disappear at freezing time.

Thanks, Z[/quote]
Well, may be

[quote]Palette is always transparent. [/quote]Wouldn’t it be possible to make it opaque?
Thanks, Z

[quote=“Zesp”][quote]Palette is always transparent. [/quote]Wouldn’t it be possible to make it opaque?
Thanks, Z[/quote]

It’s 58% opaque not to hide underlaying plot parts.

What about giving the possibility to the user to choose its transparency level (from 0% to 100%) ?

For what reason?
Which interface do you suggest?

For what reason?

To avoid ugly superimposition.
This could be ok if the palette position could be changed.

Which interface do you suggest?

Basic command line like: gStyle->SetPaletteTransparency(0.60) ;

Thanks, Z

Basic command line like: gStyle->SetPaletteTransparency(0.60) ;

Yes, may be, but gStyle is not my business :slight_smile:

With the option COLZ the palette is not transparent. It is always opaque. To avoid having it overlapping on the plot it is possible to define its position and size. I think we should do the same in the 3D case.

With GL you can zoom and move plot - you cannot do this in non-gl plot.
Plot in GL can be “bigger than pad” (clipping parts outside pad)

Dear Timur,
Did you have time to make the diff file ?
Maybe you’re fixing new things with Olivier…
Thanks for keeping me(us?) posted.
Z

[quote]Dear Timur,
Did you have time to make the diff file ?
Z[/quote]

Hi.

Attached:

Zesp/gl/inc
Zesp/gl/src
Zesp/base/inc
Zesp/base/src

(just copy these files into corresponding $ROOTSYS directories and re-compile).

Zesp/samples

3 macros, glbox1.C is a standard “glbox” option (box painting skipped, only slices)
glbox2.C shows option “glbox2”.
After glbox2.C executed, you can specify transparency function (execute opacity.C).

Please, note : :slight_smile:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS

  • OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  • FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  • TPOCHEP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  • AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  • CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    Zesp.zip (495 KB)





Hi,
I’ve followed this interesting thread… I’ve tried to download and re-compile with Zesp classes, but it gives me an error:

base/src/TStyle.cxx: In member function virtual void TStyle::Reset(const Option_t*)': base/src/TStyle.cxx:374: error:fPaletteOpacity’ was not declared in this scope
base/src/TStyle.cxx:374: warning: unused variable 'fPaletteOpacity’
make: *** [base/src/TStyle.o] Error 1
rm utils/src/rootcint_tmp.cxx utils/src/RStl_tmp.cxx

did I miss something?

Thanks a lot

Sara

[quote]Hi,
base/src/TStyle.cxx: In member function virtual void TStyle::Reset(const Option_t*)': base/src/TStyle.cxx:374: error:fPaletteOpacity’ was not declared in this scope
base/src/TStyle.cxx:374: warning: unused variable 'fPaletteOpacity’
make: *** [base/src/TStyle.o] Error 1
rm utils/src/rootcint_tmp.cxx utils/src/RStl_tmp.cxx

did I miss something?

Thanks a lot

Sara[/quote]

Did you place modified TStyle.h from zip file into base/inc?
If yes - try to remove TStyle.h from $ROOTSYS/include directory to force copying of modified header.

Thanks, this is working… now is compiling.

By the way… is it possibile to create a color palette with customized gradient, e.g. giving the color for the minimum, the maximum, the range, etc? could you please provide me such a code?

Thanks a lot, that would be very helpful!
Regards
Sara

Ok , it is working, but then I got another error, I’ve tried to remove include/TGLBoxPainter.h but is not working… I’m messing everything up!

gl/src/TGLBoxPainter.cxx: In member function void TGLBoxPainter::SetBoxColor(Double_t) const': gl/src/TGLBoxPainter.cxx:553: error:fPalette’ was not declared in this scope
gl/src/TGLBoxPainter.cxx:556: error: fRamp' was not declared in this scope gl/src/TGLBoxPainter.cxx:553: warning: unused variable 'fPalette' gl/src/TGLBoxPainter.cxx: At global scope: gl/src/TGLBoxPainter.cxx:579: error: novoid TGLBoxPainter::SetOpacityFunction(Int_t, const Double_t*, const Double_t*)’ member function declared in class TGLBoxPainter' gl/src/TGLBoxPainter.cxx: In member functionvoid TGLBoxPainter::SetOpacityFunction(Int_t, const Double_t*, const Double_t*)’:
gl/src/TGLBoxPainter.cxx:583: error: `fRamp’ was not declared in this scope
make: *** [gl/src/TGLBoxPainter.o] Error 1

By the way… is it possibile to create a color palette with customized gradient, e.g. giving the color for the minimum, the maximum, the range, etc? could you please provide me such a code?

Thanks a lot, that would be very helpful!
Regards
Sara

[quote]Ok , it is working, but then I got another error, I’ve tried to remove include/TGLBoxPainter.h but is not working… I’m messing everything up!
[/quote]

Zip file contains the whole gl module, so you can simply remove gl from $ROOTSYS and copy gl from zesp.zip. If something’s wrong after that, you possibly have to manually remove corresponding headers from $ROOTSYS/include.

Here Olivier answered this question (TColor::CreateGradientColorTable):

root.cern.ch/phpBB2/viewtopic.php?t=6445

Hi thanks! now I can compile and run. Few more questions - sorry for bothering… but you’ve been so helpful!

  1. samples/glbox1.C is working fine - great!

  2. samples/glbox2.C displays without errors, but I.m not able to go through slices with mouse+shift (this moves the all plot)… why?

  3. samples/opacity.C is not working:
    root [1] .x glbox2.C
    TCanvas::MakeDefCanvas: created default TCanvas with name c1
    root [2] .x opacity.C
    Error: Can’t call TGLHistPainter::GetGLPainter() in current scope opacity.C:5:
    Possible candidates are…
    (in TGLHistPainter)
    (in TVirtualHistPainter)
    *** Interpreter error recovered ***

  4. when I try to visualize my TH3 scatter-plot with :hvoxel->Draw(“glboxz”)
    I got:
    Error in TGLHistPainter::DistancetoPrimitive: Attempt to use TGLHistPainter, while the current pad (gPad) does not support gl

Thanks a lot
Sara