CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Fireworks/FWInterface/src/FWFFNavigator.h

Go to the documentation of this file.
00001 #ifndef Fireworks_FWInterface_FWFFNavigator_h
00002 #define Fireworks_FWInterface_FWFFNavigator_h
00003 
00004 #include "Fireworks/Core/interface/FWNavigatorBase.h"
00005 #include "FWCore/Framework/interface/Event.h"
00006 
00007 namespace edm
00008 {
00009    class EventBase;
00010 }
00011 
00012 class FWFFNavigator : public FWNavigatorBase
00013 {
00014 public:
00015    enum FWFFNavigatorState {
00016       kNoTransition,
00017       kNextEvent,
00018       kPreviousEvent,
00019       kFirstEvent,
00020       kLastEvent
00021    };
00022 
00023    FWFFNavigator(CmsShowMainBase &main)
00024       : FWNavigatorBase(main),
00025         m_currentEvent(0),
00026         m_currentTransition(kNoTransition)
00027       {}
00028    // Discard configuration for the time being.
00029    virtual void addTo(FWConfiguration&) const {}
00030    virtual void setFrom(const FWConfiguration&) {}
00031 
00032    virtual void nextEvent();
00033    virtual void previousEvent();
00034    // nextSelectedEvent and nextEvent are the same thing
00035    // for full framework, since there is no filtering. 
00036    virtual bool nextSelectedEvent() { nextEvent(); return true; }
00037    virtual bool previousSelectedEvent() { previousEvent(); return true; }
00038    
00039    // FIXME: for the time being there is no way to go to 
00040    //        first / last event.
00041    virtual void firstEvent();
00042    virtual void lastEvent();
00043    // FIXME: does not do anything for the time being.
00044    virtual void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t) {}
00045    // Notice that we have no way to tell whether the current one
00046    // is the last event in a stream.
00047    virtual bool isLastEvent() {return false;}
00048    virtual bool isFirstEvent() {return m_currentEvent->id() == m_firstEventID; }
00049    // FIXME: we need to change the API of the baseclass first.
00050    virtual const edm::EventBase* getCurrentEvent() const { return m_currentEvent; }
00051    // The number of selected events is always the total number of event.
00052    virtual int getNSelectedEvents() { return getNTotalEvents(); }
00053    // FIXME: I guess there is no way to tell how many events
00054    //        we have.
00055    virtual int getNTotalEvents() { return 0; }
00056 
00057    // Use to set the event from the framework.
00058    void setCurrentEvent(const edm::Event *);
00059    const edm::EventID &getFirstEventID();
00060    enum FWFFNavigatorState currentTransition() { return m_currentTransition; }
00061    void resetTransition() { m_currentTransition = kNoTransition; }
00062 private:
00063    const edm::Event     *m_currentEvent;
00064    edm::EventID         m_firstEventID;
00065    enum FWFFNavigatorState m_currentTransition;
00066 };
00067 
00068 #endif