CMS 3D CMS Logo

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

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

Inheritance diagram for FWCollectionSummaryTableManager:
FWTableManagerBase

Public Member Functions

void buttonReleasedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY) override
 
FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const override
 
 FWCollectionSummaryTableManager (FWEventItem *iCollection, const TGGC *iContext, const TGGC *iHighlightContext, FWCollectionSummaryWidget *)
 
std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
bool hasRowHeaders () const override
 Returns 'true' if this table has row headers. Defaults return value is false. More...
 
int numberOfColumns () const override
 Number of columns in the table. More...
 
int numberOfRows () const override
 Number of rows in the table. More...
 
FWTableCellRendererBaserowHeader (int iSortedRowNumber) const override
 Returns the renderer for the row header for the sorted row number iSortedRowNumber. More...
 
int unsortedRowNumber (int iSortedRowNumber) const override
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data More...
 
 ~FWCollectionSummaryTableManager () override
 
- 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 bool cellDataIsSortable () const
 
virtual unsigned int cellHeight () const
 require all cells to be the same height More...
 
 ClassDefOverride (FWTableManagerBase, 0)
 
void dataChanged ()
 Classes which inherit from FWTableManagerBase must call this when their underlying data changes. More...
 
 FWTableManagerBase ()
 
virtual bool hasLabelHeaders () const
 
virtual std::vector< unsigned int > maxWidthForColumns () const
 for each column in the table this returns the present maximum width for that column 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...
 
 ~FWTableManagerBase () override
 

Protected Member Functions

void implSort (int iCol, bool iSortOrder) override
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. More...
 

Private Member Functions

void dataChanged ()
 
 FWCollectionSummaryTableManager (const FWCollectionSummaryTableManager &)=delete
 
const FWCollectionSummaryTableManageroperator= (const FWCollectionSummaryTableManager &)=delete
 

Private Attributes

FWTextTableCellRenderer m_bodyRenderer
 
FWEventItemm_collection
 
FWCollectionSummaryModelCellRenderer m_renderer
 
std::vector< int > m_sortedToUnsortedIndicies
 
FWCollectionSummaryWidgetm_widget
 

Detailed Description

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

Usage: <usage>

Definition at line 35 of file FWCollectionSummaryTableManager.h.

Constructor & Destructor Documentation

◆ FWCollectionSummaryTableManager() [1/2]

FWCollectionSummaryTableManager::FWCollectionSummaryTableManager ( FWEventItem iCollection,
const TGGC *  iContext,
const TGGC *  iHighlightContext,
FWCollectionSummaryWidget iWidget 
)

Definition at line 35 of file FWCollectionSummaryTableManager.cc.

39  : m_collection(iItem),
40  m_renderer(iContext, iHighlightContext),
41  m_bodyRenderer(iContext, iHighlightContext, FWTextTableCellRenderer::kJustifyRight),
42  m_widget(iWidget) {
43  m_collection->changed_.connect(std::bind(&FWTableManagerBase::dataChanged, this));
45 
46  //try to find the default columns
47  std::vector<std::pair<std::string, std::string> > s_names;
48  edm::TypeWithDict type(*(m_collection->modelType()->GetTypeInfo()));
49 
50  dataChanged();
51 }

References FWEventItem::changed_, dataChanged(), FWTableManagerBase::dataChanged(), FWEventItem::itemChanged_, m_collection, and FWEventItem::modelType().

◆ ~FWCollectionSummaryTableManager()

FWCollectionSummaryTableManager::~FWCollectionSummaryTableManager ( )
override

Definition at line 58 of file FWCollectionSummaryTableManager.cc.

58 {}

◆ FWCollectionSummaryTableManager() [2/2]

FWCollectionSummaryTableManager::FWCollectionSummaryTableManager ( const FWCollectionSummaryTableManager )
privatedelete

Member Function Documentation

◆ buttonReleasedInRowHeader()

void FWCollectionSummaryTableManager::buttonReleasedInRowHeader ( Int_t  row,
Event_t *  event,
Int_t  relX,
Int_t  relY 
)
overridevirtual

◆ cellRenderer()

FWTableCellRendererBase * FWCollectionSummaryTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const
overridevirtual

Returns the particular renderer used to handle the requested cell. Arguments: iSortedRowNumber: the row number from the present sort (i.e. the cell number of the view) iCol: the column number of the cell. The returned value must be used immediately and not held onto since the same Renderer can be used for subsequent calls

Implements FWTableManagerBase.

Definition at line 138 of file FWCollectionSummaryTableManager.cc.

138  {
139  if (!m_collection->valueGetter().numValues()) {
140  return nullptr;
141  }
142  if (iSortedRowNumber >= static_cast<int>(m_collection->size())) {
143  m_bodyRenderer.setData("", false);
144  return &m_bodyRenderer;
145  }
146  int index = m_sortedToUnsortedIndicies[iSortedRowNumber];
147  std::stringstream s;
148  s.setf(std::ios_base::fixed, std::ios_base::floatfield);
149  s.precision(m_collection->valueGetter().precision(iCol));
151  s << v;
153  return &m_bodyRenderer;
154 }

References alignBH_cfg::fixed, FWEventItem::ModelInfo::isSelected(), m_bodyRenderer, m_collection, m_sortedToUnsortedIndicies, FWEventItem::modelData(), FWEventItem::modelInfo(), FWItemValueGetter::numValues(), FWItemValueGetter::precision(), alignCSCRings::s, FWTextTableCellRenderer::setData(), FWEventItem::size(), findQualityFiles::v, FWItemValueGetter::valueFor(), and FWEventItem::valueGetter().

◆ dataChanged()

void FWCollectionSummaryTableManager::dataChanged ( void  )
private

Definition at line 167 of file FWCollectionSummaryTableManager.cc.

167  {
170  for (int i = 0; i < static_cast<int>(m_collection->size()); ++i) {
171  m_sortedToUnsortedIndicies.push_back(i);
172  }
174 }

References FWTableManagerBase::dataChanged(), mps_fire::i, m_collection, m_sortedToUnsortedIndicies, and FWEventItem::size().

Referenced by FWCollectionSummaryTableManager().

◆ getTitles()

std::vector< std::string > FWCollectionSummaryTableManager::getTitles ( ) const
overridevirtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 129 of file FWCollectionSummaryTableManager.cc.

129  {
130  //return titles;
131  return m_collection->valueGetter().getTitles();
132 }

References FWItemValueGetter::getTitles(), m_collection, and FWEventItem::valueGetter().

◆ hasRowHeaders()

bool FWCollectionSummaryTableManager::hasRowHeaders ( ) const
overridevirtual

Returns 'true' if this table has row headers. Defaults return value is false.

Reimplemented from FWTableManagerBase.

Definition at line 156 of file FWCollectionSummaryTableManager.cc.

156 { return true; }

◆ implSort()

void FWCollectionSummaryTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
overrideprotectedvirtual

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

Implements FWTableManagerBase.

Definition at line 94 of file FWCollectionSummaryTableManager.cc.

94  {
95  if (iSortOrder) {
96  std::multimap<double, int, std::greater<double> > s;
98  } else {
99  std::multimap<double, int, std::less<double> > s;
101  }
102 }

References m_collection, m_sortedToUnsortedIndicies, alignCSCRings::s, and FWEventItem::valueGetter().

◆ numberOfColumns()

int FWCollectionSummaryTableManager::numberOfColumns ( ) const
overridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 127 of file FWCollectionSummaryTableManager.cc.

127 { return m_collection->valueGetter().numValues(); }

References m_collection, FWItemValueGetter::numValues(), and FWEventItem::valueGetter().

◆ numberOfRows()

int FWCollectionSummaryTableManager::numberOfRows ( ) const
overridevirtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 125 of file FWCollectionSummaryTableManager.cc.

125 { return m_collection->size(); }

References m_collection, and FWEventItem::size().

◆ operator=()

const FWCollectionSummaryTableManager& FWCollectionSummaryTableManager::operator= ( const FWCollectionSummaryTableManager )
privatedelete

◆ rowHeader()

FWTableCellRendererBase * FWCollectionSummaryTableManager::rowHeader ( int  iSortedRowNumber) const
overridevirtual

Returns the renderer for the row header for the sorted row number iSortedRowNumber.

Reimplemented from FWTableManagerBase.

Definition at line 158 of file FWCollectionSummaryTableManager.cc.

158  {
159  if (iSortedRowNumber >= static_cast<int>(m_collection->size())) {
160  return nullptr;
161  }
162  int index = m_sortedToUnsortedIndicies[iSortedRowNumber];
164  return &m_renderer;
165 }

References m_collection, m_renderer, m_sortedToUnsortedIndicies, FWCollectionSummaryModelCellRenderer::setData(), and FWEventItem::size().

◆ unsortedRowNumber()

int FWCollectionSummaryTableManager::unsortedRowNumber ( int  iSortedRowNumber) const
overridevirtual

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 134 of file FWCollectionSummaryTableManager.cc.

134  {
135  return m_sortedToUnsortedIndicies[iSortedRowNumber];
136 }

References m_sortedToUnsortedIndicies.

Referenced by buttonReleasedInRowHeader().

Member Data Documentation

◆ m_bodyRenderer

FWTextTableCellRenderer FWCollectionSummaryTableManager::m_bodyRenderer
mutableprivate

Definition at line 73 of file FWCollectionSummaryTableManager.h.

Referenced by cellRenderer().

◆ m_collection

FWEventItem* FWCollectionSummaryTableManager::m_collection
private

◆ m_renderer

FWCollectionSummaryModelCellRenderer FWCollectionSummaryTableManager::m_renderer
mutableprivate

Definition at line 72 of file FWCollectionSummaryTableManager.h.

Referenced by buttonReleasedInRowHeader(), and rowHeader().

◆ m_sortedToUnsortedIndicies

std::vector<int> FWCollectionSummaryTableManager::m_sortedToUnsortedIndicies
private

◆ m_widget

FWCollectionSummaryWidget* FWCollectionSummaryTableManager::m_widget
private

Definition at line 74 of file FWCollectionSummaryTableManager.h.

Referenced by buttonReleasedInRowHeader().

FWCollectionSummaryModelCellRenderer::kHitColor
Definition: FWCollectionSummaryModelCellRenderer.h:36
FWCollectionSummaryTableManager::m_collection
FWEventItem * m_collection
Definition: FWCollectionSummaryTableManager.h:69
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
FWEventItem::modelInfo
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
mps_fire.i
i
Definition: mps_fire.py:428
FWCollectionSummaryTableManager::m_bodyRenderer
FWTextTableCellRenderer m_bodyRenderer
Definition: FWCollectionSummaryTableManager.h:73
FWEventItem::valueGetter
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:112
FWCollectionSummaryTableManager::m_widget
FWCollectionSummaryWidget * m_widget
Definition: FWCollectionSummaryTableManager.h:74
FWEventItem::modelData
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:466
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FWEventItem::ModelInfo
Definition: FWEventItem.h:58
FWTextTableCellRenderer::kJustifyRight
Definition: FWTextTableCellRenderer.h:37
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:158
FWEventItem::modelType
const TClass * modelType() const
Definition: FWEventItem.cc:464
FWCollectionSummaryModelCellRenderer::setData
void setData(const FWEventItem *iItem, int iIndex)
Definition: FWCollectionSummaryModelCellRenderer.cc:90
FWCollectionSummaryModelCellRenderer::kMiss
Definition: FWCollectionSummaryModelCellRenderer.h:36
FWCollectionSummaryTableManager::m_sortedToUnsortedIndicies
std::vector< int > m_sortedToUnsortedIndicies
Definition: FWCollectionSummaryTableManager.h:70
FWCollectionSummaryTableManager::m_renderer
FWCollectionSummaryModelCellRenderer m_renderer
Definition: FWCollectionSummaryTableManager.h:72
edm::TypeWithDict
Definition: TypeWithDict.h:38
FWTableManagerBase::dataChanged
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes.
Definition: FWTableManagerBase.cc:63
FWCollectionSummaryWidget::itemColorClicked
void itemColorClicked(int iIndex, Int_t iRootX, Int_t iRootY)
Definition: FWCollectionSummaryWidget.cc:510
FWEventItem::itemChanged_
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:181
FWItemValueGetter::getTitles
std::vector< std::string > getTitles() const
Definition: FWItemValueGetter.cc:134
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
FWEventItem::ModelInfo::isSelected
bool isSelected() const
Definition: FWEventItem.h:65
FWCollectionSummaryModelCellRenderer::clickHit
ClickHit clickHit(int iX, int iY) const
Definition: FWCollectionSummaryModelCellRenderer.cc:100
FWItemValueGetter::precision
UInt_t precision(int idx) const
Definition: FWItemValueGetter.cc:132
FWEventItem::setDisplayProperties
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:247
FWEventItem::ModelInfo::displayProperties
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition: FWTextTableCellRenderer.cc:98
FWDisplayProperties
Definition: FWDisplayProperties.h:28
FWCollectionSummaryTableManager::unsortedRowNumber
int unsortedRowNumber(int iSortedRowNumber) const override
when passed the index to the sorted order of the rows it returns the original row number from the und...
Definition: FWCollectionSummaryTableManager.cc:134
FWCollectionSummaryModelCellRenderer::kHitCheck
Definition: FWCollectionSummaryModelCellRenderer.h:36
FWItemValueGetter::valueFor
double valueFor(const void *, int idx) const
Definition: FWItemValueGetter.cc:126
FWCollectionSummaryTableManager::dataChanged
void dataChanged()
Definition: FWCollectionSummaryTableManager.cc:167
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
FWItemValueGetter::numValues
int numValues() const
Definition: FWItemValueGetter.cc:144
event
Definition: event.py:1
FWEventItem::changed_
FWModelChangeSignal changed_
Definition: FWEventItem.h:178
hit
Definition: SiStripHitEffFromCalibTree.cc:88
FWEventItem::size
size_t size() const
Definition: FWEventItem.cc:457