21 #include "TEveManager.h" 22 #include "TGLViewer.h" 27 #include "Fireworks/Core/src/fwPaletteClassic.icc" 42 void resetColors(
const float(* iColors)[3],
unsigned int iSize,
unsigned int iStart,
float gammaOff )
45 TSeqCollection* colorTable = gROOT->GetListOfColors();
47 TColor*
c =
static_cast<TColor*
>(colorTable->At(iStart));
48 unsigned int index = iStart;
49 if(
nullptr==c || c->GetNumber() !=
static_cast<int>(iStart)) {
50 TIter
next(colorTable);
51 while( (c=static_cast<TColor*>(
next() )) ) {
52 if(c->GetNumber()==
static_cast<int>(iStart)) {
60 for(
unsigned int i = index;
i< index+iSize; ++
i,++iColors) {
61 TColor* c =
static_cast<TColor*
> (colorTable->At(
i));
62 float red = (*iColors)[0];
63 float green = (*iColors)[1];
64 float blue = (*iColors)[2];
67 red = TMath::Power(red, (2.5 + gammaOff)/2.5);
68 green = TMath::Power(green, (2.5 + gammaOff)/2.5);
69 blue = TMath::Power(blue, (2.5 + gammaOff)/2.5);
72 c->SetRGB(red,green,blue);
144 const float(* itEnd)[3] = fireworks::s_forBlack+fireworks::s_size;
145 for(
const float(* it)[3] = fireworks::s_forBlack;
150 if ( index <= gROOT->GetListOfColors()->GetLast())
151 gROOT->GetListOfColors()->RemoveAt(index);
152 new TColor(index++,(*it)[0],(*it)[1],(*it)[2]);
156 TEveUtil::SetColorBrightness(0, kFALSE);
173 const float(* colValues)[3];
174 colValues =
isColorSetLight() ? fireworks::s_forWhite : fireworks::s_forBlack;
182 float (*
ev)[3] = (
float (*)[3])calloc(3*fireworks::s_size,
sizeof (
float));
183 for (
int ci = 0; ci < 34; ++ci) {
184 for (
int j = 0; j < 3; ++j)
185 ev[ci][j] = colValues[ci][j];
264 if ( (iColor ==
kBlackIndex && !v->IsColorSetDark()) ||
349 if(
nullptr==m_oldColorToIndexMap.get()) {
350 m_oldColorToIndexMap = std::make_shared<std::map<Color_t,Color_t> >();
351 (*m_oldColorToIndexMap)[kRed]=kFWRed;
352 (*m_oldColorToIndexMap)[kBlue]=kFWBlue;
353 (*m_oldColorToIndexMap)[kYellow]=kFWYellow;
354 (*m_oldColorToIndexMap)[kGreen]=kFWGreen;
355 (*m_oldColorToIndexMap)[kCyan]=kFWCyan;
356 (*m_oldColorToIndexMap)[kTeal]=kFWCyan;
357 (*m_oldColorToIndexMap)[kMagenta]=kFWMagenta;
358 (*m_oldColorToIndexMap)[kViolet]=kFWMagenta;
359 (*m_oldColorToIndexMap)[kOrange]=kFWOrange;
360 (*m_oldColorToIndexMap)[3]=kFWGreen;
363 return (*m_oldColorToIndexMap)[iColor];
365 else if (version == 3)
371 const static unsigned int s_version45offset = 5;
372 return iColor < 1011 ? iColor : iColor + s_version45offset ;
Bool_t isColorSetLight() const
sigc::signal< void > geomColorsHaveChanged_
void setDefaultGeomColors()
static void resetColors(const float(*iColors)[3], unsigned int iSize, unsigned int iStart, float gammaOff)
static std::shared_ptr< std::map< Color_t, Color_t > > m_oldColorToIndexMap
static Color_t getDefaultStartColorIndex()
void fillLimitedColors(std::vector< Color_t > &cv) const
Color_t oldColorToIndex(Color_t, int version) const
int borderOfLimitedColors() const
sigc::signal< void, bool > geomTransparencyHaveChanged_
Bool_t isColorSetDark() const
bool colorHasIndex(Color_t) const
void setGeomColor(FWGeomColorIndex, Color_t)
void setBackgroundColorIndex(BackgroundColorIndex)
virtual ~FWColorManager()
void setGeomTransparency(Color_t idx, bool projectedType)
Char_t m_geomTransparency2D
FWModelChangeManager * m_changeManager
void setPalette(long long)
sigc::signal< void > colorsHaveChangedFinished_
Char_t m_geomTransparency3D
Color_t m_numColorIndices
BackgroundColorIndex backgroundColorIndex() const
void GetColorValuesForPaletteExtra(float(*iColors)[3], unsigned int iSize, FWColorManager::EPalette id, bool isWhiteBg)
Color_t m_geomColor[kFWGeomColorSize]
static const Color_t s_defaultStartColorIndex
void setBackgroundAndBrightness(BackgroundColorIndex, int)
void propagatePaletteChanges() const
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
FWColorManager(FWModelChangeManager *)
Color_t m_startColorIndex
sigc::signal< void > colorsHaveChanged_
Color_t geomColor(FWGeomColorIndex) const