Class DrawingLayout
- Namespace
- OFT.Rendering
- Assembly
- OFT.Rendering.dll
Represents a layout used for drawing operations.
public class DrawingLayout
- Inheritance
-
objectDrawingLayout
- Extension Methods
Remarks
Threading: producers may bump the content version (Invalidate() / Modified) from any thread, but rendering a layout is single-threaded by contract — BeginRender(RenderContext)/EndRender(RenderContext) of the same layout must not overlap (the version staged for commit is a single slot). WPF serializes frames per control, PlatformX per chart.
Constructors
DrawingLayout()
Initializes a new instance of the DrawingLayout class.
public DrawingLayout()
Fields
ID
Process-wide sequence number of the layout, assigned at construction; identifies the layout in serialized command buffers.
public readonly int ID
Field Value
- int
Properties
ContentVersion
Gets the version of the layout content. Producers bump it (via Invalidate()) whenever the content changes.
Added in ATAS 8.0.15.
public long ContentVersion { get; }
Property Value
- long
Height
Gets the height of the drawing layout.
public int Height { get; }
Property Value
- int
Modified
Gets or sets flag that this layout must be re-rendered. Invalidation needed if one of child layouts was changed or cached bitmaps were lost (resize). Setting true is an alias for Invalidate(); setting false is a no-op — dirtiness is cleared only by committing a rendered version, never by the producer, so a dropped frame cannot mark stale content as valid.
public bool Modified { get; set; }
Property Value
- bool
Name
Gets or sets the name of layout for debugging.
public string Name { get; set; }
Property Value
- string
Size
Gets the size of the drawing layout as a Size object.
public Size Size { get; }
Property Value
- Size
Width
Gets the width of the drawing layout.
public int Width { get; }
Property Value
- int
Methods
BeginRender(RenderContext)
Begins rendering the layout using the specified parent render context.
public RenderContext BeginRender(RenderContext parentRenderContext)
Parameters
parentRenderContextRenderContextThe parent render context to use for rendering.
Returns
- RenderContext
The render context used for rendering the layout.
Exceptions
- ArgumentNullException
Thrown if the
parentRenderContextis null.- RenderException
Thrown if the render context creation fails.
Clear()
Marks the layout as modified, indicating that it needs to be redrawn.
public void Clear()
CommitRenderedVersion(long)
Commits a rendered content version after the frame that carried it was successfully presented. Monotonic: an older version never overwrites a newer commit.
Added in ATAS 8.0.15.
public void CommitRenderedVersion(long version)
Parameters
versionlong
EndRender(RenderContext)
Ends rendering the layout using the specified render context.
public void EndRender(RenderContext renderContext)
Parameters
renderContextRenderContextThe render context used for rendering the layout.
Exceptions
- RenderException
Thrown if the specified
renderContextis null. Make sure to call BeginRender(RenderContext) before calling this method.
Invalidate()
Marks the layout content as changed so it will be re-rendered.
Added in ATAS 8.0.15.
public void Invalidate()
SetSizeAndCheckIsNeedToRedraw(RenderContext, int, int)
Sets the size of the layout and checks if the layout needs to be redrawn.
public bool SetSizeAndCheckIsNeedToRedraw(RenderContext parentRenderContext, int width, int height)
Parameters
parentRenderContextRenderContextThe parent render context used for checking font anti-aliasing settings.
widthintThe new width of the layout.
heightintThe new height of the layout.
Returns
- bool
True if the layout needs to be redrawn, otherwise false.
ToString()
public override string ToString()
Returns
- string