CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Friends
FWGeometryTableManagerBase Class Referenceabstract

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

Inheritance diagram for FWGeometryTableManagerBase:
FWTableManagerBase FWGeometryTableManager FWOverlapTableManager

Classes

class  ColorBoxRenderer
 
struct  NodeInfo
 

Public Types

enum  Bits {
  kExpanded = BIT(0), kVisNodeSelf = BIT(1), kVisNodeChld = BIT(2), kHighlighted = BIT(3),
  kSelected = BIT(4)
}
 
typedef Entries_v::iterator Entries_i
 
typedef std::vector< NodeInfoEntries_v
 

Public Member Functions

virtual void applyColorTranspToDaughters (int selectedIdx, bool recurse)
 
void applyTransparencyFromEditor ()
 
void cancelEditor (bool)
 
virtual bool cellDataIsSortable () const
 
virtual const char * cellName (const NodeInfo &) const
 
bool firstColumnClicked (int row, int xPos)
 
 FWGeometryTableManagerBase ()
 
 FWGeometryTableManagerBase (const FWGeometryTableManagerBase &)
 
int getLevelOffset () const
 
void getNodeMatrix (const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
 
void getNodePath (int, std::string &) const
 
NodeInfogetSelected ()
 
virtual std::vector< std::string > getTitles () const
 returns the title names for each column More...
 
virtual bool getVisibility (const NodeInfo &nodeInfo) const
 
virtual bool getVisibilityChld (const NodeInfo &nodeInfo) const
 
virtual void implSort (int, bool)
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. More...
 
bool isNodeRendered (int idx, int top_node_idx) const
 
void loadGeometry (TGeoNode *, TObjArray *)
 
bool nodeImported (int idx) const
 
virtual int numberOfRows () const
 Number of rows in the table. More...
 
const FWGeometryTableManagerBaseoperator= (const FWGeometryTableManagerBase &)
 
virtual void recalculateVisibility ()=0
 
void redrawTable (bool setExpand=false)
 
Entries_vrefEntries ()
 
NodeInforefEntry (int i)
 
std::vector< int > rowToIndex ()
 
void setBackgroundToWhite (bool)
 
void setCellValueEditor (TGTextEntry *editor)
 
void setDaughtersSelfVisibility (bool)
 
virtual void setDaughtersSelfVisibility (int selectedIdx, bool v)
 
void setLevelOffset (int x)
 
virtual void setVisibility (NodeInfo &, bool)
 
virtual void setVisibilityChld (NodeInfo &, bool)
 
void showEditor (int)
 
virtual const std::string title () const
 
virtual int unsortedRowNumber (int unsorted) const
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data More...
 
virtual ~FWGeometryTableManagerBase ()
 
- Public Member Functions inherited from FWTableManagerBase
virtual void buttonPressedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 Called if mouse button pressed in Row Header, defaults is to do nothing. More...
 
virtual void buttonReleasedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 
virtual unsigned int cellHeight () const
 require all cells to be the same height More...
 
virtual FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const =0
 
 ClassDef (FWTableManagerBase, 0)
 
void dataChanged ()
 Classes which inherit from FWTableManagerBase must call this when their underlying data changes. More...
 
 FWTableManagerBase ()
 
virtual bool hasLabelHeaders () const
 
virtual bool hasRowHeaders () const
 Returns 'true' if this table has row headers. Defaults return value is false. More...
 
virtual std::vector< unsigned int > maxWidthForColumns () const
 for each column in the table this returns the present maximum width for that column More...
 
virtual int numberOfColumns () const =0
 Number of columns in the table. More...
 
virtual FWTableCellRendererBaserowHeader (int iSortedRowNumber) const
 Returns the renderer for the row header for the sorted row number iSortedRowNumber. More...
 
void sort (int iCol, bool iSortOrder)
 Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder is 'true'. More...
 
int sortColumn (void)
 The current sort column. More...
 
bool sortOrder (void)
 The current sort order for the table. More...
 
void visualPropertiesChanged ()
 Classes which inherit from FWTableManagerBase must call this when how the data is shown (e.g. color) changes. More...
 
virtual ~FWTableManagerBase ()
 

Static Public Member Functions

static void getNNodesTotal (TGeoNode *geoNode, int &off)
 

Public Attributes

ColorBoxRenderer m_colorBoxRenderer
 
TGTextEntry * m_editor
 
int m_editTransparencyIdx
 
Entries_v m_entries
 
TGGC * m_highlightContext
 
int m_highlightIdx
 
int m_levelOffset
 
FWTextTreeCellRenderer m_renderer
 
std::vector< int > m_row_to_index
 

Protected Member Functions

virtual bool nodeIsParent (const NodeInfo &) const
 

Friends

class FWGeometryTableViewBase
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 36 of file FWGeometryTableManagerBase.h.

Member Typedef Documentation

typedef Entries_v::iterator FWGeometryTableManagerBase::Entries_i

Definition at line 93 of file FWGeometryTableManagerBase.h.

Definition at line 92 of file FWGeometryTableManagerBase.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWGeometryTableManagerBase::FWGeometryTableManagerBase ( )

Definition at line 102 of file FWGeometryTableManagerBase.cc.

References FWTextTableCellRenderer::height(), m_colorBoxRenderer, FWGeometryTableManagerBase::ColorBoxRenderer::m_height, m_highlightContext, m_renderer, FWGeometryTableManagerBase::ColorBoxRenderer::m_width, and FWTextTableCellRenderer::setHighlightContext().

103  :
104  m_highlightIdx(-1),
105  m_levelOffset(0),
106  m_editor(0),
108 {
111 
112  GCValues_t gval;
113  gval.fMask = kGCForeground | kGCBackground | kGCStipple | kGCFillStyle | kGCGraphicsExposures;
114  gval.fForeground = gVirtualX->GetPixel(kGray);//gClient->GetResourcePool()->GetFrameHiliteColor();
115  gval.fBackground = gVirtualX->GetPixel(kWhite);//gClient->GetResourcePool()->GetFrameBgndColor();
116  gval.fFillStyle = kFillOpaqueStippled; // kFillTiled;
117  gval.fStipple = gClient->GetResourcePool()->GetCheckeredBitmap();
118  gval.fGraphicsExposures = kFALSE;
119  m_highlightContext = gClient->GetGC(&gval, kTRUE);
120 
122 }
virtual UInt_t height() const
returns the minimum height of the cell to which the renderer is representing
void setHighlightContext(const TGGC *context)
FWGeometryTableManagerBase::~FWGeometryTableManagerBase ( )
virtual

Definition at line 124 of file FWGeometryTableManagerBase.cc.

125 {
126 }
FWGeometryTableManagerBase::FWGeometryTableManagerBase ( const FWGeometryTableManagerBase )

Member Function Documentation

void FWGeometryTableManagerBase::applyColorTranspToDaughters ( int  selectedIdx,
bool  recurse 
)
virtual

Definition at line 362 of file FWGeometryTableManagerBase.cc.

References FWGeometryTableManagerBase::NodeInfo::copyColorTransparency(), AlCaHLTBitMon_QueryRunRegistry::data, getNNodesTotal(), customizeTrackingMonitorSeedNumber::idx, m_entries, FWGeometryTableManagerBase::NodeInfo::m_node, and gen::n.

Referenced by FWGeometryTableViewBase::chosenItem().

363 {
364  NodeInfo &nInfo = m_entries[selectedIdx];
365  TGeoNode *parentNode = nInfo.m_node;
366  int nD = parentNode->GetNdaughters();
367  int dOff = 0;
368  for (int n = 0; n != nD; ++n)
369  {
370  int idx = selectedIdx + 1 + n + dOff;
371  NodeInfo& data = m_entries[idx];
372 
373  data.copyColorTransparency(nInfo);
374 
375  if (recurse)
376  {
378  }
379 
380  getNNodesTotal(parentNode->GetDaughter(n), dOff);
381  }
382 }
virtual void applyColorTranspToDaughters(int selectedIdx, bool recurse)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void FWGeometryTableManagerBase::applyTransparencyFromEditor ( )

Definition at line 277 of file FWGeometryTableManagerBase.cc.

References cancelEditor(), fwLog, fwlog::kError, m_editor, m_editTransparencyIdx, m_entries, and lumiQTWidget::t.

Referenced by FWGeometryTableViewBase::transparencyChanged().

278 {
279  printf("transparency idx %d opaci %s \n",m_editTransparencyIdx, m_editor->GetText() );
280  if ( m_editTransparencyIdx >= 0)
281  {
282  using boost::lexical_cast;
283  using boost::bad_lexical_cast;
284  try {
285  int t = lexical_cast<int>(m_editor->GetText());
286  if (t > 100 || t < 0 )
287  {
288  fwLog(fwlog::kError) << "Transparency must be set in procentage [0-100].";
289  return;
290  }
291  m_entries[m_editTransparencyIdx].m_transparency = 100 - t;
292  printf("SET !! \n");
293  cancelEditor(true);
294  }
295  catch (bad_lexical_cast &) {
296  fwLog(fwlog::kError) << "Bad Lexical cast. Transparency must be set in procentage [0-100].";
297  }
298  }
299 }
#define fwLog(_level_)
Definition: fwLog.h:50
void FWGeometryTableManagerBase::cancelEditor ( bool  redraw)

Definition at line 301 of file FWGeometryTableManagerBase.cc.

References m_editor, m_editTransparencyIdx, and redrawTable().

Referenced by applyTransparencyFromEditor(), and FWGeometryTableViewBase::cellClicked().

302 {
304 
305  if ( m_editor->IsMapped())
306  {
307  m_editor->UnmapWindow();
308  if (redraw) redrawTable();
309  }
310 }
void redrawTable(bool setExpand=false)
virtual bool FWGeometryTableManagerBase::cellDataIsSortable ( ) const
inlinevirtual

Reimplemented from FWTableManagerBase.

Definition at line 195 of file FWGeometryTableManagerBase.h.

References edm::false.

195 { return false ; }
volatile std::atomic< bool > shutdown_flag false
virtual const char* FWGeometryTableManagerBase::cellName ( const NodeInfo ) const
inlinevirtual

Reimplemented in FWGeometryTableManager.

Definition at line 125 of file FWGeometryTableManagerBase.h.

125 { return 0;}
bool FWGeometryTableManagerBase::firstColumnClicked ( int  row,
int  xPos 
)

Definition at line 171 of file FWGeometryTableManagerBase.cc.

References FWTableManagerBase::dataChanged(), customizeTrackingMonitorSeedNumber::idx, kExpanded, m_entries, m_levelOffset, recalculateVisibility(), rowToIndex(), and FWTableManagerBase::visualPropertiesChanged().

Referenced by FWGeometryTableViewBase::cellClicked().

172 {
173  if (row == -1)
174  return false;
175 
176  int idx = rowToIndex()[row];
177  // printf("click %s \n", m_entries[idx].name());
178 
179  int off = 0;
180  if (idx >= 0)
181  off = (m_entries[idx].m_level - m_levelOffset)* 20;
182 
183  // printf("compare %d %d level %d\n" , xPos, off, idx);
184  if (xPos > off && xPos < (off + 20))
185  {
186  m_entries[idx].switchBit(kExpanded);
187 
189  dataChanged();
191  return false;
192  }
193 
194  return true;
195 }
virtual void recalculateVisibility()=0
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e...
int FWGeometryTableManagerBase::getLevelOffset ( ) const
inline

Definition at line 157 of file FWGeometryTableManagerBase.h.

References m_levelOffset.

Referenced by FWEveDetectorGeo::Paint().

void FWGeometryTableManagerBase::getNNodesTotal ( TGeoNode *  geoNode,
int &  off 
)
inlinestatic
void FWGeometryTableManagerBase::getNodeMatrix ( const NodeInfo nodeInfo,
TGeoHMatrix &  mat 
) const

Definition at line 202 of file FWGeometryTableManagerBase.cc.

References m_entries, FWGeometryTableManagerBase::NodeInfo::m_node, and FWGeometryTableManagerBase::NodeInfo::m_parent.

Referenced by FWEveDetectorGeo::Paint(), and FWEveOverlap::Paint().

203 {
204  // utility used by browser and FWGeoNode
205  // printf("================ FWGeometryTableManagerBase::getNodeMatri \n");
206  int pIdx = data.m_parent;
207 
208  while (pIdx > 0)
209  {
210  // printf("%s [%d]\n",m_entries.at(pIdx).name(), m_entries.at(pIdx).m_level );
211  mtx.MultiplyLeft(m_entries.at(pIdx).m_node->GetMatrix());
212  pIdx = m_entries.at(pIdx).m_parent;
213  }
214 
215  // printf("right %s [%d]\n",data.name(), data.m_level );
216  mtx.Multiply(data.m_node->GetMatrix());
217 }
void FWGeometryTableManagerBase::getNodePath ( int  idx,
std::string &  path 
) const

Definition at line 237 of file FWGeometryTableManagerBase.cc.

References i, customizeTrackingMonitorSeedNumber::idx, m_entries, and mergeVDriftHistosByStation::name.

Referenced by FWGeometryTableViewBase::cdNode(), FWGeometryTableViewBase::cdUp(), and FWGeometryTableViewBase::chosenItem().

238 {
239  std::vector<std::string> relPath;
240  while(idx >= 0)
241  {
242  relPath.push_back( m_entries[idx].name());
243  // printf("push %s \n",m_entries[idx].name() );
244  idx = m_entries[idx].m_parent;
245  }
246 
247  size_t ns = relPath.size();
248  for (size_t i = 1; i < ns; ++i )
249  {
250  path +="/";
251  path += relPath[ns-i -1];
252  // printf("push_back add to path %s\n", path.c_str());
253  }
254 }
int i
Definition: DBlmapReader.cc:9
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
NodeInfo* FWGeometryTableManagerBase::getSelected ( )
std::vector< std::string > FWGeometryTableManagerBase::getTitles ( ) const
virtual

returns the title names for each column

Implements FWTableManagerBase.

Reimplemented in FWOverlapTableManager.

Definition at line 140 of file FWGeometryTableManagerBase.cc.

References FWTableManagerBase::numberOfColumns().

141 {
142  std::vector<std::string> returnValue;
143  returnValue.reserve(numberOfColumns());
144 
145  returnValue.push_back("Name");
146  returnValue.push_back("Color");
147  returnValue.push_back("Opcty");
148  returnValue.push_back("RnrSelf");
149  returnValue.push_back("RnrChildren");
150  returnValue.push_back("Material");
151  return returnValue;
152 }
virtual int numberOfColumns() const =0
Number of columns in the table.
bool FWGeometryTableManagerBase::getVisibility ( const NodeInfo nodeInfo) const
virtual
bool FWGeometryTableManagerBase::getVisibilityChld ( const NodeInfo nodeInfo) const
virtual
virtual void FWGeometryTableManagerBase::implSort ( int  iCol,
bool  iSortOrder 
)
inlinevirtual

Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'.

Implements FWTableManagerBase.

Definition at line 142 of file FWGeometryTableManagerBase.h.

142 {}
bool FWGeometryTableManagerBase::isNodeRendered ( int  idx,
int  top_node_idx 
) const

Definition at line 386 of file FWGeometryTableManagerBase.cc.

References AlCaHLTBitMon_QueryRunRegistry::data, customizeTrackingMonitorSeedNumber::idx, kVisNodeChld, kVisNodeSelf, m_entries, FWGeometryTableManagerBase::NodeInfo::m_parent, and FWGeometryTableManagerBase::NodeInfo::testBit().

Referenced by FWOverlapTableView::refreshTable3D().

387 {
388  const NodeInfo& data = m_entries[idx];
389  bool foundParent = false;
390 
391  if (data.testBit(kVisNodeSelf))
392  {
393  int pidx = data.m_parent;
394  while (pidx >= 0 )
395  {
396  if (!m_entries[pidx].testBit(kVisNodeChld)) {
397  // printf ("parent disallow not visible !!! \n");
398  return false;
399  }
400 
401  if (pidx == topNodeIdx) { foundParent = true;
402  // printf("parent found \n");
403  break;
404  }
405  pidx = m_entries[pidx].m_parent;
406  }
407 
408  return foundParent;
409  }
410  return false;
411 }
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void FWGeometryTableManagerBase::loadGeometry ( TGeoNode *  ,
TObjArray *   
)
bool FWGeometryTableManagerBase::nodeImported ( int  idx) const
virtual bool FWGeometryTableManagerBase::nodeIsParent ( const NodeInfo ) const
inlineprotectedvirtual

Reimplemented in FWGeometryTableManager, and FWOverlapTableManager.

Definition at line 118 of file FWGeometryTableManagerBase.h.

118 { return false; }
int FWGeometryTableManagerBase::numberOfRows ( ) const
virtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 134 of file FWGeometryTableManagerBase.cc.

References m_row_to_index.

135 {
136  return m_row_to_index.size();
137 }
const FWGeometryTableManagerBase& FWGeometryTableManagerBase::operator= ( const FWGeometryTableManagerBase )
virtual void FWGeometryTableManagerBase::recalculateVisibility ( )
pure virtual
void FWGeometryTableManagerBase::redrawTable ( bool  setExpand = false)

Definition at line 220 of file FWGeometryTableManagerBase.cc.

References FWTableManagerBase::dataChanged(), m_entries, recalculateVisibility(), and FWTableManagerBase::visualPropertiesChanged().

Referenced by FWGeometryTableView::autoExpandCallback(), cancelEditor(), FWGeometryTableViewBase::refreshTable3D(), FWGeometryTableViewBase::setColumnSelected(), and showEditor().

221 {
222  // std::cerr << "GeometryTableManagerBase::redrawTable ------------------------------------- \n";
223  if (m_entries.empty()) return;
224 
225  // if (setExpand) checkExpandLevel();
226 
228 
229 
230  dataChanged();
232 }
virtual void recalculateVisibility()=0
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e...
Entries_v& FWGeometryTableManagerBase::refEntries ( )
inline
NodeInfo& FWGeometryTableManagerBase::refEntry ( int  i)
inline
std::vector<int> FWGeometryTableManagerBase::rowToIndex ( )
inline

Definition at line 139 of file FWGeometryTableManagerBase.h.

References m_row_to_index.

Referenced by FWGeometryTableViewBase::cellClicked(), and firstColumnClicked().

139 { return m_row_to_index; }
void FWGeometryTableManagerBase::setBackgroundToWhite ( bool  iToWhite)

Definition at line 160 of file FWGeometryTableManagerBase.cc.

References m_renderer, FWTextTreeCellRenderer::setBlackIcon(), and FWTextTableCellRenderer::setGraphicsContext().

Referenced by FWGeometryTableViewBase::setBackgroundColor().

161 {
162  if(iToWhite) {
163  m_renderer.setGraphicsContext(&TGFrame::GetBlackGC());
164  } else {
165  m_renderer.setGraphicsContext(&TGFrame::GetWhiteGC());
166  }
167  m_renderer.setBlackIcon(iToWhite);
168 }
void setGraphicsContext(const TGGC *iContext)
void FWGeometryTableManagerBase::setCellValueEditor ( TGTextEntry *  editor)
void FWGeometryTableManagerBase::setDaughtersSelfVisibility ( bool  )
void FWGeometryTableManagerBase::setDaughtersSelfVisibility ( int  selectedIdx,
bool  v 
)
virtual

Reimplemented in FWOverlapTableManager, and FWGeometryTableManager.

Definition at line 329 of file FWGeometryTableManagerBase.cc.

References AlCaHLTBitMon_QueryRunRegistry::data, getNNodesTotal(), customizeTrackingMonitorSeedNumber::idx, m_entries, gen::n, setVisibility(), and setVisibilityChld().

330 {
331  TGeoNode *parentNode = m_entries[selectedIdx].m_node;
332  int nD = parentNode->GetNdaughters();
333  int dOff = 0;
334  for (int n = 0; n != nD; ++n)
335  {
336  int idx = selectedIdx + 1 + n + dOff;
337  NodeInfo& data = m_entries[idx];
338 
339  setVisibility(data, v);
340  setVisibilityChld(data, v);
341 
342  getNNodesTotal(parentNode->GetDaughter(n), dOff);
343  }
344 }
virtual void setVisibilityChld(NodeInfo &, bool)
virtual void setVisibility(NodeInfo &, bool)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void FWGeometryTableManagerBase::setLevelOffset ( int  x)
inline
void FWGeometryTableManagerBase::setVisibility ( NodeInfo data,
bool  x 
)
virtual
void FWGeometryTableManagerBase::setVisibilityChld ( NodeInfo data,
bool  x 
)
virtual
void FWGeometryTableManagerBase::showEditor ( int  row)

Definition at line 265 of file FWGeometryTableManagerBase.cc.

References m_editor, m_editTransparencyIdx, m_entries, and redrawTable().

Referenced by FWGeometryTableViewBase::cellClicked().

266 {
267  m_editTransparencyIdx = row;
268  m_editor->UnmapWindow();
269  m_editor->SetText(Form("%d", 100 - m_entries[row].m_transparency));
270  m_editor->Resize(40, 17);
271  m_editor->SetCursorPosition(2);
272  redrawTable();
273 }
void redrawTable(bool setExpand=false)
const std::string FWGeometryTableManagerBase::title ( ) const
virtual
int FWGeometryTableManagerBase::unsortedRowNumber ( int  iSortedRowNumber) const
virtual

when passed the index to the sorted order of the rows it returns the original row number from the underlying data

Implements FWTableManagerBase.

Definition at line 129 of file FWGeometryTableManagerBase.cc.

130 {
131  return unsorted;
132 }

Friends And Related Function Documentation

friend class FWGeometryTableViewBase
friend

Definition at line 38 of file FWGeometryTableManagerBase.h.

Member Data Documentation

ColorBoxRenderer FWGeometryTableManagerBase::m_colorBoxRenderer
mutable
TGTextEntry* FWGeometryTableManagerBase::m_editor
int FWGeometryTableManagerBase::m_editTransparencyIdx
Entries_v FWGeometryTableManagerBase::m_entries
TGGC* FWGeometryTableManagerBase::m_highlightContext
mutable
int FWGeometryTableManagerBase::m_highlightIdx

Definition at line 95 of file FWGeometryTableManagerBase.h.

int FWGeometryTableManagerBase::m_levelOffset
FWTextTreeCellRenderer FWGeometryTableManagerBase::m_renderer
mutable
std::vector<int> FWGeometryTableManagerBase::m_row_to_index