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

Method DrawColorChartBar

source/digits_hits/utils/src/G4VScoreColorMap.cc:60–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void G4VScoreColorMap::DrawColorChartBar(G4int _nPoint)
61{
62 G4double min = this->GetMin();
63 G4double max = this->GetMax();
64 G4double smin = -0.89, smax = smin + 0.05 * (_nPoint) *0.83, step = 0.001;
65 G4double c[4];
66
67 fVisManager->BeginDraw2D();
68
69 for(G4double y = smin; y < smax; y += step)
70 {
71 G4double ra = (y - smin) / (smax - smin), rb = 1. - ra;
72 G4Polyline line;
73 line.push_back(G4Point3D(-0.96, y, 0.));
74 line.push_back(G4Point3D(-0.91, y, 0.));
75 this->GetMapColor((ra * max + rb * min) / (ra + rb), c);
76 G4Colour col(c[0], c[1], c[2]);
77 G4VisAttributes att(col);
78 line.SetVisAttributes(&att);
79 fVisManager->Draw2D(line);
80 }
81
82 fVisManager->EndDraw2D();
83}
84
85void G4VScoreColorMap::DrawColorChartText(G4int _nPoint)
86{

Callers

nothing calls this directly

Calls 8

GetMinMethod · 0.95
GetMaxMethod · 0.95
BeginDraw2DMethod · 0.80
Draw2DMethod · 0.80
EndDraw2DMethod · 0.80
push_backMethod · 0.45
GetMapColorMethod · 0.45
SetVisAttributesMethod · 0.45

Tested by

no test coverage detected