CMS 3D CMS Logo

VisCaloGeometryTwig Class Reference

#include <VisFramework/VisEventSetup/interface/VisCaloGeometryTwig.h>

Inheritance diagram for VisCaloGeometryTwig:

VisQueuedTwig IgSimpleTwig VisEventObserver IgCompoundTwig IgTwig IgRepresentable

List of all members.

Public Member Functions

virtual void onNewEvent (const edm::Event &event, const edm::EventSetup &eventSetup)
virtual void update (IgLegoRep *rep)
virtual void update (IgRZRep *rep)
virtual void update (IgRPhiRep *rep)
virtual void update (Ig3DRep *rep)
virtual void update (IgTextRep *rep)
 VisCaloGeometryTwig (IgState *state, IgTwig *parent, const std::string &name="", const std::string detId="", const int subdetn=-1)
virtual ~VisCaloGeometryTwig (void)
 Clean the scene graph.

Private Member Functions

void invalidate (void)

Private Attributes

SoSeparator * m_3dDet
bool m_3Ddone
VisAnnotateGeometry m_annotate
const std::string m_detId
SoSeparator * m_legoDet
bool m_legodone
SoSeparator * m_rphiDet
bool m_rphidone
SoSeparator * m_rzDet
bool m_rzdone
VisLegoScale m_scale
const int m_subdetn


Detailed Description

Definition at line 26 of file VisCaloGeometryTwig.h.


Constructor & Destructor Documentation

VisCaloGeometryTwig::VisCaloGeometryTwig ( IgState state,
IgTwig parent,
const std::string &  name = "",
const std::string  detId = "",
const int  subdetn = -1 
)

Definition at line 23 of file VisCaloGeometryTwig.cc.

00026     : VisQueuedTwig (state, parent, name),
00027       m_detId (detId),
00028       m_subdetn (subdetn),
00029       m_3dDet (NULL),
00030       m_rzDet (NULL),
00031       m_rphiDet (NULL),
00032       m_legoDet (NULL),
00033       m_3Ddone (false),
00034       m_rzdone (false),
00035       m_rphidone (false),
00036       m_legodone (false),
00037       m_annotate (state, lat::CreateCallback (this, &VisCaloGeometryTwig::invalidate)),
00038       m_scale (state, lat::CreateCallback (this, &VisCaloGeometryTwig::invalidate))
00039 {}

VisCaloGeometryTwig::~VisCaloGeometryTwig ( void   )  [virtual]

Clean the scene graph.

Definition at line 42 of file VisCaloGeometryTwig.cc.

References m_3dDet, m_legoDet, m_rphiDet, m_rzDet, and NULL.

00043 {
00044     if (m_3dDet != NULL) m_3dDet->unref ();
00045     if (m_rzDet != NULL) m_rzDet->unref ();
00046     if (m_rphiDet != NULL) m_rphiDet->unref ();
00047     if (m_legoDet != NULL) m_legoDet->unref ();
00048 }


Member Function Documentation

void VisCaloGeometryTwig::invalidate ( void   )  [private]

Definition at line 65 of file VisCaloGeometryTwig.cc.

References m_3dDet, m_3Ddone, m_legoDet, m_legodone, m_rphiDet, m_rphidone, m_rzDet, m_rzdone, NULL, and VisQueuedTwig::onBaseInvalidate().

Referenced by onNewEvent().

00066 {      
00067     if (m_3dDet != NULL) m_3dDet->unref ();
00068     if (m_rzDet != NULL) m_rzDet->unref ();
00069     if (m_rphiDet != NULL) m_rphiDet->unref ();
00070     if (m_legoDet != NULL) m_legoDet->unref ();
00071     m_3Ddone = false;    
00072     m_rzdone = false;
00073     m_rphidone = false;
00074     m_legodone = false;    
00075 
00076     VisQueuedTwig::onBaseInvalidate ();
00077 }

void VisCaloGeometryTwig::onNewEvent ( const edm::Event event,
const edm::EventSetup eventSetup 
) [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 51 of file VisCaloGeometryTwig.cc.

References ASSERT, VisEventSetupService::caloGeomChanged(), DBSPlugin::get(), invalidate(), VisQueuedTwig::onNewEvent(), and VisQueuedTwig::state().

00053 {
00054     // Get debugging dump.
00055     VisQueuedTwig::onNewEvent (event, eventSetup);
00056 
00057     VisEventSetupService *esService = VisEventSetupService::get (state ());
00058     ASSERT (esService);
00059 
00060     if (esService->caloGeomChanged ())
00061         invalidate ();
00062 }

void VisCaloGeometryTwig::update ( IgLegoRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 208 of file VisCaloGeometryTwig.cc.

References ASSERT, VisEventSetupService::buildLegoDet(), Ig3DBaseRep::clear(), DBSPlugin::get(), m_legoDet, m_legodone, m_scale, m_subdetn, Ig3DBaseRep::node(), NULL, VisQueuedTwig::state(), VisQueuedTwig::update(), and VisActiveConfigurable< T >::value().

00209 {
00210     // Get debugging dump.
00211     VisQueuedTwig::update (rep);    
00212 
00213     IgQtLock ();
00214     rep->clear ();
00215 
00216     if ((! m_legodone) && (m_subdetn == -1))
00217     {
00218         VisEventSetupService *esService = VisEventSetupService::get (state ());
00219         ASSERT (esService);
00220 
00221         m_legoDet = esService->buildLegoDet (m_scale.value ());
00222         m_legoDet->ref ();
00223         m_legodone = true;
00224     }
00225 
00226     if (m_legoDet != NULL) 
00227         rep->node ()->addChild (m_legoDet);
00228 }

void VisCaloGeometryTwig::update ( IgRZRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 176 of file VisCaloGeometryTwig.cc.

References VisEventSetupService::annotateCaloDet(), ASSERT, VisEventSetupService::buildCaloDet(), Ig3DBaseRep::clear(), DBSPlugin::get(), m_annotate, m_detId, m_rzDet, m_rzdone, m_subdetn, Ig3DBaseRep::node(), NULL, VisEventSetupService::RZDet, VisQueuedTwig::state(), VisQueuedTwig::update(), and VisActiveConfigurable< T >::value().

00177 {
00178     // Get debugging dump.
00179     VisQueuedTwig::update (rep);
00180 
00181     IgQtLock ();
00182     rep->clear ();
00183 
00184     if (m_subdetn != -1)
00185     {
00186         if (! m_rzdone)
00187         {
00188             VisEventSetupService *esService = VisEventSetupService::get (state ());
00189             ASSERT (esService);
00190 
00191             m_rzDet = esService->buildCaloDet (VisEventSetupService::RZDet, m_detId, m_subdetn);
00192             if (m_rzDet == NULL) return;
00193 
00194             if (m_annotate.value ()) 
00195             {       
00196                 SoSeparator *sep = esService->annotateCaloDet (VisEventSetupService::RZDet, m_detId, m_subdetn);
00197                 if (sep != NULL) m_rzDet->addChild (sep);
00198             }
00199         
00200             m_rzDet->ref ();
00201             m_rzdone = true;
00202         }
00203         rep->node ()->addChild (m_rzDet);
00204     }
00205 }

void VisCaloGeometryTwig::update ( IgRPhiRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 144 of file VisCaloGeometryTwig.cc.

References VisEventSetupService::annotateCaloDet(), ASSERT, VisEventSetupService::buildCaloDet(), Ig3DBaseRep::clear(), DBSPlugin::get(), m_annotate, m_detId, m_rphiDet, m_rphidone, m_subdetn, Ig3DBaseRep::node(), NULL, VisEventSetupService::RPhiDet, VisQueuedTwig::state(), VisQueuedTwig::update(), and VisActiveConfigurable< T >::value().

00145 {
00146     // Get debugging dump.
00147     VisQueuedTwig::update (rep);
00148 
00149     IgQtLock ();
00150     rep->clear ();
00151 
00152     if (m_subdetn != -1)
00153     {
00154         if (! m_rphidone)
00155         {
00156             VisEventSetupService *esService = VisEventSetupService::get (state ());
00157             ASSERT (esService);
00158 
00159             m_rphiDet = esService->buildCaloDet (VisEventSetupService::RPhiDet, m_detId, m_subdetn);
00160             if (m_rphiDet == NULL) return;
00161 
00162             if (m_annotate.value ())
00163             {       
00164                 SoSeparator *sep = esService->annotateCaloDet (VisEventSetupService::RPhiDet, m_detId, m_subdetn);
00165                 if (sep != NULL) m_rphiDet->addChild (sep);         
00166             }
00167 
00168             m_rphiDet->ref ();
00169             m_rphidone = true;
00170         }
00171         rep->node ()->addChild (m_rphiDet);
00172     }    
00173 }

void VisCaloGeometryTwig::update ( Ig3DRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 112 of file VisCaloGeometryTwig.cc.

References VisEventSetupService::annotateCaloDet(), ASSERT, VisEventSetupService::buildCaloDet(), Ig3DBaseRep::clear(), VisEventSetupService::FullDet, DBSPlugin::get(), m_3dDet, m_3Ddone, m_annotate, m_detId, m_subdetn, Ig3DBaseRep::node(), NULL, VisQueuedTwig::state(), VisQueuedTwig::update(), and VisActiveConfigurable< T >::value().

00113 {
00114     // Get debugging dump.
00115     VisQueuedTwig::update (rep);
00116 
00117     IgQtLock ();
00118     rep->clear ();
00119 
00120     if (m_subdetn != -1)
00121     {
00122         if (! m_3Ddone)
00123         {
00124             VisEventSetupService *esService = VisEventSetupService::get (state ());
00125             ASSERT (esService);
00126 
00127             m_3dDet = esService->buildCaloDet (VisEventSetupService::FullDet, m_detId, m_subdetn);
00128             if (m_3dDet == NULL) return;
00129 
00130             if (m_annotate.value ())
00131             {       
00132                 SoSeparator *sep = esService->annotateCaloDet (VisEventSetupService::FullDet, m_detId, m_subdetn);
00133                 if (sep != NULL) m_3dDet->addChild (sep);           
00134             }
00135         
00136             m_3dDet->ref ();
00137             m_3Ddone = true;    
00138         }
00139         rep->node ()->addChild (m_3dDet);
00140     }    
00141 }

void VisCaloGeometryTwig::update ( IgTextRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 80 of file VisCaloGeometryTwig.cc.

References ASSERT, VisEventSetupService::caloTextRep(), DBSPlugin::get(), m_detId, m_subdetn, IgSimpleTwig::name(), IgTextRep::setText(), VisQueuedTwig::state(), and VisQueuedTwig::update().

00081 {
00082     // Get debugging dump.
00083     VisQueuedTwig::update (rep);
00084 
00085     // Prepare property description.
00086     std::ostringstream  text;
00087     text << "CMS Calo Geometry: ";
00088     text << this->name () << "<br>";
00089     
00090     text << "<table width='100%' border=1>"
00091          << "<TR align = center>"
00092          << "<TH>#</TH>"
00093          << "<TH>id(dec)</TH>"
00094          << "<TH>Position</TH>"
00095          << "</TR>";
00096 
00097     if (m_subdetn != -1)
00098     {
00099         VisEventSetupService *esService = VisEventSetupService::get (state ());
00100         ASSERT (esService);
00101         text << esService->caloTextRep (m_detId, m_subdetn);
00102     }
00103     else
00104         text << "<TR align = right><TD COLSPAN = 3>Only LEGO view is available for this twig.</TD></TR>";
00105     text << "</table>";
00106 
00107     IgQtLock ();
00108     rep->setText (text.str ());
00109 }


Member Data Documentation

SoSeparator* VisCaloGeometryTwig::m_3dDet [private]

Definition at line 53 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), update(), and ~VisCaloGeometryTwig().

bool VisCaloGeometryTwig::m_3Ddone [private]

Definition at line 57 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), and update().

VisAnnotateGeometry VisCaloGeometryTwig::m_annotate [private]

Definition at line 61 of file VisCaloGeometryTwig.h.

Referenced by update().

const std::string VisCaloGeometryTwig::m_detId [private]

Definition at line 51 of file VisCaloGeometryTwig.h.

Referenced by update().

SoSeparator* VisCaloGeometryTwig::m_legoDet [private]

Definition at line 56 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), update(), and ~VisCaloGeometryTwig().

bool VisCaloGeometryTwig::m_legodone [private]

Definition at line 60 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), and update().

SoSeparator* VisCaloGeometryTwig::m_rphiDet [private]

Definition at line 55 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), update(), and ~VisCaloGeometryTwig().

bool VisCaloGeometryTwig::m_rphidone [private]

Definition at line 59 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), and update().

SoSeparator* VisCaloGeometryTwig::m_rzDet [private]

Definition at line 54 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), update(), and ~VisCaloGeometryTwig().

bool VisCaloGeometryTwig::m_rzdone [private]

Definition at line 58 of file VisCaloGeometryTwig.h.

Referenced by invalidate(), and update().

VisLegoScale VisCaloGeometryTwig::m_scale [private]

Definition at line 62 of file VisCaloGeometryTwig.h.

Referenced by update().

const int VisCaloGeometryTwig::m_subdetn [private]

Definition at line 52 of file VisCaloGeometryTwig.h.

Referenced by update().


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