SurfaceMeshSeries3D don't support "InsertRowBackAndScroll"?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
bongsama
Posts: 2
Joined: Fri Aug 01, 2014 8:44 am

SurfaceMeshSeries3D don't support "InsertRowBackAndScroll"?

Post by bongsama » Fri Aug 01, 2014 8:55 am

SurfaceGridSeries3D Class is support function named "InsertRowBackAndScroll".

As you know, this function(InsertRowBackAndScroll) is optimized to real time data rendering.

So, I have to know how to use this function in SurfaceMeshSeries3D Class..(Not SurfaceGridSeries3D)

I find a function named "InsertRowBack" instead of "InsertRowBackAndScroll" but, I don't know hot to use it.

Please help me how to use this function(InsertRowBack & InsertRowBackAndScroll is support in SurfaceMeshSeries3D Class?)

I'll waiting for your reply.

Thanks

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: SurfaceMeshSeries3D don't support "InsertRowBackAndScrol

Post by ArctionPasi » Mon Aug 04, 2014 10:07 pm

No wonder you are wondering especially how to use InsertRowBack. There's problem in that method. It truncated the data to be copied, if SizeZ < SizeX. It's been fixed now and waiting for next maintenance release. My apologies for that.

For SurfaceMeshSeries3D, you might as well use data shifting in a loop. InsertColumnBack and InsertRowBack shifts the data one column earlier or one row earlier, and inserts one column back or one row in the back.

Consider you have a surface mesh of size 100x40.

Code: Select all


int m_iRow = 0;
int RowLength = 100; 

//Initialize chart
chart.BeginUpdate();

            chart.ActiveView = Arction.WPF.LightningChartUltimate.ActiveView.View3D;

            SurfaceMeshSeries3D mesh = new SurfaceMeshSeries3D(chart.View3D, Arction.WPF.LightningChartUltimate.Axis3DBinding.Primary, Arction.WPF.LightningChartUltimate.Axis3DBinding.Primary, Arction.WPF.LightningChartUltimate.Axis3DBinding.Primary); 
            chart.View3D.SurfaceMeshSeries3D.Add(mesh);

            int iRowCount = 40;
            int iColumnCount = RowLength;

            SurfacePoint[,] points = new SurfacePoint[iColumnCount, iRowCount];
            Random rand = new Random(); 

            for (int iCol = 0; iCol < iColumnCount; iCol++)
            {
                for (int iRow = 0; iRow < iRowCount; iRow++)
                {
                    points[iCol, iRow].X = iCol;
                    points[iCol, iRow].Z = iRow;
                    points[iCol, iRow].Y = 10; // rand.NextDouble() * 100.0; 

                    
                }
            }

            m_iRow = iRowCount; 

            mesh.Data = points;

            chart.MouseDoubleClick += new MouseButtonEventHandler(chart_MouseDoubleClick);

            chart.EndUpdate(); 

Code: Select all

void chart_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {

            chart.BeginUpdate();

            //Add one row of data in the back 

            SurfacePoint[] newRowData = new SurfacePoint[RowLength]; 
            for(int iCol = 0; iCol < RowLength; iCol++)
            {
                newRowData[iCol].X = iCol; 
                newRowData[iCol].Z = m_iRow; 
                newRowData[iCol].Y = 50; 
            }

            m_iRow++; 

            int iRowCount = chart.View3D.SurfaceMeshSeries3D[0].SizeZ;
            SurfacePoint[,] data = chart.View3D.SurfaceMeshSeries3D[0].Data; 
            //Move old data 
            for (int iRow = 0; iRow < iRowCount - 1; iRow++)
            {
                for (int iCol = 0; iCol < RowLength; iCol++)
                {
                    data[iCol, iRow] = data[iCol, iRow + 1];
                }
            }

            //Copy new data in the back 
            for (int iCol = 0; iCol < RowLength; iCol++)
            {
                data[iCol, iRowCount - 1] = newRowData[iCol];
            }
            chart.View3D.SurfaceMeshSeries3D[0].InvalidateData(); 

            chart.EndUpdate(); 
        }
Surface mesh at the start
Surface mesh at the start
surface_start.jpg (182.47 KiB) Viewed 7787 times
After a couple of double-clicks it looks like:
Surface first rows overwritten with latter ones
Surface first rows overwritten with latter ones
surface_end.jpg (176.67 KiB) Viewed 7787 times
LightningChart Support Team, PT

bongsama
Posts: 2
Joined: Fri Aug 01, 2014 8:44 am

Re: SurfaceMeshSeries3D don't support "InsertRowBackAndScrol

Post by bongsama » Wed Aug 06, 2014 12:17 am

um..

What's this meaning that ..

int iRowCount = chart.View3D.SurfaceMeshSeries3D[0].SizeZ;
SurfacePoint[,] data = chart.View3D.SurfaceMeshSeries3D[0].Data;

array index?

SurfaceMeshSeries3D is not array..

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: SurfaceMeshSeries3D don't support "InsertRowBackAndScrol

Post by ArctionPasi » Wed Aug 06, 2014 6:22 am

View3D.SurfaceMeshSeries3D is collection, a list.

After creating a SurfaceMeshSeries3D (mesh) object and adding it into the collection by chart.View3D.SurfaceMeshSeries3D.Add(mesh), it becomes the first item in the View3D.SurfaceMeshSeries3D collection. So [0] is a list index, to access the first mesh series.
LightningChart Support Team, PT

Post Reply