CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FWGeometryTableManager Class Reference

#include <Fireworks/Core/interface/FWGeometryTableManager.h>

Inheritance diagram for FWGeometryTableManager:
FWGeometryTableManagerBase FWTableManagerBase

List of all members.

Classes

struct  Match

Public Types

enum  ECol {
  kNameColumn, kColorColumn, kTranspColumn, kVisSelfColumn,
  kVisChildColumn, kMaterialColumn, kNumColumn
}
enum  GeometryBits { kMatches = BIT(5), kChildMatches = BIT(6), kFilterCached = BIT(7) }
typedef Volumes_t::iterator Volumes_i
typedef boost::unordered_map
< TGeoVolume *, Match
Volumes_t

Public Member Functions

void assertNodeFilterCache (NodeInfo &data)
virtual FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const
void checkChildMatches (TGeoVolume *v, std::vector< TGeoVolume * > &)
void checkHierarchy ()
void checkRegionOfInterest (double *center, double radius, long algo)
 FWGeometryTableManager (FWGeometryTableView *)
virtual bool getVisibility (const NodeInfo &nodeInfo) const
virtual bool getVisibilityChld (const NodeInfo &nodeInfo) const
void importChildren (int parent_idx)
void loadGeometry (TGeoNode *iGeoTopNode, TObjArray *iVolumes)
virtual int numberOfColumns () const
 Number of columns in the table.
void printMaterials ()
virtual void recalculateVisibility ()
void recalculateVisibilityNodeRec (int)
void recalculateVisibilityVolumeRec (int)
void resetRegionOfInterest ()
virtual void setDaughtersSelfVisibility (int i, bool v)
virtual void setVisibility (NodeInfo &nodeInfo, bool)
virtual void setVisibilityChld (NodeInfo &nodeInfo, bool)
void updateFilter (int)
virtual ~FWGeometryTableManager ()

Protected Member Functions

virtual const char * cellName (const NodeInfo &data) const
virtual bool nodeIsParent (const NodeInfo &) const

Private Member Functions

 FWGeometryTableManager (const FWGeometryTableManager &)
const FWGeometryTableManageroperator= (const FWGeometryTableManager &)

Private Attributes

FWGeometryTableViewm_browser
bool m_filterOff
Volumes_t m_volumes

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 32 of file FWGeometryTableManager.h.


Member Typedef Documentation

typedef Volumes_t::iterator FWGeometryTableManager::Volumes_i

Definition at line 55 of file FWGeometryTableManager.h.

typedef boost::unordered_map<TGeoVolume*, Match> FWGeometryTableManager::Volumes_t

Definition at line 54 of file FWGeometryTableManager.h.


Member Enumeration Documentation

Enumerator:
kNameColumn 
kColorColumn 
kTranspColumn 
kVisSelfColumn 
kVisChildColumn 
kMaterialColumn 
kNumColumn 

Definition at line 35 of file FWGeometryTableManager.h.

Enumerator:
kMatches 
kChildMatches 
kFilterCached 

Definition at line 37 of file FWGeometryTableManager.h.

   {
      kMatches         =  BIT(5),
      kChildMatches    =  BIT(6),
      kFilterCached    =  BIT(7)
   };

Constructor & Destructor Documentation

FWGeometryTableManager::FWGeometryTableManager ( FWGeometryTableView v)

Definition at line 29 of file FWGeometryTableManager.cc.

FWGeometryTableManager::~FWGeometryTableManager ( ) [virtual]

Definition at line 35 of file FWGeometryTableManager.cc.

{}
FWGeometryTableManager::FWGeometryTableManager ( const FWGeometryTableManager ) [private]

Member Function Documentation

void FWGeometryTableManager::assertNodeFilterCache ( NodeInfo data)

Definition at line 424 of file FWGeometryTableManager.cc.

References kChildMatches, FWGeometryTableManagerBase::kExpanded, kFilterCached, kMatches, FWGeometryTableManagerBase::NodeInfo::m_node, m_volumes, FWGeometryTableManagerBase::NodeInfo::setBit(), FWGeometryTableManagerBase::NodeInfo::setBitVal(), setVisibility(), setVisibilityChld(), and FWGeometryTableManagerBase::NodeInfo::testBit().

Referenced by recalculateVisibility(), recalculateVisibilityNodeRec(), recalculateVisibilityVolumeRec(), and updateFilter().

{
   if (! data.testBit(kFilterCached))
   {
      bool matches = m_volumes[data.m_node->GetVolume()].m_matches;
     // if (matches) printf("%s matches filter \n", data.name());
      data.setBitVal(kMatches, matches);
      setVisibility(data, matches);

      bool childMatches = m_volumes[data.m_node->GetVolume()].m_childMatches;
      data.setBitVal(kChildMatches, childMatches);
      data.setBitVal(kExpanded, childMatches);
      setVisibilityChld(data, childMatches);

      data.setBit(kFilterCached);
      //  printf("%s matches [%d] childMatches [%d] ................ %d %d \n", data.name(), data.testBit(kMatches), data.testBit(kChildMatches), matches , childMatches);
   }
}
const char * FWGeometryTableManager::cellName ( const NodeInfo data) const [protected, virtual]

Reimplemented from FWGeometryTableManagerBase.

Definition at line 38 of file FWGeometryTableManager.cc.

References FWGeometryTableView::getVolumeMode(), m_browser, and FWGeometryTableManagerBase::NodeInfo::m_node.

Referenced by cellRenderer().

{
   if (m_browser->getVolumeMode())
      return Form("%s [%d]", data.m_node->GetVolume()->GetName(), data.m_node->GetNdaughters());
   else
      return Form("%s [%d]", data.m_node->GetName(), data.m_node->GetNdaughters());
}
FWTableCellRendererBase * FWGeometryTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const [virtual]

Returns the particular renderer used to handle the requested cell. Arguments: iSortedRowNumber: the row number from the present sort (i.e. the cell number of the view) iCol: the column number of the cell. The returned value must be used immediately and not held onto since the same Renderer can be used for subsequent calls

Implements FWTableManagerBase.

Definition at line 48 of file FWGeometryTableManager.cc.

References cellName(), data, getVisibility(), getVisibilityChld(), FWTextTreeCellRenderer::iconWidth(), kColorColumn, FWGeometryTableManagerBase::kExpanded, FWGeometryTableManagerBase::kHighlighted, kMatches, kMaterialColumn, kNameColumn, FWGeometryTableManagerBase::kSelected, kTranspColumn, kVisChildColumn, kVisSelfColumn, testEve_cfg::level, FWGeometryTableManagerBase::NodeInfo::m_color, FWGeometryTableManagerBase::m_colorBoxRenderer, FWGeometryTableManagerBase::m_editTransparencyIdx, FWGeometryTableManagerBase::m_entries, FWGeometryTableManagerBase::m_highlightContext, FWGeometryTableManagerBase::NodeInfo::m_level, FWGeometryTableManagerBase::m_levelOffset, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::m_renderer, FWGeometryTableManagerBase::m_row_to_index, FWGeometryTableManagerBase::NodeInfo::m_transparency, nodeIsParent(), FWTextTableCellRenderer::setData(), FWGeometryTableManagerBase::ColorBoxRenderer::setData(), FWTextTreeCellRenderer::setIndentation(), FWTextTreeCellRenderer::setIsOpen(), FWTextTreeCellRenderer::setIsParent(), FWTextTreeCellRenderer::showEditor(), and FWGeometryTableManagerBase::NodeInfo::testBit().

{
   FWTextTreeCellRenderer* renderer = &m_renderer;
   if (m_row_to_index.empty()) return renderer;

   int unsortedRow =  m_row_to_index[iSortedRowNumber];
   if (unsortedRow < 0) printf("!!!!!!!!!!!!!!!! error %d %d \n",unsortedRow,  iSortedRowNumber);

   // editor state
   //
   m_renderer.showEditor(unsortedRow == m_editTransparencyIdx && iCol == kTranspColumn);

   // selection state
   //
   const NodeInfo& data = m_entries[unsortedRow];
   TGeoNode& gn = *data.m_node;
   bool isSelected = data.testBit(kHighlighted) ||  data.testBit(kSelected);
   // printf("cell render %s \n", data.name());
   if (data.testBit(kSelected))
   {
      m_highlightContext->SetBackground(0xc86464);
   }
   else if (data.testBit(kHighlighted) )
   {
      m_highlightContext->SetBackground(0x6464c8);
   }
   else if (iCol == kMaterialColumn && data.testBit(kMatches) )
   {
      m_highlightContext->SetBackground(0xdddddd);
   }

   // set column content
   //
   if (iCol == kNameColumn)
   {
      renderer->setData(cellName(data), isSelected);

      renderer->setIsParent(nodeIsParent(data));

      renderer->setIsOpen( data.testBit(FWGeometryTableManagerBase::kExpanded));

      int level = data.m_level - m_levelOffset;
      if (nodeIsParent(data))
         renderer->setIndentation(20*level);
      else
         renderer->setIndentation(20*level + FWTextTreeCellRenderer::iconWidth());

      return renderer;
   }
   else
   {
      // printf("title %s \n",data.m_node->GetTitle());
      renderer->setIsParent(false);
      renderer->setIndentation(0);
      if (iCol == kColorColumn)
      {
         // m_colorBoxRenderer.setData(data.m_node->GetVolume()->GetLineColor(), isSelected);
         m_colorBoxRenderer.setData(data.m_color, isSelected);
         return  &m_colorBoxRenderer;
      }
      else if (iCol == kTranspColumn)
      {
         renderer->setData(Form("%d", 100 -data.m_transparency), isSelected);
         return renderer;
      }
      else if (iCol == kVisSelfColumn)
      {
         renderer->setData(getVisibility(data)  ? "On" : "-", isSelected);
         return renderer;
      }
      else if (iCol == kVisChildColumn)
      {
         renderer->setData( getVisibilityChld(data) ? "On" : "-", isSelected);
         return renderer;
      }
      else if (iCol == kMaterialColumn)
      {
         renderer->setData( gn.GetVolume()->GetMaterial()->GetName(), isSelected);
         return renderer;
      }
      else
      {  renderer->setData("ERROR", false);
         return renderer;
      }
   }
}
void FWGeometryTableManager::checkChildMatches ( TGeoVolume *  v,
std::vector< TGeoVolume * > &  pstack 
)

Definition at line 186 of file FWGeometryTableManager.cc.

References i, FWGeometryTableManager::Match::m_childMatches, and m_volumes.

Referenced by updateFilter().

{
   if (m_volumes[vol].m_matches)
   {
      for (std::vector<TGeoVolume*>::iterator i = pstack.begin(); i != pstack.end(); ++i)
      {
         Match& pm =  m_volumes[*i];
         pm.m_childMatches = true;
      }
   }

   pstack.push_back(vol);

   int nD = vol->GetNdaughters(); //TMath::Min(m_browser->getMaxDaughters(), vol->GetNdaughters());
   for (int i = 0; i < nD; ++i)
      checkChildMatches(vol->GetNode(i)->GetVolume(), pstack);

   pstack.pop_back();
}
void FWGeometryTableManager::checkHierarchy ( )

Definition at line 162 of file FWGeometryTableManager.cc.

References alignCSCRings::e, i, FWGeometryTableManagerBase::m_entries, mergeVDriftHistosByStation::name, and convertSQLiteXML::ok.

{
   // Used for debug: in a NodeInfo entry look TGeoNode children from parent index and check
   // if child is found.

   for (size_t i = 0,  e = m_entries.size(); i != e; ++i)
   {
      if (m_entries[i].m_level > 0)
      {
         TGeoNode* pn = m_entries[m_entries[i].m_parent].m_node;
         bool ok = false;
         for (int d = 0; d < pn->GetNdaughters(); ++d)
         {
            if (m_entries[i].m_node == pn->GetDaughter(d))
            {
               ok = true;
               break;
            }
         }
         if (! ok) printf("!!!!!! node %s has false parent %s \n", m_entries[i].name(), pn->GetName());
      }
   }
}
void FWGeometryTableManager::checkRegionOfInterest ( double *  center,
double  radius,
long  algo 
)

Definition at line 524 of file FWGeometryTableManager.cc.

References delta, FWGeometryTableViewManager::getGeoMangeur(), i, FWGeometryTableView::kBBoxCenter, FWGeometryTableView::kBBoxSurface, FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, FWGeometryTableManagerBase::m_entries, alignCSCRings::r, CosmicsPD_Skims::radius, and lumiQTWidget::t.

Referenced by FWGeometryTableView::checkRegionOfInterest().

{
   double sqr_r = radius * radius;

   for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni)
      ni->resetBit(kVisNodeChld);

   int cnt = 0;
   TEveGeoManagerHolder mangeur( FWGeometryTableViewManager::getGeoMangeur());
   printf("FWGeometryTableManagerBase::checkRegionOfInterest BEGIN r=%d center= (%.1f, %.1f, %.1f)\n ", (int)radius, center[0], center[1], center[2]);
   TGeoIterator git(m_entries[0].m_node->GetVolume());
   Entries_i    eit(m_entries.begin());
   while (git())
   {
      const TGeoMatrix *gm   = git.GetCurrentMatrix();
      const TGeoBBox   *bb   = static_cast<TGeoBBox*>(eit->m_node->GetVolume()->GetShape());
      const Double_t   *bo   = bb->GetOrigin();
      const Double_t    bd[] = { bb->GetDX(), bb->GetDY(), bb->GetDZ() };
      const Double_t   *cc   = center;

      bool visible = false;

      switch (algo)
      {
         case FWGeometryTableView::kBBoxCenter:
         {
            const Double_t *t = gm->GetTranslation();
            TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
            Double_t sqr_d = d.Mag2();;
            visible = (sqr_d <= sqr_r);
            break;
         }
         case FWGeometryTableView::kBBoxSurface:
         {
            assert (gm->IsScale() == false);

            const Double_t *t = gm->GetTranslation();
            const Double_t *r = gm->GetRotationMatrix();
            TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
            Double_t sqr_d = 0;
            for (Int_t i = 0; i < 3; ++i)
            {
               Double_t dp = d[0]*r[i] + d[1]*r[i+3] + d[2]*r[i+6];
               if (dp < -bd[i])
               {
                  Double_t delta = dp + bd[i];
                  sqr_d += delta * delta;
               }
               else if (dp > bd[i])
               {
                  Double_t delta = dp - bd[i];
                  sqr_d += delta * delta;               
               }
            }
            visible = (sqr_d <= sqr_r);
         }
      }

      if (visible)
      {
         eit->setBit(kVisNodeSelf);
         int pidx = eit->m_parent;
         while (pidx >= 0)
         {
            m_entries[pidx].setBit(kVisNodeChld);
            pidx = m_entries[pidx].m_parent;
            ++cnt;
         }
      }
      else
      {
         eit->resetBit(kVisNodeSelf);
      }
      eit++;
   }

   printf("FWGeometryTableManager::checkRegionOfInterest END [%d]\n ", cnt);
}
bool FWGeometryTableManager::getVisibility ( const NodeInfo nodeInfo) const [virtual]
bool FWGeometryTableManager::getVisibilityChld ( const NodeInfo nodeInfo) const [virtual]
void FWGeometryTableManager::importChildren ( int  parent_idx)

Definition at line 137 of file FWGeometryTableManager.cc.

References data, FWGeometryTableView::getAutoExpand(), FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableManagerBase::kExpanded, m_browser, FWGeometryTableManagerBase::NodeInfo::m_color, FWGeometryTableManagerBase::m_entries, FWGeometryTableManagerBase::NodeInfo::m_level, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::NodeInfo::m_parent, FWGeometryTableManagerBase::NodeInfo::m_transparency, n, dbtoconf::parent, and FWGeometryTableManagerBase::NodeInfo::setBit().

Referenced by loadGeometry().

{
   NodeInfo& parent        = m_entries[parent_idx];
   TGeoNode* parentGeoNode = parent.m_node;
   int       parentLevel   = parent.m_level;

   int nV   = parentGeoNode->GetNdaughters();
   int dOff = 0;
   for (int n = 0; n != nV; ++n)
   {
      NodeInfo& data = m_entries[parent_idx + n + 1 + dOff];
      data.m_node    = parentGeoNode->GetDaughter(n);
      data.m_level   = parentLevel + 1;
      data.m_parent  = parent_idx;
      data.m_color   = data.m_node->GetVolume()->GetLineColor();
      data.m_transparency = data.m_node->GetVolume()->GetTransparency();
      if (data.m_level <= m_browser->getAutoExpand()) data.setBit(kExpanded);

      importChildren(parent_idx + n + 1 + dOff);
      getNNodesTotal(parentGeoNode->GetDaughter(n), dOff);
   }
}
void FWGeometryTableManager::loadGeometry ( TGeoNode *  iGeoTopNode,
TObjArray *  iVolumes 
)

Reimplemented from FWGeometryTableManagerBase.

Definition at line 261 of file FWGeometryTableManager.cc.

References FWGeometryTableView::drawTopNode(), FWGeometryTableView::getAutoExpand(), FWGeometryTableView::getFilterType(), FWGeometryTableManagerBase::getNNodesTotal(), importChildren(), FWGeometryTableManagerBase::kExpanded, FWGeometryTableManagerBase::kVisNodeSelf, m_browser, FWGeometryTableManagerBase::NodeInfo::m_color, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::NodeInfo::m_level, FWGeometryTableManagerBase::m_levelOffset, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::NodeInfo::m_parent, FWGeometryTableManagerBase::m_row_to_index, FWGeometryTableManagerBase::NodeInfo::m_transparency, m_volumes, MultipleCompare::Match(), GetRecoTauVFromDQM_MC_cff::next, FWGeometryTableManagerBase::NodeInfo::setBitVal(), updateFilter(), and v.

Referenced by FWGeometryTableView::FWGeometryTableView().

{
#ifdef PERFTOOL_GEO_TABLE
   ProfilerStart("loadGeo");
#endif

   // Prepare data for cell render.

   // clear entries
   m_entries.clear();
   m_row_to_index.clear();
   m_volumes.clear();
   m_levelOffset = 0;

   // set volume table for filters
   boost::unordered_map<TGeoVolume*, Match>  pipi(iVolumes->GetSize());
   m_volumes.swap(pipi);
   TIter next( iVolumes);
   TGeoVolume* v;
   while ((v = (TGeoVolume*) next()) != 0)
      m_volumes.insert(std::make_pair(v, Match()));

   if (!m_filterOff)
      updateFilter(m_browser->getFilterType());

   // add top node to init

   int nTotal = 0;
   NodeInfo topNodeInfo;
   topNodeInfo.m_node   = iGeoTopNode;
   topNodeInfo.m_level  = 0;
   topNodeInfo.m_parent = -1;
   topNodeInfo.m_color =  iGeoTopNode->GetVolume()->GetLineColor();
   topNodeInfo.m_transparency = iGeoTopNode->GetVolume()->GetTransparency();
   topNodeInfo.setBitVal(kExpanded, m_browser->getAutoExpand());
   topNodeInfo.setBitVal(kVisNodeSelf, m_browser->drawTopNode());

   getNNodesTotal(topNodeInfo.m_node , nTotal);
   m_entries.resize(nTotal+1);
   m_entries[0] = topNodeInfo;

   importChildren(0);

   // checkHierarchy();

#ifdef PERFTOOL_GEO_TABLE
   ProfilerStop();
#endif
}
bool FWGeometryTableManager::nodeIsParent ( const NodeInfo data) const [protected, virtual]

Reimplemented from FWGeometryTableManagerBase.

Definition at line 517 of file FWGeometryTableManager.cc.

References kChildMatches, m_filterOff, FWGeometryTableManagerBase::NodeInfo::m_node, and FWGeometryTableManagerBase::NodeInfo::testBit().

Referenced by cellRenderer().

{
   return (data.m_node->GetNdaughters() != 0) && (m_filterOff || data.testBit(kChildMatches));
}
virtual int FWGeometryTableManager::numberOfColumns ( ) const [inline, virtual]

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 82 of file FWGeometryTableManager.h.

References kNumColumn.

{ return kNumColumn; }
const FWGeometryTableManager& FWGeometryTableManager::operator= ( const FWGeometryTableManager ) [private]
void FWGeometryTableManager::printMaterials ( )

Definition at line 313 of file FWGeometryTableManager.cc.

References dtNoiseDBValidation_cfg::cerr.

{
   std::cerr << "not implemented \n";
}
void FWGeometryTableManager::recalculateVisibility ( ) [virtual]
void FWGeometryTableManager::recalculateVisibilityNodeRec ( int  pIdx)

Definition at line 396 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), data, FWGeometryTableManagerBase::getNNodesTotal(), kChildMatches, FWGeometryTableManagerBase::kExpanded, kMatches, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::m_row_to_index, n, FWGeometryTableManagerBase::NodeInfo::testBit(), and FWGeometryTableManagerBase::NodeInfo::testBitAny().

Referenced by recalculateVisibility().

{
   TGeoNode* parentNode = m_entries[pIdx].m_node;
   int nD   = parentNode->GetNdaughters();
   int dOff = 0;
   for (int n = 0; n != nD; ++n)
   {
      int idx = pIdx + 1 + n + dOff;
      NodeInfo& data = m_entries[idx];

      if (m_filterOff)
      {
         m_row_to_index.push_back(idx);
         if (data.testBit(kExpanded)) recalculateVisibilityNodeRec(idx);
      }
      else
      {
         assertNodeFilterCache(data);
         if (data.testBitAny(kMatches | kChildMatches)) m_row_to_index.push_back(idx);
         if (data.testBit(kChildMatches) && data.testBit(kExpanded) ) recalculateVisibilityNodeRec(idx);
      }

      FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
   }
}
void FWGeometryTableManager::recalculateVisibilityVolumeRec ( int  pIdx)

Definition at line 346 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), data, FWGeometryTableManagerBase::getNNodesTotal(), kChildMatches, FWGeometryTableManagerBase::kExpanded, kMatches, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::m_row_to_index, n, FWGeometryTableManagerBase::NodeInfo::testBit(), FWGeometryTableManagerBase::NodeInfo::testBitAny(), and makeLayoutFileForGui::toAdd.

Referenced by recalculateVisibility().

{
   TGeoNode* parentNode = m_entries[pIdx].m_node;
   int nD = parentNode->GetNdaughters();
   int dOff=0;

   // printf("----------- parent %s\n", parentNode->GetName() );

   std::vector<int> vi;
   vi.reserve(nD);

   for (int n = 0; n != nD; ++n)
   {
      int idx = pIdx + 1 + n + dOff;
      NodeInfo& data = m_entries[idx];

      bool toAdd = true;
      for (std::vector<int>::iterator u = vi.begin(); u != vi.end(); ++u )
      {
         TGeoVolume* neighbourVolume =  parentNode->GetDaughter(*u)->GetVolume();
         if (neighbourVolume == data.m_node->GetVolume())
         {
            toAdd = false;
            // printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
            break;
         }
      }

      if (toAdd)
      {
         vi.push_back(n);
         if (m_filterOff)
         {
            //    std::cout << data.nameIndent() << std::endl;
            m_row_to_index.push_back(idx);
            if (data.testBit(kExpanded)) recalculateVisibilityVolumeRec(idx);
         }
         else
         {
            assertNodeFilterCache(data);
            if (data.testBitAny(kMatches | kChildMatches)) m_row_to_index.push_back(idx);
            if (data.testBit(kChildMatches) && data.testBit(kExpanded)) recalculateVisibilityVolumeRec(idx);
         }
      }
      FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
   }
}
void FWGeometryTableManager::resetRegionOfInterest ( )

Definition at line 603 of file FWGeometryTableManager.cc.

References FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, and FWGeometryTableManagerBase::m_entries.

Referenced by FWGeometryTableView::checkRegionOfInterest().

{
   for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni)
   {
      ni->setBit(kVisNodeSelf);
      ni->setBit(kVisNodeChld);
   }
   // ni->setMatchRegion(true);
}
void FWGeometryTableManager::setDaughtersSelfVisibility ( int  i,
bool  v 
) [virtual]

Reimplemented from FWGeometryTableManagerBase.

Definition at line 480 of file FWGeometryTableManager.cc.

References data, FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableManagerBase::m_entries, n, setVisibility(), and setVisibilityChld().

{
   TGeoNode  *parentNode = m_entries[selectedIdx].m_node;
   int nD   = parentNode->GetNdaughters();
   int dOff = 0;
   for (int n = 0; n != nD; ++n)
   {
      int idx = selectedIdx + 1 + n + dOff;
      NodeInfo& data = m_entries[idx];

      setVisibility(data, v);
      setVisibilityChld(data, v);

      FWGeometryTableManager::getNNodesTotal(parentNode->GetDaughter(n), dOff);
   }
}
void FWGeometryTableManager::setVisibility ( NodeInfo nodeInfo,
bool  x 
) [virtual]
void FWGeometryTableManager::setVisibilityChld ( NodeInfo nodeInfo,
bool  x 
) [virtual]
void FWGeometryTableManager::updateFilter ( int  iType)

Definition at line 211 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), checkChildMatches(), FWGeometryTableView::getFilter(), i, kFilterCached, FWGeometryTableView::kFilterMaterialName, FWGeometryTableView::kFilterMaterialTitle, FWGeometryTableView::kFilterShapeClassName, FWGeometryTableView::kFilterShapeName, m_browser, FWGeometryTableManagerBase::m_entries, m_filterOff, and m_volumes.

Referenced by loadGeometry(), FWGeometryTableView::setFrom(), and FWGeometryTableView::updateFilter().

{
   std::string filterExp =  m_browser->getFilter();
   m_filterOff =  filterExp.empty();
   printf("update filter %s  OFF %d volumes size %d\n",filterExp.c_str(),  m_filterOff , (int)m_volumes.size());

   if (m_filterOff || m_entries.empty()) return;

   // update volume-match entries
   int numMatched = 0;
   for (Volumes_i i = m_volumes.begin(); i != m_volumes.end(); ++i)
   {
      const char* res = 0;
      
      if (iType == FWGeometryTableView::kFilterMaterialName)
      {
         res = strcasestr( i->first->GetMaterial()->GetName() , filterExp.c_str());
      }
      else if (iType == FWGeometryTableView::kFilterMaterialTitle)
      {
         res = strcasestr( i->first->GetMaterial()->GetTitle() , filterExp.c_str());
      }
      else if (iType == FWGeometryTableView::kFilterShapeName) 
      {
         res = strcasestr( i->first->GetShape()->GetName() , filterExp.c_str());
      }      
      else if (iType == FWGeometryTableView::kFilterShapeClassName) 
      {
         res = strcasestr( i->first->GetShape()->ClassName() , filterExp.c_str());
      }
      
      i->second.m_matches = (res != 0);
      i->second.m_childMatches = false;
      if (res != 0) numMatched++;
   }

   printf("update filter [%d] volumes matched\n", numMatched);
   std::vector<TGeoVolume*> pstack;
   checkChildMatches(m_entries[0].m_node->GetVolume(), pstack);

   for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni)
   {
      ni->resetBit(kFilterCached);
     assertNodeFilterCache(*ni);
   }
   
}

Member Data Documentation