#include "TEveGeoNodeEditor.h"
#include "TEveGValuators.h"
#include "TEveGeoNode.h"
#include "TGeoNode.h"
#include "TVirtualPad.h"
#include "TColor.h"
#include "TGLabel.h"
#include "TGButton.h"
#include "TGNumberEntry.h"
#include "TGColorSelect.h"
#include "TGDoubleSlider.h"
ClassImp(TEveGeoNodeEditor)
TEveGeoNodeEditor::TEveGeoNodeEditor(const TGWindow *p,
Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
TGedFrame(p,width, height, options | kVerticalFrame, back),
fNodeRE (0),
fVizNode(0),
fVizNodeDaughters(0),
fVizVolume(0),
fVizVolumeDaughters(0)
{
MakeTitle("GeoNode");
fVizNode = new TGCheckButton(this, "VizNode");
AddFrame(fVizNode, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
fVizNode->Connect
("Toggled(Bool_t)",
"TEveGeoNodeEditor", this, "DoVizNode()");
fVizNodeDaughters = new TGCheckButton(this, "VizNodeDaughters");
AddFrame(fVizNodeDaughters, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
fVizNodeDaughters->Connect
("Toggled(Bool_t)",
"TEveGeoNodeEditor", this, "DoVizNodeDaughters()");
fVizVolume = new TGCheckButton(this, "VizVolume");
AddFrame(fVizVolume, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
fVizVolume->Connect
("Toggled(Bool_t)",
"TEveGeoNodeEditor", this, "DoVizVolume()");
fVizVolumeDaughters = new TGCheckButton(this, "VizVolumeDaughters");
AddFrame(fVizVolumeDaughters, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
fVizVolumeDaughters->Connect
("Toggled(Bool_t)",
"TEveGeoNodeEditor", this, "DoVizVolumeDaughters()");
}
void TEveGeoNodeEditor::SetModel(TObject* obj)
{
fNodeRE = dynamic_cast<TEveGeoNode*>(obj);
TGeoNode* node = fNodeRE->fNode;
TGeoVolume* vol = node->GetVolume();
fVizNode->SetState(node->TGeoAtt::IsVisible() ? kButtonDown : kButtonUp);
fVizNodeDaughters->SetState(node->TGeoAtt::IsVisDaughters() ? kButtonDown : kButtonUp);
fVizVolume->SetState(vol->IsVisible() ? kButtonDown : kButtonUp);
fVizVolumeDaughters->SetState(vol->IsVisDaughters() ? kButtonDown : kButtonUp);
}
void TEveGeoNodeEditor::DoVizNode()
{
fNodeRE->SetRnrSelf(fVizNode->IsOn());
Update();
}
void TEveGeoNodeEditor::DoVizNodeDaughters()
{
fNodeRE->SetRnrChildren(fVizNodeDaughters->IsOn());
Update();
}
void TEveGeoNodeEditor::DoVizVolume()
{
fNodeRE->fNode->GetVolume()->SetVisibility(fVizVolume->IsOn());
Update();
}
void TEveGeoNodeEditor::DoVizVolumeDaughters()
{
fNodeRE->fNode->GetVolume()->VisibleDaughters(fVizVolumeDaughters->IsOn());
Update();
}
ClassImp(TEveGeoTopNodeEditor)
TEveGeoTopNodeEditor::TEveGeoTopNodeEditor(const TGWindow *p,
Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
TGedFrame(p, width, height, options | kVerticalFrame, back),
fTopNodeRE (0),
fVisOption (0),
fVisLevel (0),
fMaxVisNodes (0)
{
MakeTitle("GeoTopNode");
Int_t labelW = 64;
fVisOption = new TEveGValuator(this, "VisOption:", 90, 0);
fVisOption->SetLabelWidth(labelW);
fVisOption->SetShowSlider(kFALSE);
fVisOption->SetNELength(4);
fVisOption->Build();
fVisOption->SetLimits(0, 2, 10, TGNumberFormat::kNESInteger);
fVisOption->SetToolTip("Visualization option passed to TGeoPainter.");
fVisOption->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisOption()");
AddFrame(fVisOption, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
fVisLevel = new TEveGValuator(this, "VisLevel:", 90, 0);
fVisLevel->SetLabelWidth(labelW);
fVisLevel->SetShowSlider(kFALSE);
fVisLevel->SetNELength(4);
fVisLevel->Build();
fVisLevel->SetLimits(0, 10, 10, TGNumberFormat::kNESInteger);
fVisLevel->SetToolTip("Level (depth) to which the geometry is traversed.\nWhen zero, maximum number of nodes to draw can be specified.");
fVisLevel->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisLevel()");
AddFrame(fVisLevel, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
fMaxVisNodes = new TEveGValuator(this, "MaxNodes:", 90, 0);
fMaxVisNodes->SetLabelWidth(labelW);
fMaxVisNodes->SetShowSlider(kFALSE);
fMaxVisNodes->SetNELength(6);
fMaxVisNodes->Build();
fMaxVisNodes->SetLimits(100, 999999, 0, TGNumberFormat::kNESInteger);
fMaxVisNodes->SetToolTip("Maximum number of nodes to draw.");
fMaxVisNodes->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoMaxVisNodes()");
AddFrame(fMaxVisNodes, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
}
void TEveGeoTopNodeEditor::SetModel(TObject* obj)
{
fTopNodeRE = dynamic_cast<TEveGeoTopNode*>(obj);
fVisOption ->SetValue(fTopNodeRE->GetVisOption());
fVisLevel ->SetValue(fTopNodeRE->GetVisLevel());
fMaxVisNodes->SetValue(fTopNodeRE->GetMaxVisNodes());
if (fTopNodeRE->GetVisLevel() > 0)
fMaxVisNodes->UnmapWindow();
else
fMaxVisNodes->MapWindow();
}
void TEveGeoTopNodeEditor::DoVisOption()
{
fTopNodeRE->SetVisOption(Int_t(fVisOption->GetValue()));
Update();
}
void TEveGeoTopNodeEditor::DoVisLevel()
{
fTopNodeRE->SetVisLevel(Int_t(fVisLevel->GetValue()));
Update();
}
void TEveGeoTopNodeEditor::DoMaxVisNodes()
{
fTopNodeRE->SetMaxVisNodes(Int_t(fMaxVisNodes->GetValue()));
Update();
}
TEveGeoNodeEditor.cxx:100 TEveGeoNodeEditor.cxx:101 TEveGeoNodeEditor.cxx:102 TEveGeoNodeEditor.cxx:103 TEveGeoNodeEditor.cxx:104 TEveGeoNodeEditor.cxx:105 TEveGeoNodeEditor.cxx:106 TEveGeoNodeEditor.cxx:107 TEveGeoNodeEditor.cxx:108 TEveGeoNodeEditor.cxx:109 TEveGeoNodeEditor.cxx:110 TEveGeoNodeEditor.cxx:111 TEveGeoNodeEditor.cxx:112 TEveGeoNodeEditor.cxx:113 TEveGeoNodeEditor.cxx:114 TEveGeoNodeEditor.cxx:115 TEveGeoNodeEditor.cxx:116 TEveGeoNodeEditor.cxx:117 TEveGeoNodeEditor.cxx:118 TEveGeoNodeEditor.cxx:119 TEveGeoNodeEditor.cxx:120 TEveGeoNodeEditor.cxx:121 TEveGeoNodeEditor.cxx:122 TEveGeoNodeEditor.cxx:123 TEveGeoNodeEditor.cxx:124 TEveGeoNodeEditor.cxx:125 TEveGeoNodeEditor.cxx:126 TEveGeoNodeEditor.cxx:127 TEveGeoNodeEditor.cxx:128 TEveGeoNodeEditor.cxx:129 TEveGeoNodeEditor.cxx:130 TEveGeoNodeEditor.cxx:131 TEveGeoNodeEditor.cxx:132 TEveGeoNodeEditor.cxx:133 TEveGeoNodeEditor.cxx:134 TEveGeoNodeEditor.cxx:135 TEveGeoNodeEditor.cxx:136 TEveGeoNodeEditor.cxx:137 TEveGeoNodeEditor.cxx:138 TEveGeoNodeEditor.cxx:139 TEveGeoNodeEditor.cxx:140 TEveGeoNodeEditor.cxx:141 TEveGeoNodeEditor.cxx:142 TEveGeoNodeEditor.cxx:143 TEveGeoNodeEditor.cxx:144 TEveGeoNodeEditor.cxx:145 TEveGeoNodeEditor.cxx:146 TEveGeoNodeEditor.cxx:147 TEveGeoNodeEditor.cxx:148 TEveGeoNodeEditor.cxx:149 TEveGeoNodeEditor.cxx:150 TEveGeoNodeEditor.cxx:151 TEveGeoNodeEditor.cxx:152 TEveGeoNodeEditor.cxx:153 TEveGeoNodeEditor.cxx:154 TEveGeoNodeEditor.cxx:155 TEveGeoNodeEditor.cxx:156 TEveGeoNodeEditor.cxx:157 TEveGeoNodeEditor.cxx:158 TEveGeoNodeEditor.cxx:159 TEveGeoNodeEditor.cxx:160 TEveGeoNodeEditor.cxx:161 TEveGeoNodeEditor.cxx:162 TEveGeoNodeEditor.cxx:163 TEveGeoNodeEditor.cxx:164 TEveGeoNodeEditor.cxx:165 TEveGeoNodeEditor.cxx:166 TEveGeoNodeEditor.cxx:167 TEveGeoNodeEditor.cxx:168 TEveGeoNodeEditor.cxx:169 TEveGeoNodeEditor.cxx:170 TEveGeoNodeEditor.cxx:171 TEveGeoNodeEditor.cxx:172 TEveGeoNodeEditor.cxx:173 TEveGeoNodeEditor.cxx:174 TEveGeoNodeEditor.cxx:175 TEveGeoNodeEditor.cxx:176 TEveGeoNodeEditor.cxx:177 TEveGeoNodeEditor.cxx:178 TEveGeoNodeEditor.cxx:179 TEveGeoNodeEditor.cxx:180 TEveGeoNodeEditor.cxx:181 TEveGeoNodeEditor.cxx:182 TEveGeoNodeEditor.cxx:183 TEveGeoNodeEditor.cxx:184 TEveGeoNodeEditor.cxx:185 TEveGeoNodeEditor.cxx:186 TEveGeoNodeEditor.cxx:187 TEveGeoNodeEditor.cxx:188 TEveGeoNodeEditor.cxx:189 TEveGeoNodeEditor.cxx:190 TEveGeoNodeEditor.cxx:191 TEveGeoNodeEditor.cxx:192 TEveGeoNodeEditor.cxx:193 TEveGeoNodeEditor.cxx:194 TEveGeoNodeEditor.cxx:195 TEveGeoNodeEditor.cxx:196 TEveGeoNodeEditor.cxx:197 TEveGeoNodeEditor.cxx:198 TEveGeoNodeEditor.cxx:199 TEveGeoNodeEditor.cxx:200 TEveGeoNodeEditor.cxx:201 TEveGeoNodeEditor.cxx:202 TEveGeoNodeEditor.cxx:203 TEveGeoNodeEditor.cxx:204 TEveGeoNodeEditor.cxx:205 TEveGeoNodeEditor.cxx:206 TEveGeoNodeEditor.cxx:207 TEveGeoNodeEditor.cxx:208 TEveGeoNodeEditor.cxx:209 TEveGeoNodeEditor.cxx:210 TEveGeoNodeEditor.cxx:211 TEveGeoNodeEditor.cxx:212 TEveGeoNodeEditor.cxx:213 TEveGeoNodeEditor.cxx:214 TEveGeoNodeEditor.cxx:215 TEveGeoNodeEditor.cxx:216 TEveGeoNodeEditor.cxx:217 TEveGeoNodeEditor.cxx:218 TEveGeoNodeEditor.cxx:219 TEveGeoNodeEditor.cxx:220 TEveGeoNodeEditor.cxx:221 TEveGeoNodeEditor.cxx:222 TEveGeoNodeEditor.cxx:223 TEveGeoNodeEditor.cxx:224 TEveGeoNodeEditor.cxx:225 TEveGeoNodeEditor.cxx:226 TEveGeoNodeEditor.cxx:227 TEveGeoNodeEditor.cxx:228 TEveGeoNodeEditor.cxx:229 TEveGeoNodeEditor.cxx:230 TEveGeoNodeEditor.cxx:231 TEveGeoNodeEditor.cxx:232 TEveGeoNodeEditor.cxx:233 TEveGeoNodeEditor.cxx:234