Table of Contents

Interface IGLFigure

Namespace
SearchAThing.OpenGL.Core
Assembly
netcore-opengl-core.dll

This is the direct child of a vertex manager.
A figure contains primitives and primitive contains vertexes. The figure is useful to group together primitives and handle properties such as Visibile, Order, ObjectMatrix, ScreenCoord mode.

[JsonObject(MemberSerialization.OptIn)]
public interface IGLFigure : IGLVertexManagerObject, INotifyPropertyChanged
Inherited Members
Extension Methods

Remarks

All properties are INotifyPropertyChanged managed and allow to be ui reactive.

Properties

Alpha

Allow to change alpha (0:full transparent, 1:full opaque) of the figure without the need to change primitives color. If null figure primitives alpha will not overriden. (Default: null)
Changing this property emits FigureInvalidated event.

[JsonProperty]
float? Alpha { get; set; }

Property Value

float?

EvalInShadowMap

States if this figure has to be considered for building of the shadow map.
While is true by default in GLFigureBase, is overriden to false by GLTextCharFigure specialization of GLTriangleFigure in order to avoid dropping shadows of the triangles used by the font textures.

bool EvalInShadowMap { get; }

Property Value

bool

ExcludeFromShadeWithEdge

If true figure will rendered w/out "shade with edge" shader regardless the option is active in the gl control. (Default: false)

bool ExcludeFromShadeWithEdge { get; }

Property Value

bool

ExpandBBox

States if this figure is considered in bbox expansion (Default: true).
Useful to avoid cs figure or non related to content of interest to decrease view and zoom experience.

bool ExpandBBox { get; set; }

Property Value

bool

Highlight

Enable highlight of a figure with a color ( Default: Yellow ).

Changing this property emits FigureInvalidated event.

bool Highlight { get; set; }

Property Value

bool

Indexes

List of vertex manager vertex indexes used by this figure.
Used in the final render phase where GL.DrawElements take place to mapped as opengl ElementArrayBuffer.

IEnumerable<uint> Indexes { get; }

Property Value

IEnumerable<uint>

LBBox

(cached) Bounding box of this figure vertexes [local].

BBox LBBox { get; }

Property Value

BBox

OBBox

Bounding bbox of this figure vertexes [object].

BBox OBBox { get; }

Property Value

BBox

ObjectMatrix

Object coord [object] to local space coord [local] transformation matrix.
Changing this property emits FigureInvalidated event.

[JsonProperty]
Matrix4x4 ObjectMatrix { get; set; }

Property Value

Matrix4x4

Remarks

While each control has separate model/view/projection matrixes, the figure object matrix is common to all controls that uses the same model containing this figure instance.

Order

Figure order appareance ( Default: 0 ).
Higher order figure appears front to lower order figures.
From the opengl point of view figures with higher order ( front ) are drawn firstly then lower order ( back ).
Changing this property emits FigureInvalidated event.

[JsonProperty]
int Order { get; set; }

Property Value

int

PrimitiveType

Enum that describe which type underlying to the instance.

GLPrimitiveType PrimitiveType { get; }

Property Value

GLPrimitiveType

Primitives

A figure can contains primitives that in turn can contains vertexes.

ReadOnlyObservableCollection<GLPrimitiveBase> Primitives { get; }

Property Value

ReadOnlyObservableCollection<GLPrimitiveBase>

ScreenCoordMode

Enable handling of figure primitive vertexes as screen coord.
At vertex manager level these vertexes coord not distinguish from non screen coord vertexes types, these can share the same memory region, but when render cycles through figures at each a uniform variable inform the shader to transform within screen scoped projection/model matrixes designed to make a unscaled orthografic projection with a model translated by (-sw/2, -sh/2) where sw,sh = screen width,height.
Changing this property emits FigureInvalidated event.

[JsonProperty]
bool ScreenCoordMode { get; set; }

Property Value

bool

Selected

States if figure is actually selected.
It true the figure is listed in model selected figures SelectedFigures.

bool Selected { get; }

Property Value

bool

Tag

User object

object? Tag { get; set; }

Property Value

object

Visible

Figure visibility.
Changing this property emits FigureInvalidated event.

[JsonProperty]
bool Visible { get; set; }

Property Value

bool

Remarks

Changing visbility of a figure affects all controls that uses the same model containing this figure instance.

Methods

Invalidate()

Invoke FigureInvalidated.
Used for internal purpose by the GLPrimitiveBase.

void Invalidate()

RemovePrimitive(GLPrimitiveBase)

Remove primitive from this figure.

void RemovePrimitive(GLPrimitiveBase primitive)

Parameters

primitive GLPrimitiveBase

Gl primitive to remove.

SimpleCmd()

Retrieve e simple cmd representation of this figure.
Its a textual representation of figure information useful to regen in a separate tool.

string SimpleCmd()

Returns

string

Events

FigureInvalidated

This event is managed internally by the GLModel and signal that a model figure changed some of its vertex propertties.
When a model figure emit this event the model emit ViewInvalidated.

event FigureInvalidatedDelegate? FigureInvalidated

Event Type

FigureInvalidatedDelegate