00001
00002
00003
00004
00005
00006
00007
00008
00009
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
00027
00028
00029
00030
00031
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
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
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
00085
00086 fM->SetRnrLine(fRnrLine->IsOn());
00087 Update();
00088 }
00089
00090
00091 void TEveLineEditor::DoRnrPoints()
00092 {
00093
00094
00095 fM->SetRnrPoints(fRnrPoints->IsOn());
00096 Update();
00097 }
00098
00099
00100 void TEveLineEditor::DoSmooth()
00101 {
00102
00103
00104 fM->SetSmooth(fSmooth->IsOn());
00105 Update();
00106 }