This Event causes Dx11DrawRenderingRoom to invalidate it's cache and rebuild geometry while the Room Geometry is still being processed.
This would not only occur during Undo/Redo, but also during Smart Geometry such as Shovel.
To avoid this, I created two new Events:
SuspendRenderingEvent to ignore any drawing attempts and
ResumRenderingEvent to reenable rendering.
The RenderingPanel class got a new bool AllowRendering (default true).
It also got an overriden WndProc, which checks whether the Message is WM_PAINT and AllowRendering is true to accept the message.
When building RoomGeometry of rooms in Parallel (
Parallel.For(Each)
), the C# Runtime would occasionally fire aOnPaint
Event to avoid unresponsiveness. See this: https://stackoverflow.com/questions/4540244/how-is-this-possible-onpaint-processed-while-in-waitone and this: https://stackoverflow.com/questions/35535580/why-does-parallel-for-execute-the-winforms-message-pump-and-how-to-prevent-itThis Event causes
Dx11DrawRenderingRoom
to invalidate it's cache and rebuild geometry while the Room Geometry is still being processed.This would not only occur during Undo/Redo, but also during Smart Geometry such as Shovel.
To avoid this, I created two new Events:
SuspendRenderingEvent
to ignore any drawing attempts andResumRenderingEvent
to reenable rendering.The
RenderingPanel
class got a newbool AllowRendering
(defaulttrue
). It also got an overridenWndProc
, which checks whether the Message isWM_PAINT
andAllowRendering
is true to accept the message.