TEveLineEditor.cxx

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveLineEditor.cxx 25422 2008-09-16 20:50:49Z 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 "TEveLineEditor.h"
00013 #include "TEveLine.h"
00014 
00015 #include "TVirtualPad.h"
00016 #include "TColor.h"
00017 
00018 #include "TGLabel.h"
00019 #include "TGButton.h"
00020 #include "TGNumberEntry.h"
00021 #include "TGColorSelect.h"
00022 #include "TGDoubleSlider.h"
00023 
00024 //==============================================================================
00025 //==============================================================================
00026 // TEveLineEditor
00027 //==============================================================================
00028 
00029 //______________________________________________________________________________
00030 //
00031 // Editor for TEveLine class.
00032 
00033 ClassImp(TEveLineEditor);
00034 
00035 //______________________________________________________________________________
00036 TEveLineEditor::TEveLineEditor(const TGWindow *p, Int_t width, Int_t height,
00037                                UInt_t options, Pixel_t back) :
00038    TGedFrame  (p, width, height, options | kVerticalFrame, back),
00039    fM         (0),
00040    fRnrLine   (0),
00041    fRnrPoints (0),
00042    fSmooth    (0)
00043 {
00044    // Constructor.
00045 
00046    fPriority = 20;
00047    {
00048       TGHorizontalFrame* f = new TGHorizontalFrame(this);
00049 
00050       fRnrPoints = new TGCheckButton(f, "Draw Marker");
00051       f->AddFrame(fRnrPoints, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
00052       fRnrPoints->Connect("Toggled(Bool_t)"," TEveLineEditor", this, "DoRnrPoints()");
00053 
00054       fRnrLine  = new TGCheckButton(f, "Draw Line");
00055       f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
00056       fRnrLine->Connect("Toggled(Bool_t)", "TEveLineEditor", this, "DoRnrLine()");
00057 
00058       AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
00059    }
00060    fSmooth  = new TGCheckButton(this, "Smooth line");
00061    AddFrame(fSmooth, new TGLayoutHints(kLHintsNormal, 2,1,2,1));
00062    fSmooth->Connect("Toggled(Bool_t)", "TEveLineEditor", this, "DoSmooth()");
00063 }
00064 
00065 /******************************************************************************/
00066 
00067 //______________________________________________________________________________
00068 void TEveLineEditor::SetModel(TObject* obj)
00069 {
00070    // Set model object.
00071 
00072    fM = dynamic_cast<TEveLine*>(obj);
00073 
00074    fRnrLine  ->SetState(fM->fRnrLine  ? kButtonDown : kButtonUp);
00075    fRnrPoints->SetState(fM->fRnrPoints ? kButtonDown : kButtonUp);
00076    fSmooth->SetState(fM->fSmooth ? kButtonDown : kButtonUp);
00077 }
00078 
00079 /******************************************************************************/
00080 
00081 //______________________________________________________________________________
00082 void TEveLineEditor::DoRnrLine()
00083 {
00084    // Slot for RnrLine.
00085 
00086    fM->SetRnrLine(fRnrLine->IsOn());
00087    Update();
00088 }
00089 
00090 //______________________________________________________________________________
00091 void TEveLineEditor::DoRnrPoints()
00092 {
00093    // Slot for RnrPoints.
00094 
00095    fM->SetRnrPoints(fRnrPoints->IsOn());
00096    Update();
00097 }
00098 
00099 //______________________________________________________________________________
00100 void TEveLineEditor::DoSmooth()
00101 {
00102    // Slot for anti-alias.
00103 
00104    fM->SetSmooth(fSmooth->IsOn());
00105    Update();
00106 }

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