22 #include "TEveVector.h" 23 #include "TGeoShape.h" 24 #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)
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)
211 int matchTPME(
const char*
w, TPMERegexp&
regexp) {
213 return regexp.Match(s);
227 TPMERegexp
regexp(TString(filterExp.c_str()),
"o");
234 res = matchTPME(
i->first->GetMaterial()->GetName() ,
regexp);
238 res = matchTPME(
i->first->GetMaterial()->GetTitle() ,
regexp);
242 res = matchTPME(
i->first->GetShape()->GetName() ,
regexp);
246 res = matchTPME(
i->first->GetShape()->ClassName() ,
regexp);
249 i->second.m_matches = (res > 0);
250 i->second.m_childMatches =
false;
251 if (res) numMatched++;
254 printf(
"update filter [%d] volumes matched\n", numMatched);
255 std::vector<TGeoVolume*> pstack;
270 #ifdef PERFTOOL_GEO_TABLE 271 ProfilerStart(
"loadGeo");
285 TIter
next( iVolumes);
287 while ((v = (TGeoVolume*)
next()) !=
nullptr)
297 topNodeInfo.
m_node = iGeoTopNode;
300 topNodeInfo.
m_color = iGeoTopNode->GetVolume()->GetLineColor();
301 topNodeInfo.
m_transparency = iGeoTopNode->GetVolume()->GetTransparency();
313 #ifdef PERFTOOL_GEO_TABLE 355 TGeoNode* parentNode =
m_entries[pIdx].m_node;
356 int nD = parentNode->GetNdaughters();
364 for (
int n = 0;
n != nD; ++
n)
366 int idx = pIdx + 1 +
n + dOff;
370 for (std::vector<int>::iterator u = vi.begin(); u != vi.end(); ++u )
372 TGeoVolume* neighbourVolume = parentNode->GetDaughter(*u)->GetVolume();
373 if (neighbourVolume == data.
m_node->GetVolume())
405 TGeoNode* parentNode =
m_entries[pIdx].m_node;
406 int nD = parentNode->GetNdaughters();
408 for (
int n = 0;
n != nD; ++
n)
410 int idx = pIdx + 1 +
n + dOff;
440 bool childMatches =
m_volumes[data.
m_node->GetVolume()].m_childMatches;
456 if (data.
m_node->GetVolume()->IsVisible() !=
x)
459 data.
m_node->GetVolume()->SetVisibility(x);
474 if (data.
m_node->GetVolume()->IsVisibleDaughters() !=
x)
477 data.
m_node->GetVolume()->VisibleDaughters(x);
489 TGeoNode *parentNode =
m_entries[selectedIdx].m_node;
490 int nD = parentNode->GetNdaughters();
492 for (
int n = 0;
n != nD; ++
n)
494 int idx = selectedIdx + 1 +
n + dOff;
509 return data.
m_node->GetVolume()->IsVisible();
517 return data.
m_node->GetVolume()->IsVisibleDaughters();
533 double sqr_r = radius *
radius;
540 printf(
"FWGeometryTableManagerBase::checkRegionOfInterest BEGIN r=%d center= (%.1f, %.1f, %.1f)\n ", (
int)radius, center[0], center[1], center[2]);
541 TGeoIterator git(
m_entries[0].m_node->GetVolume());
545 const TGeoMatrix *gm = git.GetCurrentMatrix();
546 const TGeoBBox *bb =
static_cast<TGeoBBox*
>(eit->m_node->GetVolume()->GetShape());
547 const Double_t *bo = bb->GetOrigin();
548 const Double_t bd[] = { bb->GetDX(), bb->GetDY(), bb->GetDZ() };
549 const Double_t *cc = center;
551 bool visible =
false;
557 const Double_t *
t = gm->GetTranslation();
558 TEveVectorD
d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
559 Double_t sqr_d = d.Mag2();;
560 visible = (sqr_d <= sqr_r);
565 assert (gm->IsScale() ==
false);
567 const Double_t *
t = gm->GetTranslation();
568 const Double_t *
r = gm->GetRotationMatrix();
569 TEveVectorD
d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
571 for (Int_t
i = 0;
i < 3; ++
i)
573 Double_t dp = d[0]*r[
i] + d[1]*r[
i+3] + d[2]*r[
i+6];
576 Double_t
delta = dp + bd[
i];
577 sqr_d += delta *
delta;
581 Double_t
delta = dp - bd[
i];
582 sqr_d += delta *
delta;
585 visible = (sqr_d <= sqr_r);
592 int pidx = eit->m_parent;
607 printf(
"FWGeometryTableManager::checkRegionOfInterest END [%d]\n ", cnt);
FWGeometryTableView * m_browser
bool getVisibility(const NodeInfo &nodeInfo) const override
std::vector< int > m_row_to_index
FWGeometryTableManager(FWGeometryTableView *)
int getFilterType() const
void setIsOpen(bool value)
void checkRegionOfInterest(double *center, double radius, long algo)
std::string getFilter() const
std::unordered_map< TGeoVolume *, Match > Volumes_t
const char * cellName(const NodeInfo &data) const override
void setDaughtersSelfVisibility(int i, bool v) override
FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const override
TGGC * m_highlightContext
void setData(Color_t c, bool)
void recalculateVisibility() override
int getAutoExpand() const
void recalculateVisibilityNodeRec(int)
bool getVisibilityChld(const NodeInfo &nodeInfo) const override
void resetRegionOfInterest()
void assertNodeFilterCache(NodeInfo &data)
void setIsParent(bool value)
~FWGeometryTableManager() override
int m_editTransparencyIdx
virtual void setIndentation(int indentation=0)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
void setData(const std::string &, bool isSelected)
void loadGeometry(TGeoNode *iGeoTopNode, TObjArray *iVolumes)
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume * > &)
void recalculateVisibilityVolumeRec(int)
static TGeoManager * getGeoMangeur()
bool getVolumeMode() const
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
int getTopNodeIdx() const
void setBitVal(UChar_t f, bool x)
Volumes_t::iterator Volumes_i
Entries_v::iterator Entries_i
FWTextTreeCellRenderer m_renderer
void importChildren(int parent_idx)
bool testBitAny(UChar_t f) const
ColorBoxRenderer m_colorBoxRenderer
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
bool testBit(UChar_t f) const
bool nodeIsParent(const NodeInfo &) const override
virtual void showEditor(bool value)