Class MeshModel
- Namespace
- LightningChartLib.WinForms.Charting.Views.View3D
- Assembly
- LightningChart.WinForms.Charting.NET4.dll
Mesh model.
[TypeConverter(typeof(ExpandableObjectConverter))]
public class MeshModel : TransparencyRenderItem, IChartNode, IDisposable, IHighlightingItem
- Inheritance
-
MeshModel
- Implements
- Inherited Members
Constructors
MeshModel()
Constructor.
public MeshModel()
MeshModel(View3D)
Constructor. Use primary axis for axis binding.
public MeshModel(View3D owner)
Parameters
ownerView3DParent.
MeshModel(View3D, Axis3DBinding, Axis3DBinding, Axis3DBinding)
Constructor.
public MeshModel(View3D owner, Axis3DBinding xAxis, Axis3DBinding yAxis, Axis3DBinding zAxis)
Parameters
ownerView3DParent.
xAxisAxis3DBindingX-axis binding.
yAxisAxis3DBindingY-axis binding.
zAxisAxis3DBindingZ-axis binding.
Properties
Cull
Face culling determines which faces are not rendered based on their winding order. If model show wrong faces, culling may be an issue.
public Cull Cull { get; set; }
Property Value
CursorTrackEnabled
Cursor tracking enabled.
public bool CursorTrackEnabled { get; set; }
Property Value
Fill
Render as filled.
public bool Fill { get; set; }
Property Value
ModelFileName
Model file name.
public string ModelFileName { get; set; }
Property Value
Position
Position (offset) in axis values.
public PointDoubleXYZ Position { get; set; }
Property Value
RenderingOrder
Sets MeshModel's rendering order in relation to other series.
public MeshModelRenderingOrder RenderingOrder { get; set; }
Property Value
Rotation
Rotating angles, in degrees
public PointDoubleXYZ Rotation { get; set; }
Property Value
ShadeMode
MeshModel shading mode.
public ShadeMode ShadeMode { get; set; }
Property Value
Size
Scaling factor.
public SizeDoubleXYZ Size { get; set; }
Property Value
TrackTriangle
Enable sending events of model face tracking.
public bool TrackTriangle { get; set; }
Property Value
Visible
Visible.
public bool Visible { get; set; }
Property Value
Wireframe
Render as wireframe.
public bool Wireframe { get; set; }
Property Value
WireframeLineColor
Wireframe color.
public Color WireframeLineColor { get; set; }
Property Value
XAxisBinding
X axis binding
public Axis3DBinding XAxisBinding { get; set; }
Property Value
YAxisBinding
Y axis binding
public Axis3DBinding YAxisBinding { get; set; }
Property Value
ZAxisBinding
Z axis binding
public Axis3DBinding ZAxisBinding { get; set; }
Property Value
Methods
Construct()
Construct object.
protected void Construct()
Create(PointFloat3D[], PointFloat3D[], PointFloat[], Image, TextureWrapMode, int[])
Create a mesh model from positions, normals, texture coordinates, bitmap and optional indices.
public MeshModel.CreateReturnCode Create(PointFloat3D[] positions, PointFloat3D[] normals, PointFloat[] textureCoordinates, Image bitmap, TextureWrapMode textureWrapMode, int[] indices = null)
Parameters
positionsPointFloat3D[]Vertex array.
normalsPointFloat3D[]Vertex normals array.
textureCoordinatesPointFloat[]Texture coordinate array.
bitmapImageBitmap.
textureWrapModeTextureWrapModeTexture wrapping mode.
indicesint[]Optional index array.
Returns
- MeshModel.CreateReturnCode
Success code.
Create(PointFloat3D[], PointFloat[], Image, TextureWrapMode, int[])
Create a mesh model from positions, texture coordinates, bitmap and optional indices.
public MeshModel.CreateReturnCode Create(PointFloat3D[] positions, PointFloat[] textureCoordinates, Image bitmap, TextureWrapMode textureWrapMode, int[] indices = null)
Parameters
positionsPointFloat3D[]Vertex array.
textureCoordinatesPointFloat[]Texture coordinate array.
bitmapImageBitmap.
textureWrapModeTextureWrapModeTexture wrapping mode.
indicesint[]Optional index array.
Returns
- MeshModel.CreateReturnCode
Success code.
Create(PointFloat3D[], int[])
Create a mesh model from positions and optionally colors.
public MeshModel.CreateReturnCode Create(PointFloat3D[] positions, int[] colors = null)
Parameters
positionsPointFloat3D[]Vertex array.
colorsint[]Color array, optional.
Returns
- MeshModel.CreateReturnCode
Success code.
Create(PointFloat3D[], int[], PointFloat3D[], int[])
Create a mesh model from positions, colors, normals and optional indices.
public MeshModel.CreateReturnCode Create(PointFloat3D[] positions, int[] colors, PointFloat3D[] normals, int[] indices = null)
Parameters
positionsPointFloat3D[]Vertex array.
colorsint[]Color array.
normalsPointFloat3D[]Vertex normals array.
indicesint[]Optional index array.
Returns
- MeshModel.CreateReturnCode
Success code.
CreateFromTriangles(PointFloat3D[], Color[], PointFloat3D[])
Create a mesh model from positions and colors. Positions must be triplets of triangle points and each color in input is color of each triangle.
public MeshModel.CreateReturnCode CreateFromTriangles(PointFloat3D[] positions, Color[] colors, PointFloat3D[] normals = null)
Parameters
positionsPointFloat3D[]Triangle position array.
colorsColor[]Color per triangle (array of Color).
normalsPointFloat3D[]Optional normal array.
Returns
- MeshModel.CreateReturnCode
Success code.
CreateFromTriangles(PointFloat3D[], int[], PointFloat3D[])
Create a mesh model from positions and colors. Positions must be triplets of triangle points and each color in input is color of each triangle.
public MeshModel.CreateReturnCode CreateFromTriangles(PointFloat3D[] positions, int[] colors, PointFloat3D[] normals = null)
Parameters
positionsPointFloat3D[]Triangle position array.
colorsint[]Color per triangle (array of Int32).
normalsPointFloat3D[]Optional normal array.
Returns
- MeshModel.CreateReturnCode
Success code.
Dispose(bool)
Clean up any resources being used.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue if managed resources should be disposed, otherwise false.
IsPositionOver(int, int, bool)
Is position over item.
public override bool IsPositionOver(int x, int y, bool useDIP = false)
Parameters
Returns
- bool
True if position is over item, false otherwise
LoadFromFile(string)
Load from obj format file (.obj).
public void LoadFromFile(string fileName)
Parameters
fileNamestringFilename.
LoadFromResource(string)
Load from obj format resource.
public void LoadFromResource(string resourceName)
Parameters
resourceNamestringResource name.
LoadFromStream(Stream)
Load from obj file stream (.obj).
public void LoadFromStream(Stream objStream)
Parameters
objStreamStreamSource stream (obj file formatted).
ToString()
Convert class description to string
public override string ToString()
Returns
- string
String
UpdateFillBitmap(Image)
Update mesh bitmap, without reconstructing the geometry.
public void UpdateFillBitmap(Image bitmap)
Parameters
bitmapImageBitmap image.
Remarks
Applicable only for cases where the model was created by code, using MeshModel.Create() method, with bitmap supplied as argument.
UpdateFillColors(int[])
Update mesh colors. The color order must be identical with GeometryConstructed event vertex array.
public void UpdateFillColors(int[] colors)
Parameters
colorsint[]Array of colors.
UpdateWireframeColors(int[])
Update mesh wireframe colors. The color order must be identical with GeometryConstructed event vertex array.
public void UpdateWireframeColors(int[] colors)
Parameters
colorsint[]Array of colors.
Events
GeometryConstructed
Geometry has been constructed.
public event MeshModel.GeometryConstructedEventHandler GeometryConstructed
Event Type
TriangleTraced
User has traced a triangle of mesh with user interactive device.
public event MeshModel.TriangleTracedEventHandler TriangleTraced