22 #include "TEveVector.h"
23 #include "TGeoShape.h"
24 #include "TGeoMatrix.h"
40 return Form(
"%s [%d]", data.
m_node->GetVolume()->GetName(), data.
m_node->GetNdaughters());
42 return Form(
"%s [%d]", data.
m_node->GetName(), data.
m_node->GetNdaughters());
53 if (unsortedRow < 0) printf(
"!!!!!!!!!!!!!!!! error %d %d \n",unsortedRow, iSortedRowNumber);
62 TGeoNode& gn = *data.
m_node;
124 renderer->
setData( gn.GetVolume()->GetMaterial()->GetName(), isSelected);
128 { renderer->
setData(
"ERROR",
false);
139 TGeoNode* parentGeoNode = parent.
m_node;
140 int parentLevel = parent.
m_level;
142 int nV = parentGeoNode->GetNdaughters();
144 for (
int n = 0;
n != nV; ++
n)
147 data.
m_node = parentGeoNode->GetDaughter(
n);
148 data.
m_level = parentLevel + 1;
172 for (
int d = 0; d < pn->GetNdaughters(); ++d)
174 if (
m_entries[
i].m_node == pn->GetDaughter(d))
180 if (! ok) printf(
"!!!!!! node %s has false parent %s \n",
m_entries[
i].
name(), pn->GetName());
189 for (std::vector<TGeoVolume*>::iterator
i = pstack.begin();
i != pstack.end(); ++
i)
196 pstack.push_back(vol);
198 int nD = vol->GetNdaughters();
199 for (
int i = 0;
i < nD; ++
i)
214 printf(
"update filter %s OFF %d volumes size %d\n",filterExp.c_str(),
m_filterOff , (int)
m_volumes.size());
226 res = strcasestr(
i->first->GetMaterial()->GetName() , filterExp.c_str());
230 res = strcasestr(
i->first->GetMaterial()->GetTitle() , filterExp.c_str());
234 res = strcasestr(
i->first->GetShape()->GetName() , filterExp.c_str());
238 res = strcasestr(
i->first->GetShape()->ClassName() , filterExp.c_str());
241 i->second.m_matches = (res != 0);
242 i->second.m_childMatches =
false;
243 if (res != 0) numMatched++;
246 printf(
"update filter [%d] volumes matched\n", numMatched);
247 std::vector<TGeoVolume*> pstack;
262 #ifdef PERFTOOL_GEO_TABLE
263 ProfilerStart(
"loadGeo");
275 boost::unordered_map<TGeoVolume*, Match> pipi(iVolumes->GetSize());
277 TIter
next( iVolumes);
279 while ((v = (TGeoVolume*)
next()) != 0)
289 topNodeInfo.
m_node = iGeoTopNode;
292 topNodeInfo.
m_color = iGeoTopNode->GetVolume()->GetLineColor();
293 topNodeInfo.
m_transparency = iGeoTopNode->GetVolume()->GetTransparency();
305 #ifdef PERFTOOL_GEO_TABLE
347 TGeoNode* parentNode =
m_entries[pIdx].m_node;
348 int nD = parentNode->GetNdaughters();
356 for (
int n = 0;
n != nD; ++
n)
358 int idx = pIdx + 1 +
n + dOff;
362 for (std::vector<int>::iterator u = vi.begin(); u != vi.end(); ++u )
364 TGeoVolume* neighbourVolume = parentNode->GetDaughter(*u)->GetVolume();
365 if (neighbourVolume == data.
m_node->GetVolume())
397 TGeoNode* parentNode =
m_entries[pIdx].m_node;
398 int nD = parentNode->GetNdaughters();
400 for (
int n = 0;
n != nD; ++
n)
402 int idx = pIdx + 1 +
n + dOff;
432 bool childMatches =
m_volumes[data.
m_node->GetVolume()].m_childMatches;
448 if (data.
m_node->GetVolume()->IsVisible() !=
x)
451 data.
m_node->GetVolume()->SetVisibility(x);
466 if (data.
m_node->GetVolume()->IsVisibleDaughters() !=
x)
469 data.
m_node->GetVolume()->VisibleDaughters(x);
481 TGeoNode *parentNode =
m_entries[selectedIdx].m_node;
482 int nD = parentNode->GetNdaughters();
484 for (
int n = 0;
n != nD; ++
n)
486 int idx = selectedIdx + 1 +
n + dOff;
501 return data.
m_node->GetVolume()->IsVisible();
509 return data.
m_node->GetVolume()->IsVisibleDaughters();
525 double sqr_r = radius *
radius;
532 printf(
"FWGeometryTableManagerBase::checkRegionOfInterest BEGIN r=%d center= (%.1f, %.1f, %.1f)\n ", (
int)radius, center[0], center[1], center[2]);
533 TGeoIterator git(
m_entries[0].m_node->GetVolume());
537 const TGeoMatrix *gm = git.GetCurrentMatrix();
538 const TGeoBBox *bb =
static_cast<TGeoBBox*
>(eit->m_node->GetVolume()->GetShape());
539 const Double_t *bo = bb->GetOrigin();
540 const Double_t bd[] = { bb->GetDX(), bb->GetDY(), bb->GetDZ() };
541 const Double_t *cc = center;
543 bool visible =
false;
549 const Double_t *
t = gm->GetTranslation();
550 TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
551 Double_t sqr_d = d.Mag2();;
552 visible = (sqr_d <= sqr_r);
557 assert (gm->IsScale() ==
false);
559 const Double_t *
t = gm->GetTranslation();
560 const Double_t *
r = gm->GetRotationMatrix();
561 TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
563 for (Int_t
i = 0;
i < 3; ++
i)
565 Double_t
dp = d[0]*r[
i] + d[1]*r[
i+3] + d[2]*r[
i+6];
568 Double_t
delta = dp + bd[
i];
569 sqr_d += delta *
delta;
573 Double_t
delta = dp - bd[
i];
574 sqr_d += delta *
delta;
577 visible = (sqr_d <= sqr_r);
584 int pidx = eit->m_parent;
599 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)