Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Scenery.h

Go to the documentation of this file.
00001 
00002 //
00003 // $Id: Scenery.h,v 1.4 2002/05/06 12:44:27 west Exp $
00004 //
00005 // Scenery
00006 //
00007 // Package: MIDAD
00008 //
00009 // Stuff that is added to a Scene
00010 //
00011 // Contact: bv@bnl.gov
00012 //
00013 // Created on: Sun Dec 16 14:17:59 2001
00014 //
00016 
00017 #ifndef MIDAD_SCENERY_H
00018 #define MIDAD_SCENERY_H
00019 
00020 #include "Midad/TScenery.h"
00021 #include "Midad/Watched.h"
00022 #include "Midad/Range.h"
00023 
00024 //#include "TObject.h"
00025 #include "TList.h"
00026 
00027 #include <string>
00028 #include <iostream>
00029 
00030 using std::cerr;
00031 
00032 class Registry;
00033 
00034 namespace Midad {
00035 class Scene;
00036 class SceneElement;
00037 
00038 class Scenery : public TScenery, public Watched
00039 {
00040 
00041 public:
00042 
00043     Scenery();
00044     virtual ~Scenery();
00045     
00046     // For sub classes to over ride.
00047     virtual string GetInfo() { return "Scenery"; }
00048     virtual void Configure(const Registry&) {}
00049     
00050     // Some signals:
00051     SigC::Signal1<void,TObject*> picked, entered, exited;
00052     
00053     // override TObject methods - sub classes should likely ignore these
00054     virtual void ExecuteEvent(int event, int px, int py);
00055     virtual void Draw(Option_t* option="");
00056     virtual void Paint(Option_t* option);
00057     virtual int DistancetoPrimitive(int px, int py);
00058 
00059     TList* GetPrimitiveList() { return fPrimitiveList; }
00060 
00061     // Called in Scene::Add()
00062     virtual void SetScene(Scene* scene) { fScene = scene; } 
00063 
00064     RangeDouble2D GetBounds() { return fBounds; }
00065 
00066     Scene* GetScene() { return fScene; }
00067 
00068     // TScenery methods
00069     virtual void Burp() 
00070         { cerr << "Default burp from: " << this->GetName() << endl; }
00071 
00072 protected:
00073 
00074     // For calling by sub classes
00075     void ClearPrimitives();
00076     void AddPrimitive(TObject* obj);
00077 
00078 private:
00079     void InitBounds();
00080     void AddToBounds(SceneElement* se);
00081 
00082     TList* fPrimitiveList;
00083     TObject* fHotObject;
00084 
00085     Scene* fScene;
00086     
00087     RangeDouble2D fBounds;
00088 };                              // end of class Scenery
00089 
00090 Scenery* Midad::MakeScenery(const char* name);
00091 }
00092 #endif  // MIDAD_SCENERY_H

Generated on Wed Sep 4 19:01:20 2002 for loon by doxygen1.2.16