23 #include "TEveVector.h"
24 #include "TGeoShape.h"
25 #include "TGeoMatrix.h"
41 return Form(
"%s [%d]", data.
m_node->GetVolume()->GetName(), data.
m_node->GetNdaughters());
43 return Form(
"%s [%d]", data.
m_node->GetName(), data.
m_node->GetNdaughters());
54 if (unsortedRow < 0) printf(
"!!!!!!!!!!!!!!!! error %d %d \n",unsortedRow, iSortedRowNumber);
63 TGeoNode& gn = *data.
m_node;
125 renderer->
setData( gn.GetVolume()->GetMaterial()->GetName(), isSelected);
129 { renderer->
setData(
"ERROR",
false);
140 TGeoNode* parentGeoNode = parent.
m_node;
141 int parentLevel = parent.
m_level;
143 int nV = parentGeoNode->GetNdaughters();
145 for (
int n = 0;
n != nV; ++
n)
148 data.
m_node = parentGeoNode->GetDaughter(
n);
149 data.
m_level = parentLevel + 1;
173 for (
int d = 0; d < pn->GetNdaughters(); ++d)
175 if (
m_entries[
i].m_node == pn->GetDaughter(d))
181 if (! ok) printf(
"!!!!!! node %s has false parent %s \n",
m_entries[
i].
name(), pn->GetName());
190 for (std::vector<TGeoVolume*>::iterator
i = pstack.begin();
i != pstack.end(); ++
i)
197 pstack.push_back(vol);
199 int nD = vol->GetNdaughters();
200 for (
int i = 0;
i < nD; ++
i)
215 printf(
"update filter %s OFF %d volumes size %d\n",filterExp.c_str(),
m_filterOff , (int)
m_volumes.size());
227 res = strcasestr(
i->first->GetMaterial()->GetName() , filterExp.c_str());
231 res = strcasestr(
i->first->GetMaterial()->GetTitle() , filterExp.c_str());
235 res = strcasestr(
i->first->GetShape()->GetName() , filterExp.c_str());
239 res = strcasestr(
i->first->GetShape()->ClassName() , filterExp.c_str());
242 i->second.m_matches = (res != 0);
243 i->second.m_childMatches =
false;
244 if (res != 0) numMatched++;
247 printf(
"update filter [%d] volumes matched\n", numMatched);
248 std::vector<TGeoVolume*> pstack;
263 #ifdef PERFTOOL_GEO_TABLE
264 ProfilerStart(
"loadGeo");
276 boost::unordered_map<TGeoVolume*, Match> pipi(iVolumes->GetSize());
278 TIter next( iVolumes);
280 while ((v = (TGeoVolume*) next()) != 0)
290 topNodeInfo.
m_node = iGeoTopNode;
293 topNodeInfo.
m_color = iGeoTopNode->GetVolume()->GetLineColor();
294 topNodeInfo.
m_transparency = iGeoTopNode->GetVolume()->GetTransparency();
306 #ifdef PERFTOOL_GEO_TABLE
348 TGeoNode* parentNode =
m_entries[pIdx].m_node;
349 int nD = parentNode->GetNdaughters();
357 for (
int n = 0;
n != nD; ++
n)
359 int idx = pIdx + 1 +
n + dOff;
363 for (std::vector<int>::iterator u = vi.begin(); u != vi.end(); ++u )
365 TGeoVolume* neighbourVolume = parentNode->GetDaughter(*u)->GetVolume();
366 if (neighbourVolume == data.
m_node->GetVolume())
398 TGeoNode* parentNode =
m_entries[pIdx].m_node;
399 int nD = parentNode->GetNdaughters();
401 for (
int n = 0;
n != nD; ++
n)
403 int idx = pIdx + 1 +
n + dOff;
433 bool childMatches =
m_volumes[data.
m_node->GetVolume()].m_childMatches;
449 if (data.
m_node->GetVolume()->IsVisible() !=
x)
452 data.
m_node->GetVolume()->SetVisibility(x);
467 if (data.
m_node->GetVolume()->IsVisibleDaughters() !=
x)
470 data.
m_node->GetVolume()->VisibleDaughters(x);
482 TGeoNode *parentNode =
m_entries[selectedIdx].m_node;
483 int nD = parentNode->GetNdaughters();
485 for (
int n = 0;
n != nD; ++
n)
487 int idx = selectedIdx + 1 +
n + dOff;
502 return data.
m_node->GetVolume()->IsVisible();
510 return data.
m_node->GetVolume()->IsVisibleDaughters();
526 double sqr_r = radius *
radius;
533 printf(
"FWGeometryTableManagerBase::checkRegionOfInterest BEGIN r=%d center= (%.1f, %.1f, %.1f)\n ", (
int)radius, center[0], center[1], center[2]);
534 TGeoIterator git(
m_entries[0].m_node->GetVolume());
538 const TGeoMatrix *gm = git.GetCurrentMatrix();
539 const TGeoBBox *bb =
static_cast<TGeoBBox*
>(eit->m_node->GetVolume()->GetShape());
540 const Double_t *bo = bb->GetOrigin();
541 const Double_t bd[] = { bb->GetDX(), bb->GetDY(), bb->GetDZ() };
542 const Double_t *cc = center;
544 bool visible =
false;
550 const Double_t *
t = gm->GetTranslation();
551 TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
552 Double_t sqr_d = d.Mag2();;
553 visible = (sqr_d <= sqr_r);
558 assert (gm->IsScale() ==
false);
560 const Double_t *
t = gm->GetTranslation();
561 const Double_t *
r = gm->GetRotationMatrix();
562 TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
564 for (Int_t
i = 0;
i < 3; ++
i)
566 Double_t
dp = d[0]*r[
i] + d[1]*r[
i+3] + d[2]*r[
i+6];
569 Double_t
delta = dp + bd[
i];
570 sqr_d += delta *
delta;
574 Double_t
delta = dp - bd[
i];
575 sqr_d += delta *
delta;
578 visible = (sqr_d <= sqr_r);
585 int pidx = eit->m_parent;
600 printf(
"FWGeometryTableManager::checkRegionOfInterest END [%d]\n ", cnt);
virtual void setVisibility(NodeInfo &nodeInfo, bool)
FWGeometryTableView * m_browser
virtual bool getVisibilityChld(const NodeInfo &nodeInfo) const
virtual FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const
std::vector< int > m_row_to_index
FWGeometryTableManager(FWGeometryTableView *)
virtual void setVisibilityChld(NodeInfo &nodeInfo, bool)
int getFilterType() const
void setIsOpen(bool value)
void checkRegionOfInterest(double *center, double radius, long algo)
std::string getFilter() const
TGGC * m_highlightContext
void setData(Color_t c, bool)
int getAutoExpand() const
void recalculateVisibilityNodeRec(int)
void resetRegionOfInterest()
virtual const char * cellName(const NodeInfo &data) const
virtual void setDaughtersSelfVisibility(int i, bool v)
virtual bool getVisibility(const NodeInfo &nodeInfo) const
void assertNodeFilterCache(NodeInfo &data)
void setIsParent(bool value)
int m_editTransparencyIdx
virtual void setIndentation(int indentation=0)
virtual ~FWGeometryTableManager()
static void getNNodesTotal(TGeoNode *geoNode, int &off)
void setData(const std::string &, bool isSelected)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
void loadGeometry(TGeoNode *iGeoTopNode, TObjArray *iVolumes)
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume * > &)
void recalculateVisibilityVolumeRec(int)
static TGeoManager * getGeoMangeur()
bool getVolumeMode() const
char data[epos_bytes_allocation]
int getTopNodeIdx() const
void setBitVal(UChar_t f, bool x)
virtual void recalculateVisibility()
Volumes_t::iterator Volumes_i
virtual bool nodeIsParent(const NodeInfo &) const
Entries_v::iterator Entries_i
FWTextTreeCellRenderer m_renderer
void importChildren(int parent_idx)
bool testBitAny(UChar_t f) const
ColorBoxRenderer m_colorBoxRenderer
bool testBit(UChar_t f) const
virtual void showEditor(bool value)