CMS 3D CMS Logo

VisRootModel Class Reference

#include <VisRoot/VisRootModel/interface/VisRootModel.h>

Inheritance diagram for VisRootModel:

IgModel

List of all members.

Public Types

enum  { ModelChanged }
typedef IgDispatcher
< VisRootModelEvent
Dispatcher

Public Member Functions

void canvas (TCanvas *canvas)
TCanvas * canvas (void)
void changed (void)
Dispatcherdispatcher (unsigned int eventType)
TVirtualPad * getCurrentVecElement ()
unsigned int getNextPad (void)
std::vector< TVirtualPad * > getVec ()
void pad (TVirtualPad *pad)
TVirtualPad * pad (void)
void resetVec ()
void setCanvasSubdivisions (unsigned int x, unsigned int y)
void setPad (TVirtualPad *p, unsigned int n)
IgStatestate (void)
void trackRep (VisRootRep *rep)
void untrackRep (VisRootRep *rep)
 VisRootModel (IgState *state)
 ~VisRootModel (void)

Private Attributes

TCanvas * m_canvas
unsigned int m_currentPad
unsigned int m_maxPads
Dispatcherm_modelChangedDispatcher
TVirtualPad * m_pad
std::set< VisRootRep * > m_repSet
IgStatem_state
std::vector< TVirtualPad * > m_vec


Detailed Description

Definition at line 25 of file VisRootModel.h.


Member Typedef Documentation

typedef IgDispatcher<VisRootModelEvent> VisRootModel::Dispatcher

Definition at line 28 of file VisRootModel.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
ModelChanged 

Definition at line 29 of file VisRootModel.h.

00029 {ModelChanged};


Constructor & Destructor Documentation

VisRootModel::VisRootModel ( IgState state  ) 

Definition at line 20 of file VisRootModel.cc.

References m_currentPad.

00021     : m_state (state),
00022       m_canvas (0),
00023       m_modelChangedDispatcher (new Dispatcher)
00024 {
00025     m_currentPad = 0;
00026     
00027 }

VisRootModel::~VisRootModel ( void   ) 

Definition at line 29 of file VisRootModel.cc.

References i, m_repSet, and untrackRep().

00030 {
00031     for (std::set<VisRootRep *>::iterator i = m_repSet.begin ();
00032          i != m_repSet.end ();
00033          i++)
00034     {
00035         untrackRep (*i);
00036         delete *i;      
00037     }    
00038 }


Member Function Documentation

void VisRootModel::canvas ( TCanvas *  canvas  ) 

Definition at line 48 of file VisRootModel.cc.

References m_canvas.

00049 {
00050     m_canvas = canvas;
00051 }

TCanvas * VisRootModel::canvas ( void   ) 

Definition at line 42 of file VisRootModel.cc.

References m_canvas.

Referenced by VisHtmlRootBrowser::getJPGBuffer(), VisHtmlRootBrowser::VisHtmlRootBrowser(), and VisRootBrowser::VisRootBrowser().

00043 {
00044     return m_canvas;    
00045 }

void VisRootModel::changed ( void   ) 

Definition at line 79 of file VisRootModel.cc.

References IgDispatcher< Message >::broadcast(), dispatcher(), event(), and ModelChanged.

00080 {
00081     VisRootModelEvent event (this);    
00082     dispatcher (ModelChanged)->broadcast (event);    
00083 }

VisRootModel::Dispatcher * VisRootModel::dispatcher ( unsigned int  eventType  ) 

Definition at line 73 of file VisRootModel.cc.

References m_modelChangedDispatcher.

Referenced by changed(), VisHtmlRootBrowser::VisHtmlRootBrowser(), and VisRootBrowser::VisRootBrowser().

00074 {
00075     return m_modelChangedDispatcher;    
00076 }

TVirtualPad * VisRootModel::getCurrentVecElement ( void   ) 

Definition at line 104 of file VisRootModel.cc.

References m_currentPad, m_maxPads, and m_vec.

00105 {
00106     m_currentPad %= (m_maxPads);
00107     m_currentPad++;
00108    
00109     return (m_vec.at (m_currentPad-1));
00110  }

unsigned int VisRootModel::getNextPad ( void   ) 

Definition at line 113 of file VisRootModel.cc.

References m_currentPad, and m_maxPads.

00114 {
00115     m_currentPad++;
00116     m_currentPad %= (m_maxPads + 1);
00117     return m_currentPad;
00118 }

std::vector< TVirtualPad * > VisRootModel::getVec (  ) 

Definition at line 140 of file VisRootModel.cc.

References m_vec.

00141 {
00142     return m_vec;    
00143 }

void VisRootModel::pad ( TVirtualPad *  pad  ) 

Definition at line 60 of file VisRootModel.cc.

References m_pad.

00061 {
00062     m_pad = pad;
00063 }

TVirtualPad * VisRootModel::pad ( void   ) 

Definition at line 54 of file VisRootModel.cc.

References m_pad.

00055 {
00056     return m_pad;    
00057 }

void VisRootModel::resetVec (  ) 

Definition at line 127 of file VisRootModel.cc.

References m_vec.

00128 {
00129     m_vec.clear ();    
00130 }

void VisRootModel::setCanvasSubdivisions ( unsigned int  x,
unsigned int  y 
)

Definition at line 86 of file VisRootModel.cc.

References ASSERT, m_canvas, m_currentPad, and m_maxPads.

00087 {
00088     ASSERT (m_canvas);
00089     m_canvas->Clear ();    
00090     m_canvas->cd ();    
00091     m_canvas->Divide (x, y);
00092     m_maxPads = x * y;
00093     m_currentPad = 0;   
00094 }

void VisRootModel::setPad ( TVirtualPad *  p,
unsigned int  n 
)

Definition at line 97 of file VisRootModel.cc.

References m_maxPads, and m_vec.

00098 {
00099     m_vec.push_back (p);
00100     m_maxPads = nChildren;
00101 }

IgState * VisRootModel::state ( void   ) 

Definition at line 66 of file VisRootModel.cc.

References m_state.

00067 {
00068     return m_state;
00069 }

void VisRootModel::trackRep ( VisRootRep rep  ) 

Definition at line 121 of file VisRootModel.cc.

References m_repSet.

Referenced by VisRootRep::VisRootRep().

00122 {
00123     m_repSet.insert (rep);    
00124 }

void VisRootModel::untrackRep ( VisRootRep rep  ) 

Definition at line 133 of file VisRootModel.cc.

References ASSERT, and m_repSet.

Referenced by ~VisRootModel(), and VisRootRep::~VisRootRep().

00134 {
00135     ASSERT (m_repSet.find (rep) != m_repSet.end ());    
00136     m_repSet.erase (rep);    
00137 }


Member Data Documentation

TCanvas* VisRootModel::m_canvas [private]

Definition at line 54 of file VisRootModel.h.

Referenced by canvas(), and setCanvasSubdivisions().

unsigned int VisRootModel::m_currentPad [private]

Definition at line 60 of file VisRootModel.h.

Referenced by getCurrentVecElement(), getNextPad(), setCanvasSubdivisions(), and VisRootModel().

unsigned int VisRootModel::m_maxPads [private]

Definition at line 59 of file VisRootModel.h.

Referenced by getCurrentVecElement(), getNextPad(), setCanvasSubdivisions(), and setPad().

Dispatcher* VisRootModel::m_modelChangedDispatcher [private]

Definition at line 58 of file VisRootModel.h.

Referenced by dispatcher().

TVirtualPad* VisRootModel::m_pad [private]

Definition at line 57 of file VisRootModel.h.

Referenced by pad().

std::set<VisRootRep *> VisRootModel::m_repSet [private]

Definition at line 61 of file VisRootModel.h.

Referenced by trackRep(), untrackRep(), and ~VisRootModel().

IgState* VisRootModel::m_state [private]

Definition at line 53 of file VisRootModel.h.

Referenced by state().

std::vector<TVirtualPad *> VisRootModel::m_vec [private]

Definition at line 55 of file VisRootModel.h.

Referenced by getCurrentVecElement(), getVec(), resetVec(), and setPad().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:36 2009 for CMSSW by  doxygen 1.5.4