diff --git a/gui/ged/src/TH2Editor.cxx b/gui/ged/src/TH2Editor.cxx index ce28892e94938e9e1810e9acb780120350dca28d..ca1f23fcb28d86ee90239dfddb106b24f7f460c7 100644 --- a/gui/ged/src/TH2Editor.cxx +++ b/gui/ged/src/TH2Editor.cxx @@ -55,7 +55,7 @@ // // // 3d Plot: // // 'Type' : ComboBox: set histogram type Lego or Surface-Plot // -// draw(Lego, Lego1.2, Surf, Surf1..5) // +// draw(Lego, Lego1..4, Surf, Surf1..5) // // see THistPainter::Paint // // 'Coords' : ComboBox: set the coordinate system (Cartesian, .. // // Spheric) see THistPainter::Paint // @@ -153,7 +153,7 @@ ClassImp(TH2Editor) enum ETH2Wid { kTH2_TITLE, kDIM_SIMPLE, kDIM_COMPLEX, kHIST_TYPE, - kTYPE_LEGO, kTYPE_LEGO1, kTYPE_LEGO2, + kTYPE_LEGO, kTYPE_LEGO1, kTYPE_LEGO2, kTYPE_LEGO3, kTYPE_LEGO4, kTYPE_SURF, kTYPE_SURF1, kTYPE_SURF2, kTYPE_SURF3, kTYPE_SURF4, kTYPE_SURF5, kCOORD_TYPE, kCOORDS_CAR, kCOORDS_CYL, kCOORDS_POL, kCOORDS_PSR, kCOORDS_SPH, kCONT_TYPE, kERROR_ONOFF, kPALETTE_ONOFF, kPALETTE_ONOFF1, @@ -874,7 +874,9 @@ void TH2Editor::SetModel(TObject* obj) ShowFrame(f38); fDimGroup->SetButton(kDIM_COMPLEX, kTRUE); fDimGroup->SetButton(kDIM_SIMPLE, kFALSE); - if (str.Contains("LEGO2")) fTypeCombo->Select(kTYPE_LEGO2); + if (str.Contains("LEGO4")) fTypeCombo->Select(kTYPE_LEGO4); + else if (str.Contains("LEGO3")) fTypeCombo->Select(kTYPE_LEGO3); + else if (str.Contains("LEGO2")) fTypeCombo->Select(kTYPE_LEGO2); else if (str.Contains("LEGO1")) fTypeCombo->Select(kTYPE_LEGO1); else if (str.Contains("LEGO")) fTypeCombo->Select(kTYPE_LEGO); else if (str.Contains("SURF5")) fTypeCombo->Select(kTYPE_SURF5); @@ -922,6 +924,8 @@ void TH2Editor::SetModel(TObject* obj) } if ((fTypeCombo->GetSelected()==kTYPE_LEGO) || (fTypeCombo->GetSelected()==kTYPE_LEGO1)|| + (fTypeCombo->GetSelected()==kTYPE_LEGO3)|| + (fTypeCombo->GetSelected()==kTYPE_LEGO4)|| (fTypeCombo->GetSelected()==kTYPE_SURF) || (fTypeCombo->GetSelected()==kTYPE_SURF4)) fAddPalette1->SetState(kButtonDisabled); @@ -1183,6 +1187,8 @@ void TH2Editor::DoHistChanges() } if ((fTypeCombo->GetSelected()==kTYPE_LEGO) || (fTypeCombo->GetSelected()==kTYPE_LEGO1)|| + (fTypeCombo->GetSelected()==kTYPE_LEGO3)|| + (fTypeCombo->GetSelected()==kTYPE_LEGO4)|| (fTypeCombo->GetSelected()==kTYPE_SURF) || (fTypeCombo->GetSelected()==kTYPE_SURF4)) fAddPalette1->SetState(kButtonDisabled); @@ -2694,7 +2700,7 @@ void TH2Editor::DoFillPattern(Style_t pattern) //______________________________________________________________________________ TString TH2Editor::GetHistTypeLabel() { - // Return the immediate histogram type (HIST, LEGO1-2, SURF1-5). + // Return the immediate histogram type (HIST, LEGO1-4, SURF1-5). TString s=""; switch (fTypeCombo->GetSelected()){ @@ -2702,6 +2708,8 @@ TString TH2Editor::GetHistTypeLabel() case (kTYPE_LEGO ): {s = "LEGO"; break;} case (kTYPE_LEGO1): {s = "LEGO1"; break;} case (kTYPE_LEGO2): {s = "LEGO2"; break;} + case (kTYPE_LEGO3): {s = "LEGO3"; break;} + case (kTYPE_LEGO4): {s = "LEGO4"; break;} case (kTYPE_SURF ): {s = "SURF"; break;} case (kTYPE_SURF1): {s = "SURF1"; break;} case (kTYPE_SURF2): {s = "SURF2"; break;} @@ -2798,6 +2806,8 @@ TGComboBox* TH2Editor::BuildHistTypeComboBox(TGFrame* parent, Int_t id) c->AddEntry("Lego" , kTYPE_LEGO); c->AddEntry("Lego1", kTYPE_LEGO1); c->AddEntry("Lego2", kTYPE_LEGO2); + c->AddEntry("Lego3", kTYPE_LEGO3); + c->AddEntry("Lego4", kTYPE_LEGO4); c->AddEntry("Surf" , kTYPE_SURF); c->AddEntry("Surf1", kTYPE_SURF1); c->AddEntry("Surf2", kTYPE_SURF2); diff --git a/hist/doc/v600/index.md b/hist/doc/v600/index.md index f138aa4a845723b9513ea4b6b91fb2b318b83bfb..cf72eba40297019b8907f3178f83ab95e8c8f23d 100644 --- a/hist/doc/v600/index.md +++ b/hist/doc/v600/index.md @@ -15,12 +15,14 @@ these options is now drawn with the default 1D plotting option. This is useful when the default option in the TBrowser is, for instance, COL. Before this change the 1D histogram appeared as blank. -- New plotting option `"LEGO3"`.cw Like the option `"LEGO1"`, the +- New plotting option `"LEGO3"`. Like the option `"LEGO1"`, the option `"LEGO3"` draws a lego plot using the hidden surface removal technique but doesn't draw the border lines of each individual lego-bar. This is very useful for histograms having many bins. With such histograms the option `"LEGO1"` gives a black image because of the border lines. This option also works with stacked legos. +- New plotting option `"LEGO4"`. Draw a lego plot with hidden surface + removal, like LEGO1, but without the shadow effect on each lego-bar. - Line attributes can be used in lego plots to change the edges' style. - Implement in THistPainter::GetObjectInfo the case of TProfile and diff --git a/hist/histpainter/src/THistPainter.cxx b/hist/histpainter/src/THistPainter.cxx index 9a651bcca7f87bb497ad9d941d17bd6f22e93c69..3fa747a8f6476fa846fd778b7d48d605503e5628 100644 --- a/hist/histpainter/src/THistPainter.cxx +++ b/hist/histpainter/src/THistPainter.cxx @@ -264,6 +264,11 @@ Draw a lego plot with hidden surface removal, like LEGO1 but the border lines of each lego-bar are not drawn. </td></tr> +<tr><th valign=top>"LEGO4"</th><td> +Draw a lego plot with hidden surface removal, like LEGO1 but without the +shadow effect on each lego-bar. +</td></tr> + <tr><th valign=top>"TEXT"</th><td> Draw bin contents as text (format set via <tt>gStyle->SetPaintTextFormat</tt>). </td></tr> @@ -1593,6 +1598,11 @@ Draw a lego plot with hidden surface removal, like LEGO1 but the border lines of each lego-bar are not drawn. </td></tr> +<tr><th valign=top>"LEGO4"</th><td> +Draw a lego plot with hidden surface removal, like LEGO1 but without the +shadow effect on each lego-bar. +</td></tr> + <tr><th valign=top>"0"</th><td> When used with any LEGO option, the empty bins are not drawn. </td></tr> @@ -3445,6 +3455,7 @@ Int_t THistPainter::MakeChopt(Option_t *choptin) if (l[4] == '1') { Hoption.Lego = 11; l[4] = ' '; } if (l[4] == '2') { Hoption.Lego = 12; l[4] = ' '; } if (l[4] == '3') { Hoption.Lego = 13; l[4] = ' '; } + if (l[4] == '4') { Hoption.Lego = 14; l[4] = ' '; } l = strstr(chopt,"FB"); if (l) { Hoption.FrontBox = 0; strncpy(l," ",2); } l = strstr(chopt,"BB"); if (l) { Hoption.BackBox = 0; strncpy(l," ",2); } l = strstr(chopt,"0"); if (l) { Hoption.Zero = 1; strncpy(l," ",1); } @@ -6455,11 +6466,19 @@ void THistPainter::PaintLego(Option_t *) fLego = new TPainter3dAlgorithms(fXbuf, fYbuf, Hoption.System); fLego->SetEdgeAtt(fH->GetLineColor(),fH->GetLineStyle(),fH->GetLineWidth()); + Color_t colormain = -1, colordark = -1 ; + Bool_t drawShadowsInLego1=kTRUE ; + // LEGO3 is like LEGO1 except that the black lines around each lego are not drawn. if (Hoption.Lego == 13) { Hoption.Lego = 11; fLego->SetMesh(0); } + // LEGO4 is like LEGO1 except no shadows are drawn. + if (Hoption.Lego == 14) { + Hoption.Lego = 11; + drawShadowsInLego1=kFALSE ; + } // Create axis object @@ -6476,7 +6495,7 @@ void THistPainter::PaintLego(Option_t *) // Initialize colors for the lighting model (option Lego1 only) if (Hoption.Lego == 1) { - Color_t colormain = fH->GetLineColor(); + colormain = fH->GetLineColor(); fLego->SetColorMain(colormain,0); } if (Hoption.Lego == 11) { @@ -6485,9 +6504,10 @@ void THistPainter::PaintLego(Option_t *) TH1 *hid = fH; for (Int_t id=0;id<=nids;id++) { if (id > 0 && fStack) hid = (TH1*)fStack->At(id-1); - Color_t colormain = hid->GetFillColor(); + colormain = hid->GetFillColor(); if (colormain == 1) colormain = 17; //avoid drawing with black - Color_t colordark = TColor::GetColorDark(colormain); + if (drawShadowsInLego1) colordark = TColor::GetColorDark(colormain); + else colordark = colormain ; fLego->SetColorMain(colormain,id); fLego->SetColorDark(colordark,id); if (id == 0) fLego->SetColorMain(colormain,-1); // Set Bottom color