5 #include "TGComboBox.h" 8 #include "TGResourcePool.h" 10 #include "TGLViewer.h" 11 #include "TEveManager.h" 12 #include "TEveViewer.h" 33 : TGTransientFrame(gClient->GetDefaultRoot(),
p,
w,
h),
35 m_backgroundButton(nullptr),
36 m_gammaSlider(nullptr),
37 m_gammaButton(nullptr),
38 m_colorRnrCtxHighlightWidget(nullptr),
39 m_colorRnrCtxSelectWidget(nullptr),
41 SetCleanup(kDeepCleanup);
44 const TGFont* font = gClient->GetFont(
"-adobe-helvetica-bold-r-*-*-14-*-*-*-*-*-iso8859-1");
46 font = gClient->GetResourcePool()->GetDefaultFont();
48 gval.fMask = kGCBackground | kGCFont | kGCForeground;
49 gval.fFont = font->GetFontHandle();
50 fTextGC = gClient->GetGC(&gval, kTRUE);
52 TGCompositeFrame* vf2 =
new TGVerticalFrame(
this);
53 AddFrame(vf2,
new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
58 TGLabel*
xx =
new TGLabel(vf2,
"GlobalScales ", fTextGC->GetGC());
59 vf2->AddFrame(
xx,
new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
62 vf2->AddFrame(scaleEditor);
66 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4, 8, 3, 3));
68 TGLabel*
xx =
new TGLabel(vf2,
"Projections ", fTextGC->GetGC());
69 vf2->AddFrame(
xx,
new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
71 vf2->AddFrame(
new TGLabel(vf2,
"Track behavior when crossing y=0 in RhoZ view:"),
72 new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
80 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4, 8, 8, 2));
82 TGLabel*
xx =
new TGLabel(vf2,
"General Colors ", fTextGC->GetGC());
83 vf2->AddFrame(
xx,
new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
86 TGCompositeFrame*
hf =
new TGHorizontalFrame(vf2);
87 vf2->AddFrame(
hf,
new TGLayoutHints(kLHintsExpandX));
91 m_backgroundButton->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"switchBackground()");
96 TGFont* smallFont =
nullptr;
99 TGFontPool*
pool = gClient->GetFontPool();
100 TGFont* defaultFont =
pool->GetFont(defaultFontStruct);
101 FontAttributes_t attributes = defaultFont->GetFontAttributes();
102 smallFont =
pool->GetFont(attributes.fFamily, 8, attributes.fWeight, attributes.fSlant);
114 m_combo =
static_cast<TGComboBox*
>(
static_cast<TGFrameElement*
>(
f->GetList()->At(0))->fFrame);
117 TGCompositeFrame*
hf =
new TGHorizontalFrame(vf2);
118 vf2->AddFrame(
hf,
new TGLayoutHints(kLHintsExpandX));
121 butt =
new TGTextButton(
hf,
"Permute Colors");
122 butt->SetToolTipText(
"Randomize assigned collection colors");
123 hf->AddFrame(butt,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 2, 2, 2));
124 butt->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"permuteColors()");
126 butt =
new TGTextButton(
hf,
"Randomize Colors");
127 butt->SetToolTipText(
"Randomize collection colors from full palette");
128 hf->AddFrame(butt,
new TGLayoutHints(kLHintsNormal, 0, 0, 2, 2));
129 butt->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"randomizeColors()");
137 TGHorizontalFrame* top =
new TGHorizontalFrame(vf2);
140 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
147 "ColorChosen(Color_t)",
"CmsShowCommonPopup",
this,
"changeSelectionColorSet(Color_t)");
149 TGHorizontalFrame* lf =
new TGHorizontalFrame(
hf, 45, 16, kFixedSize);
150 TGLabel*
label =
new TGLabel(lf,
"Higlight");
151 label->SetTextFont(smallFont);
153 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
157 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
164 "ColorChosen(Color_t)",
"CmsShowCommonPopup",
this,
"changeSelectionColorSet(Color_t)");
166 TGHorizontalFrame* lf =
new TGHorizontalFrame(
hf, 45, 16, kFixedSize);
167 TGLabel*
label =
new TGLabel(lf,
"Selection");
168 label->SetTextFont(smallFont);
170 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
173 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4, 8, 8, 2));
180 TGLabel*
xx =
new TGLabel(vf2,
"DetectorColors ", fTextGC->GetGC());
181 vf2->AddFrame(
xx,
new TGLayoutHints(kLHintsLeft, 2, 2, 8, 0));
184 TGHSlider* transpWidget2D =
nullptr;
185 TGHSlider* transpWidget3D =
nullptr;
186 TGCompositeFrame* top =
new TGVerticalFrame(vf2);
187 vf2->AddFrame(top,
new TGLayoutHints(kLHintsNormal, 2, 2, 2, 0));
190 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
191 hf->AddFrame(
new TGLabel(
hf,
"Tansparency 2D:"),
new TGLayoutHints(kLHintsBottom, 2, 2, 3, 3));
192 transpWidget2D =
new TGHSlider(
hf, 100, kSlider1);
193 hf->AddFrame(transpWidget2D);
194 top->AddFrame(
hf,
new TGLayoutHints(kLHintsNormal, 0, 0, 2, 2));
197 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
198 hf->AddFrame(
new TGLabel(
hf,
"Tansparency 3D:"),
new TGLayoutHints(kLHintsBottom, 2, 2, 2, 2));
199 transpWidget3D =
new TGHSlider(
hf, 100, kSlider1);
200 hf->AddFrame(transpWidget3D);
201 top->AddFrame(
hf,
new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 10));
212 for (
int k = 0;
k < 3; ++
k) {
213 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
215 for (
int j = 0;
j < 3; ++
j) {
219 m_colorSelectWidget[
i]->Connect(
"ColorChosen(Color_t)",
"CmsShowCommonPopup",
this,
"changeGeomColor(Color_t)");
221 TGHorizontalFrame* lf =
new TGHorizontalFrame(
hf, 100, 16, kFixedSize);
223 label->SetTextFont(smallFont);
225 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 0, 0, 0));
232 transpWidget2D->SetRange(0, 100);
234 transpWidget2D->Connect(
"PositionChanged(Int_t)",
"CmsShowCommonPopup",
this,
"changeGeomTransparency2D(Int_t)");
236 transpWidget3D->SetRange(0, 100);
238 transpWidget3D->Connect(
"PositionChanged(Int_t)",
"CmsShowCommonPopup",
this,
"changeGeomTransparency3D(Int_t)");
240 SetWindowName(
"Common Preferences");
242 Resize(GetDefaultSize());
244 CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
258 TGColorSelect*
cs = (TGColorSelect*)gTQSender;
264 TGColorSelect*
cs = (TGColorSelect*)gTQSender;
267 for (TEveElement::List_i
it = gEve->GetViewers()->BeginChildren();
it != gEve->GetViewers()->EndChildren(); ++
it) {
268 TGLViewer*
v = ((TEveViewer*)(*
it))->GetGLViewer();
271 colorset.Selection(
cs->WidgetId()).SetColor(
idx);
272 colorset.Selection(
cs->WidgetId() + 1).SetColor(
idx);
293 TGLColorSet& colorset =
296 TGLColor& glc = colorset.Selection(3);
297 hci = TColor::GetColor(glc.GetRed(), glc.GetGreen(), glc.GetBlue());
301 TGLColor& glc = colorset.Selection(1);
302 sci = TColor::GetColor(glc.GetRed(), glc.GetGreen(), glc.GetBlue());
309 ptr->attach(param,
this);
311 TGFrame* pframe = ptr->build(
frame);
312 frame->AddFrame(pframe,
new TGLayoutHints(kLHintsExpandX, 0, 0, 2, 2));
TGLColorSet m_lightColorSet
void SetColorByIndex(Color_t iColor)
FWBoolParameter m_drawBreakPoints
Bool_t isColorSetDark() const
Color_t geomTransparency(bool projected) const
const std::string names[nVars_]
void setGeomTransparency(int val, bool projected)
Color_t geomColor(FWGeomColorIndex) const
void setGeomColor(FWGeomColorIndex, Color_t)
fireworks::Context * m_context
const FWColorManager * colorManager() const
FWViewEnergyScale * getEnergyScale() const
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
TGLColorSet m_darkColorSet
sigc::signal< void(T)> changed_
FWEnumParameter m_trackBreak
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
FWColorManager * colorManager() const
FWEnumParameter m_palette