CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

FWEveDetectorGeo Class Reference

#include <FWEveDetectorGeo.h>

Inheritance diagram for FWEveDetectorGeo:
FWGeoTopNode

List of all members.

Public Types

enum  MenuOptions {
  kGeoSetTopNode, kGeoSetTopNodeCam, kGeoVisOn, kGeoVisOff,
  kGeoInspectMaterial, kGeoInspectShape, kGeoCamera
}

Public Member Functions

 FWEveDetectorGeo (FWGeometryTableView *v)
virtual TString GetHighlightTooltip ()
virtual void Paint (Option_t *option="")
virtual void popupMenu (int x, int y)
virtual
FWGeometryTableManagerBase
tableManager ()
virtual ~FWEveDetectorGeo ()

Private Member Functions

 ClassDef (FWEveDetectorGeo, 0)
void paintChildNodesRecurse (FWGeometryTableManagerBase::Entries_i pIt, Int_t idx, const TGeoHMatrix &mtx)

Private Attributes

FWGeometryTableViewm_browser
bool m_filterOff
int m_maxLevel

Detailed Description

Definition at line 10 of file FWEveDetectorGeo.h.


Member Enumeration Documentation

Enumerator:
kGeoSetTopNode 
kGeoSetTopNodeCam 
kGeoVisOn 
kGeoVisOff 
kGeoInspectMaterial 
kGeoInspectShape 
kGeoCamera 

Definition at line 14 of file FWEveDetectorGeo.h.


Constructor & Destructor Documentation

FWEveDetectorGeo::FWEveDetectorGeo ( FWGeometryTableView v)

Definition at line 13 of file FWEveDetectorGeo.cc.

                                                        :
   m_browser(v), m_maxLevel(0), m_filterOff(0)
{
} 
virtual FWEveDetectorGeo::~FWEveDetectorGeo ( ) [inline, virtual]

Definition at line 25 of file FWEveDetectorGeo.h.

{}

Member Function Documentation

FWEveDetectorGeo::ClassDef ( FWEveDetectorGeo  ,
 
) [private]
TString FWEveDetectorGeo::GetHighlightTooltip ( ) [virtual]
void FWEveDetectorGeo::Paint ( Option_t *  option = "") [virtual]

Reimplemented from FWGeoTopNode.

Definition at line 24 of file FWEveDetectorGeo.cc.

References FWGeometryTableView::getFilter(), FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableManagerBase::getLevelOffset(), FWGeometryTableManagerBase::getNodeMatrix(), FWGeometryTableView::getTableManager(), FWGeometryTableViewBase::getTopNodeIdx(), FWGeometryTableView::getVisLevel(), FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeSelf, m_browser, m_filterOff, m_maxLevel, paintChildNodesRecurse(), FWGeoTopNode::paintShape(), FWGeometryTableManagerBase::refEntries(), and tableManager().

{
   FWGeoTopNode::Paint();

   //   printf("PAINPAINTPAINTPAINTPAINTPAINTPAINTPAINTPAINTPAINTT  %d/%d \n",  m_browser->getTopNodeIdx(),  (int)m_browser->getTableManager()->refEntries().size());
   if (m_browser->getTableManager()->refEntries().empty()) return; 

   TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());

   m_maxLevel = m_browser->getVisLevel() + m_browser->getTableManager()->getLevelOffset();
   m_filterOff = m_browser->getFilter().empty();

   Int_t topIdx = m_browser->getTopNodeIdx();
   FWGeometryTableManagerBase::Entries_i sit = m_browser->getTableManager()->refEntries().begin(); 

   TGeoHMatrix mtx;
   if (topIdx >= 0)
   {
      std::advance(sit, topIdx);
      m_browser->getTableManager()->getNodeMatrix(*sit, mtx);

      if (sit->testBit(FWGeometryTableManagerBase::kVisNodeSelf) && ((FWGeometryTableManager*)tableManager())->getVisibility(*sit))
         paintShape(*sit,  topIdx,mtx, m_browser->getVolumeMode() );
   }

   if ( ((FWGeometryTableManager*)tableManager())->getVisibilityChld(*sit))
      paintChildNodesRecurse( sit, topIdx, mtx);
}
void FWEveDetectorGeo::paintChildNodesRecurse ( FWGeometryTableManagerBase::Entries_i  pIt,
Int_t  idx,
const TGeoHMatrix &  mtx 
) [private]

Definition at line 55 of file FWEveDetectorGeo.cc.

References FWGeometryTableView::getIgnoreVisLevelWhenFilter(), FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kExpanded, m_browser, m_filterOff, m_maxLevel, n, FWGeoTopNode::paintShape(), and tableManager().

Referenced by Paint().

{ 
   TGeoNode* parentNode =  pIt->m_node;
   int nD = parentNode->GetNdaughters();

   int dOff=0;

   pIt++;
   int pcnt = cnt+1;

   FWGeometryTableManagerBase::Entries_i it;
   for (int n = 0; n != nD; ++n)
   {
      it =  pIt;
      std::advance(it,n + dOff);
      cnt = pcnt + n+dOff;

      TGeoHMatrix nm = parentMtx;
      nm.Multiply(it->m_node->GetMatrix());

  
      if (m_filterOff)
      {
         if ( ((FWGeometryTableManager*)tableManager())->getVisibility(*it))
            paintShape(*it, cnt , nm, m_browser->getVolumeMode() );

         if  ( ((FWGeometryTableManager*)tableManager())->getVisibilityChld(*it) && ( it->m_level < m_maxLevel  || it->testBit(FWGeometryTableManagerBase::kExpanded) )) {
            paintChildNodesRecurse(it,cnt , nm);
         }

      }
      else
      {
         if ( ((FWGeometryTableManager*)tableManager())->getVisibility(*it))
            paintShape(*it,cnt , nm, m_browser->getVolumeMode()  );

         if ( ((FWGeometryTableManager*)tableManager())->getVisibilityChld(*it) && ( it->m_level < m_maxLevel || m_browser->getIgnoreVisLevelWhenFilter() ))
         {
            paintChildNodesRecurse(it,cnt , nm);
         }
      }


      FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);  
   }
}
void FWEveDetectorGeo::popupMenu ( int  x,
int  y 
) [virtual]

Reimplemented from FWGeoTopNode.

Definition at line 120 of file FWEveDetectorGeo.cc.

References FWGeoTopNode::fSted, fwLog, FWGeoTopNode::getFirstSelectedTableIndex(), kGeoCamera, kGeoInspectShape, kGeoSetTopNode, kGeoSetTopNodeCam, kGeoVisOff, kGeoVisOn, fwlog::kInfo, and m_browser.

{  
   if (getFirstSelectedTableIndex() < 0)
   {
      if (fSted.empty()) fwLog(fwlog::kInfo) << "No menu -- no node/entry selected \n";
      return;
   }
   
   FWPopupMenu* nodePopup = new FWPopupMenu();
   nodePopup->AddEntry("Set As Top Node", kGeoSetTopNode);
   nodePopup->AddEntry("Set As Top Node And Camera Center", kGeoSetTopNodeCam);
   nodePopup->AddSeparator();
   nodePopup->AddEntry("Rnr Off For All Children", kGeoVisOff);
   nodePopup->AddEntry("Rnr On For All Children", kGeoVisOn);
   nodePopup->AddSeparator();
   nodePopup->AddEntry("Set Camera Center", kGeoCamera);
   nodePopup->AddSeparator();
   //   nodePopup->AddEntry("InspectMaterial", kGeoInspectMaterial); crashes !!!
   nodePopup->AddEntry("InspectShape", kGeoInspectShape);

   nodePopup->PlaceMenu(x, y,true,true);
   nodePopup->Connect("Activated(Int_t)",
                      "FWGeometryTableView",
                       m_browser,
                      "chosenItem(Int_t)");
}
FWGeometryTableManagerBase * FWEveDetectorGeo::tableManager ( ) [virtual]

Reimplemented from FWGeoTopNode.

Definition at line 18 of file FWEveDetectorGeo.cc.

References FWGeometryTableView::getTableManager(), and m_browser.

Referenced by Paint(), and paintChildNodesRecurse().

{
   return m_browser->getTableManager();
}

Member Data Documentation

Definition at line 39 of file FWEveDetectorGeo.h.

Referenced by Paint(), and paintChildNodesRecurse().

Definition at line 38 of file FWEveDetectorGeo.h.

Referenced by Paint(), and paintChildNodesRecurse().