CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
ViewerParameterGUI Class Reference

#include <CmsShowViewPopup.h>

Inheritance diagram for ViewerParameterGUI:
FWParameterSetterEditorBase

Public Member Functions

void addFrameToContainer (TGCompositeFrame *)
 
ViewerParameterGUIaddParam (const FWParameterBase *)
 
TGCompositeFrame * getTabContainer ()
 
void populateComplete ()
 
ViewerParameterGUIrequestTab (const char *)
 
void reset ()
 
ViewerParameterGUIseparator ()
 
 ViewerParameterGUI (const TGFrame *)
 
 ~ViewerParameterGUI () override
 
- Public Member Functions inherited from FWParameterSetterEditorBase
 FWParameterSetterEditorBase ()
 
 FWParameterSetterEditorBase (const FWParameterSetterEditorBase &)=delete
 
const FWParameterSetterEditorBaseoperator= (const FWParameterSetterEditorBase &)=delete
 
virtual void updateEditor ()
 
virtual ~FWParameterSetterEditorBase ()
 

Private Attributes

std::string m_selectedTabName
 
std::vector< std::shared_ptr
< FWParameterSetterBase > > 
m_setters
 
TGTab * m_tab
 

Detailed Description

Definition at line 49 of file CmsShowViewPopup.h.

Constructor & Destructor Documentation

ViewerParameterGUI::ViewerParameterGUI ( const TGFrame *  p)

Definition at line 170 of file CmsShowViewPopup.cc.

171  : TGCompositeFrame(p), m_tab(nullptr), m_selectedTabName("Style") {
172  SetCleanup(kDeepCleanup);
173 }
std::string m_selectedTabName
ViewerParameterGUI::~ViewerParameterGUI ( )
inlineoverride

Definition at line 52 of file CmsShowViewPopup.h.

52 {}

Member Function Documentation

void ViewerParameterGUI::addFrameToContainer ( TGCompositeFrame *  x)

Definition at line 245 of file CmsShowViewPopup.cc.

References cms::cuda::assert(), m_tab, and SpecificationBuilder_cfi::parent().

Referenced by FWEveView::populateController().

245  {
246  assert(m_tab);
247  TGCompositeFrame* parent = m_tab->GetCurrentContainer();
248  parent->AddFrame(x, new TGLayoutHints(kLHintsExpandX, 4, 4, 2, 2));
249 
250  parent->MapSubwindows();
251  parent->Layout();
252  m_tab->Layout();
253  parent->Resize(parent->GetDefaultSize());
254 }
assert(be >=bs)
ViewerParameterGUI & ViewerParameterGUI::addParam ( const FWParameterBase param)

Definition at line 212 of file CmsShowViewPopup.cc.

References m_setters, m_tab, FWParameterSetterBase::makeSetterFor(), and SpecificationBuilder_cfi::parent().

Referenced by FWGeometryTableView::populateController(), FWOverlapTableView::populateController(), FWRPZView::populateController(), FW3DViewBase::populateController(), FWLegoViewBase::populateController(), FWEveView::populateController(), FWTriggerTableView::populateController(), and FWGeometryTableViewBase::populateController().

212  {
213  std::shared_ptr<FWParameterSetterBase> ptr(FWParameterSetterBase::makeSetterFor((FWParameterBase*)param));
214  ptr->attach((FWParameterBase*)param, this);
215  TGCompositeFrame* parent = m_tab->GetCurrentContainer();
216 
217  TGFrame* pframe = ptr->build(parent);
218  parent->AddFrame(pframe, new TGLayoutHints(kLHintsExpandX));
219  m_setters.push_back(ptr);
220 
221  pframe->MapWindow();
222  pframe->MapSubwindows();
223  pframe->Layout();
224  parent->MapSubwindows();
225  parent->Layout();
226  m_tab->Layout();
227  parent->Resize(parent->GetDefaultSize());
228  return *this;
229 }
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
TGCompositeFrame * ViewerParameterGUI::getTabContainer ( )
void ViewerParameterGUI::populateComplete ( )

Definition at line 256 of file CmsShowViewPopup.cc.

References m_selectedTabName, m_tab, and x.

Referenced by CmsShowViewPopup::reset().

256  {
257  // Set tab - same as it was before, if not exisiting select first time.
258  if (m_tab) {
259  bool x = m_tab->SetTab(m_selectedTabName.c_str(), false);
260  if (!x)
261  m_tab->SetTab("Style");
262  }
263 }
std::string m_selectedTabName
ViewerParameterGUI & ViewerParameterGUI::requestTab ( const char *  name)

Definition at line 197 of file CmsShowViewPopup.cc.

References m_tab.

Referenced by FWGeometryTableView::populateController(), FWOverlapTableView::populateController(), FWRPZView::populateController(), FW3DViewBase::populateController(), FWLegoViewBase::populateController(), FWEveView::populateController(), FWTriggerTableView::populateController(), and FWGeometryTableViewBase::populateController().

197  {
198  if (!m_tab) {
199  m_tab = new TGTab(this);
200  AddFrame(m_tab, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
201  }
202 
203  if (!m_tab->GetTabContainer(name))
204  m_tab->AddTab(name);
205 
206  m_tab->SetTab(name);
207 
208  return *this;
209 }
void ViewerParameterGUI::reset ( void  )

Definition at line 175 of file CmsShowViewPopup.cc.

References cms::cuda::assert(), validate-o2o-wbm::f, m_selectedTabName, m_setters, and m_tab.

Referenced by CmsShowViewPopup::reset().

175  {
176  // remember selected tab
177  if (m_tab)
178  m_selectedTabName = m_tab->GetCurrentTab()->GetString();
179  else
180  m_selectedTabName = "Style";
181 
182  // remove TGTab as the only child
183  m_setters.clear();
184  if (m_tab) {
185  assert(GetList()->GetSize() == 1);
186  TGFrameElement* el = (TGFrameElement*)GetList()->First();
187  TGFrame* f = el->fFrame;
188 
189  assert(f == m_tab);
190  f->UnmapWindow();
191  RemoveFrame(f);
192  f->DeleteWindow();
193  m_tab = nullptr;
194  }
195 }
std::string m_selectedTabName
assert(be >=bs)
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
ViewerParameterGUI & ViewerParameterGUI::separator ( )

Definition at line 232 of file CmsShowViewPopup.cc.

References cms::cuda::assert(), m_tab, and alignCSCRings::s.

Referenced by FWGeometryTableView::populateController(), FWOverlapTableView::populateController(), FWRPZView::populateController(), FW3DViewBase::populateController(), FWLegoViewBase::populateController(), FWEveView::populateController(), and FWGeometryTableViewBase::populateController().

232  {
233  assert(m_tab);
234  TGHorizontal3DLine* s = new TGHorizontal3DLine(m_tab->GetCurrentContainer());
235  m_tab->GetCurrentContainer()->AddFrame(s, new TGLayoutHints(kLHintsExpandX, 4, 4, 2, 2));
236 
237  return *this;
238 }
assert(be >=bs)

Member Data Documentation

std::string ViewerParameterGUI::m_selectedTabName
private

Definition at line 65 of file CmsShowViewPopup.h.

Referenced by populateComplete(), and reset().

std::vector<std::shared_ptr<FWParameterSetterBase> > ViewerParameterGUI::m_setters
private

Definition at line 67 of file CmsShowViewPopup.h.

Referenced by addParam(), and reset().

TGTab* ViewerParameterGUI::m_tab
private