#include <Fireworks/Core/interface/FWGeometryTableManagerBase.h>
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< NodeInfo > | Entries_v |
Public Member Functions | |
virtual bool | cellDataIsSortable () const |
virtual const char * | cellName (const NodeInfo &) const |
bool | firstColumnClicked (int row, int xPos) |
FWGeometryTableManagerBase (const FWGeometryTableManagerBase &) | |
FWGeometryTableManagerBase () | |
int | getLevelOffset () const |
void | getNodeMatrix (const NodeInfo &nodeInfo, TGeoHMatrix &mat) const |
void | getNodePath (int, std::string &) const |
NodeInfo * | getSelected () |
virtual std::vector< std::string > | getTitles () const |
returns the title names for each column | |
virtual void | implSort (int, bool) |
Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. | |
void | loadGeometry (TGeoNode *, TObjArray *) |
bool | nodeImported (int idx) const |
virtual int | numberOfRows () const |
Number of rows in the table. | |
const FWGeometryTableManagerBase & | operator= (const FWGeometryTableManagerBase &) |
virtual void | recalculateVisibility ()=0 |
void | redrawTable (bool setExpand=false) |
Entries_v & | refEntries () |
NodeInfo & | refEntry (int i) |
std::vector< int > | rowToIndex () |
void | setBackgroundToWhite (bool) |
void | setDaughtersSelfVisibility (bool) |
void | setLevelOffset (int x) |
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 | |
virtual | ~FWGeometryTableManagerBase () |
Static Public Member Functions | |
static void | getNNodesTotal (TGeoNode *geoNode, int &off) |
Public Attributes | |
ColorBoxRenderer | m_colorBoxRenderer |
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 |
Description: [one line class summary]
Usage: <usage>
Definition at line 37 of file FWGeometryTableManagerBase.h.
typedef Entries_v::iterator FWGeometryTableManagerBase::Entries_i |
Definition at line 84 of file FWGeometryTableManagerBase.h.
typedef std::vector<NodeInfo> FWGeometryTableManagerBase::Entries_v |
Definition at line 83 of file FWGeometryTableManagerBase.h.
Definition at line 44 of file FWGeometryTableManagerBase.h.
{ kExpanded = BIT(0), kVisNodeSelf = BIT(1), kVisNodeChld = BIT(2), kHighlighted = BIT(3), kSelected = BIT(4) };
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().
: m_highlightIdx(-1), m_levelOffset(0) { m_colorBoxRenderer.m_width = 50; m_colorBoxRenderer.m_height = m_renderer.height(); GCValues_t gval; gval.fMask = kGCForeground | kGCBackground | kGCStipple | kGCFillStyle | kGCGraphicsExposures; gval.fForeground = gVirtualX->GetPixel(kGray);//gClient->GetResourcePool()->GetFrameHiliteColor(); gval.fBackground = gVirtualX->GetPixel(kWhite);//gClient->GetResourcePool()->GetFrameBgndColor(); gval.fFillStyle = kFillOpaqueStippled; // kFillTiled; gval.fStipple = gClient->GetResourcePool()->GetCheckeredBitmap(); gval.fGraphicsExposures = kFALSE; m_highlightContext = gClient->GetGC(&gval, kTRUE); m_renderer.setHighlightContext( m_highlightContext); }
FWGeometryTableManagerBase::~FWGeometryTableManagerBase | ( | ) | [virtual] |
Definition at line 122 of file FWGeometryTableManagerBase.cc.
{ }
FWGeometryTableManagerBase::FWGeometryTableManagerBase | ( | const FWGeometryTableManagerBase & | ) |
virtual bool FWGeometryTableManagerBase::cellDataIsSortable | ( | ) | const [inline, virtual] |
Reimplemented from FWTableManagerBase.
Definition at line 179 of file FWGeometryTableManagerBase.h.
References funct::false.
{ return false ; }
virtual const char* FWGeometryTableManagerBase::cellName | ( | const NodeInfo & | ) | const [inline, virtual] |
Reimplemented in FWGeometryTableManager.
Definition at line 116 of file FWGeometryTableManagerBase.h.
{ return 0;}
bool FWGeometryTableManagerBase::firstColumnClicked | ( | int | row, |
int | xPos | ||
) |
Definition at line 168 of file FWGeometryTableManagerBase.cc.
References FWTableManagerBase::dataChanged(), UserOptions_cff::idx, kExpanded, m_entries, m_levelOffset, recalculateVisibility(), rowToIndex(), and FWTableManagerBase::visualPropertiesChanged().
Referenced by FWGeometryTableViewBase::cellClicked().
{ if (row == -1) return false; int idx = rowToIndex()[row]; // printf("click %s \n", m_entries[idx].name()); int off = 0; if (idx >= 0) off = (m_entries[idx].m_level - m_levelOffset)* 20; // printf("compare %d %d level %d\n" , xPos, off, idx); if (xPos > off && xPos < (off + 20)) { m_entries[idx].switchBit(kExpanded); recalculateVisibility(); dataChanged(); visualPropertiesChanged(); return false; } return true; }
int FWGeometryTableManagerBase::getLevelOffset | ( | ) | const [inline] |
Definition at line 148 of file FWGeometryTableManagerBase.h.
References m_levelOffset.
Referenced by FWEveDetectorGeo::Paint().
{ return m_levelOffset; }
void FWGeometryTableManagerBase::getNNodesTotal | ( | TGeoNode * | geoNode, |
int & | off | ||
) | [inline, static] |
Definition at line 198 of file FWGeometryTableManagerBase.h.
References i.
Referenced by FWOverlapTableManager::addOverlapEntry(), FWGeometryTableManager::importChildren(), FWGeometryTableManager::loadGeometry(), FWEveDetectorGeo::paintChildNodesRecurse(), FWEveOverlap::paintChildNodesRecurse(), FWGeometryTableManager::recalculateVisibilityNodeRec(), FWOverlapTableManager::recalculateVisibilityNodeRec(), FWGeometryTableManager::recalculateVisibilityVolumeRec(), FWOverlapTableView::refreshTable3D(), FWGeometryTableManager::setDaughtersSelfVisibility(), and FWOverlapTableManager::setDaughtersSelfVisibility().
{ int nD = geoNode->GetNdaughters(); off += nD; for (int i = 0; i < nD; ++i ) { getNNodesTotal(geoNode->GetDaughter(i), off); } }
void FWGeometryTableManagerBase::getNodeMatrix | ( | const NodeInfo & | nodeInfo, |
TGeoHMatrix & | mat | ||
) | const |
Definition at line 199 of file FWGeometryTableManagerBase.cc.
References m_entries, FWGeometryTableManagerBase::NodeInfo::m_node, and FWGeometryTableManagerBase::NodeInfo::m_parent.
Referenced by FWGeometryTableView::chosenItem(), FWOverlapTableView::chosenItem(), FWEveOverlap::Paint(), and FWEveDetectorGeo::Paint().
{ // utility used by browser and FWGeoNode // printf("================ FWGeometryTableManagerBase::getNodeMatri \n"); int pIdx = data.m_parent; while (pIdx > 0) { // printf("%s [%d]\n",m_entries.at(pIdx).name(), m_entries.at(pIdx).m_level ); mtx.MultiplyLeft(m_entries.at(pIdx).m_node->GetMatrix()); pIdx = m_entries.at(pIdx).m_parent; } // printf("right %s [%d]\n",data.name(), data.m_level ); mtx.Multiply(data.m_node->GetMatrix()); }
void FWGeometryTableManagerBase::getNodePath | ( | int | idx, |
std::string & | path | ||
) | const |
Definition at line 234 of file FWGeometryTableManagerBase.cc.
References i, UserOptions_cff::idx, m_entries, and mergeVDriftHistosByStation::name.
Referenced by FWGeometryTableViewBase::cdNode(), and FWGeometryTableViewBase::cdUp().
{ std::vector<std::string> relPath; while(idx >= 0) { relPath.push_back( m_entries[idx].name()); // printf("push %s \n",m_entries[idx].name() ); idx = m_entries[idx].m_parent; } size_t ns = relPath.size(); for (size_t i = 1; i < ns; ++i ) { path +="/"; path += relPath[ns-i -1]; // printf("push_back add to path %s\n", path.c_str()); } }
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 138 of file FWGeometryTableManagerBase.cc.
References FWTableManagerBase::numberOfColumns().
{ std::vector<std::string> returnValue; returnValue.reserve(numberOfColumns()); returnValue.push_back("Name"); returnValue.push_back("Color"); returnValue.push_back("RnrSelf"); returnValue.push_back("RnrChildren"); returnValue.push_back("Material"); return returnValue; }
virtual void FWGeometryTableManagerBase::implSort | ( | int | iCol, |
bool | iSortOrder | ||
) | [inline, virtual] |
Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'.
Implements FWTableManagerBase.
Definition at line 133 of file FWGeometryTableManagerBase.h.
{}
void FWGeometryTableManagerBase::loadGeometry | ( | TGeoNode * | , |
TObjArray * | |||
) |
Reimplemented in FWGeometryTableManager.
bool FWGeometryTableManagerBase::nodeImported | ( | int | idx | ) | const |
virtual bool FWGeometryTableManagerBase::nodeIsParent | ( | const NodeInfo & | ) | const [inline, protected, virtual] |
Reimplemented in FWGeometryTableManager, and FWOverlapTableManager.
Definition at line 109 of file FWGeometryTableManagerBase.h.
{ return false; }
int FWGeometryTableManagerBase::numberOfRows | ( | ) | const [virtual] |
Number of rows in the table.
Implements FWTableManagerBase.
Definition at line 132 of file FWGeometryTableManagerBase.cc.
References m_row_to_index.
{ return m_row_to_index.size(); }
const FWGeometryTableManagerBase& FWGeometryTableManagerBase::operator= | ( | const FWGeometryTableManagerBase & | ) |
virtual void FWGeometryTableManagerBase::recalculateVisibility | ( | ) | [pure virtual] |
Implemented in FWGeometryTableManager, and FWOverlapTableManager.
Referenced by firstColumnClicked(), and redrawTable().
void FWGeometryTableManagerBase::redrawTable | ( | bool | setExpand = false | ) |
Definition at line 217 of file FWGeometryTableManagerBase.cc.
References FWTableManagerBase::dataChanged(), m_entries, recalculateVisibility(), and FWTableManagerBase::visualPropertiesChanged().
Referenced by FWGeometryTableView::autoExpandCallback(), FWGeometryTableViewBase::refreshTable3D(), and FWGeometryTableViewBase::setColumnSelected().
{ // std::cerr << "GeometryTableManagerBase::redrawTable ------------------------------------- \n"; if (m_entries.empty()) return; // if (setExpand) checkExpandLevel(); recalculateVisibility(); dataChanged(); visualPropertiesChanged(); }
Entries_v& FWGeometryTableManagerBase::refEntries | ( | ) | [inline] |
Definition at line 140 of file FWGeometryTableManagerBase.h.
References m_entries.
Referenced by FWGeometryTableViewBase::cdTop(), FWGeometryTableViewBase::cdUp(), FWGeometryTableViewBase::cellClicked(), FWGeometryTableViewBase::checkExpandLevel(), FWGeoMaterialValidator::fillOptions(), FWGeoTopNode::getFirstSelectedTableIndex(), FWEveDetectorGeo::GetHighlightTooltip(), FWEveOverlap::GetHighlightTooltip(), FWGeometryTableViewBase::nodeColorChangeRequested(), FWEveOverlap::Paint(), FWEveDetectorGeo::Paint(), FWOverlapTableView::refreshTable3D(), FWGeometryTableView::setPath(), FWGeoTopNode::SetStateOf(), FWGeoTopNode::UnHighlighted(), FWGeoTopNode::UnSelected(), FWGeometryTableView::updateFilter(), and FWGeometryTableView::updateVisibilityTopNode().
{return m_entries;}
NodeInfo& FWGeometryTableManagerBase::refEntry | ( | int | i | ) | [inline] |
Definition at line 141 of file FWGeometryTableManagerBase.h.
Referenced by FWGeometryTableView::chosenItem(), FWOverlapTableView::chosenItem(), and FWGeometryTableViewBase::setColumnSelected().
std::vector<int> FWGeometryTableManagerBase::rowToIndex | ( | ) | [inline] |
Definition at line 130 of file FWGeometryTableManagerBase.h.
References m_row_to_index.
Referenced by FWGeometryTableViewBase::cellClicked(), and firstColumnClicked().
{ return m_row_to_index; }
void FWGeometryTableManagerBase::setBackgroundToWhite | ( | bool | iToWhite | ) |
Definition at line 157 of file FWGeometryTableManagerBase.cc.
References m_renderer, FWTextTreeCellRenderer::setBlackIcon(), and FWTextTableCellRenderer::setGraphicsContext().
Referenced by FWGeometryTableViewBase::setBackgroundColor().
{ if(iToWhite) { m_renderer.setGraphicsContext(&TGFrame::GetBlackGC()); } else { m_renderer.setGraphicsContext(&TGFrame::GetWhiteGC()); } m_renderer.setBlackIcon(iToWhite); }
void FWGeometryTableManagerBase::setDaughtersSelfVisibility | ( | bool | ) |
void FWGeometryTableManagerBase::setLevelOffset | ( | int | x | ) | [inline] |
Definition at line 149 of file FWGeometryTableManagerBase.h.
References m_levelOffset, and x.
Referenced by FWOverlapTableView::recalculate(), FWGeometryTableView::setPath(), and FWGeometryTableViewBase::setPath().
{ m_levelOffset =x; }
const std::string FWGeometryTableManagerBase::title | ( | ) | const [virtual] |
Definition at line 151 of file FWGeometryTableManagerBase.cc.
{ return "Geometry"; }
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 127 of file FWGeometryTableManagerBase.cc.
{
return unsorted;
}
friend class FWGeometryTableViewBase [friend] |
Definition at line 39 of file FWGeometryTableManagerBase.h.
Definition at line 186 of file FWGeometryTableManagerBase.h.
Referenced by FWGeometryTableManager::cellRenderer(), FWOverlapTableManager::cellRenderer(), and FWGeometryTableManagerBase().
Definition at line 190 of file FWGeometryTableManagerBase.h.
Referenced by FWOverlapTableManager::addOverlapEntry(), FWGeometryTableManager::cellRenderer(), FWOverlapTableManager::cellRenderer(), FWGeometryTableManager::checkHierarchy(), firstColumnClicked(), getNodeMatrix(), getNodePath(), FWGeometryTableManager::importChildren(), FWOverlapTableManager::importOverlaps(), FWGeometryTableManager::loadGeometry(), FWOverlapTableManager::recalculateVisibility(), FWGeometryTableManager::recalculateVisibility(), FWGeometryTableManager::recalculateVisibilityNodeRec(), FWOverlapTableManager::recalculateVisibilityNodeRec(), FWGeometryTableManager::recalculateVisibilityVolumeRec(), redrawTable(), refEntries(), refEntry(), FWGeometryTableManager::setDaughtersSelfVisibility(), FWOverlapTableManager::setDaughtersSelfVisibility(), and FWGeometryTableManager::updateFilter().
TGGC* FWGeometryTableManagerBase::m_highlightContext [mutable] |
Definition at line 184 of file FWGeometryTableManagerBase.h.
Referenced by FWGeometryTableManager::cellRenderer(), FWOverlapTableManager::cellRenderer(), and FWGeometryTableManagerBase().
Definition at line 86 of file FWGeometryTableManagerBase.h.
Definition at line 193 of file FWGeometryTableManagerBase.h.
Referenced by FWGeometryTableManager::cellRenderer(), FWOverlapTableManager::cellRenderer(), firstColumnClicked(), getLevelOffset(), FWGeometryTableManager::loadGeometry(), and setLevelOffset().
Definition at line 185 of file FWGeometryTableManagerBase.h.
Referenced by FWGeometryTableManager::cellRenderer(), FWOverlapTableManager::cellRenderer(), FWGeometryTableManagerBase(), and setBackgroundToWhite().
std::vector<int> FWGeometryTableManagerBase::m_row_to_index |
Definition at line 188 of file FWGeometryTableManagerBase.h.
Referenced by FWGeometryTableManager::cellRenderer(), FWOverlapTableManager::cellRenderer(), FWGeometryTableManager::loadGeometry(), numberOfRows(), FWOverlapTableManager::recalculateVisibility(), FWGeometryTableManager::recalculateVisibility(), FWGeometryTableManager::recalculateVisibilityNodeRec(), FWOverlapTableManager::recalculateVisibilityNodeRec(), FWGeometryTableManager::recalculateVisibilityVolumeRec(), and rowToIndex().