Class SurfaceSeries3DBase
- Namespace
- LightningChartLib.WinForms.Charting.Series3D
- Assembly
- LightningChart.WinForms.Charting.NET4.dll
Surface series base.
public class SurfaceSeries3DBase : SeriesBase3D, IChartNode, IDisposable, IHighlightingItem
- Inheritance
-
SurfaceSeries3DBase
- Implements
- Derived
- Inherited Members
Constructors
SurfaceSeries3DBase()
public SurfaceSeries3DBase()
SurfaceSeries3DBase(View3D, Axis3DBinding, Axis3DBinding, Axis3DBinding)
Constructor
public SurfaceSeries3DBase(View3D owner, Axis3DBinding xAxis, Axis3DBinding yAxis, Axis3DBinding zAxis)
Parameters
ownerView3DParent.
xAxisAxis3DBindingX-axis you want to bind.
yAxisAxis3DBindingY-axis you want to bind. You can give null if X axis binding is used.
zAxisAxis3DBindingZ-axis you want to bind.
Properties
AllowCellTrace
Allow tracing of the surface cell when user interactive device is over.
public bool AllowCellTrace { get; set; }
Property Value
BaseColor
Base color for filling.
public Color BaseColor { get; set; }
Property Value
ColorSaturation
Surface fill color saturation. High value gives brighter colors.
public double ColorSaturation { get; set; }
Property Value
ContourLineColor
Contour line color.
public Color ContourLineColor { get; set; }
Property Value
ContourPalette
Color palette for Y value information.
public ValueRangePalette ContourPalette { get; set; }
Property Value
Data
Series 3D point data.
public SurfacePoint[,] Data { get; set; }
Property Value
- SurfacePoint[,]
DisableDepthTest
Disable depth buffer test. Disabling this improves performance, but may cause erroneous painting order of objects.
public bool DisableDepthTest { get; set; }
Property Value
FadeAway
Fade away surface/waterfall towards back (higher data row numbers), with given percent. Valid range is from 0(no fadeaway) to 100 (full fadeaway).
public double FadeAway { get; set; }
Property Value
FastContourZoneHeight
Height (Y-axis value range) for fast contour zones. The fast contour zone is a contour line equivalent.
public double FastContourZoneHeight { get; set; }
Property Value
InitialValue
Initial value for data Y. Clears the series. It is applied when creating or resizing Data array.
public double InitialValue { get; set; }
Property Value
RenderingOrder
Drawing order related to PointLineSeries.
public SurfaceRenderingOrder RenderingOrder { get; set; }
Property Value
SizeX
Grid size in X dimension (Data array columns).
public int SizeX { get; set; }
Property Value
SizeZ
Grid size in Z dimension (Data array rows).
public int SizeZ { get; set; }
Property Value
SuppressLighting
Suppress all light calculations on this surface series.
public bool SuppressLighting { get; set; }
Property Value
Title
Series title
public SeriesTitle3D Title { get; set; }
Property Value
ToneColor
Solid fill tone color
public Color ToneColor { get; set; }
Property Value
WireframeLineStyle
Wireframe line style.
public LineStyle3D WireframeLineStyle { get; set; }
Property Value
WireframeOffset
Wireframe shift amount from fill. Keep some amount of shift, to avoid 3D render engine Z buffer fighting.
public PointDoubleXYZ WireframeOffset { get; set; }
Property Value
Methods
CheckSurfaceSizeForGPU(int, int)
Check if the given surface size can be used with the GPU. GPU index buffer capacity is verified.
public bool CheckSurfaceSizeForGPU(int gridSizeX, int gridSizeZ)
Parameters
Returns
- bool
True if index buffer size on the GPU is sufficient, else false.
Clear()
Clears the series by setting Data Y values to InitialValues. Sets the data point colors to BaseColor.
public override void Clear()
CreateMaterial()
Create material.
protected override void CreateMaterial()
CreateNewDataArray(int, int)
Create new data array.
public virtual void CreateNewDataArray(int sizeX, int sizeZ)
Parameters
CreatePalette()
Create palette.
protected virtual void CreatePalette()
CreateTitle()
Create title.
protected virtual void CreateTitle()
CreateWireframeOffset()
Create wireframe offset.
protected virtual void CreateWireframeOffset()
Dispose(bool)
Clean up any resources being used.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue if managed resources should be disposed, otherwise false.
DisposeStaticBuffers(bool, bool, bool)
Free all vertex and index buffer data
protected void DisposeStaticBuffers(bool disposeVertexBuffers, bool disposeIndexBuffers, bool disposeSurfaceCache)
Parameters
disposeVertexBuffersboolparam disposeVertexBuffers M:LightningChartLib.WinForms.Charting.Series3D.SurfaceSeries3DBase.DisposeStaticBuffers(System.Boolean,System.Boolean,System.Boolean) disposeIndexBuffersboolparam disposeIndexBuffers M:LightningChartLib.WinForms.Charting.Series3D.SurfaceSeries3DBase.DisposeStaticBuffers(System.Boolean,System.Boolean,System.Boolean) disposeSurfaceCacheboolparam disposeSurfaceCache M:LightningChartLib.WinForms.Charting.Series3D.SurfaceSeries3DBase.DisposeStaticBuffers(System.Boolean,System.Boolean,System.Boolean)
GetDataColor(int, int)
Get color from Data array value.
public Color GetDataColor(int columnIndex, int rowIndex)
Parameters
Returns
- Color
Color. If invalid index is given, returns Color.Black.
GetDataColor(int, int, out Color)
Get color from Data array value.
public bool GetDataColor(int columnIndex, int rowIndex, out Color color)
Parameters
columnIndexintColumn index of Data array.
rowIndexintRow index of Data array.
colorColorColor.
Returns
- bool
True, if indexes at valid range, otherwise false and outputs Color.Black.
GetDataValue(int, int)
Get value from Data array value.
public double GetDataValue(int columnIndex, int rowIndex)
Parameters
Returns
- double
Z value. If invalid index is given, returns 0.
GetDataValue(int, int, out double)
Get value from Data array value.
public bool GetDataValue(int columnIndex, int rowIndex, out double value)
Parameters
columnIndexintColumn index of Data array.
rowIndexintRow index of Data array.
valuedoubleData value at position. Zero, in case of failure.
Returns
- bool
True, if indexes at valid range, otherwise false.
GetDataXValue(int, int)
Get Data array X value.
public double GetDataXValue(int columnIndex, int rowIndex)
Parameters
Returns
- double
X value. If invalid index is given, returns 0.
GetDataXValue(int, int, out double)
Get Data array X value.
public bool GetDataXValue(int columnIndex, int rowIndex, out double value)
Parameters
columnIndexintColumn index of Data array.
rowIndexintRow index of Data array.
valuedoubleX-value at position. Zero, in case of failure.
Returns
- bool
True, if indexes at valid range, otherwise false.
GetDataYValue(int, int)
Get Data array Y value.
public double GetDataYValue(int columnIndex, int rowIndex)
Parameters
Returns
- double
Y value. If invalid index is given, returns 0.
GetDataYValue(int, int, out double)
Get Data array Y value.
public bool GetDataYValue(int columnIndex, int rowIndex, out double value)
Parameters
columnIndexintColumn index of Data array.
rowIndexintRow index of Data array.
valuedoubleY-value at position. Zero, in case of failure.
Returns
- bool
True, if indexes at valid range, otherwise false.
GetDataZValue(int, int)
Get Data array Z value.
public double GetDataZValue(int columnIndex, int rowIndex)
Parameters
Returns
- double
Z value. If invalid index is given, returns 0.
GetDataZValue(int, int, out double)
Get Data array Z value.
public bool GetDataZValue(int columnIndex, int rowIndex, out double value)
Parameters
columnIndexintColumn index of Data array.
rowIndexintRow index of Data array.
valuedoubleZ-value at position. Zero, in case of failure.
Returns
- bool
True, if indexes at valid range, otherwise false.
HandleOver()
General handler for mouse over event. Check also mouse hit columns.
protected override void HandleOver()
IsPositionOver(int, int, out int, out int, bool)
Detect if position is over the series. Also solves the column and row index where position is over of.
public bool IsPositionOver(int x, int y, out int hitColumnIndex, out int hitRowIndex, bool useDIP = false)
Parameters
xintScreen X coordinate
yintScreen Y coordinate
hitColumnIndexintColumn index. If failed, contains -1
hitRowIndexintRow index. If failed, contains -1
useDIPboolUse DIPs instead of pixels
Returns
- bool
True if position is over the series
LoadFromCSV(string, SeparatorCSV)
Loads series data from a CSV file.
public override bool LoadFromCSV(string file, SeparatorCSV separator)
Parameters
filestringCSV file. If file does not exist, LoadFromCSV returns false.
separatorSeparatorCSVValue and floating point number separator.
Returns
- bool
True if import succeeds. Otherwise false.
OnDeserialized(StreamingContext)
OnDeserialized is called just after the object has been deserialized
[OnDeserialized]
protected void OnDeserialized(StreamingContext context)
Parameters
contextStreamingContextContext
RefreshRenderingData()
Rebuilds rendering data. Expert's method for allowing multi-threaded application to pre-build rendering data before rendering stage. Rendering stage must always be synchronized to main thread, but this call can be called parallel for every series of this type.
public void RefreshRenderingData()
SaveToCSV(string, SeparatorCSV)
Saves series data into CSV file.
public override bool SaveToCSV(string file, SeparatorCSV separator)
Parameters
filestringTarget file. If file already exists, it will be overwritten.
separatorSeparatorCSVValue and floating point number separator definition.
Returns
- bool
True if export is successful.
SetDataValue(int, int, double, double, double, double, Color)
Set data values from X, Y, Z and color.
public bool SetDataValue(int columnIndex, int rowIndex, double x, double y, double z, double value, Color color)
Parameters
columnIndexintColumn index of Data array.
rowIndexintRow index of Data array.
xdoubleX value.
ydoubleY value.
zdoubleZ value.
valuedoubleValue.
colorColorColor. Effects only if Fill is set to SourcePointColoring.
Returns
- bool
False if invalid index. Otherwise true.
Remarks
Does not invalidate data. Use Invalidate() method after setting all Data array items.
SetHeightDataFromBitmap(double, double, double, double, double, double, Bitmap, BitmapAntialiasOptions, bool)
Create data based on bitmap file contents. Data array will have dimensions of the bitmap Width X Height. Use options to reduce resolution and smooth it if needed. Height data of is calculated for each pixel from R, G, and B sum. 0 (black) will have the minimum value, and maximum value is obtained from 3*255 (white). If bitmap has alpha value of 0, the data is set to -INF, and the value is not drawn.
public bool SetHeightDataFromBitmap(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax, Bitmap bitmap, BitmapAntialiasOptions options, bool setNegativeInfinityForAlpha0)
Parameters
xMindoubleMinimum X.
xMaxdoubleMaximum X.
yMindoubleMinimum Y.
yMaxdoubleMaximum Y.
zMindoubleMinimum Z.
zMaxdoubleMaximum Z.
bitmapBitmapInput bitmap.
optionsBitmapAntialiasOptionsBitmap resolution decrement and smoothing options. Give null to use pure bitmap data only.
setNegativeInfinityForAlpha0boolSets NegativeInfinity when bitmap pixel has alpha = 0.
Returns
- bool
True if data was successfully filled, else false.
SetSize(int, int)
Set grid size, both X and Z at same time. If you already have a large existing data, using this method is faster than setting SizeX and SizeZ separately.
public void SetSize(int sizeX, int sizeZ)
Parameters
SolveNearestDataPointByCoord(int, int, out SurfacePoint, out int, out int)
Solve nearest data point to given screen coordinate [input in DIP]. Takes the data point distance from camera into account. Only solves the point when coordinate is over the surface.
public bool SolveNearestDataPointByCoord(int xCoordinate, int yCoordinate, out SurfacePoint nearestPoint, out int columnIndex, out int rowIndex)
Parameters
xCoordinateintX screen coordinate as DIP
yCoordinateintY screen coordinate as DIP
nearestPointSurfacePointNearest point solved
columnIndexintColumn index in Data array
rowIndexintRow index in Data array
Returns
- bool
True if solved, else false.
ToString()
Item to string.
public override string ToString()
Returns
- string
returns M:LightningChartLib.WinForms.Charting.Series3D.SurfaceSeries3DBase.ToString
Events
TraceCellChanged
Occurs when the user interactive device has been moved over to a different surface series cell.
public virtual event SurfaceSeries3DBase.TraceCellChangedEventHandler TraceCellChanged