40 ClassImp(TParallelCoordEditor);
102 TParallelCoordEditor::TParallelCoordEditor(
const TGWindow* ,
112 TGHorizontalFrame *f1 =
new TGHorizontalFrame(
this);
113 fGlobalLineColor =
new TGColorSelect(f1,0,kGlobalLineColor);
114 f1->AddFrame(fGlobalLineColor,
new TGLayoutHints(kLHintsLeft | kLHintsTop));
115 fGlobalLineWidth =
new TGLineWidthComboBox(f1, kGlobalLineWidth);
116 fGlobalLineWidth->Resize(91, 20);
117 f1->AddFrame(fGlobalLineWidth,
new TGLayoutHints(kLHintsLeft, 3, 1, 1, 1));
118 AddFrame(f1,
new TGLayoutHints(kLHintsLeft | kLHintsTop));
120 if (!TCanvas::SupportAlpha()) {
122 AddFrame(
new TGLabel(
this,
"Dots spacing"),
123 new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
125 TGHorizontalFrame *f2 =
new TGHorizontalFrame(
this);
126 fDotsSpacing =
new TGHSlider(f2,100,kSlider2|kScaleNo,kDotsSpacing);
127 fDotsSpacing->SetRange(0,60);
128 f2->AddFrame(fDotsSpacing,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
129 fDotsSpacingField =
new TGNumberEntryField(f2, kDotsSpacingField, 0,
130 TGNumberFormat::kNESInteger,
131 TGNumberFormat::kNEANonNegative);
132 fDotsSpacingField->Resize(40,20);
133 f2->AddFrame(fDotsSpacingField,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
134 AddFrame(f2,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
137 TGLabel *AlphaLabel =
new TGLabel(
this,
"Opacity");
139 new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
140 TGHorizontalFrame *f2a =
new TGHorizontalFrame(
this);
141 fAlpha =
new TGHSlider(f2a,100,kSlider2|kScaleNo,kAlpha);
142 fAlpha->SetRange(0,1000);
143 f2a->AddFrame(fAlpha,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
144 fAlphaField =
new TGNumberEntryField(f2a, kAlphaField, 0,
145 TGNumberFormat::kNESReal,
146 TGNumberFormat::kNEANonNegative);
147 fAlphaField->Resize(40,20);
148 f2a->AddFrame(fAlphaField,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
149 AddFrame(f2a,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
152 fLineTypeBgroup =
new TGButtonGroup(
this,2,1,0,0,
"Line type");
153 fLineTypeBgroup->SetRadioButtonExclusive(kTRUE);
154 fLineTypePoly =
new TGRadioButton(fLineTypeBgroup,
"Polyline", kLineTypePoly);
155 fLineTypePoly->SetToolTipText(
"Draw the entries with a polyline");
156 fLineTypeCurves =
new TGRadioButton(fLineTypeBgroup,
"Curves",
158 fLineTypeCurves->SetToolTipText(
"Draw the entries with a curve");
159 fLineTypeBgroup->ChangeOptions(kChildFrame|kVerticalFrame);
160 AddFrame(fLineTypeBgroup,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft));
163 MakeTitle(
"Selections");
165 fHideAllRanges =
new TGCheckButton(
this,
"Hide all ranges",kHideAllRanges);
166 AddFrame(fHideAllRanges);
168 fSelectionSelect =
new TGComboBox(
this,kSelectionSelect);
169 fSelectionSelect->Resize(140,20);
170 AddFrame(fSelectionSelect,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft,0,0,3,0));
172 TGHorizontalFrame *f3 =
new TGHorizontalFrame(
this);
173 fSelectLineColor =
new TGColorSelect(f3,0,kSelectLineColor);
174 f3->AddFrame(fSelectLineColor,
new TGLayoutHints(kLHintsLeft | kLHintsTop));
175 fSelectLineWidth =
new TGLineWidthComboBox(f3, kSelectLineWidth);
176 fSelectLineWidth->Resize(94, 20);
177 f3->AddFrame(fSelectLineWidth,
new TGLayoutHints(kLHintsLeft, 3, 1, 1, 1));
178 AddFrame(f3,
new TGLayoutHints(kLHintsLeft | kLHintsTop,0,0,3,0));
180 fActivateSelection =
new TGCheckButton(
this,
"Activate",kActivateSelection);
181 fActivateSelection->SetToolTipText(
"Activate the current selection");
182 AddFrame(fActivateSelection);
183 fShowRanges =
new TGCheckButton(
this,
"Show ranges",kShowRanges);
184 AddFrame(fShowRanges);
186 TGHorizontalFrame *f5 =
new TGHorizontalFrame(
this);
187 fAddSelectionField =
new TGTextEntry(f5);
188 fAddSelectionField->Resize(57,20);
189 f5->AddFrame(fAddSelectionField,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
190 fAddSelection =
new TGTextButton(f5,
"Add");
191 fAddSelection->SetToolTipText(
"Add a new selection (Right click on the axes to add a range).");
192 f5->AddFrame(fAddSelection,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY,3,0,0,0));
193 fDeleteSelection =
new TGTextButton(f5,
"Delete",kDeleteSelection);
194 fDeleteSelection->SetToolTipText(
"Delete the current selection");
195 f5->AddFrame(fDeleteSelection,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY,3,0,0,0));
196 AddFrame(f5,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY,3,0,0,0));
198 TGHorizontalFrame *f7 =
new TGHorizontalFrame(
this);
199 fApplySelect =
new TGTextButton(f7,
"Apply to tree",kApplySelect);
200 fApplySelect->SetToolTipText(
"Generate an entry list for the current selection and apply it to the tree.");
201 f7->AddFrame(fApplySelect);
202 fUnApply =
new TGTextButton(f7,
"Reset tree",kUnApply);
203 fUnApply->SetToolTipText(
"Reset the tree entry list");
204 f7->AddFrame(fUnApply,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY,10,0,0,0));
205 AddFrame(f7,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY,0,0,3,0));
208 MakeTitle(
"Entries");
210 fPaintEntries =
new TGCheckButton(
this,
"Draw entries",kPaintEntries);
211 AddFrame(fPaintEntries);
212 fDelayDrawing =
new TGCheckButton(
this,
"Delay Drawing", kDelayDrawing);
213 AddFrame(fDelayDrawing);
215 fEntriesToDraw =
new TGDoubleHSlider(
this,140,kDoubleScaleNo,kEntriesToDraw);
216 AddFrame(fEntriesToDraw);
218 TGHorizontalFrame *f6 =
new TGHorizontalFrame(
this);
219 TGVerticalFrame *v1 =
new TGVerticalFrame(f6);
220 TGVerticalFrame *v2 =
new TGVerticalFrame(f6);
221 v1->AddFrame(
new TGLabel(v1,
"First entry:"));
222 fFirstEntry =
new TGNumberEntryField(v1, kFirstEntry, 0,
223 TGNumberFormat::kNESInteger,
224 TGNumberFormat::kNEANonNegative);
225 fFirstEntry->Resize(68,20);
226 v1->AddFrame(fFirstEntry);
227 v2->AddFrame(
new TGLabel(v2,
"# of entries:"));
228 fNentries =
new TGNumberEntryField(v2, kFirstEntry, 0,
229 TGNumberFormat::kNESInteger,
230 TGNumberFormat::kNEANonNegative);
231 fNentries->Resize(68,20);
232 v2->AddFrame(fNentries);
234 f6->AddFrame(v2,
new TGLayoutHints(kLHintsLeft,4,0,0,0));
237 AddFrame(
new TGLabel(
this,
"Weight cut:"));
239 TGHorizontalFrame *f8 =
new TGHorizontalFrame(
this);
240 fWeightCut =
new TGHSlider(f8,100,kSlider2|kScaleNo,kDotsSpacing);
241 fWeightCutField =
new TGNumberEntryField(f8,kDotsSpacingField, 0,
242 TGNumberFormat::kNESInteger,
243 TGNumberFormat::kNEANonNegative);
244 fWeightCutField->Resize(40,20);
245 f8->AddFrame(fWeightCut);
246 f8->AddFrame(fWeightCutField);
255 void TParallelCoordEditor::MakeVariablesTab()
257 fVarTab = CreateEditorTabSubFrame(
"Variables");
260 TGHorizontalFrame *f9 =
new TGHorizontalFrame(fVarTab);
261 fAddVariable =
new TGTextEntry(f9);
262 fAddVariable->Resize(71,20);
263 f9->AddFrame(fAddVariable,
new TGLayoutHints(kLHintsCenterY));
264 fButtonAddVar =
new TGTextButton(f9,
"Add");
265 fButtonAddVar->SetToolTipText(
"Add a new variable from the tree (must be a valid expression).");
266 f9->AddFrame(fButtonAddVar,
new TGLayoutHints(kLHintsCenterY,4,0,0,0));
267 fVarTab->AddFrame(f9);
269 TGHorizontalFrame *f10 =
new TGHorizontalFrame(fVarTab);
270 fVariables =
new TGComboBox(f10,kVariables);
271 fVariables->Resize(105,20);
272 f10->AddFrame(fVariables,
new TGLayoutHints(kLHintsCenterY));
273 fVarTab->AddFrame(f10,
new TGLayoutHints(kLHintsLeft,0,0,2,0));
275 TGHorizontalFrame *f12 =
new TGHorizontalFrame(fVarTab);
276 fDeleteVar =
new TGTextButton(f12,
"Delete",kDeleteVar);
277 fDeleteVar->SetToolTipText(
"Delete the current selected variable");
278 f12->AddFrame(fDeleteVar,
new TGLayoutHints(kLHintsCenterY,1,0,0,0));
279 fRenameVar =
new TGTextButton(f12,
"Rename",kRenameVar);
280 fRenameVar->SetToolTipText(
"Rename the current selected variable");
281 f12->AddFrame(fRenameVar,
new TGLayoutHints(kLHintsCenterY,4,0,0,0));
282 fVarTab->AddFrame(f12,
new TGLayoutHints(kLHintsLeft,0,0,2,0));
284 fVarTab->AddFrame(
new TGLabel(fVarTab,
"Axis histograms:"));
286 TGHorizontalFrame *f11 =
new TGHorizontalFrame(fVarTab);
287 TGVerticalFrame *v3 =
new TGVerticalFrame(f11);
288 TGVerticalFrame *v4 =
new TGVerticalFrame(f11);
289 v3->AddFrame(
new TGLabel(v3,
"Binning:"));
290 fHistBinning =
new TGNumberEntryField(v3, kHistWidth, 0,
291 TGNumberFormat::kNESInteger,
292 TGNumberFormat::kNEANonNegative);
293 fHistBinning->Resize(68,20);
294 v3->AddFrame(fHistBinning);
295 v4->AddFrame(
new TGLabel(v4,
"Width:"));
296 fHistWidth =
new TGNumberEntryField(v4, kHistWidth, 0,
297 TGNumberFormat::kNESInteger,
298 TGNumberFormat::kNEANonNegative);
299 fHistWidth->Resize(68,20);
300 v4->AddFrame(fHistWidth,
new TGLayoutHints(kLHintsLeft,4,0,0,0));
303 fVarTab->AddFrame(f11);
305 fHistShowBoxes =
new TGCheckButton(fVarTab,
"Show box histograms");
306 fVarTab->AddFrame(fHistShowBoxes);
308 fVarTab->AddFrame(
new TGLabel(fVarTab,
"Bar histograms style:"));
310 TGCompositeFrame *f13 =
new TGCompositeFrame(fVarTab, 80, 20, kHorizontalFrame);
311 fHistColorSelect =
new TGColorSelect(f13, 0, kHistColorSelect);
312 f13->AddFrame(fHistColorSelect,
new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
313 fHistColorSelect->Associate(
this);
314 fHistPatternSelect =
new TGedPatternSelect(f13, 1, kHistPatternSelect);
315 f13->AddFrame(fHistPatternSelect,
new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
316 fHistPatternSelect->Associate(
this);
317 fVarTab->AddFrame(f13,
new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
323 TParallelCoordEditor::~TParallelCoordEditor()
325 delete fLineTypePoly;
326 delete fLineTypeCurves;
332 void TParallelCoordEditor::CleanUpSelections()
334 TList *list = fParallel->GetSelectList();
335 fSelectionSelect->RemoveAll();
336 Bool_t enable = list->GetSize() > 0;
337 fSelectionSelect->SetEnabled(enable);
338 fSelectLineColor->SetEnabled(enable);
339 fSelectLineWidth->SetEnabled(enable);
340 fActivateSelection->SetEnabled(enable);
341 fShowRanges->SetEnabled(enable);
342 fDeleteSelection->SetEnabled(enable);
343 if (list->GetSize() > 0) {
346 TParallelCoordSelect* sel;
347 while ((sel = (TParallelCoordSelect*)next())) {
348 fSelectionSelect->AddEntry(sel->GetTitle(),i);
349 TGLBEntry *entry = fSelectionSelect->GetListBox()->GetEntry(i);
351 entry->SetBackgroundColor(TColor::Number2Pixel(sel->GetLineColor()));
354 sel = fParallel->GetCurrentSelection();
356 fSelectionSelect->Select(list->IndexOf(sel),kFALSE);
359 c = sel->GetLineColor();
360 p = TColor::Number2Pixel(c);
361 fSelectLineColor->SetColor(p);
362 fSelectLineWidth->Select(sel->GetLineWidth());
363 fActivateSelection->SetOn(sel->TestBit(TParallelCoordSelect::kActivated));
364 fShowRanges->SetOn(sel->TestBit(TParallelCoordSelect::kShowRanges));
372 void TParallelCoordEditor::CleanUpVariables()
374 TList *list = fParallel->GetVarList();
375 fVariables->RemoveAll();
376 Bool_t enable = list->GetSize() > 0;
377 fVariables->SetEnabled(enable);
378 fDeleteVar->SetEnabled(enable);
379 fHistShowBoxes->SetEnabled(enable);
380 fHistWidth->SetEnabled(enable);
381 fHistBinning->SetEnabled(enable);
382 if (list->GetSize() > 0) {
385 TParallelCoordVar* var;
386 while ((var = (TParallelCoordVar*)next())) {
387 fVariables->AddEntry(var->GetTitle(),i);
390 var = (TParallelCoordVar*)list->First();
391 fVariables->Select(0,kFALSE);
392 fHistShowBoxes->SetOn(var->TestBit(TParallelCoordVar::kShowBarHisto));
393 fHistWidth->SetNumber(var->GetHistLineWidth());
394 fHistBinning->SetNumber(var->GetHistBinning());
401 void TParallelCoordEditor::ConnectSignals2Slots()
403 fGlobalLineColor->Connect(
"ColorSelected(Pixel_t)",
"TParallelCoordEditor",
404 this,
"DoGlobalLineColor(Pixel_t)");
405 fGlobalLineWidth->Connect(
"Selected(Int_t)",
"TParallelCoordEditor",
406 this,
"DoGlobalLineWidth(Int_t)");
407 if (!TCanvas::SupportAlpha()) {
408 fDotsSpacing->Connect(
"Released()",
"TParallelCoordEditor",
409 this,
"DoDotsSpacing()");
410 fDotsSpacing->Connect(
"PositionChanged(Int_t)",
"TParallelCoordEditor",
411 this,
"DoLiveDotsSpacing(Int_t)");
412 fDotsSpacingField->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
413 this,
"DoDotsSpacingField()");
416 fAlpha->Connect(
"Released()",
"TParallelCoordEditor",
418 fAlpha->Connect(
"PositionChanged(Int_t)",
"TParallelCoordEditor",
419 this,
"DoLiveAlpha(Int_t)");
420 fAlphaField->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
421 this,
"DoAlphaField()");
423 fLineTypeBgroup->Connect(
"Clicked(Int_t)",
"TParallelCoordEditor",
424 this,
"DoLineType()");
425 fSelectionSelect->Connect(
"Selected(const char*)",
"TParallelCoordEditor",
426 this,
"DoSelectionSelect(const char*)");
427 fSelectLineColor->Connect(
"ColorSelected(Pixel_t)",
"TParallelCoordEditor",
428 this,
"DoSelectLineColor(Pixel_t)");
429 fSelectLineWidth->Connect(
"Selected(Int_t)",
"TParallelCoordEditor",
430 this,
"DoSelectLineWidth(Int_t)");
431 fActivateSelection->Connect(
"Toggled(Bool_t)",
"TParallelCoordEditor",
432 this,
"DoActivateSelection(Bool_t)");
433 fShowRanges->Connect(
"Toggled(Bool_t)",
"TParallelCoordEditor",
434 this,
"DoShowRanges(Bool_t)");
435 fDeleteSelection->Connect(
"Clicked()",
"TParallelCoordEditor",
436 this,
"DoDeleteSelection()");
437 fAddSelection->Connect(
"Clicked()",
"TParallelCoordEditor",
438 this,
"DoAddSelection()");
439 fPaintEntries->Connect(
"Toggled(Bool_t)",
"TParallelCoordEditor",
440 this,
"DoPaintEntries(Bool_t)");
441 fEntriesToDraw->Connect(
"Released()",
"TParallelCoordEditor",
442 this,
"DoEntriesToDraw()");
443 fEntriesToDraw->Connect(
"PositionChanged()",
"TParallelCoordEditor",
444 this,
"DoLiveEntriesToDraw()");
445 fFirstEntry->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
446 this,
"DoFirstEntry()");
447 fNentries->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
448 this,
"DoNentries()");
449 fApplySelect->Connect(
"Clicked()",
"TParallelCoordEditor",
450 this,
"DoApplySelect()");
451 fUnApply->Connect(
"Clicked()",
"TParallelCoordEditor",
452 this,
"DoUnApply()");
453 fDelayDrawing->Connect(
"Toggled(Bool_t)",
"TParallelCoordEditor",
454 this,
"DoDelayDrawing(Bool_t)");
455 fAddVariable->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
456 this,
"DoAddVariable()");
457 fButtonAddVar->Connect(
"Clicked()",
"TParallelCoordEditor",
458 this,
"DoAddVariable()");
459 fHideAllRanges->Connect(
"Toggled(Bool_t)",
"TParallelCoordEditor",
460 this,
"DoHideAllRanges(Bool_t)");
461 fVariables->Connect(
"Selected(const char*)",
"TParallelCoordEditor",
462 this,
"DoVariableSelect(const char*)");
463 fDeleteVar->Connect(
"Clicked()",
"TParallelCoordEditor",
464 this,
"DoDeleteVar()");
465 fHistWidth->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
466 this,
"DoHistWidth()");
467 fHistBinning->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
468 this,
"DoHistBinning()");
469 fWeightCut->Connect(
"Released()",
"TParallelCoordEditor",
470 this,
"DoWeightCut()");
471 fWeightCut->Connect(
"PositionChanged(Int_t)",
"TParallelCoordEditor",
472 this,
"DoLiveWeightCut(Int_t)");
473 fWeightCutField->Connect(
"ReturnPressed()",
"TParallelCoordEditor",
474 this,
"DoWeightCut()");
475 fHistColorSelect->Connect(
"ColorSelected(Pixel_t)",
"TParallelCoordEditor",
476 this,
"DoHistColorSelect(Pixel_t)");
477 fHistPatternSelect->Connect(
"PatternSelected(Style_t)",
"TParallelCoordEditor",
478 this,
"DoHistPatternSelect(Style_t)");
479 fHistShowBoxes->Connect(
"Toggled(Bool_t)",
"TParallelCoordEditor",
480 this,
"DoHistShowBoxes(Bool_t)");
488 void TParallelCoordEditor::DoActivateSelection(Bool_t on)
490 if (fAvoidSignal)
return;
492 TParallelCoordSelect* sel = fParallel->GetCurrentSelection();
494 sel->SetActivated(on);
502 void TParallelCoordEditor::DoAddSelection()
504 TString title = fAddSelectionField->GetText();
505 if (title ==
"") title =
"Selection";
506 TString titlebis = title;
507 Bool_t found = kTRUE;
510 if (fSelectionSelect->FindEntry(titlebis)) {
512 titlebis.Append(Form(
"(%d)",i));
518 fParallel->AddSelection(titlebis.Data());
526 void TParallelCoordEditor::DoAddVariable()
528 if (fAvoidSignal)
return;
530 fParallel->AddVariable(fAddVariable->GetText());
538 void TParallelCoordEditor::DoApplySelect()
543 if (fAvoidSignal)
return;
545 fParallel->ApplySelectionToTree();
553 void TParallelCoordEditor::DoDelayDrawing(Bool_t on)
555 if (fAvoidSignal)
return;
558 fParallel->SetLiveRangesUpdate(!on);
564 void TParallelCoordEditor::DoDeleteSelection()
566 if (fAvoidSignal)
return;
568 fParallel->DeleteSelection(fParallel->GetCurrentSelection());
577 void TParallelCoordEditor::DoDeleteVar()
579 if (fAvoidSignal)
return;
581 Bool_t hasDeleted = fParallel->RemoveVariable(((TGTextLBEntry*)fVariables->GetSelectedEntry())->GetTitle());
583 if (hasDeleted) Update();
589 void TParallelCoordEditor::DoDotsSpacing()
591 if (fAvoidSignal)
return;
593 fParallel->SetDotsSpacing(fDotsSpacing->GetPosition());
594 fDotsSpacingField->SetNumber((Int_t)fDotsSpacing->GetPosition());
601 void TParallelCoordEditor::DoDotsSpacingField()
603 if (fAvoidSignal)
return;
605 fParallel->SetDotsSpacing((Int_t)fDotsSpacingField->GetNumber());
606 fDotsSpacing->SetPosition((Int_t)fDotsSpacingField->GetNumber());
613 void TParallelCoordEditor::DoAlphaField()
615 if (fAvoidSignal)
return;
617 if (TColor *color = gROOT->GetColor(fParallel->GetLineColor())) {
618 color->SetAlpha((Float_t)fAlphaField->GetNumber());
619 fAlpha->SetPosition((Int_t)fAlphaField->GetNumber()*1000);
627 void TParallelCoordEditor::DoAlpha()
629 if (fAvoidSignal)
return;
631 if (TColor *color = gROOT->GetColor(fParallel->GetLineColor())) {
632 color->SetAlpha((Float_t)fAlpha->GetPosition()/1000);
633 fAlphaField->SetNumber((Float_t)fAlpha->GetPosition()/1000);
641 void TParallelCoordEditor::DoEntriesToDraw()
643 if (fAvoidSignal)
return;
645 Long64_t nentries,firstentry;
646 firstentry = (Long64_t)fEntriesToDraw->GetMinPosition();
647 nentries = (Long64_t)(fEntriesToDraw->GetMaxPosition() - fEntriesToDraw->GetMinPosition() + 1);
649 fParallel->SetCurrentFirst(firstentry);
650 fParallel->SetCurrentN(nentries);
657 void TParallelCoordEditor::DoFirstEntry()
659 if (fAvoidSignal)
return;
661 fParallel->SetCurrentFirst((Long64_t)fFirstEntry->GetNumber());
662 fEntriesToDraw->SetPosition((Long64_t)fFirstEntry->GetNumber(),(Long64_t)fFirstEntry->GetNumber()+fParallel->GetCurrentN());
669 void TParallelCoordEditor::DoGlobalLineColor(Pixel_t a)
671 if (fAvoidSignal)
return;
673 if (TColor *color = gROOT->GetColor(fParallel->GetLineColor())) {
675 color = gROOT->GetColor(TColor::GetColor(a));
677 color->SetAlpha((Float_t)fAlphaField->GetNumber());
678 fParallel->SetLineColor(color->GetNumber());
687 void TParallelCoordEditor::DoGlobalLineWidth(Int_t wid)
689 if (fAvoidSignal)
return;
691 fParallel->SetLineWidth(wid);
698 void TParallelCoordEditor::DoHideAllRanges(Bool_t on)
700 if (fAvoidSignal)
return;
702 TIter next(fParallel->GetSelectList());
703 TParallelCoordSelect* sel;
704 while((sel = (TParallelCoordSelect*)next())) sel->SetShowRanges(!on);
705 fShowRanges->SetOn(!on);
706 fShowRanges->SetEnabled(!on);
707 fShowRanges->SetOn(!on);
714 void TParallelCoordEditor::DoHistBinning()
716 if (fAvoidSignal)
return;
718 fParallel->SetAxisHistogramBinning((Int_t)fHistBinning->GetNumber());
725 void TParallelCoordEditor::DoHistColorSelect(Pixel_t p)
727 if (fAvoidSignal)
return;
729 Color_t col = TColor::GetColor(p);
730 TIter next(fParallel->GetVarList());
731 TParallelCoordVar *var = NULL;
732 while ((var = (TParallelCoordVar*)next())) var->SetFillColor(col);
739 void TParallelCoordEditor::DoHistShowBoxes(Bool_t s)
741 if (fAvoidSignal)
return;
743 TIter next(fParallel->GetVarList());
744 TParallelCoordVar* var;
745 while ((var = (TParallelCoordVar*)next())) var->SetBit(TParallelCoordVar::kShowBarHisto,s);
752 void TParallelCoordEditor::DoHistPatternSelect(Style_t sty)
754 if (fAvoidSignal)
return;
756 TIter next(fParallel->GetVarList());
757 TParallelCoordVar *var = NULL;
758 while ((var = (TParallelCoordVar*)next())) var->SetFillStyle(sty);
765 void TParallelCoordEditor::DoHistWidth()
767 if (fAvoidSignal)
return;
769 fParallel->SetAxisHistogramLineWidth((Int_t)fHistWidth->GetNumber());
776 void TParallelCoordEditor::DoLineType()
778 if (fAvoidSignal)
return;
780 if (fLineTypePoly->GetState() == kButtonDown) fParallel->SetCurveDisplay(kFALSE);
781 else fParallel->SetCurveDisplay(kTRUE);
788 void TParallelCoordEditor::DoLiveDotsSpacing(Int_t a)
790 if (fAvoidSignal)
return;
791 fDotsSpacingField->SetNumber(a);
792 fParallel->SetDotsSpacing(a);
793 if (!fDelay) Update();
799 void TParallelCoordEditor::DoLiveAlpha(Int_t a)
801 if (fAvoidSignal)
return;
802 fAlphaField->SetNumber((Float_t)a/1000);
804 if (TColor *color = gROOT->GetColor(fParallel->GetLineColor())) color->SetAlpha((Float_t)a/1000);
805 if (!fDelay) Update();
811 void TParallelCoordEditor::DoLiveEntriesToDraw()
813 if (fAvoidSignal)
return;
815 Long64_t nentries,firstentry;
816 firstentry = (Long64_t)fEntriesToDraw->GetMinPosition();
817 nentries = (Long64_t)(fEntriesToDraw->GetMaxPosition() - fEntriesToDraw->GetMinPosition() + 1);
819 fFirstEntry->SetNumber(firstentry);
820 fNentries->SetNumber(nentries);
823 fParallel->SetCurrentFirst(firstentry);
824 fParallel->SetCurrentN(nentries);
832 void TParallelCoordEditor::DoLiveWeightCut(Int_t n)
834 if (fAvoidSignal)
return;
836 fWeightCutField->SetNumber(n);
838 fParallel->SetWeightCut(n);
846 void TParallelCoordEditor::DoNentries()
848 if (fAvoidSignal)
return;
850 fParallel->SetCurrentN((Long64_t)fNentries->GetNumber());
851 fEntriesToDraw->SetPosition(fParallel->GetCurrentFirst(),fParallel->GetCurrentFirst()+fParallel->GetCurrentN());
858 void TParallelCoordEditor::DoPaintEntries(Bool_t on)
860 if (fAvoidSignal)
return;
862 fParallel->SetBit(TParallelCoord::kPaintEntries,on);
869 void TParallelCoordEditor::DoSelectLineColor(Pixel_t a)
871 if (fAvoidSignal)
return;
873 TParallelCoordSelect* sel = fParallel->GetCurrentSelection();
874 if (sel) sel->SetLineColor(TColor::GetColor(a));
875 fSelectionSelect->GetSelectedEntry()->SetBackgroundColor(a);
882 void TParallelCoordEditor::DoSelectLineWidth(Int_t wid)
884 if (fAvoidSignal)
return;
886 TParallelCoordSelect* sel = fParallel->GetCurrentSelection();
888 sel->SetLineWidth(wid);
896 void TParallelCoordEditor::DoSelectionSelect(
const char* title)
898 if (fAvoidSignal)
return;
900 if (!fParallel->SetCurrentSelection(title))
return;
902 Color_t c = fParallel->GetCurrentSelection()->GetLineColor();
903 Pixel_t p = TColor::Number2Pixel(c);
904 fSelectLineColor->SetColor(p,kFALSE);
906 fSelectLineWidth->Select(fParallel->GetCurrentSelection()->GetLineWidth(),kFALSE);
908 fActivateSelection->SetOn(fParallel->GetCurrentSelection()->TestBit(TParallelCoordSelect::kActivated));
909 fShowRanges->SetOn(fParallel->GetCurrentSelection()->TestBit(TParallelCoordSelect::kShowRanges));
915 void TParallelCoordEditor::DoShowRanges(Bool_t s)
917 if (fAvoidSignal)
return;
919 TParallelCoordSelect *select = fParallel->GetCurrentSelection();
921 select->SetShowRanges(s);
929 void TParallelCoordEditor::DoUnApply()
931 if (fAvoidSignal)
return;
933 fParallel->ResetTree();
941 void TParallelCoordEditor::DoVariableSelect(
const char* )
948 void TParallelCoordEditor::DoWeightCut()
950 if (fAvoidSignal)
return;
952 Int_t n = (Int_t)fWeightCutField->GetNumber();
953 fParallel->SetWeightCut(n);
960 void TParallelCoordEditor::SetModel(TObject* obj)
963 fParallel =
dynamic_cast<TParallelCoord*
>(obj);
964 if (!fParallel)
return;
965 fAvoidSignal = kTRUE;
967 Color_t c = fParallel->GetLineColor();
968 Pixel_t p = TColor::Number2Pixel(c);
969 fGlobalLineColor->SetColor(p);
971 fGlobalLineWidth->Select(fParallel->GetLineWidth());
973 fPaintEntries->SetOn(fParallel->TestBit(TParallelCoord::kPaintEntries));
975 if (!TCanvas::SupportAlpha()) {
976 fDotsSpacing->SetPosition(fParallel->GetDotsSpacing());
977 fDotsSpacingField->SetNumber(fParallel->GetDotsSpacing());
980 if (TColor *color = gROOT->GetColor(fParallel->GetLineColor())) {
981 fAlpha->SetPosition((Int_t)color->GetAlpha()*1000);
982 fAlphaField->SetNumber(color->GetAlpha());
986 Bool_t cur = fParallel->GetCurveDisplay();
987 if (cur) fLineTypeBgroup->SetButton(kLineTypeCurves,kTRUE);
988 else fLineTypeBgroup->SetButton(kLineTypePoly,kTRUE);
990 if (fInit) fHideAllRanges->SetOn(kFALSE);
995 if (fInit) fEntriesToDraw->SetRange(0,fParallel->GetNentries());
996 fEntriesToDraw->SetPosition(fParallel->GetCurrentFirst(), fParallel->GetCurrentFirst()+fParallel->GetCurrentN());
998 fFirstEntry->SetNumber(fParallel->GetCurrentFirst());
999 fNentries->SetNumber(fParallel->GetCurrentN());
1001 fDelayDrawing->SetOn(fDelay);
1003 fWeightCut->SetRange(0,(Int_t)(fParallel->GetNentries()/10));
1004 fWeightCut->SetPosition(fParallel->GetWeightCut());
1005 fWeightCutField->SetNumber(fParallel->GetWeightCut());
1007 fHistColorSelect->SetColor(TColor::Number2Pixel(((TParallelCoordVar*)fParallel->GetVarList()->Last())->GetFillColor()), kFALSE);
1008 fHistPatternSelect->SetPattern(((TParallelCoordVar*)fParallel->GetVarList()->Last())->GetFillStyle(),kFALSE);
1010 if (fInit) ConnectSignals2Slots();
1012 fAvoidSignal = kFALSE;