Class GLVertexManager
- Namespace
- SearchAThing.OpenGL.Core
- Assembly
- netcore-opengl-core.dll
public class GLVertexManager : IGLVertexManager, INotifyPropertyChanged
- Inheritance
-
GLVertexManager
- Implements
- Inherited Members
Constructors
GLVertexManager(bool)
Create a new gl vertex manager that can be added to the gl model through AddCustomVertexManager(GLVertexManager).
public GLVertexManager(bool expandModelBBox = true)
Parameters
expandModelBBox
boolIf false adding vertexes to this vertex manager doesn't affects the gl model bbox. (Default: true).
Properties
ExpandModelBBox
Flag to state if vertex added to this vertex manager imply expansion of the gl model (Default: true).
More (custom) vertex manager can be registered into the gl model, may for temporary purpose and
setting this variable to false at the construct of these custom vertex manager allow to unaffect
the gl model bbox.
Should be used to avoid the zoomfit to evaluate temporary vertex manager figures.
GLVertexManager
public bool ExpandModelBBox { get; }
Property Value
FigureCount
Actual size of registered figures list.
public int FigureCount { get; set; }
Property Value
Figures
Enumerates vertex manager registered figures.
public IEnumerable<GLFigureBase> Figures { get; }
Property Value
LBBox
BBox of registered figure vertexes [local].
public BBox LBBox { get; }
Property Value
TriangleCount
Actual count of gl triangles belonging to added figures.
public int TriangleCount { get; set; }
Property Value
VertexCount
Actual size of GLVertexStruct vertex list.
public int VertexCount { get; set; }
Property Value
Methods
AddFigure(GLFigureBase)
Adds given figure to the vertex manager.
All vertexes belonging to the figure's primitives will be added.
Emits FigureAdded event.
public void AddFigure(GLFigureBase figure)
Parameters
figure
GLFigureBaseFigure to add.
AddFigure(params GLFigureBase[])
Adds given figures to the vertex manager.
All vertexes belonging to the figures primitives will be added.
Emits FigureAdded event.
public void AddFigure(params GLFigureBase[] figures)
Parameters
figures
GLFigureBase[]Figures to add.
AddFigure(IEnumerable<GLFigureBase>)
Adds given figures to the vertex manager.
All vertexes belonging to the figures primitives will be added.
Emits FigureAdded event.
public void AddFigure(IEnumerable<GLFigureBase> figures)
Parameters
figures
IEnumerable<GLFigureBase>Figures to add.
Clear()
Clear all vertexes and figures from the vertex manager, and emit FiguresCleared and Invalidated event.
public void Clear()
GetVboArray()
Used internally by the GLModel.RenderVertexManager
to render the scene.
Contains the list of vertex structs directly mapped to the gpu.
This array will be built each time a vertex changes from the ToArray() of the list Vertexes.
To avoid performance penalty in a scenario where you need to change the position of a figure
you can use ObjectMatrix that doesn't affects at all vertexes because is a figure
related information forwarded to the gl pipeline shader through UNINAME_uObject.
public GLVertexStruct[] GetVboArray()
Returns
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
RecomputeLBBox()
Recompute bbox [local] of all figure/primitive vertexes upading LBBox.
Used internally after figure/primitive deletion.
REVIEW: may improved
public BBox RecomputeLBBox()
Returns
RemoveFigure(GLFigureBase)
Remove given figure from the vertex manager.
All vertexes belonging to the figures primitives will be removed.
Emits FigureRemoved event.
public bool RemoveFigure(GLFigureBase figure)
Parameters
figure
GLFigureBaseFigure to remove.
Returns
- bool
True if figure effectively removed.
RemoveFigure(params GLFigureBase[])
Remove given figures from the vertex manager.
All vertexes belonging to the figures primitives will be removed.
Emits FigureRemoved event.
public int RemoveFigure(params GLFigureBase[] figures)
Parameters
figures
GLFigureBase[]Figures to remove.
Returns
- int
Count of figures effectively removed.
RemoveFigure(IEnumerable<GLFigureBase>)
Remove given figures from the vertex manager.
All vertexes belonging to the figures primitives will be removed.
Emits FigureRemoved event.
public int RemoveFigure(IEnumerable<GLFigureBase> figures)
Parameters
figures
IEnumerable<GLFigureBase>Figures to remove.
Returns
- int
Count of figures effectively removed.
Events
FigureAdded
Event emitted when a figure was added.
public event FigureEvent? FigureAdded
Event Type
FigureRemoved
Event emitted when a figure was removed.
public event FigureEvent? FigureRemoved
Event Type
FiguresCleared
Event emitted when all figures cleared.
The list of figures removed is reported through the event argument of FiguresEvent delegate.
public event FiguresEvent? FiguresCleared
Event Type
Invalidated
Event emitted when a vertex was added or removed or all vertexes cleared.
Its used by the GLModel to track the model changes
and emit a ViewInvalidated event.
public event VertexManagerInvalidatedDelegate? Invalidated
Event Type
- See Also
-
Clear()
PropertyChanged
public event PropertyChangedEventHandler? PropertyChanged