25 ClassImp(TEveProjectionManagerEditor);
30 TEveProjectionManagerEditor::TEveProjectionManagerEditor(
const TGWindow *p,
31 Int_t width, Int_t height,
32 UInt_t options, Pixel_t back) :
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
39 fPastFixRFac(0), fPastFixZFac(0),
47 MakeTitle(
"TEveProjection");
49 TGHorizontalFrame* f =
new TGHorizontalFrame(
this);
50 TGLabel* lab =
new TGLabel(f,
"Type");
51 f->AddFrame(lab,
new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 31, 1, 2));
52 fType =
new TGComboBox(f);
53 fType->AddEntry(
"RPhi", TEveProjection::kPT_RPhi);
54 fType->AddEntry(
"RhoZ", TEveProjection::kPT_RhoZ);
55 fType->AddEntry(
"3D", TEveProjection::kPT_3D);
56 TGListBox* lb = fType->GetListBox();
57 lb->Resize(lb->GetWidth(), 2*18);
58 fType->Resize(80, 20);
59 fType->Connect(
"Selected(Int_t)",
"TEveProjectionManagerEditor",
60 this,
"DoType(Int_t)");
61 f->AddFrame(fType,
new TGLayoutHints(kLHintsTop, 1, 1, 2, 4));
67 fDistortion =
new TEveGValuator(
this,
"Distortion:", 90, 0);
68 fDistortion->SetNELength(nel);
69 fDistortion->SetLabelWidth(labelW);
71 fDistortion->SetLimits(0, 50, 101, TGNumberFormat::kNESRealTwo);
72 fDistortion->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
73 this,
"DoDistortion()");
74 AddFrame(fDistortion,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
77 fFixR =
new TEveGValuator(
this,
"FixedR:", 90, 0);
78 fFixR->SetNELength(nel);
79 fFixR->SetLabelWidth(labelW);
81 fFixR->SetLimits(0, 1000, 101, TGNumberFormat::kNESRealOne);
82 fFixR->SetToolTip(
"Radius after which scale is kept constant.");
83 fFixR->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
85 AddFrame(fFixR,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
87 fFixZ =
new TEveGValuator(
this,
"FixedZ:", 90, 0);
88 fFixZ->SetNELength(nel);
89 fFixZ->SetLabelWidth(labelW);
91 fFixZ->SetLimits(0, 1000, 101, TGNumberFormat::kNESRealOne);
92 fFixZ->SetToolTip(
"Z-coordinate after which scale is kept constant.");
93 fFixZ->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
95 AddFrame(fFixZ,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
97 fPastFixRFac =
new TEveGValuator(
this,
"ScaleR:", 90, 0);
98 fPastFixRFac->SetNELength(nel);
99 fPastFixRFac->SetLabelWidth(labelW);
100 fPastFixRFac->Build();
101 fPastFixRFac->SetLimits(-2, 2, 101, TGNumberFormat::kNESRealTwo);
102 fPastFixRFac->SetToolTip(
"Relative R-scale beyond FixedR.\nExpressed as 10^x.");
103 fPastFixRFac->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
104 this,
"DoPastFixRFac()");
105 AddFrame(fPastFixRFac,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
107 fPastFixZFac =
new TEveGValuator(
this,
"ScaleZ:", 90, 0);
108 fPastFixZFac->SetNELength(nel);
109 fPastFixZFac->SetLabelWidth(labelW);
110 fPastFixZFac->Build();
111 fPastFixZFac->SetLimits(-2, 2, 101, TGNumberFormat::kNESRealTwo);
112 fPastFixZFac->SetToolTip(
"Relative Z-scale beyond FixedZ.\nExpressed as 10^x.");
113 fPastFixZFac->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
114 this,
"DoPastFixZFac()");
115 AddFrame(fPastFixZFac,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
117 fCurrentDepth =
new TEveGValuator(
this,
"CurrentZ:", 90, 0);
118 fCurrentDepth->SetNELength(nel);
119 fCurrentDepth->SetLabelWidth(labelW);
120 fCurrentDepth->Build();
121 fCurrentDepth->SetLimits(-300, 300, 601, TGNumberFormat::kNESRealTwo);
122 fCurrentDepth->SetToolTip(
"Z coordinate of incoming projected object.");
123 fCurrentDepth->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
124 this,
"DoCurrentDepth()");
125 AddFrame(fCurrentDepth,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
127 fMaxTrackStep =
new TEveGValuator(
this,
"TrackStep:", 90, 0);
128 fMaxTrackStep->SetNELength(nel);
129 fMaxTrackStep->SetLabelWidth(labelW);
130 fMaxTrackStep->Build();
131 fMaxTrackStep->SetLimits(1, 100, 100, TGNumberFormat::kNESRealOne);
132 fMaxTrackStep->SetToolTip(
"Maximum step between two consecutive track-points to avoid artefacts due to projective distortions.\nTaken into account automatically during projection procedure.");
133 fMaxTrackStep->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
134 this,
"DoMaxTrackStep()");
135 AddFrame(fMaxTrackStep,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 3));
139 MakeTitle(
"Distortion centre");
140 fCenterFrame =
new TGVerticalFrame(
this);
142 fCenterX =
new TEveGValuator(fCenterFrame,
"CenterX:", 90, 0);
143 fCenterX->SetNELength(nel);
144 fCenterX->SetLabelWidth(labelW);
146 fCenterX->SetLimits(-5, 5, 501, TGNumberFormat::kNESRealThree);
147 fCenterX->SetToolTip(
"Origin of the projection.");
148 fCenterX->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
150 fCenterFrame->AddFrame(fCenterX,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
152 fCenterY =
new TEveGValuator(fCenterFrame,
"CenterY:", 90, 0);
153 fCenterY->SetNELength(nel);
154 fCenterY->SetLabelWidth(labelW);
156 fCenterY->SetLimits(-5, 5, 501, TGNumberFormat::kNESRealThree);
157 fCenterY->SetToolTip(
"Origin of the projection.");
158 fCenterY->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
160 fCenterFrame->AddFrame(fCenterY,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
162 fCenterZ =
new TEveGValuator(fCenterFrame,
"CenterZ:", 90, 0);
163 fCenterZ->SetNELength(nel);
164 fCenterZ->SetLabelWidth(labelW);
166 fCenterZ->SetLimits(-25, 25, 501, TGNumberFormat::kNESRealThree);
167 fCenterZ->SetToolTip(
"Origin of the projection.");
168 fCenterZ->Connect(
"ValueSet(Double_t)",
"TEveProjectionManagerEditor",
170 fCenterFrame->AddFrame(fCenterZ,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
172 AddFrame(fCenterFrame,
new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
178 void TEveProjectionManagerEditor::SetModel(TObject* obj)
180 fM =
dynamic_cast<TEveProjectionManager*
>(obj);
182 fType->Select(fM->GetProjection()->GetType(), kFALSE);
183 fDistortion->SetValue(1000.0f * fM->GetProjection()->GetDistortion());
184 fFixR->SetValue(fM->GetProjection()->GetFixR());
185 fFixZ->SetValue(fM->GetProjection()->GetFixZ());
186 fPastFixRFac->SetValue(fM->GetProjection()->GetPastFixRFac());
187 fPastFixZFac->SetValue(fM->GetProjection()->GetPastFixZFac());
188 fCurrentDepth->SetValue(fM->GetCurrentDepth());
189 fMaxTrackStep->SetValue(fM->GetProjection()->GetMaxTrackStep());
191 fCenterX->SetValue(fM->GetCenter().fX);
192 fCenterY->SetValue(fM->GetCenter().fY);
193 fCenterZ->SetValue(fM->GetCenter().fZ);
199 void TEveProjectionManagerEditor::DoType(Int_t type)
203 fM->SetProjection((TEveProjection::EPType_e)type);
204 fM->ProjectChildren();
217 void TEveProjectionManagerEditor::DoDistortion()
219 fM->GetProjection()->SetDistortion(0.001f * fDistortion->GetValue());
221 fM->ProjectChildren();
228 void TEveProjectionManagerEditor::DoFixR()
230 fM->GetProjection()->SetFixR(fFixR->GetValue());
231 fM->ProjectChildren();
238 void TEveProjectionManagerEditor::DoFixZ()
240 fM->GetProjection()->SetFixZ(fFixZ->GetValue());
241 fM->ProjectChildren();
248 void TEveProjectionManagerEditor::DoPastFixRFac()
250 fM->GetProjection()->SetPastFixRFac(fPastFixRFac->GetValue());
251 fM->ProjectChildren();
258 void TEveProjectionManagerEditor::DoPastFixZFac()
260 fM->GetProjection()->SetPastFixZFac(fPastFixZFac->GetValue());
261 fM->ProjectChildren();
268 void TEveProjectionManagerEditor::DoCurrentDepth()
270 fM->SetCurrentDepth(fCurrentDepth->GetValue());
271 fM->ProjectChildren();
278 void TEveProjectionManagerEditor::DoMaxTrackStep()
280 fM->GetProjection()->SetMaxTrackStep(fMaxTrackStep->GetValue());
281 fM->ProjectChildren();
288 void TEveProjectionManagerEditor::DoCenter()
290 fM->SetCenter(fCenterX->GetValue(), fCenterY->GetValue(), fCenterZ->GetValue());