------------------------------------------------------------------------------ The render method that is called from the volume. If this is a canonical view render, a specialized version of this method will be called instead. Otherwise we will - Invoke a start event - Start timing - Check that everything is OK for rendering - Render - Stop the timer and record results - Invoke an end event -------
| 135 | // - Invoke an end event |
| 136 | //------------------------------------------------------------------------------ |
| 137 | void vtkGPUVolumeRayCastMapper::Render(vtkRenderer* ren, vtkVolume* vol) |
| 138 | { |
| 139 | // Catch renders that are happening due to a canonical view render and |
| 140 | // handle them separately. |
| 141 | if (this->GeneratingCanonicalView) |
| 142 | { |
| 143 | this->CanonicalViewRender(ren, vol); |
| 144 | return; |
| 145 | } |
| 146 | |
| 147 | // Invoke a VolumeMapperRenderStartEvent |
| 148 | this->InvokeEvent(vtkCommand::VolumeMapperRenderStartEvent, nullptr); |
| 149 | |
| 150 | // Start the timer to time the length of this render |
| 151 | vtkTimerLog* timer = vtkTimerLog::New(); |
| 152 | timer->StartTimer(); |
| 153 | |
| 154 | // Make sure everything about this render is OK. |
| 155 | // This is where the input is updated. |
| 156 | if (this->ValidateRender(ren, vol)) |
| 157 | { |
| 158 | // Everything is OK - so go ahead and really do the render |
| 159 | this->GPURender(ren, vol); |
| 160 | } |
| 161 | |
| 162 | // Stop the timer |
| 163 | timer->StopTimer(); |
| 164 | double t = timer->GetElapsedTime(); |
| 165 | |
| 166 | // std::cout << "Render Timer " << t << " seconds, " << 1.0/t << " frames per second" << endl; |
| 167 | |
| 168 | this->TimeToDraw = t; |
| 169 | timer->Delete(); |
| 170 | |
| 171 | if (vol->GetAllocatedRenderTime() < 1.0) |
| 172 | { |
| 173 | this->SmallTimeToDraw = t; |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | this->BigTimeToDraw = t; |
| 178 | } |
| 179 | |
| 180 | // Invoke a VolumeMapperRenderEndEvent |
| 181 | this->InvokeEvent(vtkCommand::VolumeMapperRenderEndEvent, nullptr); |
| 182 | } |
| 183 | |
| 184 | //------------------------------------------------------------------------------ |
| 185 | // Special version for rendering a canonical view - we don't do things like |
nothing calls this directly
no test coverage detected