|
|
Go to the documentation of this file.
33 #include "KeySymbols.h"
35 #include "TGComboBox.h"
37 #include "TGListBox.h"
38 #include "TGLViewer.h"
39 #include "TGeoMatrix.h"
41 #include "TVirtualX.h"
42 #include "TEveViewer.h"
43 #include "TEveScene.h"
44 #include "TEveSceneInfo.h"
45 #include "TEveManager.h"
46 #include "TGeoManager.h"
47 #include "TGLCamera.h"
57 mutable std::vector<const char*>
m_list;
64 m_list.push_back(
v->GetMaterial()->GetName());
67 m_list.push_back(
v->GetMaterial()->GetTitle());
70 m_list.push_back(
v->GetShape()->GetName());
73 m_list.push_back(
v->GetShape()->ClassName());
76 std::cerr <<
"FWGeoMaterialValidator unhandeled case. \n";
79 for (
int i = 0;
i <
v->GetNdaughters(); ++
i)
99 unsigned int part_size =
part.size();
102 oOptions.push_back(std::make_pair(std::make_shared<std::string>(*
m_list.begin()),
h));
103 std::vector<const char*>::iterator startIt =
m_list.begin();
105 for (std::vector<const char*>::iterator
i = startIt;
i !=
m_list.end(); ++
i) {
107 if ((strlen(*
i) >= part_size) && strncmp(*
i,
part.c_str(), part_size) == 0) {
108 oOptions.push_back(std::make_pair(std::make_shared<std::string>((*
i)), &((*
i)[part_size])));
125 m_tableManager(nullptr),
126 m_filterEntry(nullptr),
127 m_filterValidator(nullptr),
128 m_mode(this,
"Mode", 0
l, 0
l, 1
l),
129 m_disableTopNode(this,
"HideTopNode",
true),
130 m_visLevel(this,
"VisLevel", 3
l, 1
l, 100
l),
131 m_filter(this,
"Materials",
std::
string()),
132 m_filterType(this,
"FilterType:", 0
l, 0
l, 3
l),
133 m_visLevelFilter(this,
"IgnoreVisLevelOnFilter",
true),
134 m_selectRegion(this,
"SelectNearCameraCenter",
false),
135 m_regionRadius(this,
"SphereRadius", 10.0, 1.0, 300.0),
136 m_proximityAlgo(this,
"Proximity algorithm", 1
l, 0
l, 1
l) {
138 #if ROOT_VERSION_CODE < ROOT_VERSION(5, 32, 0)
139 m_eveScene =
new FWGeoTopNodeEveScene(gls,
"TopGeoNodeScene",
"");
141 m_eveScene =
new TEveScene(gls,
"TopGeoNodeScene",
"");
154 TGHorizontalFrame*
hp =
new TGHorizontalFrame(
m_frame);
156 TGTextButton* rb =
new TGTextButton(
hp,
"CdTop");
157 hp->AddFrame(rb,
new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0));
158 rb->Connect(
"Clicked()",
"FWGeometryTableViewBase",
this,
"cdTop()");
161 TGTextButton* rb =
new TGTextButton(
hp,
"CdUp");
162 hp->AddFrame(rb,
new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0));
163 rb->Connect(
"Clicked()",
"FWGeometryTableViewBase",
this,
"cdUp()");
167 hp->AddFrame(
m_viewBox,
new TGLayoutHints(kLHintsExpandY, 2, 2, 0, 0));
178 TGFrame* pframe = ptr->build(
hp,
false);
179 hp->AddFrame(pframe,
new TGLayoutHints(kLHintsLeft));
183 hp->AddFrame(
new TGLabel(
hp,
"FilterExp:"),
new TGLayoutHints(kLHintsBottom, 0, 0, 0, 2));
188 hp->AddFrame(
m_filterEntry,
new TGLayoutHints(kLHintsExpandX, 0, 2, 1, 0));
191 m_filterEntry->Connect(
"ReturnPressed()",
"FWGeometryTableView",
this,
"filterTextEntryCallback()");
193 gVirtualX->GrabKey(
m_filterEntry->GetId(), gVirtualX->KeysymToKeycode((
int)kKey_A), kKeyControlMask,
true);
195 m_frame->AddFrame(
hp,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 2, 0));
307 TGTextButton* butt =
new TGTextButton(gui.
getTabContainer(),
"ReloadColors");
331 if (strstr(
v->GetElementName(),
"3D")) {
332 for (TEveElement::List_i eit =
v->BeginChildren(); eit !=
v->EndChildren(); ++eit) {
333 TEveScene*
s = ((TEveSceneInfo*)*eit)->GetScene();
334 if (el &&
s->HasChildren() &&
s->FirstChild() == el)
343 double* center =
nullptr;
344 for (TEveElement::List_i it = gEve->GetViewers()->BeginChildren(); it != gEve->GetViewers()->EndChildren(); ++it) {
345 TEveViewer*
v = ((TEveViewer*)(*it));
350 center =
v->GetGLViewer()->CurrentCamera().GetCenterVec();
352 "Center picked (%.1f, %.1f, %.1f) from first selected 3D view \n", center[0], center[1], center[2]);
379 (*it)->setFrom(iFrom);
void setValidator(FWValidatorBase *)
std::vector< FWParameterBase * >::const_iterator const_iterator
const FWConfiguration * m_viewersConfig
FWGeoMaterialValidator(FWGeometryTableView *v)
static TGeoManager * getGeoMangeur()
FWGeoTopNode * m_eveTopNode
void resetRegionOfInterest()
FWEnumParameter m_proximityAlgo
int getFilterType() const
virtual void refreshTable3D()
FWStringParameter m_filter
FWLongParameter m_autoExpand
bool addEntry(Long_t id, const std::string &txt)
const_iterator end() const
FWLongParameter m_minParentTransparency
FWGUIValidatingTextEntry * m_filterEntry
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
void setTopNodePathFromConfig(const FWConfiguration &iFrom)
virtual void addDaughtersRec(TGeoVolume *v) const
~FWGeometryTableView() override
FWGeoTopNode * m_eveTopNode
const_iterator begin() const
void setLevelOffset(int x)
void updateVisibilityTopNode()
FWGeoMaterialValidator * m_filterValidator
FWGeometryTableManager * m_tableManager
FWBoolParameter m_visLevelFilter
sigc::signal< void, T > changed_
void loadGeometry(TGeoNode *iGeoTopNode, TObjArray *iVolumes)
ViewerParameterGUI & separator()
void populateController(ViewerParameterGUI &) const override
void autoExpandCallback()
void setFrom(const FWConfiguration &) override
bool isStringValid(std::string &exp)
bool viewIsChecked(TEveViewer *v, TEveElement *el)
FWGeometryTableManagerBase * getTableManager() override
const FWConfiguration * valueForKey(const std::string &iKey) const
TGCompositeFrame * m_frame
~FWGeoMaterialValidator() override
FWEnumParameter m_filterType
TGListBox * getListBox() const
TGCompositeFrame * getTabContainer()
FWLongParameter m_topNodeIdx
FWBoolParameter m_disableTopNode
void checkRegionOfInterest(double *center, double radius, long algo)
FWGeoTopNodeGLScene * m_scene
std::vector< const char * > m_list
void filterListCallback()
const std::string & name() const
void fillOptions(const char *iBegin, const char *iEnd, std::vector< std::pair< std::shared_ptr< std::string >, std::string > > &oOptions) const override
FWDoubleParameter m_regionRadius
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
int getTopNodeIdx() const
FWGeometryTableView(TEveWindowSlot *iParent, FWColorManager *colMng)
FWLongParameter m_visLevel
FWBoolParameter m_selectRegion
FWLongParameter m_minLeafTransparency
void checkRegionOfInterest()
void filterTextEntryCallback()
def unique(seq, keepstr=True)
void redrawTable(bool setExpand=false)
std::shared_ptr< FWParameterSetterBase > m_filterTypeSetter
void setMaxListBoxHeight(UInt_t x)
void updateFilter(std::string &)
void setPath(int, std::string &) override
Entries_v::iterator Entries_i
FWGeometryTableView * m_browser
void setVisibility(NodeInfo &nodeInfo, bool) override
ViewerParameterGUI & addParam(const FWParameterBase *)
ViewerParameterGUI & requestTab(const char *)