GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4CondArrayPainter.cxx
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
15
16#include "TVirtualPad.h"
17
18#include "TGo4WinCond.h"
19#include "TGo4CondArray.h"
20
25
27: TGo4ConditionPainter(name,"TGo4CondArrayPainter")
28{
29}
30
35
37{
38 if (!gPad)
39 return;
40 TGo4CondArray *arconny = dynamic_cast<TGo4CondArray *>(fxCondition);
41 if (arconny) {
42 TH1 *workhis = arconny->GetWorkHistogram();
43 Int_t number = arconny->GetNumber();
44 Int_t selected = arconny->GetCurrentIndex();
45 for (Int_t i = 0; i < number; ++i) {
46 TGo4Condition *con = arconny->At(i);
47 if (con) {
48 con->SetOwnedByEditor(kTRUE); // prevent interactive deletion
49 con->SetWorkHistogram(workhis);
50 con->SetLineColor((i) % 6 + 2);
51 con->SetFillColor((i) % 6 + 2);
52 if (dynamic_cast<TGo4WinCond *>(con)) {
53 if (!arconny->IsMultiEdit() && i == selected) {
54 con->SetFillStyle(3002);
55 } else {
56 con->SetFillStyle(0);
57 }
58 } else {
59 if (!arconny->IsMultiEdit() && i == selected) {
60 con->SetLineStyle(1);
61 } else {
62 con->SetLineStyle(4);
63 }
64 }
65 con->Paint(opt);
66 }
67 }
68 } // if(arconny)
69}
70
72{
73 if (!gPad)
74 return;
75 TGo4CondArray *arconny = dynamic_cast<TGo4CondArray *>(fxCondition);
76 if (arconny) {
77 Int_t number = arconny->GetNumber();
78 for (Int_t i = 0; i < number; ++i) {
79 TGo4Condition *con = arconny->At(i);
80 if (con)
81 con->UnDraw(opt);
82 }
83 }
84}
85
87{
88 // do not create a label for the complete array
89}
void PaintCondition(Option_t *opt="") override
Display condition with plain root canvas and in go4 viewpanel.
void PaintLabel(Option_t *opt="") override
To suppress the label of the array, we overwrite method here.
void UnPaintCondition(Option_t *opt="") override
Erase condition view.
Array of conditions.
Int_t GetNumber() const
Returns number of conditions in array.
Int_t GetCurrentIndex() const override
get index for array type subclasses
TGo4Condition * At(Int_t i) const
Returns condition object i from object array.
TGo4Condition * fxCondition
Condition to be painted.
Go4 condition class.
void SetOwnedByEditor(Bool_t on)
TH1 * GetWorkHistogram() const
access work histogram reference
virtual void UnDraw(Option_t *opt="")
Erase view of this condition from the pad.
virtual void SetWorkHistogram(TH1 *histo)
Set reference to work histogram for statistics functions.
void Paint(Option_t *opt="") override
Display condition with plain root canvas and in go4 viewpanel.
virtual Bool_t IsMultiEdit() const
Window condition.
Definition TGo4WinCond.h:26