Skip to content
eduardgushchin edited this page Oct 22, 2026 · 4 revisions

Home | API by Category | Complete API Index | API Status

Field Value
Full name Electron2D.Mesh
Namespace Electron2D
Kind class
Category API Rendering

Overview

Describes indexed two-dimensional surfaces consumed by retained canvas drawing.

Syntax

public abstract class Electron2D.Mesh

Remarks

Surfaces use typed copied arrays. Materials and textures are borrowed. Implementations provide the surface callbacks; geometry, naming and storage changes publish Resource.Changed after committing.

Inherits: Resource

Detailed engine reference

Members

Member Kind Summary
protected Mesh() constructor Initializes the reusable mesh resource contract.
public Electron2D.PlaceholderMesh CreatePlaceholder() method Creates a caller-owned surface-free mesh retaining the current visibility bounds.
protected override System.Void Dispose(System.Boolean disposing) method
public Electron2D.Rect2 GetAABB() method Returns the axis-aligned visibility bounds of this two-dimensional mesh.
public System.Int32 GetBlendShapeCount() method Gets the number of named blend shapes.
public System.String GetBlendShapeName(System.Int32 index) method Gets one shape's authored name.
public Electron2D.Vector2[] GetFaces() method Gets copied local vertices for every triangle face.
public override Electron2D.RID GetRID() method Returns the stable borrowed identity of this mesh.
public System.Int32 GetSurfaceCount() method Gets the number of currently authored surfaces.
protected virtual Electron2D.Rect2 OnGetAABB() method Supplies the local two-dimensional visibility rectangle.
protected virtual System.Int32 OnGetBlendShapeCount() method Supplies the number of named shapes; unshaped meshes return zero.
protected virtual System.String OnGetBlendShapeName(System.Int32 index) method Supplies a name for an existing shape.
protected abstract System.Int32 OnGetSurfaceCount() method Supplies the authored surface count.
protected virtual System.Void OnSetBlendShapeName(System.Int32 index, System.String name) method Renames an existing shape and publishes its resource change.
protected abstract System.Int32 OnSurfaceGetArrayIndexLen(System.Int32 surfaceIndex) method Supplies the explicit index count.
protected abstract System.Int32 OnSurfaceGetArrayLen(System.Int32 surfaceIndex) method Supplies a surface's vertex count.
protected abstract Electron2D.MeshSurfaceData OnSurfaceGetArrays(System.Int32 surfaceIndex) method Supplies copied typed arrays for one surface.
protected virtual Electron2D.MeshSurfaceData[] OnSurfaceGetBlendShapeArrays(System.Int32 surfaceIndex) method Supplies copied shape payloads in the mesh's shape-index order.
protected abstract Electron2D.Mesh.ArrayFormat OnSurfaceGetFormat(System.Int32 surfaceIndex) method Supplies a surface format mask.
protected virtual System.Collections.Generic.IReadOnlyDictionary<System.Single, System.Int32[]> OnSurfaceGetLODs(System.Int32 surfaceIndex) method Supplies copied alternative index sets for one surface.
protected abstract Electron2D.Material OnSurfaceGetMaterial(System.Int32 surfaceIndex) method Supplies a surface's borrowed material.
protected abstract Electron2D.Mesh.PrimitiveType OnSurfaceGetPrimitiveType(System.Int32 surfaceIndex) method Supplies the primitive ordering policy.
protected abstract System.Void OnSurfaceSetMaterial(System.Int32 surfaceIndex, Electron2D.Material material) method Commits a borrowed surface material and reports its change.
public System.Void SetBlendShapeName(System.Int32 index, System.String name) method Renames one shape without changing its index or payload.
public System.Int32 SurfaceGetArrayIndexLen(System.Int32 surfaceIndex) method Gets one surface's explicit index count.
public System.Int32 SurfaceGetArrayLen(System.Int32 surfaceIndex) method Gets one surface's vertex count.
public Electron2D.MeshSurfaceData SurfaceGetArrays(System.Int32 surfaceIndex) method Gets independent typed arrays for one surface.
public Electron2D.MeshSurfaceData[] SurfaceGetBlendShapeArrays(System.Int32 surfaceIndex) method Gets copied position/normal/tangent payloads for all named shapes of one surface.
public Electron2D.Mesh.ArrayFormat SurfaceGetFormat(System.Int32 surfaceIndex) method Gets one surface's typed channel and policy mask.
public System.Collections.Generic.IReadOnlyDictionary<System.Single, System.Int32[]> SurfaceGetLODs(System.Int32 surfaceIndex) method Returns copied local edge-error thresholds and alternative vertex indices.
public Electron2D.Material SurfaceGetMaterial(System.Int32 surfaceIndex) method Gets a surface's borrowed material.
public Electron2D.Mesh.PrimitiveType SurfaceGetPrimitiveType(System.Int32 surfaceIndex) method Gets one surface's primitive topology.
public System.Void SurfaceSetMaterial(System.Int32 surfaceIndex, Electron2D.Material material) method Assigns a borrowed material to one surface.

Member Details

Mesh()

Kind: constructor

protected Mesh()

Summary

Initializes the reusable mesh resource contract.

CreatePlaceholder()

Kind: method

public Electron2D.PlaceholderMesh CreatePlaceholder()

Summary

Creates a caller-owned surface-free mesh retaining the current visibility bounds.

Returns

A new PlaceholderMesh with copied local bounds.

Dispose(System.Boolean)

Kind: method

protected override System.Void Dispose(System.Boolean disposing)

GetAABB()

Kind: method

public Electron2D.Rect2 GetAABB()

Summary

Returns the axis-aligned visibility bounds of this two-dimensional mesh.

Remarks

Ordinary bounds include stored vertices from every topology, including unreferenced vertices. Packed server surfaces retain their explicitly authored visibility rectangles. Prepared custom surface snapshots are reused; live ArrayMesh positions are read without copied queries.

Returns

A finite local rectangle, empty without vertices.

Exceptions

  • T:System.ArgumentException: A custom bounds callback supplies an invalid rectangle.

GetBlendShapeCount()

Kind: method

public System.Int32 GetBlendShapeCount()

Summary

Gets the number of named blend shapes.

Returns

A nonnegative count, zero for an unshaped mesh.

GetBlendShapeName(System.Int32)

Kind: method

public System.String GetBlendShapeName(System.Int32 index)

Summary

Gets one shape's authored name.

Returns

A non-null name; empty names are permitted.

Parameters

  • index: Existing zero-based shape index.

GetFaces()

Kind: method

public Electron2D.Vector2[] GetFaces()

Summary

Gets copied local vertices for every triangle face.

Remarks

Indexed and sequential triangles and triangle strips are expanded in surface order. Strip winding alternates to preserve face orientation. The result is caller-owned cold query storage.

Returns

Three vertices per face; point, line and UseEmptyVertexArray surfaces contribute no vertices.

Exceptions

  • T:System.ObjectDisposedException: The mesh is disposed.
  • T:System.ArgumentException: Custom surface arrays are malformed.

GetRID()

Kind: method

public override Electron2D.RID GetRID()

Summary

Returns the stable borrowed identity of this mesh.

Returns

A renderer-independent logical identity valid until resource disposal.

Exceptions

  • T:System.ObjectDisposedException: The mesh is disposed.

GetSurfaceCount()

Kind: method

public System.Int32 GetSurfaceCount()

Summary

Gets the number of currently authored surfaces.

Returns

The nonnegative surface count.

Exceptions

  • T:System.ObjectDisposedException: The mesh is disposed.

OnGetAABB()

Kind: method

protected virtual Electron2D.Rect2 OnGetAABB()

Summary

Supplies the local two-dimensional visibility rectangle.

Returns

Finite nonnegative local bounds; the default derives them from prepared surface positions.

OnGetBlendShapeCount()

Kind: method

protected virtual System.Int32 OnGetBlendShapeCount()

Summary

Supplies the number of named shapes; unshaped meshes return zero.

Returns

A nonnegative count.

OnGetBlendShapeName(System.Int32)

Kind: method

protected virtual System.String OnGetBlendShapeName(System.Int32 index)

Summary

Supplies a name for an existing shape.

Returns

A non-null name.

Parameters

  • index: Existing zero-based shape index.

OnGetSurfaceCount()

Kind: method

protected abstract System.Int32 OnGetSurfaceCount()

Summary

Supplies the authored surface count.

Returns

A nonnegative count.

OnSetBlendShapeName(System.Int32, System.String)

Kind: method

protected virtual System.Void OnSetBlendShapeName(System.Int32 index, System.String name)

Summary

Renames an existing shape and publishes its resource change.

Parameters

  • index: Existing zero-based shape index.
  • name: Non-null authored name.

OnSurfaceGetArrayIndexLen(System.Int32)

Kind: method

protected abstract System.Int32 OnSurfaceGetArrayIndexLen(System.Int32 surfaceIndex)

Summary

Supplies the explicit index count.

Returns

The index count.

Parameters

  • surfaceIndex: Existing zero-based index.

OnSurfaceGetArrayLen(System.Int32)

Kind: method

protected abstract System.Int32 OnSurfaceGetArrayLen(System.Int32 surfaceIndex)

Summary

Supplies a surface's vertex count.

Returns

The vertex count.

Parameters

  • surfaceIndex: Existing zero-based index.

OnSurfaceGetArrays(System.Int32)

Kind: method

protected abstract Electron2D.MeshSurfaceData OnSurfaceGetArrays(System.Int32 surfaceIndex)

Summary

Supplies copied typed arrays for one surface.

Returns

Independent channel arrays.

Parameters

  • surfaceIndex: Existing zero-based index.

OnSurfaceGetBlendShapeArrays(System.Int32)

Kind: method

protected virtual Electron2D.MeshSurfaceData[] OnSurfaceGetBlendShapeArrays(System.Int32 surfaceIndex)

Summary

Supplies copied shape payloads in the mesh's shape-index order.

Returns

Position/normal/tangent-only payloads, or empty when the mesh has no shapes.

Parameters

  • surfaceIndex: Existing zero-based surface index.

OnSurfaceGetFormat(System.Int32)

Kind: method

protected abstract Electron2D.Mesh.ArrayFormat OnSurfaceGetFormat(System.Int32 surfaceIndex)

Summary

Supplies a surface format mask.

Returns

The format mask.

Parameters

  • surfaceIndex: Existing zero-based index.

OnSurfaceGetLODs(System.Int32)

Kind: method

protected virtual System.Collections.Generic.IReadOnlyDictionary<System.Single, System.Int32[]> OnSurfaceGetLODs(System.Int32 surfaceIndex)

Summary

Supplies copied alternative index sets for one surface.

Returns

Positive finite local thresholds and independent index arrays; empty without LODs.

Parameters

  • surfaceIndex: Existing zero-based surface index.

OnSurfaceGetMaterial(System.Int32)

Kind: method

protected abstract Electron2D.Material OnSurfaceGetMaterial(System.Int32 surfaceIndex)

Summary

Supplies a surface's borrowed material.

Returns

The borrowed material or null.

Parameters

  • surfaceIndex: Existing zero-based index.

OnSurfaceGetPrimitiveType(System.Int32)

Kind: method

protected abstract Electron2D.Mesh.PrimitiveType OnSurfaceGetPrimitiveType(System.Int32 surfaceIndex)

Summary

Supplies the primitive ordering policy.

Returns

The topology.

Parameters

  • surfaceIndex: Existing zero-based index.

OnSurfaceSetMaterial(System.Int32, Electron2D.Material)

Kind: method

protected abstract System.Void OnSurfaceSetMaterial(System.Int32 surfaceIndex, Electron2D.Material material)

Summary

Commits a borrowed surface material and reports its change.

Parameters

  • surfaceIndex: Existing zero-based index.
  • material: Borrowed live material or null.

SetBlendShapeName(System.Int32, System.String)

Kind: method

public System.Void SetBlendShapeName(System.Int32 index, System.String name)

Summary

Renames one shape without changing its index or payload.

Parameters

  • index: Existing zero-based shape index.
  • name: Non-null authored name.

SurfaceGetArrayIndexLen(System.Int32)

Kind: method

public System.Int32 SurfaceGetArrayIndexLen(System.Int32 surfaceIndex)

Summary

Gets one surface's explicit index count.

Returns

Zero for sequential vertices; otherwise the index count.

Parameters

  • surfaceIndex: Existing zero-based surface index.

SurfaceGetArrayLen(System.Int32)

Kind: method

public System.Int32 SurfaceGetArrayLen(System.Int32 surfaceIndex)

Summary

Gets one surface's vertex count.

Returns

The number of vertex positions.

Parameters

  • surfaceIndex: Existing zero-based surface index.

SurfaceGetArrays(System.Int32)

Kind: method

public Electron2D.MeshSurfaceData SurfaceGetArrays(System.Int32 surfaceIndex)

Summary

Gets independent typed arrays for one surface.

Returns

Caller-owned copies of the surface channels.

Parameters

  • surfaceIndex: Existing zero-based surface index.

Exceptions

  • T:System.ArgumentOutOfRangeException: The index is outside the mesh.
  • T:System.ObjectDisposedException: The mesh is disposed.

SurfaceGetBlendShapeArrays(System.Int32)

Kind: method

public Electron2D.MeshSurfaceData[] SurfaceGetBlendShapeArrays(System.Int32 surfaceIndex)

Summary

Gets copied position/normal/tangent payloads for all named shapes of one surface.

Returns

Independent payloads in shape-index order; empty for an unshaped mesh.

Parameters

  • surfaceIndex: Existing zero-based surface index.

SurfaceGetFormat(System.Int32)

Kind: method

public Electron2D.Mesh.ArrayFormat SurfaceGetFormat(System.Int32 surfaceIndex)

Summary

Gets one surface's typed channel and policy mask.

Returns

The format mask.

Parameters

  • surfaceIndex: Existing zero-based surface index.

SurfaceGetLODs(System.Int32)

Kind: method

public System.Collections.Generic.IReadOnlyDictionary<System.Single, System.Int32[]> SurfaceGetLODs(System.Int32 surfaceIndex)

Summary

Returns copied local edge-error thresholds and alternative vertex indices.

Remarks

Canvas drawing chooses the largest threshold whose transformed error is at most one framebuffer pixel. Base arrays, bounds and face queries keep the full authored geometry.

Returns

Ascending positive finite thresholds mapped to independent index arrays.

Parameters

  • surfaceIndex: Existing zero-based surface index.

Exceptions

  • T:System.ArgumentOutOfRangeException: The surface index is outside the mesh.

SurfaceGetMaterial(System.Int32)

Kind: method

public Electron2D.Material SurfaceGetMaterial(System.Int32 surfaceIndex)

Summary

Gets a surface's borrowed material.

Returns

The material or null for the drawing item's material.

Parameters

  • surfaceIndex: Existing zero-based surface index.

SurfaceGetPrimitiveType(System.Int32)

Kind: method

public Electron2D.Mesh.PrimitiveType SurfaceGetPrimitiveType(System.Int32 surfaceIndex)

Summary

Gets one surface's primitive topology.

Returns

The primitive ordering policy.

Parameters

  • surfaceIndex: Existing zero-based surface index.

SurfaceSetMaterial(System.Int32, Electron2D.Material)

Kind: method

public System.Void SurfaceSetMaterial(System.Int32 surfaceIndex, Electron2D.Material material)

Summary

Assigns a borrowed material to one surface.

Parameters

  • surfaceIndex: Existing zero-based surface index.
  • material: Borrowed live material or null.

Exceptions

  • T:System.ObjectDisposedException: The mesh or material is disposed.

Clone this wiki locally