5 #include "TGComboBox.h"
8 #include "TGResourcePool.h"
10 #include "TGLViewer.h"
11 #include "TEveManager.h"
12 #include "TEveViewer.h"
29 #include <boost/bind.hpp>
32 TGTransientFrame(gClient->GetDefaultRoot(),p,w,h),
34 m_backgroundButton(0),
37 m_colorRnrCtxHighlightWidget(0),
38 m_colorRnrCtxSelectWidget(0),
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);
53 TGCompositeFrame* vf2 =
new TGVerticalFrame(
this);
54 AddFrame(vf2,
new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
59 TGLabel* xx =
new TGLabel(vf2,
"GlobalScales ", fTextGC->GetGC());
60 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft, 2,2,4,4));
63 vf2->AddFrame(scaleEditor);
67 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4,8,3,3));
69 TGLabel* xx =
new TGLabel(vf2,
"Projections ", fTextGC->GetGC());
70 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft, 2,2,4,4));
72 vf2->AddFrame(
new TGLabel(vf2,
"Track behavior when crossing y=0 in RhoZ view:"),
73 new TGLayoutHints(kLHintsLeft, 2,2,0,0));
81 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4,8,8,2));
83 TGLabel* xx =
new TGLabel(vf2,
"General Colors ", fTextGC->GetGC());
84 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft,2,2,4,4));
87 TGCompositeFrame *hf =
new TGHorizontalFrame(vf2);
88 vf2->AddFrame(hf,
new TGLayoutHints(kLHintsExpandX));
91 hf->AddFrame(
m_backgroundButton,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,2,2,2));
92 m_backgroundButton->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"switchBackground()");
97 TGFont* smallFont = 0;
101 TGFontPool *
pool = gClient->GetFontPool();
102 TGFont* defaultFont = pool->GetFont(defaultFontStruct);
103 FontAttributes_t attributes = defaultFont->GetFontAttributes();
104 smallFont = pool->GetFont(attributes.fFamily, 8, attributes.fWeight, attributes.fSlant);
119 m_combo =
static_cast<TGComboBox*
>(
static_cast<TGFrameElement*
>(f->GetList()->At(0))->fFrame);
122 TGCompositeFrame *hf =
new TGHorizontalFrame(vf2);
123 vf2->AddFrame(hf,
new TGLayoutHints(kLHintsExpandX));
126 butt =
new TGTextButton(hf,
"Permute Colors");
127 butt->SetToolTipText(
"Randomize assigned collection colors");
128 hf->AddFrame(butt,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY, 2,2,2,2));
129 butt->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"permuteColors()");
132 butt =
new TGTextButton(hf,
"Randomize Colors");
133 butt->SetToolTipText(
"Randomize collection colors from full palette");
134 hf->AddFrame(butt,
new TGLayoutHints(kLHintsNormal, 0, 0, 2,2));
135 butt->Connect(
"Clicked()",
"CmsShowCommonPopup",
this,
"randomizeColors()");
143 TGHorizontalFrame* top =
new TGHorizontalFrame(vf2);
146 TGHorizontalFrame* hf =
new TGHorizontalFrame(top);
154 TGHorizontalFrame* lf =
new TGHorizontalFrame(hf, 45, 16, kFixedSize);
155 TGLabel*
label =
new TGLabel(lf,
"Higlight");
156 label->SetTextFont(smallFont);
158 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY));
162 TGHorizontalFrame* hf =
new TGHorizontalFrame(top);
168 m_colorRnrCtxSelectWidget->Connect(
"ColorChosen(Color_t)",
"CmsShowCommonPopup",
this,
"changeSelectionColorSet(Color_t)");
170 TGHorizontalFrame* lf =
new TGHorizontalFrame(hf, 45, 16, kFixedSize);
171 TGLabel*
label =
new TGLabel(lf,
"Selection");
172 label->SetTextFont(smallFont);
174 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft|kLHintsCenterY));
177 vf2->AddFrame(
new TGHorizontal3DLine(vf2),
new TGLayoutHints(kLHintsExpandX, 4,8,8,2));
184 TGLabel* xx =
new TGLabel(vf2,
"DetectorColors ", fTextGC->GetGC());
185 vf2->AddFrame(xx,
new TGLayoutHints(kLHintsLeft,2,2,8,0));
188 TGHSlider* transpWidget2D = 0;
189 TGHSlider* transpWidget3D = 0;
190 TGCompositeFrame* top =
new TGVerticalFrame(vf2);
191 vf2->AddFrame(top,
new TGLayoutHints(kLHintsNormal, 2, 2, 2, 0));
194 TGHorizontalFrame* hf =
new TGHorizontalFrame(top);
195 hf->AddFrame(
new TGLabel(hf,
"Tansparency 2D:"),
new TGLayoutHints(kLHintsBottom, 2, 2, 3, 3));
196 transpWidget2D =
new TGHSlider(hf, 100, kSlider1);
197 hf->AddFrame( transpWidget2D);
198 top->AddFrame(hf,
new TGLayoutHints( kLHintsNormal, 0, 0, 2, 2));
201 TGHorizontalFrame* hf =
new TGHorizontalFrame(top);
202 hf->AddFrame(
new TGLabel(hf,
"Tansparency 3D:") ,
new TGLayoutHints(kLHintsBottom,2, 2, 2, 2 ));
203 transpWidget3D =
new TGHSlider(hf, 100, kSlider1);
204 hf->AddFrame( transpWidget3D);
205 top->AddFrame(hf,
new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 10));
215 for (
int k = 0;
k < 3; ++
k)
217 TGHorizontalFrame* hf =
new TGHorizontalFrame(top);
220 for (
int j = 0;
j < 2; ++
j)
225 m_colorSelectWidget[
i]->Connect(
"ColorChosen(Color_t)",
"CmsShowCommonPopup",
this,
"changeGeomColor(Color_t)");
227 TGHorizontalFrame* lf =
new TGHorizontalFrame(hf, 100, 16, kFixedSize);
229 label->SetTextFont(smallFont);
231 hf->AddFrame(lf,
new TGLayoutHints(kLHintsLeft |kLHintsCenterY , 0, 0, 0,0));
238 transpWidget2D->SetRange(0, 100);
240 transpWidget2D->Connect(
"PositionChanged(Int_t)",
"CmsShowCommonPopup",
this,
"changeGeomTransparency2D(Int_t)");
242 transpWidget3D->SetRange(0, 100);
244 transpWidget3D->Connect(
"PositionChanged(Int_t)",
"CmsShowCommonPopup",
this,
"changeGeomTransparency3D(Int_t)");
246 SetWindowName(
"Common Preferences");
248 Resize(GetDefaultSize());
250 CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
271 TGColorSelect *
cs = (TGColorSelect *) gTQSender;
280 TGColorSelect *
cs = (TGColorSelect *) gTQSender;
283 for (TEveElement::List_i it = gEve->GetViewers()->BeginChildren(); it != gEve->GetViewers()->EndChildren(); ++it)
285 TGLViewer*
v = ((TEveViewer*)(*it))->GetGLViewer();
288 colorset.Selection(cs->WidgetId()).SetColor(idx);
289 colorset.Selection(cs->WidgetId()+1).SetColor(idx);
326 TGLColor&
glc = colorset.Selection(3);
327 hci = TColor::GetColor(glc.GetRed(), glc.GetGreen(), glc.GetBlue());
331 TGLColor&
glc = colorset.Selection(1);
332 sci = TColor::GetColor(glc.GetRed(), glc.GetGreen(), glc.GetBlue());
341 ptr->attach(param,
this);
343 TGFrame* pframe = ptr->build(frame);
344 frame->AddFrame(pframe,
new TGLayoutHints(kLHintsExpandX, 0, 0, 2, 2));
TGLColorSet m_lightColorSet
auto_ptr< ClusterSequence > cs
static const HistoName names[]
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
FWColorManager * colorManager() const
static boost::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
sigc::signal< void, T > changed_
const FWColorManager * colorManager() const
Bool_t isColorSetDark() const
void setGeomTransparency(int val, bool projected)
void setGeomColor(FWGeomColorIndex, Color_t)
fireworks::Context * m_context
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::auto_ptr< FWViewEnergyScale > m_energyScale
TGLColorSet m_darkColorSet
FWEnumParameter m_trackBreak
Color_t geomColor(FWGeomColorIndex) const
FWEnumParameter m_palette