Class DrawableLineBatch
Represents a drawable batch for rendering CAD lines in 3D space. This class manages a LineBatch3D instance to efficiently render multiple lines, and updates its bounding box to encompass all added lines.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Runtimes.CAD.CustomLineBatch
Assembly: Evergine.Runtimes.CAD.dll
Syntax
public class DrawableLineBatch : Drawable3D, IDependencyObject
Remarks
The DrawableLineBatch is intended for use in CAD visualization scenarios where dynamic addition of lines and efficient rendering are required. It handles the lifecycle of the underlying LineBatch3D and ensures that the bounding box is always up to date.
Constructors
DrawableLineBatch(GraphicsContext)
Initializes a new instance of the DrawableLineBatch class. Sets up the line batch and initializes the bounding box.
Declaration
public DrawableLineBatch(GraphicsContext graphicsContext = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphicsContext | graphicsContext | The graphics context used for rendering operations. If null, the line batch will not be created. |
Methods
AddLine(CADLine)
Adds a CAD line to the line batch for rendering and updates the bounding box to include the new line's coordinates.
Declaration
public void AddLine(CADLine cadLine)
Parameters
| Type | Name | Description |
|---|---|---|
| CADLine | cadLine | The CADLine instance representing the line to add. |
Draw(DrawContext)
Updates the transform of the internal line batch before rendering.
Declaration
public override void Draw(DrawContext drawContext)
Parameters
| Type | Name | Description |
|---|---|---|
| DrawContext | drawContext | The current draw context. |
Overrides
OnActivated()
Invoked when the object is activated once it is attached.
Declaration
protected override void OnActivated()
Overrides
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
| Type | Description |
|---|---|
| bool | True if everything is OK. |
Overrides
OnDeactivated()
Invoked when the object is deactivated.
Declaration
protected override void OnDeactivated()
Overrides
OnDetached()
Invoked when the object is detached.
Declaration
protected override void OnDetached()