private void PlotParametric3DFunction(IChartAdapter3D adapter, Parametric3DParameters functionParameters) { Parameter3DFunctionPlotter plotter = new Parameter3DFunctionPlotter((Parameter3DFunction)functionParameters.Function); Point3D[] result = null; result = plotter.Plot(functionParameters.Min, functionParameters.Max, functionParameters.NumPoints); adapter.PlotPoints(result); }
private void PlotParametricSurface(IChartAdapter3D adapter, ParametricSurfaceParameters functionParameters) { ParametricSurfacePlotter plotter = new ParametricSurfacePlotter((ParametricSurface)functionParameters.Function); Point3D[] result = null; result = plotter.Plot(functionParameters.MinU, functionParameters.MaxU, functionParameters.MinV, functionParameters.MaxV, functionParameters.NumPoints); adapter.PlotPoints(result); }
private void PlotExplicit3DFunction(IChartAdapter3D adapter, Explicit3DParameters functionParameters) { Explicit3DFunctionPlotter plotter = new Explicit3DFunctionPlotter((Explicit3DFunction)functionParameters.Function); double[,] result = null; result = plotter.Plot(functionParameters.PointA, functionParameters.PointB, functionParameters.AreaSize); adapter.PlotSurface(functionParameters.PointA, functionParameters.PointB, result); }
private void PlotImplicit3DFunction(IChartAdapter3D adapter, Implicit3DParameters functionParameters) { Implicit3DFunctionPlotter plotter = new Implicit3DFunctionPlotter((Implicit3DFunction)functionParameters.Function); plotter.GridFactor = functionParameters.GridFactor; Point3D[] result = null; result = plotter.Plot(functionParameters.Point3DA, functionParameters.Point3DB, functionParameters.PixelSizeX, functionParameters.PixelSizeY, functionParameters.PixelSizeZ); adapter.PlotPoints(result); }
/// <summary> /// Plot with new source and new destination chart /// </summary> /// <example> /// <code lang="CS" description="The following example plot given function on given chart"> /// NugenCCalcComponent3D nugenCCalcComponent1 = new NugenCCalcComponent3D(); /// nugenCCalcComponent1.Plot(c1Chart3D, new Explicit3DParameters("x*x+y")); /// </code> /// </example> public void Plot(object chartControl, Function3DParameters functionParameters) { if (DesignMode) { return; } OnBeforePlot(); if (chartControl == null) { throw new ArgumentNullException("Chart control is null"); } if (functionParameters == null) { throw new ArgumentNullException("functionParameters"); } if (functionParameters.Code == "") { throw new ArgumentNullException("Source Code"); } IChartAdapter3D adapter = null; if (chartControl != _chartControl) { adapter = (IChartAdapter3D)GetChartAdapter(chartControl); adapter.SetChartControl(chartControl); } else { adapter = (IChartAdapter3D)_currentAdapter; } if (adapter == null) { throw new Exception("Chart not supported"); } Function function = functionParameters.Function; if (function is Explicit3DFunction) { PlotExplicit3DFunction(adapter, (Explicit3DParameters)functionParameters); } if (function is Implicit3DFunction) { PlotImplicit3DFunction(adapter, (Implicit3DParameters)functionParameters); } if (function is Parameter3DFunction) { PlotParametric3DFunction(adapter, (Parametric3DParameters)functionParameters); } if (function is ParametricSurface) { PlotParametricSurface(adapter, (ParametricSurfaceParameters)functionParameters); } OnAfterPlot(); }
private void PlotImplicit3DFunction(IChartAdapter3D adapter, Implicit3DParameters functionParameters) { Implicit3DFunctionPlotter plotter = new Implicit3DFunctionPlotter((Implicit3DFunction)functionParameters.Function); plotter.GridFactor = functionParameters.GridFactor; Point3D[] result = null; result = plotter.Plot(functionParameters.Point3DA, functionParameters.Point3DB, functionParameters.PixelSizeX,functionParameters.PixelSizeY, functionParameters.PixelSizeZ); adapter.PlotPoints(result); }
private void PlotExplicit3DFunction(IChartAdapter3D adapter, Explicit3DParameters functionParameters) { Explicit3DFunctionPlotter plotter = new Explicit3DFunctionPlotter((Explicit3DFunction)functionParameters.Function); double[,] result = null; result = plotter.Plot(functionParameters.PointA, functionParameters.PointB, functionParameters.AreaSize); adapter.PlotSurface(functionParameters.PointA, functionParameters.PointB,result); }