5 #include "TGComboBox.h" 8 #include "TGResourcePool.h" 10 #include "TGLViewer.h" 11 #include "TEveManager.h" 12 #include "TEveViewer.h" 30 #include <boost/bind.hpp> 33 TGTransientFrame(gClient->GetDefaultRoot(),p,w,h),
38 m_colorRnrCtxHighlightWidget(
nullptr),
39 m_colorRnrCtxSelectWidget(
nullptr),
42 SetCleanup(kDeepCleanup);
45 const TGFont *font = gClient->GetFont(
"-adobe-helvetica-bold-r-*-*-14-*-*-*-*-*-iso8859-1");
47 font = gClient->GetResourcePool()->GetDefaultFont();
49 gval.fMask = kGCBackground | kGCFont | kGCForeground;
50 gval.fFont = font->GetFontHandle();
51 fTextGC = gClient->GetGC(&gval, kTRUE);
54 TGCompositeFrame* vf2 =
new TGVerticalFrame(
this);
55 AddFrame(vf2,
new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
60 TGLabel*
xx =
new TGLabel(vf2,
"GlobalScales ", fTextGC->GetGC());
61 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft, 2,2,4,4));
64 vf2->AddFrame(scaleEditor);
68 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4,8,3,3));
70 TGLabel*
xx =
new TGLabel(vf2,
"Projections ", fTextGC->GetGC());
71 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft, 2,2,4,4));
73 vf2->AddFrame(
new TGLabel(vf2,
"Track behavior when crossing y=0 in RhoZ view:"),
74 new TGLayoutHints(kLHintsLeft, 2,2,0,0));
82 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4,8,8,2));
84 TGLabel*
xx =
new TGLabel(vf2,
"General Colors ", fTextGC->GetGC());
85 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft,2,2,4,4));
88 TGCompositeFrame *
hf =
new TGHorizontalFrame(vf2);
89 vf2->AddFrame(hf,
new TGLayoutHints(kLHintsExpandX));
92 hf->AddFrame(
m_backgroundButton,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,2,2,2));
93 m_backgroundButton->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"switchBackground()");
98 TGFont* smallFont =
nullptr;
102 TGFontPool *
pool = gClient->GetFontPool();
103 TGFont* defaultFont = pool->GetFont(defaultFontStruct);
104 FontAttributes_t attributes = defaultFont->GetFontAttributes();
105 smallFont = pool->GetFont(attributes.fFamily, 8, attributes.fWeight, attributes.fSlant);
120 m_combo =
static_cast<TGComboBox*
>(
static_cast<TGFrameElement*
>(f->GetList()->At(0))->fFrame);
123 TGCompositeFrame *
hf =
new TGHorizontalFrame(vf2);
124 vf2->AddFrame(hf,
new TGLayoutHints(kLHintsExpandX));
127 butt =
new TGTextButton(hf,
"Permute Colors");
128 butt->SetToolTipText(
"Randomize assigned collection colors");
129 hf->AddFrame(butt,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,2,2,2));
130 butt->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"permuteColors()");
133 butt =
new TGTextButton(hf,
"Randomize Colors");
134 butt->SetToolTipText(
"Randomize collection colors from full palette");
135 hf->AddFrame(butt,
new TGLayoutHints(kLHintsNormal, 0, 0, 2,2));
136 butt->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"randomizeColors()");
144 TGHorizontalFrame* top =
new TGHorizontalFrame(vf2);
147 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
155 TGHorizontalFrame* lf =
new TGHorizontalFrame(hf, 45, 16, kFixedSize);
156 TGLabel*
label =
new TGLabel(lf,
"Higlight");
157 label->SetTextFont(smallFont);
159 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY));
163 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
169 m_colorRnrCtxSelectWidget->Connect(
"ColorChosen(Color_t)",
"CmsShowCommonPopup",
this,
"changeSelectionColorSet(Color_t)");
171 TGHorizontalFrame* lf =
new TGHorizontalFrame(hf, 45, 16, kFixedSize);
172 TGLabel*
label =
new TGLabel(lf,
"Selection");
173 label->SetTextFont(smallFont);
175 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY));
178 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4,8,8,2));
185 TGLabel*
xx =
new TGLabel(vf2,
"DetectorColors ", fTextGC->GetGC());
186 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft,2,2,8,0));
189 TGHSlider* transpWidget2D =
nullptr;
190 TGHSlider* transpWidget3D =
nullptr;
191 TGCompositeFrame* top =
new TGVerticalFrame(vf2);
192 vf2->AddFrame(top,
new TGLayoutHints(kLHintsNormal, 2, 2, 2, 0));
195 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
196 hf->AddFrame(
new TGLabel(hf,
"Tansparency 2D:"),
new TGLayoutHints(kLHintsBottom, 2, 2, 3, 3));
197 transpWidget2D =
new TGHSlider(hf, 100, kSlider1);
198 hf->AddFrame( transpWidget2D);
199 top->AddFrame(hf,
new TGLayoutHints( kLHintsNormal, 0, 0, 2, 2));
202 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
203 hf->AddFrame(
new TGLabel(hf,
"Tansparency 3D:") ,
new TGLayoutHints(kLHintsBottom,2, 2, 2, 2 ));
204 transpWidget3D =
new TGHSlider(hf, 100, kSlider1);
205 hf->AddFrame( transpWidget3D);
206 top->AddFrame(hf,
new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 10));
216 for (
int k = 0;
k < 3; ++
k)
218 TGHorizontalFrame*
hf =
new TGHorizontalFrame(top);
221 for (
int j = 0; j < 2; ++j)
226 m_colorSelectWidget[
i]->Connect(
"ColorChosen(Color_t)",
"CmsShowCommonPopup",
this,
"changeGeomColor(Color_t)");
228 TGHorizontalFrame* lf =
new TGHorizontalFrame(hf, 100, 16, kFixedSize);
230 label->SetTextFont(smallFont);
232 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft |kLHintsCenterY , 0, 0, 0,0));
239 transpWidget2D->SetRange(0, 100);
241 transpWidget2D->Connect(
"PositionChanged(Int_t)",
"CmsShowCommonPopup",
this,
"changeGeomTransparency2D(Int_t)");
243 transpWidget3D->SetRange(0, 100);
245 transpWidget3D->Connect(
"PositionChanged(Int_t)",
"CmsShowCommonPopup",
this,
"changeGeomTransparency3D(Int_t)");
247 SetWindowName(
"Common Preferences");
249 Resize(GetDefaultSize());
251 CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
272 TGColorSelect *
cs = (TGColorSelect *) gTQSender;
281 TGColorSelect *
cs = (TGColorSelect *) gTQSender;
284 for (TEveElement::List_i it = gEve->GetViewers()->BeginChildren(); it != gEve->GetViewers()->EndChildren(); ++it)
286 TGLViewer*
v = ((TEveViewer*)(*it))->GetGLViewer();
289 colorset.Selection(cs->WidgetId()).SetColor(idx);
290 colorset.Selection(cs->WidgetId()+1).SetColor(idx);
327 TGLColor&
glc = colorset.Selection(3);
328 hci = TColor::GetColor(glc.GetRed(), glc.GetGreen(), glc.GetBlue());
332 TGLColor&
glc = colorset.Selection(1);
333 sci = TColor::GetColor(glc.GetRed(), glc.GetGreen(), glc.GetBlue());
342 ptr->attach(param,
this);
344 TGFrame* pframe = ptr->build(frame);
345 frame->AddFrame(pframe,
new TGLayoutHints(kLHintsExpandX, 0, 0, 2, 2));
TGLColorSet m_lightColorSet
Color_t geomTransparency(bool projected) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void SetColorByIndex(Color_t iColor)
FWBoolParameter m_drawBreakPoints
unique_ptr< ClusterSequence > cs
FWColorManager * colorManager() const
sigc::signal< void, T > changed_
const FWColorManager * colorManager() const
const std::string names[nVars_]
Bool_t isColorSetDark() const
void setGeomTransparency(int val, bool projected)
void setGeomColor(FWGeomColorIndex, Color_t)
fireworks::Context * m_context
FWViewEnergyScale * getEnergyScale() const
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
TGLColorSet m_darkColorSet
FWEnumParameter m_trackBreak
Color_t geomColor(FWGeomColorIndex) const
FWEnumParameter m_palette