![]() |
![]() |
#include <Fireworks/Core/interface/FWColorManager.h>
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 45 of file FWColorManager.h.
Definition at line 72 of file FWColorManager.h.
{ kWhiteIndex = kWhite, kBlackIndex = kBlack };
FWColorManager::FWColorManager | ( | FWModelChangeManager * | iManager | ) |
Definition at line 186 of file FWColorManager.cc.
References kFWMuonBarrelLineColorIndex, kFWMuonEndcapLineColorIndex, kFWPixelBarrelColorIndex, kFWPixelEndcapColorIndex, kFWTrackerBarrelColorIndex, kFWTrackerEndcapColorIndex, and m_geomColor.
: m_gammaOff(0), m_background(kBlack), m_foreground(kWhite), m_changeManager(iManager), m_startColorIndex(0), m_numColorIndices(0), m_geomTransparency2D(50), m_geomTransparency3D(90) { m_geomColor[kFWPixelBarrelColorIndex ] = 1032; m_geomColor[kFWPixelEndcapColorIndex ] = 1033; m_geomColor[kFWTrackerBarrelColorIndex ] = 1026; m_geomColor[kFWTrackerEndcapColorIndex ] = 1017; m_geomColor[kFWMuonBarrelLineColorIndex] = 1025; m_geomColor[kFWMuonEndcapLineColorIndex] = 1022; }
FWColorManager::~FWColorManager | ( | ) | [virtual] |
Definition at line 206 of file FWColorManager.cc.
{ }
FWColorManager::FWColorManager | ( | const FWColorManager & | ) | [private] |
Color_t FWColorManager::background | ( | ) | const [inline] |
Definition at line 54 of file FWColorManager.h.
References m_background.
Referenced by FWTableViewTableManager::cellRenderer(), FWDetailViewManager::colorsChanged(), FWEveViewManager::finishViewCreate(), FWTableView::FWTableView(), FWDetailViewManager::openDetailViewFor(), FWTableView::resetColors(), FWTableViewTableManager::rowHeader(), and FWTableView::toggleShowHide().
{return m_background;}
FWColorManager::BackgroundColorIndex FWColorManager::backgroundColorIndex | ( | ) | const |
Definition at line 352 of file FWColorManager.cc.
References kBlackIndex, kWhiteIndex, and m_background.
Referenced by CmsShowViewPopup::backgroundColorWasChanged(), FWGeometryTableView::cellClicked(), CmsShowViewPopup::changeBackground(), FWModelContextMenuHandler::chosenItem(), FWCollectionSummaryWidget::colorClicked(), FWSummaryManager::colorsChanged(), FWColorSelect::HandleButton(), FWCollectionSummaryWidget::itemColorClicked(), FWSummaryManager::newItem(), FWGeometryTableView::setBackgroundColor(), setBackgroundColorIndex(), and updateColors().
{ if(m_background==kBlack) { return kBlackIndex; } return kWhiteIndex; }
int FWColorManager::borderOfLimitedColors | ( | ) | const [inline] |
Definition at line 61 of file FWColorManager.h.
References m_numColorIndices, and m_startColorIndex.
Referenced by fillLimitedColors().
{return m_startColorIndex + m_numColorIndices;}
int FWColorManager::brightness | ( | ) |
Definition at line 263 of file FWColorManager.cc.
References m_gammaOff.
{ return TMath::FloorNint(-m_gammaOff*10); }
bool FWColorManager::colorHasIndex | ( | Color_t | iColor | ) | const |
Definition at line 361 of file FWColorManager.cc.
References m_numColorIndices, and m_startColorIndex.
Referenced by FWEventItemsManager::add().
{ return iColor > 0 && iColor < m_startColorIndex + m_numColorIndices; }
void FWColorManager::defaultBrightness | ( | ) |
Definition at line 269 of file FWColorManager.cc.
References m_gammaOff, and updateColors().
{ m_gammaOff = 0; updateColors(); }
void FWColorManager::fillLimitedColors | ( | std::vector< Color_t > & | cv | ) | const |
Definition at line 342 of file FWColorManager.cc.
References borderOfLimitedColors(), i, m_numColorIndices, and m_startColorIndex.
Referenced by FWGeometryTableView::cellClicked(), FWModelContextMenuHandler::chosenItem(), FWCollectionSummaryWidget::colorClicked(), FWModelContextMenuHandler::createColorPopup(), FWCollectionSummaryWidget::createColorPopup(), FWColorSelect::FWColorSelect(), FWColorSelect::HandleButton(), and FWCollectionSummaryWidget::itemColorClicked().
{ cv.reserve(cv.size() + m_numColorIndices); for (Color_t i = m_startColorIndex; i < borderOfLimitedColors(); ++i) { cv.push_back(i); } }
Color_t FWColorManager::foreground | ( | ) | const [inline] |
Definition at line 55 of file FWColorManager.h.
References m_foreground.
Referenced by FWTableView::resetColors().
{return m_foreground;}
Color_t FWColorManager::geomColor | ( | FWGeomColorIndex | iIndex | ) | const |
Definition at line 368 of file FWColorManager.cc.
References m_geomColor.
Referenced by CmsShowCommonPopup::CmsShowCommonPopup(), CmsShowCommonPopup::colorSetChanged(), FWViewGeometryList::FWViewGeometryList(), FWRPZViewGeometry::makeCaloOutlineRhoPhi(), and FWViewGeometryList::updateColors().
{ return m_geomColor[iIndex]; }
Color_t FWColorManager::geomTransparency | ( | bool | projected | ) | const [inline] |
Definition at line 93 of file FWColorManager.h.
References m_geomTransparency2D, and m_geomTransparency3D.
Referenced by CmsShowCommonPopup::CmsShowCommonPopup(), FWViewGeometryList::FWViewGeometryList(), FWViewGeometryList::updateColors(), and FWViewGeometryList::updateTransparency().
{ return projected ? m_geomTransparency2D : m_geomTransparency3D; }
Color_t FWColorManager::getDefaultStartColorIndex | ( | ) | [static] |
Definition at line 40 of file FWColorManager.cc.
References s_defaultStartColorIndex.
Referenced by FWEventItemsManager::add().
{ return s_defaultStartColorIndex; }
void FWColorManager::initialize | ( | ) |
Definition at line 214 of file FWColorManager.cc.
References getHLTprescales::index, m_numColorIndices, m_startColorIndex, s_defaultStartColorIndex, s_forBlack, and s_size.
{ // Save default ROOT colors. TEveUtil::SetColorBrightness(0, kFALSE); m_startColorIndex = s_defaultStartColorIndex; m_numColorIndices = s_size; unsigned int index = m_startColorIndex; //std::cout <<"start color index "<<m_startColorIndex<<std::endl; const float(* itEnd)[3] = s_forBlack+s_size; for(const float(* it)[3] = s_forBlack; it != itEnd; ++it) { //NOTE: this constructor automatically places this color into the gROOT color list //std::cout <<" color "<< index <<" "<<(*it)[0]<<" "<<(*it)[1]<<" "<<(*it)[2]<<std::endl; new TColor(index++,(*it)[0],(*it)[1],(*it)[2]); } }
Bool_t FWColorManager::isColorSetDark | ( | ) | const [inline] |
Definition at line 56 of file FWColorManager.h.
References kBlackIndex, and m_background.
Referenced by FWEveLegoView::setContext(), and switchBackground().
{return m_background == kBlackIndex;}
Bool_t FWColorManager::isColorSetLight | ( | ) | const [inline] |
Definition at line 57 of file FWColorManager.h.
References kWhiteIndex, and m_background.
Referenced by FWSummaryManager::colorsChanged().
{return m_background == kWhiteIndex;}
int FWColorManager::numberOfLimitedColors | ( | ) | const [inline] |
Definition at line 59 of file FWColorManager.h.
References m_numColorIndices.
{return m_numColorIndices;}
int FWColorManager::offsetOfLimitedColors | ( | ) | const [inline] |
Definition at line 60 of file FWColorManager.h.
References m_startColorIndex.
{return m_startColorIndex;}
Color_t FWColorManager::oldColorToIndex | ( | Color_t | iColor, |
int | version | ||
) | const |
Definition at line 377 of file FWColorManager.cc.
References kFWBlue, kFWCyan, kFWGreen, kFWMagenta, kFWOrange, kFWRed, and kFWYellow.
Referenced by FWEventItemsManager::setFrom().
{ if (version < 3) { if(0==m_oldColorToIndexMap.get()) { m_oldColorToIndexMap = boost::shared_ptr<std::map<Color_t,Color_t> >(new std::map<Color_t,Color_t>()); (*m_oldColorToIndexMap)[kRed]=kFWRed; (*m_oldColorToIndexMap)[kBlue]=kFWBlue; (*m_oldColorToIndexMap)[kYellow]=kFWYellow; (*m_oldColorToIndexMap)[kGreen]=kFWGreen; (*m_oldColorToIndexMap)[kCyan]=kFWCyan; (*m_oldColorToIndexMap)[kTeal]=kFWCyan; (*m_oldColorToIndexMap)[kMagenta]=kFWMagenta; (*m_oldColorToIndexMap)[kViolet]=kFWMagenta; (*m_oldColorToIndexMap)[kOrange]=kFWOrange; (*m_oldColorToIndexMap)[3]=kFWGreen; } return (*m_oldColorToIndexMap)[iColor]; } else if (version == 3) { return iColor+ 1000; } else { static unsigned int s_version45offset = 5; return iColor < 1011 ? iColor : iColor + s_version45offset ; } }
const FWColorManager& FWColorManager::operator= | ( | const FWColorManager & | ) | [private] |
void FWColorManager::setBackgroundAndBrightness | ( | BackgroundColorIndex | iIndex, |
int | b | ||
) |
Definition at line 297 of file FWColorManager.cc.
References m_gammaOff, and setBackgroundColorIndex().
Referenced by CmsShowCommon::setFrom().
{ m_gammaOff = -b*0.1f; setBackgroundColorIndex(iIndex); }
void FWColorManager::setBackgroundColorIndex | ( | BackgroundColorIndex | iIndex | ) |
Definition at line 282 of file FWColorManager.cc.
References backgroundColorIndex(), kBlackIndex, kWhiteIndex, m_background, m_foreground, and updateColors().
Referenced by CmsShowViewPopup::changeBackground(), setBackgroundAndBrightness(), and switchBackground().
{ if(backgroundColorIndex()!=iIndex) { if(backgroundColorIndex()==kBlackIndex) { m_background=kWhiteIndex; m_foreground=kBlackIndex; } else { m_background=kBlackIndex; m_foreground=kWhiteIndex; } updateColors(); } }
void FWColorManager::setBrightness | ( | int | b | ) |
Definition at line 254 of file FWColorManager.cc.
References m_gammaOff, and updateColors().
Referenced by CmsShowCommon::setGamma().
{ // Called from CmsShowBrightnessPopup slider where range is set // to: -15, 15. m_gammaOff = -b*0.1f; updateColors(); }
Bool_t FWColorManager::setColorSetViewer | ( | TGLViewer * | v, |
Color_t | iColor | ||
) | [static] |
Definition at line 304 of file FWColorManager.cc.
References kBlackIndex, and kWhiteIndex.
Referenced by FWEveViewManager::finishViewCreate(), FWEveView::setBackgroundColor(), FWConvTrackHitsDetailView::setBackgroundColor(), and FWTrackHitsDetailView::setBackgroundColor().
{ if ( (iColor == kBlackIndex && !v->IsColorSetDark()) || (iColor == kWhiteIndex && v->IsColorSetDark()) ) { v->SwitchColorSet(); return kTRUE; } return kFALSE; }
void FWColorManager::setGeomColor | ( | FWGeomColorIndex | idx, |
Color_t | iColor | ||
) |
Definition at line 316 of file FWColorManager.cc.
References geomColorsHaveChanged_, and m_geomColor.
Referenced by CmsShowCommon::setFrom(), and CmsShowCommon::setGeomColor().
{ // printf("set geom color %d \n", iColor); m_geomColor[idx] = iColor; geomColorsHaveChanged_(); gEve->Redraw3D(); }
void FWColorManager::setGeomTransparency | ( | Color_t | idx, |
bool | projectedType | ||
) |
Definition at line 324 of file FWColorManager.cc.
References geomTransparencyHaveChanged_, m_geomTransparency2D, and m_geomTransparency3D.
Referenced by FW3DViewBase::setFrom(), CmsShowCommon::setFrom(), and CmsShowCommon::setGeomTransparency().
{ if (projectedType) m_geomTransparency2D = iTransp; else m_geomTransparency3D = iTransp; geomTransparencyHaveChanged_.emit(projectedType); gEve->Redraw3D(); }
void FWColorManager::switchBackground | ( | ) |
Definition at line 276 of file FWColorManager.cc.
References isColorSetDark(), kBlackIndex, kWhiteIndex, and setBackgroundColorIndex().
Referenced by FWGUIManager::FWGUIManager(), and CmsShowCommon::switchBackground().
{ setBackgroundColorIndex(isColorSetDark() ? kWhiteIndex : kBlackIndex); }
void FWColorManager::updateColors | ( | ) | [private] |
Definition at line 235 of file FWColorManager.cc.
References backgroundColorIndex(), colorsHaveChanged_, colorsHaveChangedFinished_, kBlackIndex, m_changeManager, m_gammaOff, m_startColorIndex, resetColors(), s_forBlack, s_forWhite, and s_size.
Referenced by defaultBrightness(), setBackgroundColorIndex(), and setBrightness().
{ if (backgroundColorIndex() == kBlackIndex) { resetColors(s_forBlack,s_size,m_startColorIndex, m_gammaOff); TEveUtil::SetColorBrightness(1.666*m_gammaOff); } else { resetColors(s_forWhite,s_size,m_startColorIndex, m_gammaOff); TEveUtil::SetColorBrightness(1.666*m_gammaOff - 2.5); } FWChangeSentry sentry(*m_changeManager); colorsHaveChanged_(); colorsHaveChangedFinished_(); }
sigc::signal<void> FWColorManager::colorsHaveChanged_ [mutable] |
Definition at line 95 of file FWColorManager.h.
Referenced by CmsShowViewPopup::CmsShowViewPopup(), FWColorSelect::FWColorSelect(), FWDetailViewManager::FWDetailViewManager(), FWSummaryManager::FWSummaryManager(), FWViewManagerBase::setColorManager(), and updateColors().
sigc::signal<void> FWColorManager::colorsHaveChangedFinished_ [mutable] |
Definition at line 100 of file FWColorManager.h.
Referenced by FWGUIManager::FWGUIManager(), and updateColors().
sigc::signal<void> FWColorManager::geomColorsHaveChanged_ [mutable] |
Definition at line 96 of file FWColorManager.h.
Referenced by FWViewGeometryList::FWViewGeometryList(), and setGeomColor().
sigc::signal<void, bool> FWColorManager::geomTransparencyHaveChanged_ [mutable] |
Definition at line 97 of file FWColorManager.h.
Referenced by FWViewGeometryList::FWViewGeometryList(), and setGeomTransparency().
Color_t FWColorManager::m_background [private] |
Definition at line 112 of file FWColorManager.h.
Referenced by background(), backgroundColorIndex(), isColorSetDark(), isColorSetLight(), and setBackgroundColorIndex().
Definition at line 114 of file FWColorManager.h.
Referenced by updateColors().
Color_t FWColorManager::m_foreground [private] |
Definition at line 113 of file FWColorManager.h.
Referenced by foreground(), and setBackgroundColorIndex().
Float_t FWColorManager::m_gammaOff [private] |
Definition at line 110 of file FWColorManager.h.
Referenced by brightness(), defaultBrightness(), setBackgroundAndBrightness(), setBrightness(), and updateColors().
Color_t FWColorManager::m_geomColor[kFWGeomColorSize] [private] |
Definition at line 119 of file FWColorManager.h.
Referenced by FWColorManager(), geomColor(), and setGeomColor().
Char_t FWColorManager::m_geomTransparency2D [private] |
Definition at line 120 of file FWColorManager.h.
Referenced by geomTransparency(), and setGeomTransparency().
Char_t FWColorManager::m_geomTransparency3D [private] |
Definition at line 121 of file FWColorManager.h.
Referenced by geomTransparency(), and setGeomTransparency().
Color_t FWColorManager::m_numColorIndices [private] |
Definition at line 117 of file FWColorManager.h.
Referenced by borderOfLimitedColors(), colorHasIndex(), fillLimitedColors(), initialize(), and numberOfLimitedColors().
Color_t FWColorManager::m_startColorIndex [private] |
Definition at line 116 of file FWColorManager.h.
Referenced by borderOfLimitedColors(), colorHasIndex(), fillLimitedColors(), initialize(), offsetOfLimitedColors(), and updateColors().
const Color_t FWColorManager::s_defaultStartColorIndex = 1000 [static, private] |
Definition at line 123 of file FWColorManager.h.
Referenced by getDefaultStartColorIndex(), and initialize().