CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Friends

FWGeometryTableManagerBase Class Reference

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

Inheritance diagram for FWGeometryTableManagerBase:
FWTableManagerBase FWGeometryTableManager FWOverlapTableManager

List of all members.

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 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
NodeInfogetSelected ()
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 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 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

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 37 of file FWGeometryTableManagerBase.h.


Member Typedef Documentation

typedef Entries_v::iterator FWGeometryTableManagerBase::Entries_i

Definition at line 84 of file FWGeometryTableManagerBase.h.

Definition at line 83 of file FWGeometryTableManagerBase.h.


Member Enumeration Documentation

Enumerator:
kExpanded 
kVisNodeSelf 
kVisNodeChld 
kHighlighted 
kSelected 

Definition at line 44 of file FWGeometryTableManagerBase.h.

   {
      kExpanded        =  BIT(0),

      kVisNodeSelf     =  BIT(1),
      kVisNodeChld     =  BIT(2),

      kHighlighted   =  BIT(3),
      kSelected      =  BIT(4)
   };

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().

   :   
   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 )

Member Function Documentation

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]
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]
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]
NodeInfo& FWGeometryTableManagerBase::refEntry ( int  i) [inline]
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)
void FWGeometryTableManagerBase::setDaughtersSelfVisibility ( bool  )
void FWGeometryTableManagerBase::setLevelOffset ( int  x) [inline]
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;
}

Friends And Related Function Documentation

friend class FWGeometryTableViewBase [friend]

Definition at line 39 of file FWGeometryTableManagerBase.h.


Member Data Documentation

Definition at line 86 of file FWGeometryTableManagerBase.h.