MCPcopy Create free account
hub / github.com/carbonengine/trinity / Execute

Method Execute

trinity/RenderJob/TriStepRenderLineGraph.cpp:50–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50TriStepResult TriStepRenderLineGraph::Execute( Be::Time realTime, Be::Time simTime, Tr2RenderContext& renderContext )
51{
52 if( m_autoScale )
53 {
54 float maxValue = 0.0f;
55 for( Tr2LineGraphVector::iterator it = m_lineGraphs.begin(); it != m_lineGraphs.end(); ++it )
56 {
57 Tr2LineGraph* lg = *it;
58 float x = lg->GetMaxValue();
59 if( x > maxValue )
60 {
61 maxValue = x;
62 }
63 }
64
65 if( maxValue == 0.0f )
66 {
67 maxValue = 1.0f;
68 }
69
70 maxValue *= 1.1f;
71
72 if( maxValue > 1.0f )
73 {
74 maxValue /= 10.0f;
75 maxValue = ceil( maxValue );
76 maxValue *= 10.0f;
77 }
78 else
79 {
80 maxValue = 1.0f / maxValue;
81 maxValue /= 10.0f;
82 if( maxValue > 1.0f )
83 {
84 maxValue = floor( maxValue );
85 }
86 maxValue *= 10.0f;
87 maxValue = 1.0f / maxValue;
88 }
89
90 if( maxValue * m_legendScale > m_maxLegend )
91 {
92 maxValue = m_maxLegend / m_legendScale;
93 }
94
95 float newScale = 1.0f / maxValue;
96 if( newScale != m_scale )
97 {
98 m_scale = newScale;
99
100 if( m_scaleChangeCallback )
101 {
102 m_scaleChangeCallback.CallVoid();
103 }
104 }
105 }
106
107 int y = 0;

Callers

nothing calls this directly

Calls 7

GetMaxValueMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
RenderMethod · 0.45
GetColorMethod · 0.45
GetNameMethod · 0.45
GetViewportMethod · 0.45

Tested by

no test coverage detected