CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
CmsShowViewPopup Class Reference

#include <Fireworks/Core/interface/CmsShowViewPopup.h>

Inheritance diagram for CmsShowViewPopup:

Public Member Functions

void backgroundColorWasChanged ()
 
void changeBackground ()
 
 ClassDefOverride (CmsShowViewPopup, 0)
 
void CloseWindow () override
 
 CmsShowViewPopup (const TGWindow *p=nullptr, UInt_t w=200, UInt_t h=200, FWColorManager *cm=nullptr, FWViewBase *wb=nullptr, TEveWindow *ew=nullptr)
 
TEveWindow * getEveWindow () const
 
bool mapped ()
 
void MapWindow () override
 
void reset (FWViewBase *, TEveWindow *ew)
 
void saveImage ()
 
void UnmapWindow () override
 
 ~CmsShowViewPopup () override
 

Public Attributes

sigc::signal< void > closed_
 

Private Member Functions

 CmsShowViewPopup (const CmsShowViewPopup &)
 
const CmsShowViewPopupoperator= (const CmsShowViewPopup &)
 

Private Attributes

TGTextButton * m_changeBackground
 
FWColorManagerm_colorManager
 
TEveWindow * m_eveWindow
 
bool m_mapped
 
ViewerParameterGUIm_paramGUI
 
TGTextButton * m_saveImageButton
 
FWViewBasem_viewBase
 
TGLabel * m_viewLabel
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 73 of file CmsShowViewPopup.h.

Constructor & Destructor Documentation

◆ CmsShowViewPopup() [1/2]

CmsShowViewPopup::CmsShowViewPopup ( const TGWindow *  p = nullptr,
UInt_t  w = 200,
UInt_t  h = 200,
FWColorManager cm = nullptr,
FWViewBase wb = nullptr,
TEveWindow *  ew = nullptr 
)

Definition at line 43 of file CmsShowViewPopup.cc.

45  : TGTransientFrame(gClient->GetDefaultRoot(), p, w, h),
46  m_mapped(kFALSE),
47  m_viewLabel(nullptr),
48  m_paramGUI(nullptr),
49  m_saveImageButton(nullptr),
50  m_changeBackground(nullptr),
51  m_colorManager(iCMgr),
52  m_viewBase(nullptr),
53  m_eveWindow(nullptr) {
55 
56  SetCleanup(kDeepCleanup);
57 
58  // label
59  TGHorizontalFrame* viewFrame = new TGHorizontalFrame(this);
60  m_viewLabel = new TGLabel(viewFrame, "No view selected");
61  try {
62  TGFont* defaultFont = gClient->GetFontPool()->GetFont(m_viewLabel->GetDefaultFontStruct());
63  m_viewLabel->SetTextFont(gClient->GetFontPool()->GetFont(defaultFont->GetFontAttributes().fFamily,
64  14,
65  defaultFont->GetFontAttributes().fWeight + 2,
66  defaultFont->GetFontAttributes().fSlant));
67  } catch (...) {
68  // FIXME: looks like under certain conditions (e.g. in full framework)
69  // GetFontPool() throws when the default font is not found. This is a
70  // quick workaround, but we should probably investigate more.
71  }
72 
73  m_viewLabel->SetTextJustify(kTextLeft);
74  viewFrame->AddFrame(m_viewLabel, new TGLayoutHints(kLHintsExpandX));
75  AddFrame(viewFrame, new TGLayoutHints(kLHintsExpandX, 2, 2, 0, 0));
76  // background
77  m_changeBackground = new TGTextButton(this, "Change Background Color");
79  AddFrame(m_changeBackground, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 5));
80  m_changeBackground->Connect("Clicked()", "CmsShowViewPopup", this, "changeBackground()");
81  // save image
82  m_saveImageButton = new TGTextButton(this, "Save Image ...");
83  AddFrame(m_saveImageButton, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 5));
84  m_saveImageButton->Connect("Clicked()", "CmsShowViewPopup", this, "saveImage()");
85 
86  // content frame
87  AddFrame(new TGHorizontal3DLine(this), new TGLayoutHints(kLHintsExpandX, 0, 0, 5, 5));
88  m_paramGUI = new ViewerParameterGUI(this);
89  AddFrame(m_paramGUI, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
90 
91  SetWindowName("View Controller");
92 }

References backgroundColorWasChanged(), FWColorManager::colorsHaveChanged_, m_changeBackground, m_colorManager, m_paramGUI, m_saveImageButton, and m_viewLabel.

◆ ~CmsShowViewPopup()

CmsShowViewPopup::~CmsShowViewPopup ( )
override

Definition at line 99 of file CmsShowViewPopup.cc.

99 {}

◆ CmsShowViewPopup() [2/2]

CmsShowViewPopup::CmsShowViewPopup ( const CmsShowViewPopup )
private

Member Function Documentation

◆ backgroundColorWasChanged()

void CmsShowViewPopup::backgroundColorWasChanged ( )

Definition at line 160 of file CmsShowViewPopup.cc.

160  {
162  m_changeBackground->SetText("Change Background Color to White");
163  } else {
164  m_changeBackground->SetText("Change Background Color to Black");
165  }
166 }

References FWColorManager::backgroundColorIndex(), FWColorManager::kBlackIndex, m_changeBackground, and m_colorManager.

Referenced by CmsShowViewPopup().

◆ changeBackground()

void CmsShowViewPopup::changeBackground ( )

◆ ClassDefOverride()

CmsShowViewPopup::ClassDefOverride ( CmsShowViewPopup  ,
 
)

◆ CloseWindow()

void CmsShowViewPopup::CloseWindow ( )
override

Definition at line 134 of file CmsShowViewPopup.cc.

134  {
135  UnmapWindow();
136  closed_.emit();
137 }

References closed_, and UnmapWindow().

◆ getEveWindow()

TEveWindow* CmsShowViewPopup::getEveWindow ( ) const
inline

Definition at line 100 of file CmsShowViewPopup.h.

100 { return m_eveWindow; }

References m_eveWindow.

Referenced by FWGUIManager::checkSubviewAreaIconState(), and FWGUIManager::popupViewClosed().

◆ mapped()

bool CmsShowViewPopup::mapped ( )
inline

Definition at line 93 of file CmsShowViewPopup.h.

93 { return m_mapped; }

References m_mapped.

Referenced by FWGUIManager::checkSubviewAreaIconState().

◆ MapWindow()

void CmsShowViewPopup::MapWindow ( )
override

Definition at line 139 of file CmsShowViewPopup.cc.

139  {
140  TGWindow::MapWindow();
141  m_mapped = true;
142 }

References m_mapped.

◆ operator=()

const CmsShowViewPopup& CmsShowViewPopup::operator= ( const CmsShowViewPopup )
private

◆ reset()

void CmsShowViewPopup::reset ( FWViewBase vb,
TEveWindow *  ew 
)

Definition at line 101 of file CmsShowViewPopup.cc.

101  {
102  m_viewBase = vb;
103  m_eveWindow = ew;
104 
105  m_paramGUI->reset();
106 
107  // fill content
108  if (m_viewBase) {
109  m_saveImageButton->SetEnabled(kTRUE);
110  m_viewLabel->SetText(m_viewBase->typeName().c_str());
113 
114  fMain = m_eveWindow->GetEveFrame();
115 
116  if (vb->typeId() >= FWViewType::kTable)
117  m_saveImageButton->SetText("Print Text To Terminal");
118  else
119  m_saveImageButton->SetText("Save Image ...");
120  } else {
121  fMain = nullptr;
122  m_viewLabel->SetText("No view selected");
123  m_saveImageButton->SetEnabled(kFALSE);
124  }
125 
126  MapSubwindows();
127  Resize(GetDefaultSize());
128  Layout();
129  if (fMain) {
130  CenterOnParent(kTRUE, TGTransientFrame::kTopRight);
131  }
132 }

References FWViewType::kTable, m_eveWindow, m_paramGUI, m_saveImageButton, m_viewBase, m_viewLabel, ViewerParameterGUI::populateComplete(), FWViewBase::populateController(), ViewerParameterGUI::reset(), FWViewBase::typeId(), and FWViewBase::typeName().

Referenced by FWGUIManager::setViewPopup().

◆ saveImage()

void CmsShowViewPopup::saveImage ( )

Definition at line 149 of file CmsShowViewPopup.cc.

149  {
150  if (m_viewBase)
152 }

References m_viewBase, and FWViewBase::promptForSaveImageTo().

◆ UnmapWindow()

void CmsShowViewPopup::UnmapWindow ( )
override

Definition at line 144 of file CmsShowViewPopup.cc.

144  {
145  TGWindow::UnmapWindow();
146  m_mapped = false;
147 }

References m_mapped.

Referenced by CloseWindow(), FWGUIManager::setViewPopup(), and FWGUIManager::subviewInfoUnselected().

Member Data Documentation

◆ closed_

sigc::signal<void> CmsShowViewPopup::closed_

Definition at line 102 of file CmsShowViewPopup.h.

Referenced by CloseWindow(), and FWGUIManager::setViewPopup().

◆ m_changeBackground

TGTextButton* CmsShowViewPopup::m_changeBackground
private

Definition at line 118 of file CmsShowViewPopup.h.

Referenced by backgroundColorWasChanged(), and CmsShowViewPopup().

◆ m_colorManager

FWColorManager* CmsShowViewPopup::m_colorManager
private

◆ m_eveWindow

TEveWindow* CmsShowViewPopup::m_eveWindow
private

Definition at line 122 of file CmsShowViewPopup.h.

Referenced by getEveWindow(), and reset().

◆ m_mapped

bool CmsShowViewPopup::m_mapped
private

Definition at line 113 of file CmsShowViewPopup.h.

Referenced by mapped(), MapWindow(), and UnmapWindow().

◆ m_paramGUI

ViewerParameterGUI* CmsShowViewPopup::m_paramGUI
private

Definition at line 116 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

◆ m_saveImageButton

TGTextButton* CmsShowViewPopup::m_saveImageButton
private

Definition at line 117 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

◆ m_viewBase

FWViewBase* CmsShowViewPopup::m_viewBase
private

Definition at line 121 of file CmsShowViewPopup.h.

Referenced by reset(), and saveImage().

◆ m_viewLabel

TGLabel* CmsShowViewPopup::m_viewLabel
private

Definition at line 115 of file CmsShowViewPopup.h.

Referenced by CmsShowViewPopup(), and reset().

CmsShowViewPopup::m_saveImageButton
TGTextButton * m_saveImageButton
Definition: CmsShowViewPopup.h:117
ViewerParameterGUI
Definition: CmsShowViewPopup.h:49
FWViewBase::typeName
const std::string & typeName() const
Definition: FWViewBase.cc:107
CmsShowViewPopup::m_mapped
bool m_mapped
Definition: CmsShowViewPopup.h:113
CmsShowViewPopup::m_viewBase
FWViewBase * m_viewBase
Definition: CmsShowViewPopup.h:121
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
FWColorManager::colorsHaveChanged_
sigc::signal< void > colorsHaveChanged_
Definition: FWColorManager.h:101
CmsShowViewPopup::m_viewLabel
TGLabel * m_viewLabel
Definition: CmsShowViewPopup.h:115
FWColorManager::backgroundColorIndex
BackgroundColorIndex backgroundColorIndex() const
Definition: FWColorManager.cc:260
CmsShowViewPopup::backgroundColorWasChanged
void backgroundColorWasChanged()
Definition: CmsShowViewPopup.cc:160
FWViewBase::typeId
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
CmsShowViewPopup::m_paramGUI
ViewerParameterGUI * m_paramGUI
Definition: CmsShowViewPopup.h:116
w
const double w
Definition: UKUtility.cc:23
CmsShowViewPopup::m_eveWindow
TEveWindow * m_eveWindow
Definition: CmsShowViewPopup.h:122
ViewerParameterGUI::reset
void reset()
Definition: CmsShowViewPopup.cc:175
CmsShowViewPopup::UnmapWindow
void UnmapWindow() override
Definition: CmsShowViewPopup.cc:144
FWViewBase::populateController
virtual void populateController(ViewerParameterGUI &) const
Definition: FWViewBase.h:49
CmsShowViewPopup::closed_
sigc::signal< void > closed_
Definition: CmsShowViewPopup.h:102
FWColorManager::setBackgroundColorIndex
void setBackgroundColorIndex(BackgroundColorIndex)
Definition: FWColorManager.cc:206
FWColorManager::kWhiteIndex
Definition: FWColorManager.h:73
ViewerParameterGUI::populateComplete
void populateComplete()
Definition: CmsShowViewPopup.cc:256
FWColorManager::kBlackIndex
Definition: FWColorManager.h:73
FWViewBase::promptForSaveImageTo
void promptForSaveImageTo(TGFrame *) const
Definition: FWViewBase.cc:62
CmsShowViewPopup::m_changeBackground
TGTextButton * m_changeBackground
Definition: CmsShowViewPopup.h:118
CmsShowViewPopup::m_colorManager
FWColorManager * m_colorManager
Definition: CmsShowViewPopup.h:120
FWViewType::kTable
Definition: FWViewType.h:39