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
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
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
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
Highlight
Enable highlight of a figure with a color ( Default: Yellow ).
Changing this property emits FigureInvalidated event.
bool Highlight { get; set; }
Property Value
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
LBBox
(cached) Bounding box of this figure vertexes [local].
BBox LBBox { get; }
Property Value
OBBox
Bounding bbox of this figure vertexes [object].
BBox OBBox { get; }
Property Value
ObjectMatrix
Object coord [object] to local space coord [local] transformation matrix.
Changing this property emits FigureInvalidated event.
[JsonProperty]
Matrix4x4 ObjectMatrix { get; set; }
Property Value
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
PrimitiveType
Enum that describe which type underlying to the instance.
GLPrimitiveType PrimitiveType { get; }
Property Value
Primitives
A figure can contains primitives that in turn can contains vertexes.
ReadOnlyObservableCollection<GLPrimitiveBase> Primitives { get; }
Property Value
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
Selected
States if figure is actually selected.
It true the figure is listed in model selected figures SelectedFigures.
bool Selected { get; }
Property Value
Tag
User object
object? Tag { get; set; }
Property Value
Visible
Figure visibility.
Changing this property emits FigureInvalidated event.
[JsonProperty]
bool Visible { get; set; }
Property Value
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
GLPrimitiveBaseGl 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
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