CMS 3D CMS Logo

VisDetIvTwig Class Reference

#include <VisReco/VisDetector/interface/VisDetIvTwig.h>

Inheritance diagram for VisDetIvTwig:

IgSimpleTwig IgCompoundTwig IgTwig IgRepresentable

List of all members.

Public Types

enum  VisDetectorRep { VisAllDet, Vis3DDet, VisRPhiDet, VisRZDet }

Public Member Functions

virtual void update (IgRZRep *rep)
virtual void update (IgRPhiRep *rep)
virtual void update (Ig3DRep *rep)
 Update object.
virtual void update (IgTextRep *rep)
 Update object property description.
 VisDetIvTwig (IgState *state, IgTwig *parent, std::string name, std::string fileName1, std::string fileName2="", std::string fileName3="")
 ~VisDetIvTwig (void)

Private Member Functions

SoNode * emptyNode (void)

Private Attributes

std::vector< SoNode * > m_dets
bool m_done3D
bool m_doneRPhi
bool m_doneRZ
std::string m_name


Detailed Description

Definition at line 23 of file VisDetIvTwig.h.


Member Enumeration Documentation

enum VisDetIvTwig::VisDetectorRep

Enumerator:
VisAllDet 
Vis3DDet 
VisRPhiDet 
VisRZDet 

Definition at line 26 of file VisDetIvTwig.h.


Constructor & Destructor Documentation

VisDetIvTwig::VisDetIvTwig ( IgState state,
IgTwig parent,
std::string  name,
std::string  fileName1,
std::string  fileName2 = "",
std::string  fileName3 = "" 
)

Definition at line 33 of file VisDetIvTwig.cc.

References ASSERT, emptyNode(), find(), IgTwig::fullName(), DBSPlugin::get(), edm::ParameterSet::getUntrackedParameter(), Ig3DShapeManager::lookup(), m_dets, btau_dummy::none, VisConfigurationService::pSet(), python::EventAnalyzer_cfg::pset, and IgSimpleTwig::selfVisible().

00036     : IgSimpleTwig (parent, name, true, false, true),
00037       m_name (name)
00038 {    
00039     Ig3DShapeManager *shapeManager = Ig3DShapeManager::get (state);
00040     ASSERT (shapeManager);
00041     
00042     SoNode *none = emptyNode ();
00043     
00044     SoNode *det3d = shapeManager->lookup (fileName1);
00045     if (det3d) 
00046     {
00047         m_dets.push_back (det3d);
00048         m_dets.back ()->ref ();
00049     }
00050     else
00051     {
00052         m_dets.push_back (none);
00053         m_dets.back ()->ref ();
00054     }
00055     
00056     
00057     SoNode *detRPhi = shapeManager->lookup (fileName2);
00058     if (detRPhi) 
00059     {
00060         m_dets.push_back (detRPhi);
00061         m_dets.back ()->ref ();
00062     }
00063     else
00064     {
00065         m_dets.push_back (none);
00066         m_dets.back ()->ref ();
00067     }
00068     
00069     SoNode *detRZ = shapeManager->lookup (fileName3);
00070     if (detRZ) 
00071     { 
00072         m_dets.push_back (detRZ);
00073         m_dets.back ()->ref ();
00074     }
00075     else
00076     {
00077         m_dets.push_back (none);
00078         m_dets.back ()->ref ();
00079     }
00080     
00081     const edm::ParameterSet *pset = VisConfigurationService::pSet ();
00082     if (pset)
00083     {
00084         std::vector<std::string> twigs;
00085         twigs = pset->getUntrackedParameter<std::vector<std::string> > ("EnabledTwigs", twigs);
00086         if (std::find (twigs.begin (), twigs.end (), fullName ()) != twigs.end ())
00087             selfVisible (true);
00088     }
00089 }

VisDetIvTwig::~VisDetIvTwig ( void   ) 

Definition at line 91 of file VisDetIvTwig.cc.

References i, and m_dets.

00092 {
00093     for (std::vector<SoNode *>::iterator i = m_dets.begin (), iEnd = m_dets.end (); i != iEnd; ++i) 
00094     {
00095         (*i)->unref ();
00096     }
00097     m_dets.clear ();
00098 }


Member Function Documentation

SoNode * VisDetIvTwig::emptyNode ( void   )  [private]

Definition at line 154 of file VisDetIvTwig.cc.

References in, IV_NONE, SiStripLorentzAngle_cfi::read, and HLT_VtxMuL3::result.

Referenced by VisDetIvTwig().

00155 {
00156     SoInput in;
00157     in.putBack (IV_NONE);
00158     
00159     SoNode *result;
00160     SoDB::read (&in, result);
00161     
00162     return result;
00163 }

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

Definition at line 142 of file VisDetIvTwig.cc.

References Ig3DBaseRep::clear(), m_dets, and Ig3DBaseRep::node().

00143 {
00144     IgQtLock ();
00145 
00146     if (m_dets.size () >= 3)
00147     {   
00148         rep->clear ();
00149         rep->node ()->addChild (m_dets [2]);
00150     }
00151 }

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

Definition at line 130 of file VisDetIvTwig.cc.

References Ig3DBaseRep::clear(), m_dets, and Ig3DBaseRep::node().

00131 {
00132     IgQtLock ();
00133 
00134     if (m_dets.size () >= 2)
00135     {   
00136         rep->clear ();
00137         rep->node ()->addChild (m_dets [1]);
00138     }
00139 }

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

Update object.

Definition at line 117 of file VisDetIvTwig.cc.

References Ig3DBaseRep::clear(), m_dets, and Ig3DBaseRep::node().

00118 {
00119     // Send it over.
00120     IgQtLock ();
00121 
00122     if (m_dets.size () > 0)
00123     {
00124         rep->clear ();
00125         rep->node ()->addChild (m_dets [0]);
00126     }
00127 }

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

Update object property description.

Definition at line 102 of file VisDetIvTwig.cc.

References m_name, and IgTextRep::setText().

00103 {
00104     // Prepare the property description.
00105     std::ostringstream text;
00106     text << "<table width='100%'><tr><td>" << m_name << "</td><td>"
00107          << "</table>";
00108     
00109     // Send it over.
00110     IgQtLock ();
00111 
00112     rep->setText (text.str ());
00113 }


Member Data Documentation

std::vector<SoNode *> VisDetIvTwig::m_dets [private]

Definition at line 43 of file VisDetIvTwig.h.

Referenced by update(), VisDetIvTwig(), and ~VisDetIvTwig().

bool VisDetIvTwig::m_done3D [private]

Definition at line 44 of file VisDetIvTwig.h.

bool VisDetIvTwig::m_doneRPhi [private]

Definition at line 45 of file VisDetIvTwig.h.

bool VisDetIvTwig::m_doneRZ [private]

Definition at line 46 of file VisDetIvTwig.h.

std::string VisDetIvTwig::m_name [private]

Reimplemented from IgSimpleTwig.

Definition at line 42 of file VisDetIvTwig.h.

Referenced by update().


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