Added parameter 'Width_t fWidth' to TrackRnrStyle and a method to change width of...
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Oct 2006 16:18:46 +0000 (16:18 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Oct 2006 16:18:46 +0000 (16:18 +0000)
EVE/Reve/Track.cxx
EVE/Reve/Track.h
EVE/Reve/TrackEditors.cxx
EVE/Reve/TrackEditors.h

index 7bd7235..d43d196 100644 (file)
@@ -260,6 +260,7 @@ TrackRnrStyle::TrackRnrStyle() :
   TObject(),
 
   fColor(1),
+  fWidth(1),
   fMagField(fgDefMagField),
 
   fMaxR  (350),
@@ -395,6 +396,17 @@ void TrackList::MakeMarkers()
 /**************************************************************************/
 /*************************************************************************/
 
+void TrackList::SetWidth(Width_t w)
+{
+  Width_t oldw = fRnrStyle->fWidth;
+  fRnrStyle->fWidth = w;
+  for (lpRE_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+    Track& t = *((Track*)(*i));
+    if (t.GetLineWidth() == oldw)
+      t.SetLineWidth(w);
+  }
+}
+
 void TrackList::SetMaxR(Float_t x)
 {
   fRnrStyle->fMaxR = x;
index c835ef9..b6d6d00 100644 (file)
@@ -92,6 +92,7 @@ class TrackRnrStyle : public TObject
 {
 public:
   Color_t                  fColor;
+  Width_t                  fWidth;
   Float_t                  fMagField;  
   // track limits
   Float_t                  fMaxR;       
@@ -168,6 +169,9 @@ public:
   void   MakeTracks();
   void   MakeMarkers();
 
+  Width_t GetWidth() const { return fRnrStyle->fWidth; }
+  void SetWidth(Width_t w);
+
   Float_t GetMaxR()         const { return fRnrStyle->fMaxZ; }
   Float_t GetMaxZ()         const { return fRnrStyle->fMaxR; }
   Float_t GetMaxOrbs()      const { return fRnrStyle->fMaxOrbs; }
index 2bab8e4..c63e420 100644 (file)
@@ -13,6 +13,7 @@
 #include <TGNumberEntry.h>
 #include <TGColorSelect.h>
 #include <TGDoubleSlider.h>
+#include "TGComboBox.h"
 
 using namespace Reve;
 
@@ -119,14 +120,23 @@ TrackListEditor::TrackListEditor(const TGWindow *p,
 
   // --- Rendering control
 
-  fRnrTracks = new TGCheckButton(this, "Render tracks");
-  AddFrame(fRnrTracks, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
-  fRnrTracks->Connect
-    ("Toggled(Bool_t)",
-     "Reve::TrackListEditor", this, "DoRnrTracks()");
+  {
+    TGHorizontalFrame* f = new TGHorizontalFrame(this);
+    fRnrTracks = new TGCheckButton(f, "Render tracks");
+    f->AddFrame(fRnrTracks, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 0));
+    fRnrTracks->Connect
+      ("Toggled(Bool_t)", "Reve::TrackListEditor", this, "DoRnrTracks()");
+    fWidthCombo = new TGLineWidthComboBox(f);
+    fWidthCombo->Resize(80, 18);
+    f->AddFrame(fWidthCombo, new TGLayoutHints(kLHintsLeft, 8, 1, 0, 0));
+
+    fWidthCombo->Connect
+      ("Selected(Int_t)", "Reve::TrackListEditor", this, "DoLineWidth(Int_t)"); 
+    AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 3, 0));
+  }
 
   fRnrMarkers = new TGCheckButton(this, "Render markers");
-  AddFrame(fRnrMarkers, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+  AddFrame(fRnrMarkers, new TGLayoutHints(kLHintsTop, 3, 1, 2, 0));
   fRnrMarkers->Connect
     ("Toggled(Bool_t)",
      "Reve::TrackListEditor", this, "DoRnrMarkers()");  
@@ -134,11 +144,11 @@ TrackListEditor::TrackListEditor(const TGWindow *p,
   // --- Kinematics fitting
 
   fFitDaughters = new TGCheckButton(this, "Fit daughters");
-  AddFrame(fFitDaughters, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+  AddFrame(fFitDaughters, new TGLayoutHints(kLHintsTop, 3, 1, 2, 0));
   fFitDaughters->Connect("Toggled(Bool_t)","Reve::TrackListEditor", this, "DoFitDaughters()");
 
   fFitDecay = new TGCheckButton(this, "Fit decay");
-  AddFrame(fFitDecay, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+  AddFrame(fFitDecay, new TGLayoutHints(kLHintsTop, 3, 1, 2, 0));
   fFitDecay->Connect("Toggled(Bool_t)","Reve::TrackListEditor", this, "DoFitDecay()");  
 
   // --- Selectors
@@ -168,6 +178,8 @@ void TrackListEditor::SetModel(TObject* obj)
   fMinAng->SetNumber(fTC->GetMinAng());
   fDelta->SetNumber(fTC->GetDelta());
 
+  fWidthCombo->Select(fTC->GetWidth());
+
   fRnrTracks->SetState(fTC->GetRnrTracks() ? kButtonDown : kButtonUp);
   fRnrMarkers->SetState(fTC->GetRnrMarkers() ? kButtonDown : kButtonUp);
 
@@ -212,6 +224,14 @@ void TrackListEditor::DoDelta()
 
 /**************************************************************************/
 
+void TrackListEditor::DoLineWidth(Int_t width)
+{
+  fTC->SetWidth(width);
+  Update();
+}
+
+/**************************************************************************/
+
 void TrackListEditor::DoRnrTracks()
 {
   fTC->SetRnrTracks(fRnrTracks->IsOn());
index 6b8a2f1..3b510be 100644 (file)
@@ -8,6 +8,7 @@
 class TGCheckButton;
 class TGNumberEntry;
 class TGColorSelect;
+class TGLineWidthComboBox;
 
 namespace Reve {
 
@@ -30,6 +31,8 @@ protected:
   TGNumberEntry*     fMinAng;
   TGNumberEntry*     fDelta;
 
+  TGLineWidthComboBox* fWidthCombo;
+
   TGCheckButton*     fRnrTracks;
   TGCheckButton*     fRnrMarkers;
 
@@ -51,6 +54,8 @@ public:
   void DoMinAng();
   void DoDelta();
 
+  void DoLineWidth(Int_t width);
+
   void DoRnrTracks();
   void DoRnrMarkers();