Table of Contents

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

owner View3D

Parent.

MeshModel(View3D, Axis3DBinding, Axis3DBinding, Axis3DBinding)

Constructor.

public MeshModel(View3D owner, Axis3DBinding xAxis, Axis3DBinding yAxis, Axis3DBinding zAxis)

Parameters

owner View3D

Parent.

xAxis Axis3DBinding

X-axis binding.

yAxis Axis3DBinding

Y-axis binding.

zAxis Axis3DBinding

Z-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

Cull

CursorTrackEnabled

Cursor tracking enabled.

public bool CursorTrackEnabled { get; set; }

Property Value

bool

Fill

Render as filled.

public bool Fill { get; set; }

Property Value

bool

ModelFileName

Model file name.

public string ModelFileName { get; set; }

Property Value

string

Position

Position (offset) in axis values.

public PointDoubleXYZ Position { get; set; }

Property Value

PointDoubleXYZ

RenderingOrder

Sets MeshModel's rendering order in relation to other series.

public MeshModelRenderingOrder RenderingOrder { get; set; }

Property Value

MeshModelRenderingOrder

Rotation

Rotating angles, in degrees

public PointDoubleXYZ Rotation { get; set; }

Property Value

PointDoubleXYZ

ShadeMode

MeshModel shading mode.

public ShadeMode ShadeMode { get; set; }

Property Value

ShadeMode

Size

Scaling factor.

public SizeDoubleXYZ Size { get; set; }

Property Value

SizeDoubleXYZ

TrackTriangle

Enable sending events of model face tracking.

public bool TrackTriangle { get; set; }

Property Value

bool

Visible

Visible.

public bool Visible { get; set; }

Property Value

bool

Wireframe

Render as wireframe.

public bool Wireframe { get; set; }

Property Value

bool

WireframeLineColor

Wireframe color.

public Color WireframeLineColor { get; set; }

Property Value

Color

XAxisBinding

X axis binding

public Axis3DBinding XAxisBinding { get; set; }

Property Value

Axis3DBinding

YAxisBinding

Y axis binding

public Axis3DBinding YAxisBinding { get; set; }

Property Value

Axis3DBinding

ZAxisBinding

Z axis binding

public Axis3DBinding ZAxisBinding { get; set; }

Property Value

Axis3DBinding

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

positions PointFloat3D[]

Vertex array.

normals PointFloat3D[]

Vertex normals array.

textureCoordinates PointFloat[]

Texture coordinate array.

bitmap Image

Bitmap.

textureWrapMode TextureWrapMode

Texture wrapping mode.

indices int[]

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

positions PointFloat3D[]

Vertex array.

textureCoordinates PointFloat[]

Texture coordinate array.

bitmap Image

Bitmap.

textureWrapMode TextureWrapMode

Texture wrapping mode.

indices int[]

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

positions PointFloat3D[]

Vertex array.

colors int[]

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

positions PointFloat3D[]

Vertex array.

colors int[]

Color array.

normals PointFloat3D[]

Vertex normals array.

indices int[]

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

positions PointFloat3D[]

Triangle position array.

colors Color[]

Color per triangle (array of Color).

normals PointFloat3D[]

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

positions PointFloat3D[]

Triangle position array.

colors int[]

Color per triangle (array of Int32).

normals PointFloat3D[]

Optional normal array.

Returns

MeshModel.CreateReturnCode

Success code.

Dispose(bool)

Clean up any resources being used.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true 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

x int

x-coordinate

y int

y-coordinate

useDIP bool

Use DIP instead of pixels as 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

fileName string

Filename.

LoadFromResource(string)

Load from obj format resource.

public void LoadFromResource(string resourceName)

Parameters

resourceName string

Resource name.

LoadFromStream(Stream)

Load from obj file stream (.obj).

public void LoadFromStream(Stream objStream)

Parameters

objStream Stream

Source 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

bitmap Image

Bitmap 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

colors int[]

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

colors int[]

Array of colors.

Events

GeometryConstructed

Geometry has been constructed.

public event MeshModel.GeometryConstructedEventHandler GeometryConstructed

Event Type

MeshModel.GeometryConstructedEventHandler

TriangleTraced

User has traced a triangle of mesh with user interactive device.

public event MeshModel.TriangleTracedEventHandler TriangleTraced

Event Type

MeshModel.TriangleTracedEventHandler