#include <Scenery.h>
Inheritance diagram for Midad::Scenery:
Public Methods | |
Scenery () | |
virtual | ~Scenery () |
virtual string | GetInfo () |
virtual void | Configure (const Registry &) |
virtual void | ExecuteEvent (int event, int px, int py) |
virtual void | Draw (Option_t *option="") |
virtual void | Paint (Option_t *option) |
virtual int | DistancetoPrimitive (int px, int py) |
TList * | GetPrimitiveList () |
virtual void | SetScene (Scene *scene) |
RangeDouble2D | GetBounds () |
Scene * | GetScene () |
virtual void | Burp () |
Public Attributes | |
SigC::Signal1< void, TObject * > | picked |
SigC::Signal1< void, TObject * > | entered |
SigC::Signal1< void, TObject * > | exited |
Protected Methods | |
void | ClearPrimitives () |
void | AddPrimitive (TObject *obj) |
Private Methods | |
void | InitBounds () |
void | AddToBounds (SceneElement *se) |
Private Attributes | |
TList * | fPrimitiveList |
TObject * | fHotObject |
Scene * | fScene |
RangeDouble2D | fBounds |
|
Definition at line 12 of file Scenery.cxx.
00012 : fPrimitiveList(new TList), fScene(0) { } |
|
Definition at line 14 of file Scenery.cxx. References fPrimitiveList.
00015 { 00016 fPrimitiveList->Delete(); 00017 delete fPrimitiveList; 00018 } |
|
Definition at line 79 of file Scenery.cxx. References AddToBounds(), and fPrimitiveList. Referenced by Midad::TrackListScenery::Configure(), Midad::GeomScenery::Configure(), Midad::DigitListScenery::Configure(), and MyScenery::Diddle().
00080 { 00081 // cerr << "Scenery::Add primitive\n"; 00082 fPrimitiveList->Add(obj); 00083 SceneElement* se = dynamic_cast<SceneElement*>(obj); 00084 if (se) this->AddToBounds(se); 00085 } |
|
Definition at line 93 of file Scenery.cxx. References fBounds, Midad::SceneElement::GetBounds(), Range2D< double >::x, and Range2D< double >::y. Referenced by AddPrimitive().
|
|
Implements TScenery. Definition at line 69 of file Scenery.h.
00070 { cerr << "Default burp from: " << this->GetName() << endl; } |
|
Definition at line 72 of file Scenery.cxx. References fPrimitiveList, and InitBounds(). Referenced by Midad::TrackListScenery::Configure(), Midad::GeomScenery::Configure(), Midad::DigitListScenery::Configure(), and MyScenery::Diddle().
00073 { 00074 // cerr << "Scenery::Clear primitives\n"; 00075 fPrimitiveList->Delete(); 00076 this->InitBounds(); 00077 } |
|
Reimplemented in Midad::DigitListScenery. Definition at line 48 of file Scenery.h.
00048 {} |
|
Definition at line 43 of file Scenery.cxx. References fHotObject, and fPrimitiveList. Referenced by ExecuteEvent().
00044 { 00045 TIter next(fPrimitiveList); 00046 TObject* obj; 00047 int mindist = 999999; 00048 while ((obj=next())) { 00049 int dist = obj->DistancetoPrimitive(px,py); 00050 if (mindist > dist) { 00051 mindist = dist; 00052 fHotObject = obj; 00053 } 00054 } 00055 return mindist; 00056 } |
|
Definition at line 58 of file Scenery.cxx. References Draw(), and option. Referenced by Midad::Scene::Add().
00059 { 00060 // cerr << "Scenery::Draw\n"; 00061 this->TScenery::Draw(option); 00062 } |
|
Definition at line 20 of file Scenery.cxx. References DistancetoPrimitive(), entered, exited, fHotObject, INFO, and picked.
00021 { 00022 #if 0 00023 INFO << "Got event #" << event << " at [" << px << "," << py 00024 << "], \"hot\" object is: " << fHotObject->GetName() << endl; 00025 #endif 00026 switch (event) { 00027 case kButton1Up: 00028 if (this->DistancetoPrimitive(px,py) > 0) 00029 this->exited.emit(fHotObject); 00030 else this->picked.emit(fHotObject); 00031 break; 00032 case kMouseLeave: 00033 this->exited.emit(fHotObject); 00034 break; 00035 case kMouseEnter: 00036 this->entered.emit(fHotObject); 00037 break; 00038 } 00039 00040 } |
|
Definition at line 64 of file Scenery.h. References fBounds. Referenced by Midad::Scene::Add().
00064 { return fBounds; } |
|
Definition at line 47 of file Scenery.h. Referenced by Midad::Display::ShowSceneryInfo().
00047 { return "Scenery"; } |
|
Definition at line 59 of file Scenery.h. References fPrimitiveList.
00059 { return fPrimitiveList; } |
|
Definition at line 66 of file Scenery.h. References fScene. Referenced by Midad::TrackSceneElement::Configure(), Midad::HitBinSE::Configure(), Midad::Hit2dSE::Configure(), Midad::GeomOutlineSceneElement::Configure(), Midad::DLSUVZImp::CreatePrimitives(), and Midad::DLSBinImp::CreatePrimitives().
00066 { return fScene; } |
|
Definition at line 87 of file Scenery.cxx. References fBounds, Range2D< double >::x, and Range2D< double >::y. Referenced by ClearPrimitives().
|
|
Definition at line 64 of file Scenery.cxx. References fPrimitiveList, and option.
00065 { 00066 // cerr << "Scenery::Paint: painting: " << this->GetName() << endl; 00067 gPad->SetBit(TGraph::kClipFrame,true); 00068 fPrimitiveList->Paint(option); 00069 gPad->ResetBit(TGraph::kClipFrame); 00070 } |
|
Reimplemented in Midad::DigitListScenery. Definition at line 62 of file Scenery.h. References fScene. Referenced by Midad::Scene::Add().
00062 { fScene = scene; } |
|
Definition at line 51 of file Scenery.h. Referenced by ExecuteEvent(). |
|
Definition at line 51 of file Scenery.h. Referenced by ExecuteEvent(). |
|
Definition at line 87 of file Scenery.h. Referenced by AddToBounds(), GetBounds(), and InitBounds(). |
|
Definition at line 83 of file Scenery.h. Referenced by DistancetoPrimitive(), and ExecuteEvent(). |
|
Definition at line 82 of file Scenery.h. Referenced by AddPrimitive(), ClearPrimitives(), DistancetoPrimitive(), GetPrimitiveList(), Paint(), and ~Scenery(). |
|
|
|
Definition at line 51 of file Scenery.h. Referenced by ExecuteEvent(). |