Class GLPrimitiveBase
- Namespace
- SearchAThing.OpenGL.Core
- Assembly
- netcore-opengl-core.dll
public abstract class GLPrimitiveBase : IGLPrimitive, IGLVertexManagerObject, INotifyPropertyChanged
- Inheritance
-
GLPrimitiveBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
LBBox
(cached) Bounding box of the primitive [local].
public BBox LBBox { get; }
Property Value
Order
Primitive order appareance ( Default: 0 ).
Higher order primitives appears front to lower order primitives of the same figure.
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
ParentFigure
Reference to the parent figure.
public IGLFigure? ParentFigure { get; }
Property Value
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
PrimitiveType
Enum that describe which type underlying to the instance.
public GLPrimitiveType PrimitiveType { get; }
Property Value
Selected
States if primitive is actually selected.
It true the primitive is listed in model selected primitives SelectedPrimitives.
public bool Selected { get; }
Property Value
Vertexes
Enumerate primitive gl vertexes.
public abstract IEnumerable<GLVertex> Vertexes { get; }
Property Value
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
CopyBase()
Creates a copy with all elements down the hierarchy until GLPrimitiveBase included.
protected GLPrimitiveBase CopyBase()
Returns
CopySpecialized(GLPrimitiveBase)
protected abstract void CopySpecialized(GLPrimitiveBase other)
Parameters
other
GLPrimitiveBase
MakeInstance()
protected abstract GLPrimitiveBase MakeInstance()
Returns
Mirror(in Matrix4x4)
Create a mirrored primitive against given xy plane.
public abstract GLPrimitiveBase? Mirror(in Matrix4x4 xyPlane)
Parameters
xyPlane
Matrix4x4XY mirror plane.
Returns
- GLPrimitiveBase
Mirrored primitive.
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
SetColor(in Color)
Set the color of primitive vertexes.
public GLPrimitiveBase SetColor(in Color color)
Parameters
color
ColorColor to set on primitive vertexes.
Returns
- GLPrimitiveBase
This primitive.
SetColor(in Vector4)
Set the color of primitive vertexes.
public GLPrimitiveBase SetColor(in Vector4 rgbaColor)
Parameters
rgbaColor
Vector4Color to set on primitive vertexes.
Returns
- GLPrimitiveBase
This primitive.
SimpleCmd(bool)
Retrieve e simple cmd representation of this primtiive.
Its a textual representation of primitive information useful to regen in a separate tool.
public abstract string SimpleCmd(bool includeHeader = true)
Parameters
includeHeader
boolIf true header will prepended to form a complete command.
Returns
Events
PropertyChanged
public event PropertyChangedEventHandler? PropertyChanged