| 61 | } |
| 62 | |
| 63 | std::optional<OverlayDescription> EngineWorker::tryDrawVectorGraphicsAndReturnOverlay( |
| 64 | RealVector2D const& rectUpperLeft, |
| 65 | RealVector2D const& rectLowerRight, |
| 66 | IntVector2D const& imageSize, |
| 67 | double zoom) |
| 68 | { |
| 69 | EngineWorkerGuard access(this, FrameTimeout); |
| 70 | |
| 71 | if (!access.isTimeout()) { |
| 72 | registerImageResource(); |
| 73 | _simulationCudaFacade->drawVectorGraphics( |
| 74 | {rectUpperLeft.x, rectUpperLeft.y}, {rectLowerRight.x, rectLowerRight.y}, _cudaResource, {imageSize.x, imageSize.y}, zoom); |
| 75 | |
| 76 | DataTO dataTO = provideTO(); |
| 77 | |
| 78 | _simulationCudaFacade->getOverlayData( |
| 79 | {toInt(rectUpperLeft.x), toInt(rectUpperLeft.y)}, |
| 80 | int2{toInt(rectLowerRight.x), toInt(rectLowerRight.y)}, |
| 81 | dataTO); |
| 82 | |
| 83 | DescriptionConverter converter(_settings.simulationParameters); |
| 84 | auto result = converter.convertTOtoOverlayDescription(dataTO); |
| 85 | |
| 86 | syncSimulationWithRenderingIfDesired(); |
| 87 | return result; |
| 88 | } |
| 89 | return std::nullopt; |
| 90 | } |
| 91 | |
| 92 | bool EngineWorker::isSyncSimulationWithRendering() const |
| 93 | { |
no test coverage detected