Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart3D 3D Charting Tools for .Net (VB and C#)
 AddDataPoint bug
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sam

Australia
9 Posts

Posted - 15 Aug 2014 :  03:05:29  Show Profile  Reply with Quote
SimpleDataset3D doesn't seem to get new Z information from a call to AddDataPoint - and so the new point will have a Z of zero.
In the example code of LinePlot3D for SimpleLinePlots, if the following lines are inserted:

Dataset2.AddDataPoint(new Point3D(10, 10, 10));
Dataset3.AddDataPoint(new Point3D(10, 10, 10));

After the initial creation of these datasets - it will only add the x and y information to the datasets and not the Z.

quinncurtis

1531 Posts

Posted - 15 Aug 2014 :  07:33:00  Show Profile  Reply with Quote
The AddDataPoint method is not in the SimpleDataset3D class, rather it is in in the underlying SimpleDataset class, where it is assumed that the underlying z-value is the value of ImplicitZValue property. However, there should be an AddDataPoint method in the SimpleDataset3D class. It is simple enough to write external to the class though.

        int AddDataPoint(SimpleDataset3D ds, Point3D p)
        {
            int n = ds.XData.Add(p.X);
            ds.YData.Add(p.Y);
            ds.ZData.Add(p.Z);
            return n;
        }
Go to Top of Page

Sam

Australia
9 Posts

Posted - 17 Aug 2014 :  23:09:40  Show Profile  Reply with Quote
That wasn't quite working - I had to do rather:

Dataset2.AddDataPoint(10, 10);
Dataset2.ZData.Add(10);
Dataset3.AddDataPoint(10, 10);
Dataset3.ZData.Add(10);

Something to do with establishing how many datapoints there are, I suppose.
Go to Top of Page

quinncurtis

1531 Posts

Posted - 19 Aug 2014 :  09:40:36  Show Profile  Reply with Quote
You are correct. The corrected version of our routine should look like:

int AddDataPoint(SimpleDataset3D ds, Point3D p)
{
int n= ds.AddDataPoint(p);
ds.ZData.Add(p.Z);
return n;
}
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07