Table of Contents

Class GLFigureBase

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

Base abstract class for point, line, triangle figures.

public abstract class GLFigureBase : IGLFigure, IGLVertexManagerObject, INotifyPropertyChanged
Inheritance
GLFigureBase
Implements
Derived
Inherited Members
Extension Methods

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.

public 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.

public virtual bool EvalInShadowMap { get; }

Property Value

bool

ExcludeFromShadeWithEdge

ExcludeFromShadeWithEdge

public bool ExcludeFromShadeWithEdge { get; set; }

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.

public bool ExpandBBox { get; set; }

Property Value

bool

Highlight

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

Changing this property emits FigureInvalidated event.

public 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.

public IEnumerable<uint> Indexes { get; }

Property Value

IEnumerable<uint>

LBBox

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

public BBox LBBox { get; }

Property Value

BBox

OBBox

Bounding bbox of this figure vertexes [object].

public BBox OBBox { get; }

Property Value

BBox

ObjectMatrix

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

public 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.

ObjectMatrixIsIdentity

States if object matrix is an identity.

public bool ObjectMatrixIsIdentity { get; }

Property Value

bool

Remarks

This property caches Matrix4x4.IsIdentity information and keeps updated only upon effective object matrix change.

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.

public int Order { get; set; }

Property Value

int

ParentVertexManager

Vertex manager which this object is registered to.
Before the object is added to the GLModel, therefore to the GLVertexManager, or after the object is removed from, this pointer is null.

public GLVertexManager? ParentVertexManager { get; }

Property Value

GLVertexManager

PrimitiveType

Enum that describe which type underlying to the instance.

public abstract GLPrimitiveType PrimitiveType { get; }

Property Value

GLPrimitiveType

Primitives

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

public abstract 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.

public 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.

public bool Selected { get; }

Property Value

bool

Tag

User object

public object? Tag { get; set; }

Property Value

object

Visible

Figure visibility.
Changing this property emits FigureInvalidated event.

public 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

Copy()

Create a copy of this gl vertex manager object copying all relevant data except the ParentVertexManager that will default to null for copies object until added to a vertex manager.

public IGLVertexManagerObject Copy()

Returns

IGLVertexManagerObject

CopyBase()

Create a copy with all elements down the hierarchy until GLFigureBase included.

public GLFigureBase CopyBase()

Returns

GLFigureBase

CopySpecialized(GLFigureBase)

protected abstract void CopySpecialized(GLFigureBase other)

Parameters

other GLFigureBase

Invalidate()

Emit FigureInvalidated event.

public void Invalidate()

MakeInstance()

Create an instance of derived type.

protected abstract GLFigureBase MakeInstance()

Returns

GLFigureBase
See Also

Mirror(in Matrix4x4)

Create a mirrored figure against given xy plane.

public abstract GLFigureBase? Mirror(in Matrix4x4 xyPlane)

Parameters

xyPlane Matrix4x4

XY mirror plane.

Returns

GLFigureBase

Mirrored figure.

OnPropertyChanged(string?)

invoke this method to forward propertchanged event notification. note: not needed to specify propertyName set by compiler service to called property.

protected void OnPropertyChanged(string? propertyName = null)

Parameters

propertyName string

RemovePrimitive(GLPrimitiveBase)

Remove primitive from this figure.

public abstract 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.

public abstract string SimpleCmd()

Returns

string

ToString()

public override string ToString()

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.

public event FigureInvalidatedDelegate? FigureInvalidated

Event Type

FigureInvalidatedDelegate

PropertyChanged

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler