MCPcopy Create free account
hub / github.com/chrxh/alien / tryDrawVectorGraphicsAndReturnOverlay

Method tryDrawVectorGraphicsAndReturnOverlay

source/EngineImpl/EngineWorker.cpp:63–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63std::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
92bool EngineWorker::isSyncSimulationWithRendering() const
93{

Callers 1

Calls 3

toIntFunction · 0.85
isTimeoutMethod · 0.80

Tested by

no test coverage detected