TEvePointSetArrayEditor.cxx

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEvePointSetArrayEditor.cxx 30254 2009-09-18 17:24:24Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "TEvePointSetArrayEditor.h"
00013 #include "TEvePointSet.h"
00014 #include "TEveGValuators.h"
00015 
00016 #include "TVirtualPad.h"
00017 #include "TColor.h"
00018 
00019 #include "TGLabel.h"
00020 #include "TGButton.h"
00021 #include "TGNumberEntry.h"
00022 #include "TGColorSelect.h"
00023 #include "TGDoubleSlider.h"
00024 
00025 //______________________________________________________________________________
00026 //
00027 // Editor for TEvePointSetArray class.
00028 
00029 ClassImp(TEvePointSetArrayEditor);
00030 
00031 //______________________________________________________________________________
00032 TEvePointSetArrayEditor::TEvePointSetArrayEditor(const TGWindow *p,
00033                                                  Int_t width, Int_t height,
00034                                                  UInt_t options, Pixel_t back) :
00035    TGedFrame(p,width, height, options | kVerticalFrame, back),
00036    fM(0),
00037    fRange(0)
00038 {
00039    // Constructor.
00040 
00041    fM = 0;
00042    MakeTitle("TEvePointSetArray");
00043 
00044    fRange = new TEveGDoubleValuator(this,"Range", 200, 0);
00045    fRange->SetNELength(6);
00046    fRange->Build();
00047    fRange->GetSlider()->SetWidth(224);
00048    fRange->Connect("ValueSet()",
00049                    "TEvePointSetArrayEditor", this, "DoRange()");
00050    AddFrame(fRange, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
00051 }
00052 
00053 //______________________________________________________________________________
00054 TEvePointSetArrayEditor::~TEvePointSetArrayEditor()
00055 {
00056    // Destructor.
00057 }
00058 
00059 /******************************************************************************/
00060 
00061 //______________________________________________________________________________
00062 void TEvePointSetArrayEditor::SetModel(TObject* obj)
00063 {
00064    // Set model object.
00065 
00066    fM = dynamic_cast<TEvePointSetArray*>(obj);
00067 
00068    // printf("FullRange(%f, %f) Selected(%f,%f)\n",
00069    //        fM->GetMin(), fM->GetMax(), fM->GetCurMin(), fM->GetCurMax());
00070 
00071    fRange->SetLimits(fM->fMin, fM->fMax, TGNumberFormat::kNESRealTwo);
00072    fRange->SetValues(fM->fCurMin, fM->fCurMax);
00073 }
00074 
00075 /******************************************************************************/
00076 
00077 //______________________________________________________________________________
00078 void TEvePointSetArrayEditor::DoRange()
00079 {
00080    // Slot for setting the range of the separating quantity.
00081 
00082    fM->SetRange(fRange->GetMin(), fRange->GetMax());
00083    Update();
00084 }

Generated on Tue Jul 5 14:16:13 2011 for ROOT_528-00b_version by  doxygen 1.5.1