MCPcopy Create free account
hub / github.com/Geant4/geant4 / DrawColorChartBar

Method DrawColorChartBar

source/digits_hits/utils/src/G4ScoreLogColorMap.cc:149–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void G4ScoreLogColorMap::DrawColorChartBar(G4int _nPoint)
150{
151 G4bool lmin = true, lmax = true;
152 if(fMinVal <= 0.)
153 lmin = false;
154 if(fMaxVal <= 0.)
155 lmax = false;
156 G4double min = 0.;
157 if(lmin)
158 min = std::log10(fMinVal);
159 G4double max = 0.;
160 if(lmax)
161 max = std::log10(fMaxVal);
162
163 G4double smin = -0.89, smax = smin + 0.05 * (_nPoint) *0.83, step = 0.001;
164 G4double c[4];
165 for(auto y = smin; y < smax; y += step)
166 {
167 G4double ra = (y - smin) / (smax - smin), rb = 1. - ra;
168 G4Polyline line;
169 line.push_back(G4Point3D(-0.96, y, 0.));
170 line.push_back(G4Point3D(-0.91, y, 0.));
171 G4double val = std::pow(10., (ra * max + rb * min) / (ra + rb));
172 this->GetMapColor(val, c);
173 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0)
174 return;
175 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == -1.)
176 continue;
177 G4Colour col(c[0], c[1], c[2]);
178 G4VisAttributes att(col);
179 line.SetVisAttributes(&att);
180 fVisManager->Draw2D(line);
181 }
182}
183void G4ScoreLogColorMap::DrawColorChartText(G4int _nPoint)
184{
185 G4bool lmin = true, lmax = true;

Callers

nothing calls this directly

Calls 4

GetMapColorMethod · 0.95
Draw2DMethod · 0.80
push_backMethod · 0.45
SetVisAttributesMethod · 0.45

Tested by

no test coverage detected