├── .gitignore ├── LICENSE ├── README.md ├── lib ├── OpenTK.Compatibility.dll ├── OpenTK.GLControl.dll └── OpenTK.dll ├── nzy3d-api.sln ├── nzy3d-api ├── Chart │ ├── Chart.cs │ ├── ChartScene.cs │ ├── ChartView.cs │ └── Controllers │ │ ├── AbstractController.cs │ │ ├── Camera │ │ └── AbstractCameraController.cs │ │ ├── ControllerType.cs │ │ ├── Mouse │ │ └── Camera │ │ │ └── CameraMouseController.cs │ │ └── Thread │ │ └── Camera │ │ └── CameraThreadController.cs ├── Colors │ ├── Color.cs │ ├── ColorMapper.cs │ ├── ColorsMaps │ │ ├── ColorMapGrayscale.cs │ │ ├── ColorMapHotCold.cs │ │ ├── ColorMapRBG.cs │ │ ├── ColorMapRainbow.cs │ │ ├── ColorMapRedAndGreen.cs │ │ ├── ColorMapWhiteBlue.cs │ │ ├── ColorMapWhiteGreen.cs │ │ ├── ColorMapWhiteRed.cs │ │ └── IColorMap.cs │ ├── IColorMappable.cs │ ├── IMultiColorable.cs │ └── ISingleColorable.cs ├── Events │ ├── ControllerEventArgs.cs │ ├── DrawableChangedEventArgs.cs │ ├── IControllerEventListener.cs │ ├── IDrawableListener.cs │ ├── IScaleChangedListener.cs │ ├── IViewIsVerticalEventListener.cs │ ├── IViewModeChangedListener.cs │ ├── IViewPointChangedListener.cs │ ├── Keyboard │ │ └── IKeyListener.cs │ ├── Mouse │ │ ├── IMouseListener.cs │ │ ├── IMouseMotionListener.cs │ │ ├── IMouseWheelListener.cs │ │ ├── MouseButton.cs │ │ ├── MouseEventArgs.cs │ │ └── MouseWheelEventArgs.cs │ ├── ObjectEventArgs.cs │ ├── ScaleChangedEventArgs.cs │ ├── ViewIsVerticalEventArgs.cs │ ├── ViewModeChangedEventArgs.cs │ └── ViewPointChangedEventArgs.cs ├── Factories │ ├── AxeFactory.cs │ ├── CameraFactory.cs │ ├── NzyFactories.cs │ ├── OrderingStrategyFactory.cs │ ├── Renderer3dFactory.cs │ ├── SceneFactory.cs │ └── ViewFactory.cs ├── Glut │ ├── BitmapCharRec.cs │ ├── BitmapFontRec.cs │ ├── CoordRec.cs │ ├── GLUTBitmap8x13.cs │ ├── GLUTBitmap9x15.cs │ ├── GLUTBitmapHelvetica10.cs │ ├── GLUTBitmapHelvetica12.cs │ ├── GLUTBitmapHelvetica18.cs │ ├── GLUTBitmapTimesRoman10.cs │ ├── GLUTBitmapTimesRoman24.cs │ ├── GLUTStrokeMonoRoman.cs │ ├── GLUTStrokeRoman.cs │ ├── Glut.cs │ ├── StrokeCharRec.cs │ ├── StrokeFontRec.cs │ └── StrokeRec.cs ├── Maths │ ├── Algorithms │ │ ├── Interpolation │ │ │ ├── Bernstein │ │ │ │ ├── BernsteinInterpolator.cs │ │ │ │ ├── BernsteinPolynomial.cs │ │ │ │ └── Spline3D.cs │ │ │ └── IInterpolator.cs │ │ ├── OutlierRemover.cs │ │ └── ScaleFinder.cs │ ├── Angle2d.cs │ ├── Angle3d.cs │ ├── Array.cs │ ├── BoundingBox2d.cs │ ├── BoundingBox3d.cs │ ├── Coord2d.cs │ ├── Coord3d.cs │ ├── Coordinates.cs │ ├── Graphs │ │ ├── DefaultGraph.cs │ │ ├── IGraph.cs │ │ └── StringGraphGenerator.cs │ ├── Grid.cs │ ├── IntegerCoord2d.cs │ ├── Mapper.cs │ ├── Normal.cs │ ├── Pair.cs │ ├── PlaneAxis.cs │ ├── PolygonArray.cs │ ├── Range.cs │ ├── Scale.cs │ ├── Statistics.cs │ ├── TicToc.cs │ ├── Utils.cs │ ├── Vector2d.cs │ └── Vector3d.cs ├── Plot2D │ └── Primitives │ │ └── ColorbarImageGenerator.cs ├── Plot3D │ ├── Builder │ │ ├── Builder.cs │ │ ├── Concrete │ │ │ ├── BufferedImageMapper.cs │ │ │ ├── CustomGrid.cs │ │ │ ├── OrthonormalGrid.cs │ │ │ ├── OrthonormalTessellator.cs │ │ │ ├── RingExtrapolator.cs │ │ │ ├── RingGrid.cs │ │ │ ├── RingTessellator.cs │ │ │ └── SphereScatterGenerator.cs │ │ ├── Delaunay │ │ │ ├── DelaunayCoordinateValidator.cs │ │ │ ├── DelaunayTessellator.cs │ │ │ ├── DelaunayTriangulationManager.cs │ │ │ ├── ICoordinateValidator.cs │ │ │ ├── ITriangulation.cs │ │ │ ├── Jdt │ │ │ │ ├── BoundingBox.cs │ │ │ │ ├── Circle_dt.cs │ │ │ │ ├── Delaunay_Triangulation.cs │ │ │ │ ├── GridIndex.cs │ │ │ │ ├── Point_dt.cs │ │ │ │ └── Triangle_dt.cs │ │ │ └── OrthonormalCoordinateValidator.cs │ │ ├── Grid.cs │ │ ├── IObjectTopology.cs │ │ ├── Mapper.cs │ │ └── Tessellator.cs │ ├── Primitives │ │ ├── AbstractComposite.cs │ │ ├── AbstractDrawable.cs │ │ ├── AbstractWireframeable.cs │ │ ├── Axes │ │ │ ├── AxeBase.cs │ │ │ ├── AxeBox.cs │ │ │ ├── IAxe.cs │ │ │ └── Layout │ │ │ │ ├── AxeBoxLayout.cs │ │ │ │ ├── IAxeLayout.cs │ │ │ │ ├── Providers │ │ │ │ ├── AbstractTickProvider.cs │ │ │ │ ├── ITickProvider.cs │ │ │ │ ├── RegularTickProvider.cs │ │ │ │ ├── SmartTickProvider.cs │ │ │ │ └── StaticTickProvider.cs │ │ │ │ └── Renderers │ │ │ │ ├── DateTickRenderer.cs │ │ │ │ ├── DefaultDecimalTickRenderer.cs │ │ │ │ ├── FixedDecimalTickRenderer.cs │ │ │ │ ├── ITickRenderer.cs │ │ │ │ ├── IntegerTickRenderer.cs │ │ │ │ ├── ScientificNotationTickRenderer.cs │ │ │ │ └── TickLabelMap.cs │ │ ├── CompileableComposite.cs │ │ ├── Graphs │ │ │ └── Layout │ │ │ │ ├── DefaultGraphLayout2d.cs │ │ │ │ └── IGraphLayout2d.cs │ │ ├── IGLBindedResource.cs │ │ ├── IGLRenderer.cs │ │ ├── ISortableDraw.cs │ │ ├── Parallelepiped.cs │ │ ├── Point.cs │ │ ├── Polygon.cs │ │ ├── Scatter.cs │ │ ├── ScatterMultiColor.cs │ │ ├── Selectable │ │ │ └── ISelectable.cs │ │ └── Shape.cs │ ├── Rendering │ │ ├── Canvas │ │ │ ├── ICanvas.cs │ │ │ └── Quality.cs │ │ ├── Legends │ │ │ ├── Colorbars │ │ │ │ └── ColorbarLegend.cs │ │ │ └── Legend.cs │ │ ├── Lights │ │ │ ├── Light.cs │ │ │ ├── LightSet.cs │ │ │ └── LightSwitch.cs │ │ ├── Ordering │ │ │ ├── AbstractOrderingStrategy.cs │ │ │ ├── BarycentreOrderingStrategy.cs │ │ │ ├── DefaultOrderingStrategy.cs │ │ │ └── PointOrderingStrategy.cs │ │ ├── Scene │ │ │ ├── Decomposition.cs │ │ │ ├── Graph.cs │ │ │ └── Scene.cs │ │ └── View │ │ │ ├── AbstractViewport.cs │ │ │ ├── Camera.cs │ │ │ ├── IRenderer2D.cs │ │ │ ├── ImageRenderer.cs │ │ │ ├── ImageViewport.cs │ │ │ ├── Modes │ │ │ ├── CameraMode.cs │ │ │ ├── ViewBoundMode.cs │ │ │ └── ViewPositionMode.cs │ │ │ ├── Renderer3D.cs │ │ │ ├── View.cs │ │ │ └── ViewPort.cs │ ├── Text │ │ ├── AbstractTextRenderer.cs │ │ ├── Align │ │ │ ├── Halign.cs │ │ │ └── Valign.cs │ │ ├── ITextRenderer.cs │ │ └── Renderer │ │ │ ├── TextBillboardRenderer.cs │ │ │ └── TextBitmapRenderer.cs │ └── Transform │ │ ├── ITransformer.cs │ │ ├── Scale.cs │ │ └── Transform.cs ├── Properties │ └── AssemblyInfo.cs └── nzy3d-api.csproj ├── nzy3d-tests ├── App.config ├── Properties │ └── AssemblyInfo.cs ├── Triangle_DtSteps.cs ├── Triangle_dt.feature ├── Triangle_dt.feature.cs ├── nzy3d-tests.csproj └── packages.config ├── nzy3d-winformsDemo ├── App.config ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── MyMapper.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── nzy3d-winformsDemo.csproj └── nzy3d-wpfDemo ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.bak ├── MainWindow.xaml.cs ├── MyMapper.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings └── nzy3d-wpfDemo.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | obj 3 | bin 4 | packages 5 | .idea 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, benoit74 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of nzy3d-api nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | nzy3d-api 2 | ========= 3 | 4 | This is a main Git repository for Nzy3d, a .Net API for 3d charts. 5 | 6 | Much of this work is based on Jzy3d, a Java API from my friend [Martin](github.com/martin-pernollet). 7 | 8 | ##nzy3d-api 9 | This is the toolkit by itself. It is based on OpenTK for OpenGL integration in C#. 10 | 11 | ##nzy3d-tests 12 | This is where all unit/integration tests resides. Work In Progress, testers are welcome ! 13 | 14 | ##nzy3d-wpfDemo 15 | This is a demo of the use of the toolkit in a WPF application. I chose to made the demo in a WPF 16 | application because it is more complexe than in a Winforms where it is very straigthforward since 17 | the toolkit provides a Winforms control to use for rendering of 3D scene. 18 | In WPF, the integration is a bit more complex since we have to integrate this Winforms control inside a WPF 19 | canvas. There is no other solution so far since OpenTK does not provide a WPF control for drawing (at least 20 | it did not in 2012 ... and I don't even think it would made any sense). 21 | 22 | Video here: http://www.screencast.com/t/Oj2CjuFF 23 | 24 | -------------------------------------------------------------------------------- /lib/OpenTK.Compatibility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benoit74/nzy3d-api/edd2da057d722e5ace008e46a5c27e1086cfe88e/lib/OpenTK.Compatibility.dll -------------------------------------------------------------------------------- /lib/OpenTK.GLControl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benoit74/nzy3d-api/edd2da057d722e5ace008e46a5c27e1086cfe88e/lib/OpenTK.GLControl.dll -------------------------------------------------------------------------------- /lib/OpenTK.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benoit74/nzy3d-api/edd2da057d722e5ace008e46a5c27e1086cfe88e/lib/OpenTK.dll -------------------------------------------------------------------------------- /nzy3d-api.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nzy3d-api", "nzy3d-api\nzy3d-api.csproj", "{6E3BDDD2-540E-4B95-96CB-A9BF119E1241}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nzy3d-tests", "nzy3d-tests\nzy3d-tests.csproj", "{52151543-8724-4DA0-B207-3F0CF62B486A}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nzy3d-wpfDemo", "nzy3d-wpfDemo\nzy3d-wpfDemo.csproj", "{BE0A618C-AB04-4CCE-8831-8495A8A1E18E}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nzy3d-winformsDemo", "nzy3d-winformsDemo\nzy3d-winformsDemo.csproj", "{8C148A22-B1DE-44F2-AEA8-90853DCA6EFE}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {6E3BDDD2-540E-4B95-96CB-A9BF119E1241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {6E3BDDD2-540E-4B95-96CB-A9BF119E1241}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {6E3BDDD2-540E-4B95-96CB-A9BF119E1241}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {6E3BDDD2-540E-4B95-96CB-A9BF119E1241}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {52151543-8724-4DA0-B207-3F0CF62B486A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {52151543-8724-4DA0-B207-3F0CF62B486A}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {52151543-8724-4DA0-B207-3F0CF62B486A}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {52151543-8724-4DA0-B207-3F0CF62B486A}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {BE0A618C-AB04-4CCE-8831-8495A8A1E18E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {BE0A618C-AB04-4CCE-8831-8495A8A1E18E}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {BE0A618C-AB04-4CCE-8831-8495A8A1E18E}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {BE0A618C-AB04-4CCE-8831-8495A8A1E18E}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {8C148A22-B1DE-44F2-AEA8-90853DCA6EFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {8C148A22-B1DE-44F2-AEA8-90853DCA6EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {8C148A22-B1DE-44F2-AEA8-90853DCA6EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {8C148A22-B1DE-44F2-AEA8-90853DCA6EFE}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | EndGlobal 41 | -------------------------------------------------------------------------------- /nzy3d-api/Chart/ChartScene.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.Scene; 9 | using nzy3D.Plot3D.Rendering.View; 10 | using nzy3D.Maths; 11 | using nzy3D.Plot3D.Rendering.Canvas; 12 | 13 | namespace nzy3D.Chart 14 | { 15 | 16 | public class ChartScene : Scene 17 | { 18 | 19 | internal int _nview; 20 | 21 | internal View _view; 22 | public ChartScene(bool graphsort) : base(graphsort) 23 | { 24 | _nview = 0; 25 | } 26 | 27 | public void Clear() 28 | { 29 | _view.BoundManual = new BoundingBox3d(0, 0, 0, 0, 0, 0); 30 | } 31 | 32 | public override View newView(ICanvas canvas, Quality quality) 33 | { 34 | if (_nview > 0) { 35 | throw new Exception("A view has already been defined for this scene. Can not use several views."); 36 | } 37 | _nview += 1; 38 | _view = base.newView(canvas, quality); 39 | return _view; 40 | } 41 | 42 | public override void clearView(View view) 43 | { 44 | base.clearView(view); 45 | _nview = 0; 46 | } 47 | 48 | } 49 | 50 | } 51 | 52 | //======================================================= 53 | //Service provided by Telerik (www.telerik.com) 54 | //Conversion powered by NRefactory. 55 | //Twitter: @telerik 56 | //Facebook: facebook.com/telerik 57 | //======================================================= 58 | -------------------------------------------------------------------------------- /nzy3d-api/Chart/Controllers/AbstractController.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Chart; 9 | using nzy3D.Events; 10 | 11 | namespace nzy3D.Chart.Controllers 12 | { 13 | 14 | public class AbstractController 15 | { 16 | 17 | protected List _targets = new List(); 18 | 19 | protected List _controllerListeners = new List(); 20 | public AbstractController() 21 | { 22 | } 23 | 24 | public AbstractController(Chart chart) 25 | { 26 | Register(chart); 27 | } 28 | 29 | public virtual void Register(Chart chart) 30 | { 31 | _targets.Add(chart); 32 | } 33 | 34 | public void Unregister(Chart chart) 35 | { 36 | _targets.Remove(chart); 37 | } 38 | 39 | protected Chart Chart { 40 | get { return _targets[0]; } 41 | } 42 | 43 | public virtual void Dispose() 44 | { 45 | _targets.Clear(); 46 | _controllerListeners.Clear(); 47 | } 48 | 49 | public void addControllerEventListener(IControllerEventListener listener) 50 | { 51 | _controllerListeners.Add(listener); 52 | } 53 | 54 | public void removeControllerEventListener(IControllerEventListener listener) 55 | { 56 | _controllerListeners.Remove(listener); 57 | } 58 | 59 | protected void fireControllerEvent(ControllerType type, object value) 60 | { 61 | ControllerEventArgs e = new ControllerEventArgs(this, type, value); 62 | foreach (IControllerEventListener aListener in _controllerListeners) { 63 | aListener.ControllerEventFired(e); 64 | } 65 | } 66 | 67 | } 68 | 69 | } 70 | 71 | //======================================================= 72 | //Service provided by Telerik (www.telerik.com) 73 | //Conversion powered by NRefactory. 74 | //Twitter: @telerik 75 | //Facebook: facebook.com/telerik 76 | //======================================================= 77 | -------------------------------------------------------------------------------- /nzy3d-api/Chart/Controllers/Camera/AbstractCameraController.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Chart; 9 | using nzy3D.Events; 10 | using nzy3D.Maths; 11 | 12 | namespace nzy3D.Chart.Controllers.Camera 13 | { 14 | 15 | public class AbstractCameraController : AbstractController 16 | { 17 | 18 | 19 | public static bool DEFAULT_UPDATE_VIEW = false; 20 | public AbstractCameraController() : base() 21 | { 22 | } 23 | 24 | public AbstractCameraController(Chart chart) : base(chart) 25 | { 26 | } 27 | 28 | protected void Rotate(Coord2d move) 29 | { 30 | Rotate(move, DEFAULT_UPDATE_VIEW); 31 | } 32 | 33 | protected void Rotate(Coord2d move, bool updateView) 34 | { 35 | foreach (Chart c in _targets) { 36 | c.View.Rotate(move, DEFAULT_UPDATE_VIEW); 37 | } 38 | fireControllerEvent(ControllerType.ROTATE, move); 39 | } 40 | 41 | 42 | protected void Shift(float factor) 43 | { 44 | Shift(factor, DEFAULT_UPDATE_VIEW); 45 | } 46 | 47 | protected void Shift(float factor, bool updateView) 48 | { 49 | foreach (Chart c in _targets) { 50 | c.View.Shift(factor, updateView); 51 | } 52 | fireControllerEvent(ControllerType.SHIFT, factor); 53 | } 54 | 55 | protected void ZoomX(float factor) 56 | { 57 | ZoomX(factor, DEFAULT_UPDATE_VIEW); 58 | } 59 | 60 | protected void ZoomX(float factor, bool updateView) 61 | { 62 | foreach (Chart c in _targets) { 63 | c.View.ZoomX(factor, updateView); 64 | } 65 | fireControllerEvent(ControllerType.ZOOM, factor); 66 | } 67 | 68 | protected void ZoomY(float factor) 69 | { 70 | ZoomY(factor, DEFAULT_UPDATE_VIEW); 71 | } 72 | 73 | protected void ZoomY(float factor, bool updateView) 74 | { 75 | foreach (Chart c in _targets) { 76 | c.View.ZoomY(factor, updateView); 77 | } 78 | fireControllerEvent(ControllerType.ZOOM, factor); 79 | } 80 | 81 | protected void ZoomZ(float factor) 82 | { 83 | ZoomZ(factor, DEFAULT_UPDATE_VIEW); 84 | } 85 | 86 | protected void ZoomZ(float factor, bool updateView) 87 | { 88 | foreach (Chart c in _targets) { 89 | c.View.ZoomZ(factor, updateView); 90 | } 91 | fireControllerEvent(ControllerType.ZOOM, factor); 92 | } 93 | 94 | } 95 | 96 | } 97 | 98 | //======================================================= 99 | //Service provided by Telerik (www.telerik.com) 100 | //Conversion powered by NRefactory. 101 | //Twitter: @telerik 102 | //Facebook: facebook.com/telerik 103 | //======================================================= 104 | -------------------------------------------------------------------------------- /nzy3d-api/Chart/Controllers/ControllerType.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Chart.Controllers 9 | { 10 | 11 | public enum ControllerType 12 | { 13 | ZOOM, 14 | SHIFT, 15 | ROTATE, 16 | PAN 17 | } 18 | 19 | } 20 | 21 | //======================================================= 22 | //Service provided by Telerik (www.telerik.com) 23 | //Conversion powered by NRefactory. 24 | //Twitter: @telerik 25 | //Facebook: facebook.com/telerik 26 | //======================================================= 27 | -------------------------------------------------------------------------------- /nzy3d-api/Chart/Controllers/Thread/Camera/CameraThreadController.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Chart; 9 | using nzy3D.Chart.Controllers.Camera; 10 | using nzy3D.Maths; 11 | 12 | namespace nzy3D.Chart.Controllers.Thread.Camera 13 | { 14 | 15 | public class CameraThreadController : AbstractCameraController 16 | { 17 | 18 | private Coord2d _move; 19 | private System.Threading.Thread _process; 20 | ////1000/25; // nb milisecond wait between two frames 21 | private int _sleep = 1; 22 | 23 | private float _step = 0.0005f; 24 | public CameraThreadController() 25 | { 26 | } 27 | 28 | public CameraThreadController(Chart chart) 29 | { 30 | Register(chart); 31 | } 32 | 33 | public override void Dispose() 34 | { 35 | StopT(); 36 | base.Dispose(); 37 | } 38 | 39 | public void Start() 40 | { 41 | if ((_process == null)) { 42 | _process = new System.Threading.Thread(Run); 43 | _process.Name = "CameraThreadController, embedded by ChartThreadController"; 44 | _process.Start(); 45 | } 46 | } 47 | 48 | public void StopT() 49 | { 50 | if ((_process != null)) { 51 | _process.Interrupt(); 52 | _process = null; 53 | } 54 | } 55 | 56 | public void Run() 57 | { 58 | _move = new Coord2d(_step, 0); 59 | while ((_process != null)) { 60 | try { 61 | Rotate(_move); 62 | System.Threading.Thread.Sleep(_sleep); 63 | } catch (System.Threading.ThreadInterruptedException ex) { 64 | _process = null; 65 | } 66 | } 67 | } 68 | 69 | public float MoveStep { 70 | get { return _step; } 71 | set { _step = value; } 72 | } 73 | 74 | 75 | 76 | } 77 | 78 | } 79 | 80 | //======================================================= 81 | //Service provided by Telerik (www.telerik.com) 82 | //Conversion powered by NRefactory. 83 | //Twitter: @telerik 84 | //Facebook: facebook.com/telerik 85 | //======================================================= 86 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/ColorsMaps/ColorMapGrayscale.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors.ColorMaps 9 | { 10 | /// 11 | /// Creates a new instance of ColorMapGrayscale. 12 | /// A ColorMapWhiteRed objects provides a color for points standing 13 | /// between a Zmin and Zmax values. 14 | /// 15 | /// The points standing outside these [Zmin;Zmax] boundaries are assigned 16 | /// to the same color than the points standing on the boundaries. 17 | /// 18 | /// The grayscale colormap is a progressive transition from black to white. 19 | /// 20 | public class ColorMapGrayscale : IColorMap 21 | { 22 | 23 | 24 | private bool m_direction; 25 | public bool Direction { 26 | get { return m_direction; } 27 | set { m_direction = value; } 28 | } 29 | 30 | public Color GetColor(IColorMappable colorable, double v) 31 | { 32 | return GetColor(0, 0, v, colorable.ZMin, colorable.ZMax); 33 | } 34 | 35 | public Color GetColor(IColorMappable colorable, double x, double y, double z) 36 | { 37 | return GetColor(x, y, z, colorable.ZMin, colorable.ZMax); 38 | } 39 | 40 | /// 41 | /// Helper function 42 | /// 43 | private Color GetColor(double x, double y, double z, double zMin, double zMax) 44 | { 45 | double rel_value = 0; 46 | if (z < zMin) { 47 | rel_value = 0; 48 | } else if (z > zMax) { 49 | rel_value = 1; 50 | } else { 51 | if (m_direction) { 52 | rel_value = (z - zMin) / (zMax - zMin); 53 | } else { 54 | rel_value = (zMax - z) / (zMax - zMin); 55 | } 56 | } 57 | return new Color(rel_value, rel_value, rel_value); 58 | } 59 | 60 | /// 61 | /// Returns the string representation of this colormap 62 | /// 63 | /// 64 | /// 65 | public override string ToString() 66 | { 67 | return "ColorMapGrayscale"; 68 | } 69 | 70 | } 71 | 72 | } 73 | 74 | //======================================================= 75 | //Service provided by Telerik (www.telerik.com) 76 | //Conversion powered by NRefactory. 77 | //Twitter: @telerik 78 | //Facebook: facebook.com/telerik 79 | //======================================================= 80 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/ColorsMaps/ColorMapRainbow.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors.ColorMaps 9 | { 10 | /// 11 | /// Same as ColorMapRBG with a nicer name 12 | /// 13 | /// 14 | public class ColorMapRainbow : ColorMapRBG 15 | { 16 | 17 | /// 18 | /// Returns the string representation of this colormap 19 | /// 20 | /// 21 | /// 22 | public override string ToString() 23 | { 24 | return "ColorMapRainbow"; 25 | } 26 | 27 | } 28 | 29 | } 30 | 31 | //======================================================= 32 | //Service provided by Telerik (www.telerik.com) 33 | //Conversion powered by NRefactory. 34 | //Twitter: @telerik 35 | //Facebook: facebook.com/telerik 36 | //======================================================= 37 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/ColorsMaps/ColorMapWhiteBlue.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors.ColorMaps 9 | { 10 | /// 11 | /// Creates a new instance of ColorMapWhiteBlue. 12 | /// A ColorMapWhiteGreen objects provides a color for points standing 13 | /// between a Zmin and Zmax values. 14 | /// 15 | /// The points standing outside these [Zmin;Zmax] boundaries are assigned 16 | /// to the same color than the points standing on the boundaries. 17 | /// 18 | /// The white-red colormap is a progressive transition from white to blue. 19 | /// 20 | public class ColorMapWhiteBlue : IColorMap 21 | { 22 | 23 | 24 | private bool m_direction; 25 | public bool Direction { 26 | get { return m_direction; } 27 | set { m_direction = value; } 28 | } 29 | 30 | public Color GetColor(IColorMappable colorable, double v) 31 | { 32 | return GetColor(0, 0, v, colorable.ZMin, colorable.ZMax); 33 | } 34 | 35 | public Color GetColor(IColorMappable colorable, double x, double y, double z) 36 | { 37 | return GetColor(x, y, z, colorable.ZMin, colorable.ZMax); 38 | } 39 | 40 | /// 41 | /// Helper function 42 | /// 43 | private Color GetColor(double x, double y, double z, double zMin, double zMax) 44 | { 45 | double rel_value = 0; 46 | if (z < zMin) { 47 | rel_value = 0; 48 | } else if (z > zMax) { 49 | rel_value = 1; 50 | } else { 51 | if (m_direction) { 52 | rel_value = (z - zMin) / (zMax - zMin); 53 | } else { 54 | rel_value = (zMax - z) / (zMax - zMin); 55 | } 56 | } 57 | return new Color(rel_value, rel_value, 1); 58 | } 59 | 60 | /// 61 | /// Returns the string representation of this colormap 62 | /// 63 | /// 64 | /// 65 | public override string ToString() 66 | { 67 | return "ColorMapWhiteBlue"; 68 | } 69 | 70 | } 71 | } 72 | 73 | //======================================================= 74 | //Service provided by Telerik (www.telerik.com) 75 | //Conversion powered by NRefactory. 76 | //Twitter: @telerik 77 | //Facebook: facebook.com/telerik 78 | //======================================================= 79 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/ColorsMaps/ColorMapWhiteGreen.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors.ColorMaps 9 | { 10 | /// 11 | /// Creates a new instance of ColorMapWhiteGreen. 12 | /// A ColorMapWhiteGreen objects provides a color for points standing 13 | /// between a Zmin and Zmax values. 14 | /// 15 | /// The points standing outside these [Zmin;Zmax] boundaries are assigned 16 | /// to the same color than the points standing on the boundaries. 17 | /// 18 | /// The white-red colormap is a progressive transition from white to green. 19 | /// 20 | public class ColorMapWhiteGreen : IColorMap 21 | { 22 | 23 | 24 | private bool m_direction; 25 | public bool Direction { 26 | get { return m_direction; } 27 | set { m_direction = value; } 28 | } 29 | 30 | public Color GetColor(IColorMappable colorable, double v) 31 | { 32 | return GetColor(0, 0, v, colorable.ZMin, colorable.ZMax); 33 | } 34 | 35 | public Color GetColor(IColorMappable colorable, double x, double y, double z) 36 | { 37 | return GetColor(x, y, z, colorable.ZMin, colorable.ZMax); 38 | } 39 | 40 | /// 41 | /// Helper function 42 | /// 43 | private Color GetColor(double x, double y, double z, double zMin, double zMax) 44 | { 45 | double rel_value = 0; 46 | if (z < zMin) { 47 | rel_value = 0; 48 | } else if (z > zMax) { 49 | rel_value = 1; 50 | } else { 51 | if (m_direction) { 52 | rel_value = (z - zMin) / (zMax - zMin); 53 | } else { 54 | rel_value = (zMax - z) / (zMax - zMin); 55 | } 56 | } 57 | return new Color(rel_value, 1, rel_value); 58 | } 59 | 60 | /// 61 | /// Returns the string representation of this colormap 62 | /// 63 | /// 64 | /// 65 | public override string ToString() 66 | { 67 | return "ColorMapWhiteGreen"; 68 | } 69 | 70 | } 71 | } 72 | 73 | //======================================================= 74 | //Service provided by Telerik (www.telerik.com) 75 | //Conversion powered by NRefactory. 76 | //Twitter: @telerik 77 | //Facebook: facebook.com/telerik 78 | //======================================================= 79 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/ColorsMaps/ColorMapWhiteRed.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors.ColorMaps 9 | { 10 | /// 11 | /// Creates a new instance of ColorMapWhiteRed. 12 | /// A ColorMapWhiteRed objects provides a color for points standing 13 | /// between a Zmin and Zmax values. 14 | /// 15 | /// The points standing outside these [Zmin;Zmax] boundaries are assigned 16 | /// to the same color than the points standing on the boundaries. 17 | /// 18 | /// The white-red colormap is a progressive transition from white to red. 19 | /// 20 | public class ColorMapWhiteRed : IColorMap 21 | { 22 | 23 | 24 | private bool m_direction; 25 | public bool Direction { 26 | get { return m_direction; } 27 | set { m_direction = value; } 28 | } 29 | 30 | public Color GetColor(IColorMappable colorable, double v) 31 | { 32 | return GetColor(0, 0, v, colorable.ZMin, colorable.ZMax); 33 | } 34 | 35 | public Color GetColor(IColorMappable colorable, double x, double y, double z) 36 | { 37 | return GetColor(x, y, z, colorable.ZMin, colorable.ZMax); 38 | } 39 | 40 | /// 41 | /// Helper function 42 | /// 43 | private Color GetColor(double x, double y, double z, double zMin, double zMax) 44 | { 45 | double rel_value = 0; 46 | if (z < zMin) { 47 | rel_value = 0; 48 | } else if (z > zMax) { 49 | rel_value = 1; 50 | } else { 51 | if (m_direction) { 52 | rel_value = (z - zMin) / (zMax - zMin); 53 | } else { 54 | rel_value = (zMax - z) / (zMax - zMin); 55 | } 56 | } 57 | return new Color(1, rel_value, rel_value); 58 | } 59 | 60 | /// 61 | /// Returns the string representation of this colormap 62 | /// 63 | /// 64 | /// 65 | public override string ToString() 66 | { 67 | return "ColorMapWhiteRed"; 68 | } 69 | 70 | } 71 | } 72 | 73 | //======================================================= 74 | //Service provided by Telerik (www.telerik.com) 75 | //Conversion powered by NRefactory. 76 | //Twitter: @telerik 77 | //Facebook: facebook.com/telerik 78 | //======================================================= 79 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/ColorsMaps/IColorMap.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors.ColorMaps 9 | { 10 | /// 11 | /// This interface defines the set of methods that any concrete colormap 12 | /// should define in order to be used by an object implementing the 13 | /// ColorMappable interface. 14 | /// 15 | /// The ColorMappable interface impose to an object to provide a Z-scaling, 16 | /// that is, a minimum and maximum value on the Z axis. 17 | /// These values are used by concrete colormaps in order to set an interval 18 | /// for the possible colors. 19 | /// 20 | /// 21 | public interface IColorMap 22 | { 23 | 24 | 25 | /// 26 | /// Returns color of a object at given point 27 | /// 28 | /// A object. 29 | /// 30 | /// 31 | /// 32 | /// Color for the given point 33 | Color GetColor(IColorMappable colorable, double x, double y, double z); 34 | 35 | /// 36 | /// Returns color of a object at given point 37 | /// 38 | /// A object. 39 | /// The variable that is Color-dependent, and can be independent of the coordinates 40 | /// 41 | /// 42 | Color GetColor(IColorMappable colorable, double v); 43 | 44 | /// 45 | /// Indicates if the colormap use the standard (True) or reverted (False) color direction 46 | /// 47 | /// 48 | 49 | bool Direction { get; set; } 50 | /// 51 | /// Returns the string representation of this color, including alpha channel value 52 | /// 53 | /// 54 | /// 55 | string ToString(); 56 | 57 | } 58 | } 59 | 60 | //======================================================= 61 | //Service provided by Telerik (www.telerik.com) 62 | //Conversion powered by NRefactory. 63 | //Twitter: @telerik 64 | //Facebook: facebook.com/telerik 65 | //======================================================= 66 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/IColorMappable.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors 9 | { 10 | public interface IColorMappable 11 | { 12 | 13 | /// 14 | /// Get/Set the lower value boundary for a . 15 | /// 16 | /// 17 | 18 | double ZMin { get; set; } 19 | /// 20 | /// Get/Set the upper value boundary for a . 21 | /// 22 | /// 23 | 24 | double ZMax { get; set; } 25 | } 26 | } 27 | 28 | //======================================================= 29 | //Service provided by Telerik (www.telerik.com) 30 | //Conversion powered by NRefactory. 31 | //Twitter: @telerik 32 | //Facebook: facebook.com/telerik 33 | //======================================================= 34 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/IMultiColorable.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors 9 | { 10 | /// 11 | /// 12 | /// objects may have several colors interpolated between each of 13 | /// their individual points colors. 14 | /// 15 | /// 16 | /// A object requires a that defines a strategy 17 | /// for coloring points according to their position. 18 | /// 19 | /// 20 | /// 21 | public interface IMultiColorable 22 | { 23 | 24 | /// 25 | /// Get/Set the colormapper that will be used by the Drawable, instead of using precomputed colors 26 | /// 27 | /// 28 | 29 | Colors.ColorMapper ColorMapper { get; set; } 30 | } 31 | } 32 | 33 | //======================================================= 34 | //Service provided by Telerik (www.telerik.com) 35 | //Conversion powered by NRefactory. 36 | //Twitter: @telerik 37 | //Facebook: facebook.com/telerik 38 | //======================================================= 39 | -------------------------------------------------------------------------------- /nzy3d-api/Colors/ISingleColorable.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Colors 9 | { 10 | /// 11 | /// objects have a single plain color and a must define a setter for it 12 | /// 13 | /// 14 | public interface ISingleColorable 15 | { 16 | 17 | /// 18 | /// Get/Set the color 19 | /// 20 | /// 21 | 22 | Color Color { get; set; } 23 | } 24 | } 25 | 26 | //======================================================= 27 | //Service provided by Telerik (www.telerik.com) 28 | //Conversion powered by NRefactory. 29 | //Twitter: @telerik 30 | //Facebook: facebook.com/telerik 31 | //======================================================= 32 | -------------------------------------------------------------------------------- /nzy3d-api/Events/ControllerEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Chart.Controllers; 9 | 10 | namespace nzy3D.Events 11 | { 12 | 13 | public class ControllerEventArgs : ObjectEventArgs 14 | { 15 | 16 | private ControllerType _type; 17 | 18 | private object _value; 19 | public enum FieldChanged : int 20 | { 21 | Data = 0, 22 | Transform = 1, 23 | Color = 2, 24 | Metadata = 3, 25 | Displayed = 4 26 | } 27 | 28 | public ControllerEventArgs(object objectChanged, ControllerType type, object value) : base(objectChanged) 29 | { 30 | _type = type; 31 | _value = value; 32 | } 33 | 34 | public ControllerType Type { 35 | get { return _type; } 36 | } 37 | 38 | public object Value { 39 | get { return _value; } 40 | } 41 | 42 | public override string ToString() 43 | { 44 | return ("ControllerEvent(type,value): " + Type + ", " + Value); 45 | } 46 | 47 | } 48 | 49 | } 50 | 51 | 52 | //======================================================= 53 | //Service provided by Telerik (www.telerik.com) 54 | //Conversion powered by NRefactory. 55 | //Twitter: @telerik 56 | //Facebook: facebook.com/telerik 57 | //======================================================= 58 | -------------------------------------------------------------------------------- /nzy3d-api/Events/DrawableChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public class DrawableChangedEventArgs : ObjectEventArgs 12 | { 13 | 14 | 15 | private FieldChanged _what; 16 | public enum FieldChanged : int 17 | { 18 | Data = 0, 19 | Transform = 1, 20 | Color = 2, 21 | Metadata = 3, 22 | Displayed = 4 23 | } 24 | 25 | public DrawableChangedEventArgs(object objectChanged, FieldChanged what) : base(objectChanged) 26 | { 27 | _what = what; 28 | } 29 | 30 | public FieldChanged What { 31 | get { return _what; } 32 | } 33 | 34 | } 35 | 36 | } 37 | 38 | //======================================================= 39 | //Service provided by Telerik (www.telerik.com) 40 | //Conversion powered by NRefactory. 41 | //Twitter: @telerik 42 | //Facebook: facebook.com/telerik 43 | //======================================================= 44 | -------------------------------------------------------------------------------- /nzy3d-api/Events/IControllerEventListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public interface IControllerEventListener 12 | { 13 | void ControllerEventFired(ControllerEventArgs e); 14 | } 15 | 16 | } 17 | 18 | 19 | //======================================================= 20 | //Service provided by Telerik (www.telerik.com) 21 | //Conversion powered by NRefactory. 22 | //Twitter: @telerik 23 | //Facebook: facebook.com/telerik 24 | //======================================================= 25 | -------------------------------------------------------------------------------- /nzy3d-api/Events/IDrawableListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public interface IDrawableListener 12 | { 13 | void DrawableChanged(DrawableChangedEventArgs e); 14 | } 15 | 16 | } 17 | 18 | //======================================================= 19 | //Service provided by Telerik (www.telerik.com) 20 | //Conversion powered by NRefactory. 21 | //Twitter: @telerik 22 | //Facebook: facebook.com/telerik 23 | //======================================================= 24 | -------------------------------------------------------------------------------- /nzy3d-api/Events/IScaleChangedListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public interface IScaleChangedListener 12 | { 13 | void ScaleChanged(ScaleChangedEventArgs e); 14 | } 15 | 16 | } 17 | 18 | //======================================================= 19 | //Service provided by Telerik (www.telerik.com) 20 | //Conversion powered by NRefactory. 21 | //Twitter: @telerik 22 | //Facebook: facebook.com/telerik 23 | //======================================================= 24 | -------------------------------------------------------------------------------- /nzy3d-api/Events/IViewIsVerticalEventListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public interface IViewIsVerticalEventListener 12 | { 13 | void ViewVerticalReached(ViewIsVerticalEventArgs e); 14 | void ViewVerticalLeft(ViewIsVerticalEventArgs e); 15 | } 16 | 17 | } 18 | 19 | 20 | //======================================================= 21 | //Service provided by Telerik (www.telerik.com) 22 | //Conversion powered by NRefactory. 23 | //Twitter: @telerik 24 | //Facebook: facebook.com/telerik 25 | //======================================================= 26 | -------------------------------------------------------------------------------- /nzy3d-api/Events/IViewModeChangedListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public interface IViewModeChangedListener 12 | { 13 | void ViewModeChanged(ViewModeChangedEventArgs e); 14 | } 15 | 16 | } 17 | 18 | 19 | //======================================================= 20 | //Service provided by Telerik (www.telerik.com) 21 | //Conversion powered by NRefactory. 22 | //Twitter: @telerik 23 | //Facebook: facebook.com/telerik 24 | //======================================================= 25 | -------------------------------------------------------------------------------- /nzy3d-api/Events/IViewPointChangedListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public interface IViewPointChangedListener 12 | { 13 | void ViewPointChanged(ViewPointChangedEventArgs e); 14 | } 15 | 16 | } 17 | 18 | 19 | //======================================================= 20 | //Service provided by Telerik (www.telerik.com) 21 | //Conversion powered by NRefactory. 22 | //Twitter: @telerik 23 | //Facebook: facebook.com/telerik 24 | //======================================================= 25 | -------------------------------------------------------------------------------- /nzy3d-api/Events/Keyboard/IKeyListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events.Keyboard 9 | { 10 | 11 | public interface IKeyListener 12 | { 13 | 14 | /// 15 | /// Invoked when a key has been typed (key pressed in .net). 16 | /// 17 | 18 | void KeyTyped(object sender, System.Windows.Forms.KeyPressEventArgs e); 19 | /// 20 | /// Invoked when a key has been pressed (key down in .net). 21 | /// 22 | 23 | void KeyPressed(object sender, System.Windows.Forms.KeyEventArgs e); 24 | /// 25 | /// Invoked when a key has been released (key up in .net). 26 | /// 27 | 28 | void KeyReleased(object sender, System.Windows.Forms.KeyEventArgs e); 29 | } 30 | 31 | } 32 | 33 | //======================================================= 34 | //Service provided by Telerik (www.telerik.com) 35 | //Conversion powered by NRefactory. 36 | //Twitter: @telerik 37 | //Facebook: facebook.com/telerik 38 | //======================================================= 39 | -------------------------------------------------------------------------------- /nzy3d-api/Events/Mouse/IMouseListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events.Mouse 9 | { 10 | 11 | public interface IMouseListener 12 | { 13 | 14 | /// 15 | /// Invoked when the mouse button has been clicked (pressed and released) on a component. 16 | /// 17 | 18 | void MouseClicked(object sender, System.Windows.Forms.MouseEventArgs e); 19 | /// 20 | /// Invoked when a mouse button has been pressed on a component. 21 | /// 22 | 23 | void MousePressed(object sender, System.Windows.Forms.MouseEventArgs e); 24 | /// 25 | /// Invoked when a mouse button has been released on a component. 26 | /// 27 | 28 | void MouseReleased(object sender, System.Windows.Forms.MouseEventArgs e); 29 | /// 30 | /// Invoked when a mouse button has been double clicked. 31 | /// 32 | 33 | void MouseDoubleClicked(object sender, System.Windows.Forms.MouseEventArgs e); 34 | } 35 | 36 | } 37 | 38 | //======================================================= 39 | //Service provided by Telerik (www.telerik.com) 40 | //Conversion powered by NRefactory. 41 | //Twitter: @telerik 42 | //Facebook: facebook.com/telerik 43 | //======================================================= 44 | -------------------------------------------------------------------------------- /nzy3d-api/Events/Mouse/IMouseMotionListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events.Mouse 9 | { 10 | 11 | public interface IMouseMotionListener 12 | { 13 | 14 | // ''' 15 | // ''' Invoked when a mouse button is pressed on a component and then dragged. 16 | // ''' 17 | //Sub MouseDragged(sender As Object, e As System.Windows.Forms.MouseEventArgs) 18 | //Never raised by winfoms 19 | 20 | /// 21 | /// Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. 22 | /// 23 | 24 | void MouseMoved(object sender, System.Windows.Forms.MouseEventArgs e); 25 | } 26 | 27 | } 28 | 29 | //======================================================= 30 | //Service provided by Telerik (www.telerik.com) 31 | //Conversion powered by NRefactory. 32 | //Twitter: @telerik 33 | //Facebook: facebook.com/telerik 34 | //======================================================= 35 | -------------------------------------------------------------------------------- /nzy3d-api/Events/Mouse/IMouseWheelListener.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events.Mouse 9 | { 10 | 11 | public interface IMouseWheelListener 12 | { 13 | 14 | /// 15 | /// Invoked when a mouse button is pressed on a component and then dragged. 16 | /// 17 | 18 | void MouseWheelMoved(object sender, System.Windows.Forms.MouseEventArgs e); 19 | } 20 | 21 | } 22 | 23 | //======================================================= 24 | //Service provided by Telerik (www.telerik.com) 25 | //Conversion powered by NRefactory. 26 | //Twitter: @telerik 27 | //Facebook: facebook.com/telerik 28 | //======================================================= 29 | -------------------------------------------------------------------------------- /nzy3d-api/Events/Mouse/MouseButton.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events.Mouse 9 | { 10 | 11 | public enum MouseButton 12 | { 13 | LEFT, 14 | MIDDLE, 15 | RIGHT, 16 | XBUTTON1, 17 | XBUTTON2 18 | } 19 | 20 | } 21 | 22 | //======================================================= 23 | //Service provided by Telerik (www.telerik.com) 24 | //Conversion powered by NRefactory. 25 | //Twitter: @telerik 26 | //Facebook: facebook.com/telerik 27 | //======================================================= 28 | -------------------------------------------------------------------------------- /nzy3d-api/Events/Mouse/MouseEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events.Mouse 9 | { 10 | 11 | public class MouseEventArgs 12 | { 13 | 14 | private double _x; 15 | private double _y; 16 | 17 | private MouseButton _button; 18 | public MouseEventArgs(double x, double y, MouseButton button) 19 | { 20 | _x = x; 21 | _y = y; 22 | _button = button; 23 | } 24 | 25 | public double X { 26 | get { return _x; } 27 | } 28 | 29 | public double Y { 30 | get { return _y; } 31 | } 32 | 33 | public MouseButton Button { 34 | get { return _button; } 35 | } 36 | 37 | } 38 | 39 | } 40 | 41 | //======================================================= 42 | //Service provided by Telerik (www.telerik.com) 43 | //Conversion powered by NRefactory. 44 | //Twitter: @telerik 45 | //Facebook: facebook.com/telerik 46 | //======================================================= 47 | -------------------------------------------------------------------------------- /nzy3d-api/Events/Mouse/MouseWheelEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events.Mouse 9 | { 10 | 11 | public class MouseWheelEventArgs 12 | { 13 | 14 | 15 | } 16 | 17 | } 18 | 19 | //======================================================= 20 | //Service provided by Telerik (www.telerik.com) 21 | //Conversion powered by NRefactory. 22 | //Twitter: @telerik 23 | //Facebook: facebook.com/telerik 24 | //======================================================= 25 | -------------------------------------------------------------------------------- /nzy3d-api/Events/ObjectEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public class ObjectEventArgs : EventArgs 12 | { 13 | 14 | 15 | private object _objectChanged; 16 | public ObjectEventArgs(object objectChanged) : base() 17 | { 18 | _objectChanged = objectChanged; 19 | } 20 | 21 | public object ObjectChanged { 22 | get { return _objectChanged; } 23 | } 24 | 25 | } 26 | 27 | } 28 | 29 | //======================================================= 30 | //Service provided by Telerik (www.telerik.com) 31 | //Conversion powered by NRefactory. 32 | //Twitter: @telerik 33 | //Facebook: facebook.com/telerik 34 | //======================================================= 35 | -------------------------------------------------------------------------------- /nzy3d-api/Events/ScaleChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Events 11 | { 12 | 13 | public class ScaleChangedEventArgs : ObjectEventArgs 14 | { 15 | 16 | private Scale _scaling; 17 | 18 | private int _scaleID; 19 | public ScaleChangedEventArgs(object objectChanged, Scale scaling, int scaleID) : base(objectChanged) 20 | { 21 | _scaling = scaling; 22 | _scaleID = scaleID; 23 | } 24 | 25 | public ScaleChangedEventArgs(object objectChanged, Scale scaling) : this(objectChanged, scaling, -1) 26 | { 27 | } 28 | 29 | public Scale Scaling { 30 | get { return _scaling; } 31 | } 32 | 33 | public int ScaleId { 34 | get { return _scaleID; } 35 | } 36 | 37 | public override string ToString() 38 | { 39 | return "ScaleChangeEventArgs:id" + ScaleId + ", scale=" + Scaling.ToString(); 40 | } 41 | 42 | } 43 | 44 | } 45 | 46 | //======================================================= 47 | //Service provided by Telerik (www.telerik.com) 48 | //Conversion powered by NRefactory. 49 | //Twitter: @telerik 50 | //Facebook: facebook.com/telerik 51 | //======================================================= 52 | -------------------------------------------------------------------------------- /nzy3d-api/Events/ViewIsVerticalEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Events 9 | { 10 | 11 | public class ViewIsVerticalEventArgs : ObjectEventArgs 12 | { 13 | 14 | public ViewIsVerticalEventArgs(object objectChanged) : base(objectChanged) 15 | { 16 | } 17 | 18 | } 19 | 20 | } 21 | 22 | //======================================================= 23 | //Service provided by Telerik (www.telerik.com) 24 | //Conversion powered by NRefactory. 25 | //Twitter: @telerik 26 | //Facebook: facebook.com/telerik 27 | //======================================================= 28 | -------------------------------------------------------------------------------- /nzy3d-api/Events/ViewModeChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.View.Modes; 9 | 10 | namespace nzy3D.Events 11 | { 12 | 13 | public class ViewModeChangedEventArgs : ObjectEventArgs 14 | { 15 | 16 | 17 | private ViewPositionMode _mode; 18 | public ViewModeChangedEventArgs(object objectChanged, ViewPositionMode mode) : base(objectChanged) 19 | { 20 | _mode = mode; 21 | } 22 | 23 | public ViewPositionMode Mode { 24 | get { return _mode; } 25 | } 26 | } 27 | 28 | } 29 | 30 | 31 | //======================================================= 32 | //Service provided by Telerik (www.telerik.com) 33 | //Conversion powered by NRefactory. 34 | //Twitter: @telerik 35 | //Facebook: facebook.com/telerik 36 | //======================================================= 37 | -------------------------------------------------------------------------------- /nzy3d-api/Events/ViewPointChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Events 11 | { 12 | 13 | public class ViewPointChangedEventArgs : ObjectEventArgs 14 | { 15 | 16 | 17 | private Coord3d _viewPoint; 18 | public ViewPointChangedEventArgs(object objectChanged, Coord3d viewPoint) : base(objectChanged) 19 | { 20 | _viewPoint = viewPoint; 21 | } 22 | 23 | public Coord3d ViewPoint { 24 | get { return _viewPoint; } 25 | } 26 | } 27 | 28 | } 29 | 30 | //======================================================= 31 | //Service provided by Telerik (www.telerik.com) 32 | //Conversion powered by NRefactory. 33 | //Twitter: @telerik 34 | //Facebook: facebook.com/telerik 35 | //======================================================= 36 | -------------------------------------------------------------------------------- /nzy3d-api/Factories/AxeFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using nzy3D.Plot3D.Primitives.Axes; 10 | using nzy3D.Plot3D.Rendering.View; 11 | 12 | namespace nzy3D.Factories 13 | { 14 | 15 | public class AxeFactory 16 | { 17 | public static object getInstance(BoundingBox3d box, View view) 18 | { 19 | AxeBox axe = new AxeBox(box); 20 | axe.View = view; 21 | return axe; 22 | } 23 | } 24 | 25 | } 26 | 27 | //======================================================= 28 | //Service provided by Telerik (www.telerik.com) 29 | //Conversion powered by NRefactory. 30 | //Twitter: @telerik 31 | //Facebook: facebook.com/telerik 32 | //======================================================= 33 | -------------------------------------------------------------------------------- /nzy3d-api/Factories/CameraFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using nzy3D.Plot3D.Rendering.View; 10 | 11 | namespace nzy3D.Factories 12 | { 13 | 14 | public class CameraFactory 15 | { 16 | 17 | public static Camera getInstance(Coord3d center) 18 | { 19 | return new Camera(center); 20 | } 21 | 22 | } 23 | 24 | } 25 | 26 | //======================================================= 27 | //Service provided by Telerik (www.telerik.com) 28 | //Conversion powered by NRefactory. 29 | //Twitter: @telerik 30 | //Facebook: facebook.com/telerik 31 | //======================================================= 32 | -------------------------------------------------------------------------------- /nzy3d-api/Factories/NzyFactories.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Factories 9 | { 10 | public class NzyFactories 11 | { 12 | public static OrderingStrategyFactory ordering = new OrderingStrategyFactory(); 13 | public static AxeFactory axe = new AxeFactory(); 14 | public static CameraFactory camera = new CameraFactory(); 15 | public static ViewFactory view = new ViewFactory(); 16 | public static SceneFactory scene = new SceneFactory(); 17 | //Public Shared renderer3d As New Renderer3dFactory 18 | } 19 | } 20 | 21 | //======================================================= 22 | //Service provided by Telerik (www.telerik.com) 23 | //Conversion powered by NRefactory. 24 | //Twitter: @telerik 25 | //Facebook: facebook.com/telerik 26 | //======================================================= 27 | -------------------------------------------------------------------------------- /nzy3d-api/Factories/OrderingStrategyFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.Ordering; 9 | 10 | namespace nzy3D.Factories 11 | { 12 | 13 | public class OrderingStrategyFactory 14 | { 15 | 16 | public static AbstractOrderingStrategy getInstance() 17 | { 18 | return DEFAULTORDERING; 19 | } 20 | 21 | 22 | public static BarycentreOrderingStrategy DEFAULTORDERING = new BarycentreOrderingStrategy(); 23 | } 24 | 25 | } 26 | 27 | //======================================================= 28 | //Service provided by Telerik (www.telerik.com) 29 | //Conversion powered by NRefactory. 30 | //Twitter: @telerik 31 | //Facebook: facebook.com/telerik 32 | //======================================================= 33 | -------------------------------------------------------------------------------- /nzy3d-api/Factories/Renderer3dFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.View; 9 | 10 | namespace nzy3D.Factories 11 | { 12 | 13 | public class Renderer3dFactory 14 | { 15 | 16 | public static object getInstance(View view, bool traceGL, bool debugGL) 17 | { 18 | return new Renderer3d(view, traceGL, debugGL); 19 | } 20 | 21 | } 22 | 23 | } 24 | 25 | 26 | //======================================================= 27 | //Service provided by Telerik (www.telerik.com) 28 | //Conversion powered by NRefactory. 29 | //Twitter: @telerik 30 | //Facebook: facebook.com/telerik 31 | //======================================================= 32 | -------------------------------------------------------------------------------- /nzy3d-api/Factories/SceneFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Chart; 9 | 10 | namespace nzy3D.Factories 11 | { 12 | 13 | public class SceneFactory 14 | { 15 | public static ChartScene getInstance(bool sort) 16 | { 17 | return new ChartScene(sort); 18 | } 19 | } 20 | 21 | } 22 | 23 | //======================================================= 24 | //Service provided by Telerik (www.telerik.com) 25 | //Conversion powered by NRefactory. 26 | //Twitter: @telerik 27 | //Facebook: facebook.com/telerik 28 | //======================================================= 29 | -------------------------------------------------------------------------------- /nzy3d-api/Factories/ViewFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.View; 9 | using nzy3D.Plot3D.Rendering.Scene; 10 | using nzy3D.Plot3D.Rendering.Canvas; 11 | using nzy3D.Chart; 12 | 13 | namespace nzy3D.Factories 14 | { 15 | 16 | public class ViewFactory 17 | { 18 | 19 | public static View getInstance(Scene scene, ICanvas canvas, Quality quality) 20 | { 21 | return new ChartView(scene, canvas, quality); 22 | } 23 | 24 | } 25 | 26 | } 27 | 28 | 29 | //======================================================= 30 | //Service provided by Telerik (www.telerik.com) 31 | //Conversion powered by NRefactory. 32 | //Twitter: @telerik 33 | //Facebook: facebook.com/telerik 34 | //======================================================= 35 | -------------------------------------------------------------------------------- /nzy3d-api/Glut/BitmapCharRec.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | 9 | namespace nzy3D.Glut 10 | { 11 | 12 | public class BitmapCharRec 13 | { 14 | public int width; 15 | public int height; 16 | public float xorig; 17 | public float yorig; 18 | public float advance; 19 | 20 | public byte[] bitmap; 21 | public BitmapCharRec(int width, int height, float xorig, float yorig, float advance, byte[] bitmap) 22 | { 23 | this.width = width; 24 | this.height = height; 25 | this.xorig = xorig; 26 | this.yorig = yorig; 27 | this.advance = advance; 28 | this.bitmap = bitmap; 29 | } 30 | 31 | 32 | } 33 | 34 | } 35 | 36 | //======================================================= 37 | //Service provided by Telerik (www.telerik.com) 38 | //Conversion powered by NRefactory. 39 | //Twitter: @telerik 40 | //Facebook: facebook.com/telerik 41 | //======================================================= 42 | -------------------------------------------------------------------------------- /nzy3d-api/Glut/BitmapFontRec.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | 9 | namespace nzy3D.Glut 10 | { 11 | 12 | public class BitmapFontRec 13 | { 14 | public string name; 15 | public int num_chars; 16 | public int first; 17 | 18 | public BitmapCharRec[] ch; 19 | public BitmapFontRec(string name, int num_chars, int first, BitmapCharRec[] ch) 20 | { 21 | this.name = name; 22 | this.num_chars = num_chars; 23 | this.first = first; 24 | this.ch = ch; 25 | } 26 | 27 | } 28 | 29 | } 30 | 31 | //======================================================= 32 | //Service provided by Telerik (www.telerik.com) 33 | //Conversion powered by NRefactory. 34 | //Twitter: @telerik 35 | //Facebook: facebook.com/telerik 36 | //======================================================= 37 | -------------------------------------------------------------------------------- /nzy3d-api/Glut/CoordRec.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | 9 | 10 | namespace nzy3D.Glut 11 | { 12 | public class CoordRec 13 | { 14 | 15 | public float x; 16 | 17 | public float y; 18 | public CoordRec(float x, float y) 19 | { 20 | this.x = x; 21 | this.y = y; 22 | } 23 | 24 | } 25 | } 26 | 27 | //======================================================= 28 | //Service provided by Telerik (www.telerik.com) 29 | //Conversion powered by NRefactory. 30 | //Twitter: @telerik 31 | //Facebook: facebook.com/telerik 32 | //======================================================= 33 | -------------------------------------------------------------------------------- /nzy3d-api/Glut/StrokeCharRec.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | 9 | namespace nzy3D.Glut 10 | { 11 | 12 | public class StrokeCharRec 13 | { 14 | public int num_strokes; 15 | public StrokeRec[] stroke; 16 | public float center; 17 | 18 | public float right; 19 | public StrokeCharRec(int num_strokes, StrokeRec[] stroke, float center, float right) 20 | { 21 | this.num_strokes = num_strokes; 22 | this.stroke = stroke; 23 | this.center = center; 24 | this.right = right; 25 | } 26 | 27 | } 28 | 29 | } 30 | 31 | //======================================================= 32 | //Service provided by Telerik (www.telerik.com) 33 | //Conversion powered by NRefactory. 34 | //Twitter: @telerik 35 | //Facebook: facebook.com/telerik 36 | //======================================================= 37 | -------------------------------------------------------------------------------- /nzy3d-api/Glut/StrokeFontRec.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Glut 9 | { 10 | 11 | public class StrokeFontRec 12 | { 13 | public string name; 14 | public int num_chars; 15 | public StrokeCharRec[] ch; 16 | public float top; 17 | 18 | public float bottom; 19 | public StrokeFontRec(string name, int num_chars, StrokeCharRec[] ch, float top, float bottom) 20 | { 21 | this.name = name; 22 | this.num_chars = num_chars; 23 | this.ch = ch; 24 | this.top = top; 25 | this.bottom = bottom; 26 | } 27 | 28 | } 29 | 30 | } 31 | 32 | //======================================================= 33 | //Service provided by Telerik (www.telerik.com) 34 | //Conversion powered by NRefactory. 35 | //Twitter: @telerik 36 | //Facebook: facebook.com/telerik 37 | //======================================================= 38 | -------------------------------------------------------------------------------- /nzy3d-api/Glut/StrokeRec.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | 9 | namespace nzy3D.Glut 10 | { 11 | 12 | public class StrokeRec 13 | { 14 | 15 | public int num_coords; 16 | 17 | public CoordRec[] coord; 18 | public StrokeRec(int num_coords, CoordRec[] coord) 19 | { 20 | this.num_coords = num_coords; 21 | this.coord = coord; 22 | } 23 | 24 | } 25 | 26 | } 27 | 28 | //======================================================= 29 | //Service provided by Telerik (www.telerik.com) 30 | //Conversion powered by NRefactory. 31 | //Twitter: @telerik 32 | //Facebook: facebook.com/telerik 33 | //======================================================= 34 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Algorithms/Interpolation/Bernstein/BernsteinInterpolator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths.Algorithms.Interpolation.Bernstein 9 | { 10 | 11 | public class BernsteinInterpolator : IInterpolator 12 | { 13 | 14 | public System.Collections.Generic.List Interpolate(System.Collections.Generic.List controlpoints, int resolution) 15 | { 16 | Spline3D spline = new Spline3D(controlpoints); 17 | return spline.ComputeVertices(resolution); 18 | } 19 | } 20 | 21 | } 22 | 23 | //======================================================= 24 | //Service provided by Telerik (www.telerik.com) 25 | //Conversion powered by NRefactory. 26 | //Twitter: @telerik 27 | //Facebook: facebook.com/telerik 28 | //======================================================= 29 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Algorithms/Interpolation/Bernstein/BernsteinPolynomial.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths.Algorithms.Interpolation.Bernstein 9 | { 10 | 11 | /// 12 | /// Helper class for the spline3d classes in this namespace. Used to compute 13 | /// subdivision points of the curve. 14 | /// 15 | public class BernsteinPolynomial 16 | { 17 | public double[] b0; 18 | public double[] b1; 19 | public double[] b2; 20 | public double[] b3; 21 | 22 | public int resolution; 23 | /// 24 | /// Constructor 25 | /// 26 | /// Resolution : number of subdivision steps between each control point of the spline3d (must be greater than or equal to two) 27 | public BernsteinPolynomial(int res) 28 | { 29 | if (res < 2) { 30 | throw new ArgumentException("Resolution must be at least 2", "res"); 31 | } 32 | resolution = res; 33 | b0 = new double[res]; 34 | b1 = new double[res]; 35 | b2 = new double[res]; 36 | b3 = new double[res]; 37 | double t = 0; 38 | double dt = 1 / (resolution - 1); 39 | for (int i = 0; i <= resolution - 1; i++) { 40 | double t1 = 1 - t; 41 | double t12 = t1 * t1; 42 | double t2 = t * t; 43 | b0[i] = t1 * t12; 44 | b1[i] = 3 * t * t12; 45 | b2[i] = 3 * t2 * t1; 46 | b3[i] = t * t2; 47 | t = +dt; 48 | } 49 | } 50 | } 51 | 52 | } 53 | 54 | //======================================================= 55 | //Service provided by Telerik (www.telerik.com) 56 | //Conversion powered by NRefactory. 57 | //Twitter: @telerik 58 | //Facebook: facebook.com/telerik 59 | //======================================================= 60 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Algorithms/Interpolation/IInterpolator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths.Algorithms.Interpolation 9 | { 10 | 11 | public interface IInterpolator 12 | { 13 | 14 | List Interpolate(List controlpoints, int resolution); 15 | 16 | } 17 | 18 | } 19 | 20 | //======================================================= 21 | //Service provided by Telerik (www.telerik.com) 22 | //Conversion powered by NRefactory. 23 | //Twitter: @telerik 24 | //Facebook: facebook.com/telerik 25 | //======================================================= 26 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Algorithms/OutlierRemover.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths.Algorithms 9 | { 10 | 11 | public class OutlierRemover 12 | { 13 | 14 | public static int[] getOutlierIndices(double[] values, int nVariance) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | 19 | public static int[] getInlierIndices(double[] values, int nVariance) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | 24 | public static double[] getOutlierValues(double[] values, int nVariance) 25 | { 26 | Scale bounds = getInlierBounds(values, nVariance); 27 | return System.Array.FindAll(values, x => !bounds.Contains(x)); 28 | } 29 | 30 | public static double[] getInlierValues(double[] values, int nVariance) 31 | { 32 | Scale bounds = getInlierBounds(values, nVariance); 33 | return System.Array.FindAll(values, x => bounds.Contains(x)); 34 | } 35 | 36 | public static Scale getInlierBounds(double[] values, int nVariance) 37 | { 38 | if (values.Length == 0) { 39 | return new Scale(double.NaN, double.NaN); 40 | } 41 | double[] dists = new double[values.Length]; 42 | double med = Statistics.Median(values, true); 43 | double mad = 0; 44 | for (int i = 0; i <= values.Length - 1; i++) { 45 | dists[i] = Math.Abs(values[i] - med); 46 | } 47 | mad = Statistics.Median(dists, true); 48 | double upperBound = med + mad * nVariance; 49 | double lowerBound = med - mad * nVariance; 50 | return new Scale(lowerBound, upperBound); 51 | } 52 | 53 | } 54 | 55 | } 56 | 57 | //======================================================= 58 | //Service provided by Telerik (www.telerik.com) 59 | //Conversion powered by NRefactory. 60 | //Twitter: @telerik 61 | //Facebook: facebook.com/telerik 62 | //======================================================= 63 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Algorithms/ScaleFinder.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths.Algorithms 9 | { 10 | 11 | public class ScaleFinder 12 | { 13 | 14 | /// 15 | /// Apply an outlier remover on input data () 16 | /// and retrieve the min and max values of the non-rejected values. 17 | /// 18 | public static Scale getFilteredScale(double[] values, int nvariance) 19 | { 20 | return getMinMaxScale(OutlierRemover.getInlierValues(values, nvariance)); 21 | } 22 | 23 | /// 24 | /// Simply returns the min and max values of the input array into 25 | /// a Scale object. 26 | /// 27 | public static Scale getMinMaxScale(double[] values) 28 | { 29 | if (values.Length == 0) { 30 | return new Scale(double.NaN, double.NaN); 31 | } 32 | return new Scale(Statistics.Min(values), Statistics.Max(values)); 33 | } 34 | 35 | } 36 | 37 | } 38 | 39 | //======================================================= 40 | //Service provided by Telerik (www.telerik.com) 41 | //Conversion powered by NRefactory. 42 | //Twitter: @telerik 43 | //Facebook: facebook.com/telerik 44 | //======================================================= 45 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Angle2d.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | /// 12 | /// An Angle2d stores three 2d points, considering the angle is on the second one. 13 | /// An instance may return angle(), cos() and sin() 14 | /// 15 | public class Angle2d 16 | { 17 | 18 | #region "Members" 19 | private double x1; 20 | private double x2; 21 | private double x3; 22 | private double y1; 23 | private double y2; 24 | #endregion 25 | private double y3; 26 | 27 | #region "Constructors" 28 | 29 | public Angle2d(double x1, double x2, double x3, double y1, double y2, double y3) 30 | { 31 | this.x1 = x1; 32 | this.x2 = x2; 33 | this.x3 = x3; 34 | this.y1 = y1; 35 | this.y2 = y2; 36 | this.y3 = y3; 37 | } 38 | 39 | public Angle2d(Coord2d p1, Coord2d p2, Coord2d p3) : this(p1.x, p2.x, p3.x, p1.y, p2.y, p3.y) 40 | { 41 | } 42 | 43 | #endregion 44 | 45 | #region "Functions" 46 | 47 | /// 48 | /// Computes the sinus of the angle 49 | /// 50 | public double sin() 51 | { 52 | double x4 = 0; 53 | //(y1-y2)*(z3-z2) - (z1-z2)*(y3-y2); 54 | double y4 = 0; 55 | //(z1-z2)*(x3-x2) - (x1-x2)*(z3-z2); 56 | double z4 = (x1 - x2) * (y3 - y2) - (y1 - y2) * (x3 - x2); 57 | Vector3d v1 = new Vector3d(x1, y1, 0, x2, y2, 0); 58 | Vector3d v3 = new Vector3d(x3, y3, 0, x2, y2, 0); 59 | Vector3d v4 = new Vector3d(x4, y4, z4, x2, y2, 0); 60 | return (z4 >= 0 ? 1 : -1) * v4.norm() / (v1.norm() * v3.norm()); 61 | } 62 | 63 | /// 64 | /// Computes the cosinus of the angle 65 | /// 66 | public double cos() 67 | { 68 | Vector2d v1 = new Vector2d(x1, y1, x2, y2); 69 | Vector2d v3 = new Vector2d(x3, y3, x2, y2); 70 | return v1.dot(v3) / (v1.norm() * v3.norm()); 71 | } 72 | 73 | /// 74 | /// Computes the angle 75 | /// 76 | public double angle() 77 | { 78 | Vector2d v1 = new Vector2d(x1, y1, x2, y2); 79 | Vector2d v3 = new Vector2d(x3, y3, x2, y2); 80 | return Math.Acos(v1.dot(v3)); 81 | } 82 | 83 | #endregion 84 | } 85 | } 86 | 87 | //======================================================= 88 | //Service provided by Telerik (www.telerik.com) 89 | //Conversion powered by NRefactory. 90 | //Twitter: @telerik 91 | //Facebook: facebook.com/telerik 92 | //======================================================= 93 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Angle3d.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | /// 12 | /// An Angle3d stores three 3d points, considering the angle is on the second one. 13 | /// An instance may return angle(), cos() and sin() 14 | /// 15 | public class Angle3d 16 | { 17 | 18 | #region "Members" 19 | private double x1; 20 | private double x2; 21 | private double x3; 22 | private double y1; 23 | private double y2; 24 | private double y3; 25 | private double z1; 26 | private double z2; 27 | #endregion 28 | private double z3; 29 | 30 | #region "Constructors" 31 | 32 | public Angle3d(double x1, double x2, double x3, double y1, double y2, double y3, double z1, double z2, double z3) 33 | { 34 | this.x1 = x1; 35 | this.x2 = x2; 36 | this.x3 = x3; 37 | this.y1 = y1; 38 | this.y2 = y2; 39 | this.y3 = y3; 40 | this.z1 = z1; 41 | this.z2 = z2; 42 | this.z3 = z3; 43 | } 44 | 45 | /// 46 | /// Create an angle, described by three coordinates. 47 | /// The angle is supposed to be on p2 48 | /// 49 | public Angle3d(Coord3d p1, Coord3d p2, Coord3d p3) : this(p1.x, p2.x, p3.x, p1.y, p2.y, p3.y, p1.z, p2.z, p3.z) 50 | { 51 | } 52 | 53 | #endregion 54 | 55 | #region "Functions" 56 | 57 | /// 58 | /// Computes the sinus of the angle 59 | /// 60 | public double sin() 61 | { 62 | Coord3d c2 = new Coord3d(x2, y2, z2); 63 | Vector3d v1 = new Vector3d(x1, y1, z1, x2, y2, z2); 64 | Vector3d v3 = new Vector3d(x3, y3, z3, x2, y2, z2); 65 | Coord3d c4 = v1.cross(v3).@add(c2); 66 | Vector3d v4 = new Vector3d(c4, c2); 67 | return (c4.z >= 0 ? 1 : -1) * v4.norm() / (v1.norm() * v3.norm()); 68 | } 69 | 70 | /// 71 | /// Computes the cosinus of the angle 72 | /// 73 | public double cos() 74 | { 75 | Vector3d v1 = new Vector3d(x1, y1, z1, x2, y2, z2); 76 | Vector3d v3 = new Vector3d(x3, y3, z3, x2, y2, z2); 77 | return v1.dot(v3) / (v1.norm() * v3.norm()); 78 | } 79 | 80 | /// 81 | /// Computes an angle between 0 and 2*PI 82 | /// 83 | public double angle() 84 | { 85 | // between 0 and PI: Math.acos(cos()); 86 | if ((sin() > 0)) { 87 | return Math.Acos(cos()); 88 | } else { 89 | return Math.PI * 2 - Math.Acos(cos()); 90 | } 91 | } 92 | 93 | #endregion 94 | } 95 | } 96 | 97 | //======================================================= 98 | //Service provided by Telerik (www.telerik.com) 99 | //Conversion powered by NRefactory. 100 | //Twitter: @telerik 101 | //Facebook: facebook.com/telerik 102 | //======================================================= 103 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Coordinates.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | /// 12 | /// A simple utility class for storing a list of x, y, and z coordinates as 13 | /// arrays of float values. 14 | /// 15 | /// 16 | public class Coordinates 17 | { 18 | 19 | private float[] m_x; 20 | private float[] m_y; 21 | 22 | private float[] m_z; 23 | public Coordinates(float[] xi, float[] yi, float[] zi) 24 | { 25 | this.m_x = xi; 26 | this.m_y = yi; 27 | this.m_z = zi; 28 | } 29 | 30 | public Coordinates(Coord3d[] coords) 31 | { 32 | int nbCoords = coords.Length; 33 | m_x = new float[nbCoords]; 34 | m_y = new float[nbCoords]; 35 | m_z = new float[nbCoords]; 36 | for (int iCoord = 0; iCoord <= nbCoords - 1; iCoord++) { 37 | m_x[iCoord] = (float)coords[iCoord].x; 38 | m_y[iCoord] = (float)coords[iCoord].y; 39 | m_z[iCoord] = (float)coords[iCoord].z; 40 | } 41 | } 42 | 43 | public Coordinates(List coords) 44 | { 45 | int nbCoords = coords.Count; 46 | m_x = new float[nbCoords]; 47 | m_y = new float[nbCoords]; 48 | m_z = new float[nbCoords]; 49 | for (int iCoord = 0; iCoord <= nbCoords - 1; iCoord++) { 50 | m_x[iCoord] = (float)coords[iCoord].x; 51 | m_y[iCoord] = (float)coords[iCoord].y; 52 | m_z[iCoord] = (float)coords[iCoord].z; 53 | } 54 | } 55 | 56 | public float[] x { 57 | get { return this.m_x; } 58 | } 59 | 60 | public float[] y { 61 | get { return this.m_y; } 62 | } 63 | 64 | public float[] z { 65 | get { return this.m_z; } 66 | } 67 | 68 | public Coord3d[] toArray() 69 | { 70 | Coord3d[] array = new Coord3d[m_x.Length]; 71 | for (int iCoord = 0; iCoord <= m_x.Length - 1; iCoord++) { 72 | array[iCoord] = new Coord3d(m_x[iCoord], m_y[iCoord], m_z[iCoord]); 73 | } 74 | return array; 75 | } 76 | 77 | public override string ToString() 78 | { 79 | string txt = ""; 80 | for (int iCoord = 0; iCoord <= m_x.Length - 1; iCoord++) 81 | { 82 | if (iCoord > 0) { 83 | txt += "\r\n"; 84 | } 85 | txt += "[" + iCoord + "]" + m_x[iCoord] + "|" + m_y[iCoord] + "|" + m_z[iCoord]; 86 | } 87 | return txt; 88 | } 89 | 90 | } 91 | 92 | } 93 | 94 | //======================================================= 95 | //Service provided by Telerik (www.telerik.com) 96 | //Conversion powered by NRefactory. 97 | //Twitter: @telerik 98 | //Facebook: facebook.com/telerik 99 | //======================================================= 100 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Graphs/DefaultGraph.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Linq; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | using System.Data; 8 | using System.Diagnostics; 9 | namespace nzy3D.Maths.Graphs 10 | { 11 | 12 | public class DefaultGraph : IGraph where E : class 13 | { 14 | 15 | internal List vertices = new List(); 16 | internal List edges = new List(); 17 | internal List> edgeStart = new List>(); 18 | internal List> edgeStop = new List>(); 19 | 20 | internal Random r = new Random(); 21 | public void addEdge(E edge, V v1, V v2) 22 | { 23 | edges.Add(edge); 24 | edgeStart.Add(new Tuple(edge, v1)); 25 | edgeStop.Add(new Tuple(edge, v2)); 26 | } 27 | 28 | public void addVertex(V vertex) 29 | { 30 | vertices.Add(vertex); 31 | } 32 | 33 | public System.Collections.Generic.List getEdges() 34 | { 35 | return edges; 36 | } 37 | 38 | public V getEdgeStartVertex(E e) 39 | { 40 | return edgeStart.Where(p => p.Item1 == e).Single().Item2; 41 | } 42 | 43 | public V getEdgeStopVertex(E e) 44 | { 45 | return edgeStop.Where(p => p.Item1 == e).Single().Item2; 46 | } 47 | 48 | public V getRandomVertex() 49 | { 50 | return getVertex(r.Next(0, vertices.Count - 1)); 51 | } 52 | 53 | public V getVertex(int i) 54 | { 55 | return vertices[i]; 56 | } 57 | 58 | public System.Collections.Generic.List getVertices() 59 | { 60 | return vertices; 61 | } 62 | 63 | } 64 | 65 | } 66 | 67 | //======================================================= 68 | //Service provided by Telerik (www.telerik.com) 69 | //Conversion powered by NRefactory. 70 | //Twitter: @telerik 71 | //Facebook: facebook.com/telerik 72 | //======================================================= 73 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Graphs/IGraph.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths.Graphs 9 | { 10 | 11 | public interface IGraph 12 | { 13 | void addVertex(V vertex); 14 | void addEdge(E edge, V v1, V v2); 15 | V getVertex(int i); 16 | V getRandomVertex(); 17 | List getVertices(); 18 | List getEdges(); 19 | V getEdgeStartVertex(E e); 20 | V getEdgeStopVertex(E e); 21 | } 22 | 23 | } 24 | 25 | //======================================================= 26 | //Service provided by Telerik (www.telerik.com) 27 | //Conversion powered by NRefactory. 28 | //Twitter: @telerik 29 | //Facebook: facebook.com/telerik 30 | //======================================================= 31 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Graphs/StringGraphGenerator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | //using nzy3D.Plot3D.Primitives.Graphs.Layout; 9 | 10 | namespace nzy3D.Maths.Graphs 11 | { 12 | 13 | public class StringGraphGenerator 14 | { 15 | 16 | public static IGraph getGraph(int nodes, int edges) 17 | { 18 | DefaultGraph graph = new DefaultGraph(); 19 | for (int i = 0; i <= nodes - 1; i++) { 20 | graph.addVertex("vertex " + i); 21 | } 22 | for (int i = 0; i <= edges - 1; i++) { 23 | string v1 = graph.getRandomVertex(); 24 | string v2 = graph.getRandomVertex(); 25 | graph.addEdge("edge " + v1 + v2, v1, v2); 26 | } 27 | return graph; 28 | } 29 | 30 | /* 31 | public static DefaultGraphLayout2d getRandomLayout(IGraph graph, double size) 32 | { 33 | DefaultGraphLayout2d layout = new DefaultGraphLayout2d(); 34 | Random rng = new Random(); 35 | foreach (string v in graph.getVertices()) { 36 | double x = rng.NextDouble() * size - size / 2; 37 | double y = rng.NextDouble() * size - size / 2; 38 | layout.values().Add( .VertexPosition[v] = new Coord2d(x, y); 39 | } 40 | return layout; 41 | } 42 | */ 43 | 44 | } 45 | 46 | 47 | } 48 | 49 | //======================================================= 50 | //Service provided by Telerik (www.telerik.com) 51 | //Conversion powered by NRefactory. 52 | //Twitter: @telerik 53 | //Facebook: facebook.com/telerik 54 | //======================================================= 55 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Grid.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | public class Grid 12 | { 13 | 14 | private double[] m_x; 15 | private double[] m_y; 16 | 17 | private double[,] m_z; 18 | 19 | public Grid() 20 | { 21 | } 22 | 23 | public Grid(double[] x, double[] y, double[,] z) 24 | { 25 | this.SetData(x, y, z); 26 | } 27 | 28 | public Grid(int[] x, int[] y, int[,] z) 29 | { 30 | this.SetData(x, y, z); 31 | } 32 | 33 | public void SetData(double[] x, double[] y, double[,] z) 34 | { 35 | m_x = x; 36 | m_y = y; 37 | m_z = z; 38 | } 39 | 40 | public void SetData(int[] x, int[] y, int[,] z) 41 | { 42 | this.SetData(toDoubleArray(x), toDoubleArray(y), toDoubleArray(z)); 43 | } 44 | 45 | public double[] x { 46 | get { return m_x; } 47 | } 48 | 49 | public double[] y { 50 | get { return m_y; } 51 | } 52 | 53 | public double[,] z { 54 | get { return m_z; } 55 | } 56 | 57 | /// 58 | /// Computed and returns the bound of datas in the grid (x,y,z) 59 | /// 60 | /// 61 | /// BoundingBox is recomputed each time the function is called, in contrary to nzy3D where it is kept in a dangerous cache. 62 | public BoundingBox3d getBounds() 63 | { 64 | return new BoundingBox3d(Statistics.Min(x), Statistics.Max(x), Statistics.Min(y), Statistics.Max(y), Statistics.Min(z), Statistics.Max(z)); 65 | } 66 | 67 | internal double[] toDoubleArray(int[] input) 68 | { 69 | double[] @out = new double[input.Length]; 70 | for (int i = 0; i <= input.Length - 1; i++) { 71 | @out[i] = input[i]; 72 | } 73 | return @out; 74 | } 75 | 76 | internal double[,] toDoubleArray(int[,] input) 77 | { 78 | double[,] @out = new double[input.GetLength(0), input.GetLength(1)]; 79 | for (int i = 0; i <= input.GetLength(0) - 1; i++) 80 | { 81 | for (int j = 0; j <= input.GetLength(1) - 1; j++) 82 | { 83 | @out[i, j] = input[i, j]; 84 | } 85 | } 86 | return @out; 87 | } 88 | 89 | } 90 | 91 | } 92 | 93 | //======================================================= 94 | //Service provided by Telerik (www.telerik.com) 95 | //Conversion powered by NRefactory. 96 | //Twitter: @telerik 97 | //Facebook: facebook.com/telerik 98 | //======================================================= 99 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/IntegerCoord2d.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | public class IntegerCoord2d 12 | { 13 | public int x; 14 | 15 | public int y; 16 | public IntegerCoord2d() 17 | { 18 | x = 0; 19 | y = 0; 20 | } 21 | 22 | public IntegerCoord2d(int xx, int yy) 23 | { 24 | x = xx; 25 | y = yy; 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return ("(IntegerCoord2d) x=" + x + " y=" + y); 31 | } 32 | 33 | } 34 | 35 | } 36 | 37 | //======================================================= 38 | //Service provided by Telerik (www.telerik.com) 39 | //Conversion powered by NRefactory. 40 | //Twitter: @telerik 41 | //Facebook: facebook.com/telerik 42 | //======================================================= 43 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Normal.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | public class Normal 12 | { 13 | public static Coord3d compute(Coord3d p0, Coord3d p1, Coord3d p2) 14 | { 15 | Vector3d v1 = new Vector3d(p0, p1); 16 | Vector3d v2 = new Vector3d(p1, p2); 17 | Coord3d norm = v1.cross(v2); 18 | double d = norm.distance(Coord3d.ORIGIN); 19 | return norm.divide(d); 20 | } 21 | } 22 | 23 | } 24 | 25 | //======================================================= 26 | //Service provided by Telerik (www.telerik.com) 27 | //Conversion powered by NRefactory. 28 | //Twitter: @telerik 29 | //Facebook: facebook.com/telerik 30 | //======================================================= 31 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Pair.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using System.Runtime.Serialization; 9 | 10 | namespace nzy3D.Maths 11 | { 12 | 13 | public class Pair 14 | { 15 | //Implements ISerializable 16 | 17 | 18 | public X a; 19 | 20 | public Y b; 21 | 22 | public Pair(X aa, Y bb) 23 | { 24 | a = aa; 25 | b = bb; 26 | } 27 | 28 | //Public Function hashCode() As Integer 29 | // Dim prime As Integer = 31 30 | // Dim result As Integer = 1 31 | // result = primer * result 32 | //End Function 33 | 34 | } 35 | 36 | } 37 | 38 | //======================================================= 39 | //Service provided by Telerik (www.telerik.com) 40 | //Conversion powered by NRefactory. 41 | //Twitter: @telerik 42 | //Facebook: facebook.com/telerik 43 | //======================================================= 44 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/PlaneAxis.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | public enum PlaneAxis 11 | { 12 | X, 13 | Y, 14 | Z 15 | } 16 | } 17 | 18 | 19 | //======================================================= 20 | //Service provided by Telerik (www.telerik.com) 21 | //Conversion powered by NRefactory. 22 | //Twitter: @telerik 23 | //Facebook: facebook.com/telerik 24 | //======================================================= 25 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/PolygonArray.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | public class PolygonArray 12 | { 13 | internal double[] _x; 14 | internal double[] _y; 15 | 16 | internal double[] _z; 17 | public PolygonArray(double[] x, double[] y, double[] z) 18 | { 19 | _x = x; 20 | _y = y; 21 | _z = z; 22 | } 23 | 24 | public int Length { 25 | get { return _x.Length; } 26 | } 27 | 28 | public Coord3d Barycentre { 29 | get { return new Coord3d(Statistics.Mean(_x), Statistics.Mean(_y), Statistics.Mean(_z)); } 30 | } 31 | 32 | public double[] X { 33 | get { return _x; } 34 | } 35 | 36 | public double[] Y { 37 | get { return _y; } 38 | } 39 | 40 | public double[] Z { 41 | get { return _z; } 42 | } 43 | 44 | } 45 | 46 | } 47 | 48 | //======================================================= 49 | //Service provided by Telerik (www.telerik.com) 50 | //Conversion powered by NRefactory. 51 | //Twitter: @telerik 52 | //Facebook: facebook.com/telerik 53 | //======================================================= 54 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Range.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | public class Range : Scale 12 | { 13 | 14 | public Range(double min, double max) : base(min, max) 15 | { 16 | } 17 | 18 | public new void Enlarge(double ratio) 19 | { 20 | double offset = (Max - Min) * ratio; 21 | if (offset == 0) { 22 | offset = 1; 23 | } 24 | Min -= offset; 25 | Max += offset; 26 | } 27 | 28 | public new Range CreateEnlarge(double ratio) 29 | { 30 | double offset = (Max - Min) * ratio; 31 | if (offset == 0) { 32 | offset = 1; 33 | } 34 | return new Range(Min - offset, Max + offset); 35 | } 36 | 37 | } 38 | 39 | } 40 | 41 | //======================================================= 42 | //Service provided by Telerik (www.telerik.com) 43 | //Conversion powered by NRefactory. 44 | //Twitter: @telerik 45 | //Facebook: facebook.com/telerik 46 | //======================================================= 47 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Scale.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | 12 | public class Scale 13 | { 14 | 15 | private double m_min; 16 | 17 | private double m_max; 18 | public Scale(double min, double max) 19 | { 20 | m_min = min; 21 | m_max = max; 22 | } 23 | 24 | public double Min { 25 | get { return m_min; } 26 | set { m_min = value; } 27 | } 28 | 29 | public double Max { 30 | get { return m_max; } 31 | set { m_max = value; } 32 | } 33 | 34 | public double Range { 35 | get { return Max - Min; } 36 | } 37 | 38 | /// 39 | /// Add a value to min and max values of the scale 40 | /// 41 | /// Value to add 42 | /// New scale with added value to min & max 43 | /// Current object is not modified 44 | public Scale @add(double value) 45 | { 46 | return new Scale(Min + value, Max + value); 47 | } 48 | 49 | 50 | /// 51 | /// Return True if value is inside [Min;Max] 52 | /// 53 | public bool Contains(double value) 54 | { 55 | return (Min <= value & value <= Max); 56 | } 57 | 58 | public bool isMaxNan() 59 | { 60 | return double.IsNaN(Max); 61 | } 62 | 63 | public bool isMinNan() 64 | { 65 | return double.IsNaN(Min); 66 | } 67 | 68 | /// 69 | /// Returns True if Min <= Max 70 | /// 71 | public bool valid() 72 | { 73 | return Min <= Max; 74 | } 75 | 76 | public static Scale Widest(Scale scale1, Scale scale2) 77 | { 78 | return new Scale(Math.Min(scale1.Min, scale2.Min), Math.Max(scale1.Max, scale2.Max)); 79 | } 80 | 81 | public static Scale Thinest(Scale scale1, Scale scale2) 82 | { 83 | return new Scale(Math.Max(scale1.Min, scale2.Min), Math.Min(scale1.Max, scale2.Max)); 84 | } 85 | 86 | public static Scale Enlarge(Scale scale, double ratio) 87 | { 88 | double offset = (scale.Max - scale.Min) * ratio; 89 | if (offset == 0) { 90 | offset = 1; 91 | } 92 | return new Scale(scale.Min - offset, scale.Max + offset); 93 | } 94 | 95 | public override string ToString() 96 | { 97 | return ("min=" + Min + " max=" + Max); 98 | } 99 | 100 | } 101 | 102 | } 103 | 104 | //======================================================= 105 | //Service provided by Telerik (www.telerik.com) 106 | //Conversion powered by NRefactory. 107 | //Twitter: @telerik 108 | //Facebook: facebook.com/telerik 109 | //======================================================= 110 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/TicToc.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | public class TicToc 11 | { 12 | internal System.DateTime tstart; 13 | 14 | internal System.DateTime tstop; 15 | public void tic() 16 | { 17 | tstart = System.DateTime.Now; 18 | } 19 | 20 | public double toc() 21 | { 22 | tstop = System.DateTime.Now; 23 | return elapsedSecond; 24 | } 25 | 26 | public TimeSpan elapsedTimeSpan { 27 | get { return tstop - tstart; } 28 | } 29 | 30 | public double elapsedMillisecond { 31 | get { return this.elapsedTimeSpan.TotalMilliseconds; } 32 | } 33 | 34 | public double elapsedSecond { 35 | get { return this.elapsedTimeSpan.TotalSeconds; } 36 | } 37 | 38 | } 39 | } 40 | 41 | //======================================================= 42 | //Service provided by Telerik (www.telerik.com) 43 | //Conversion powered by NRefactory. 44 | //Twitter: @telerik 45 | //Facebook: facebook.com/telerik 46 | //======================================================= 47 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Vector2d.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | /// 12 | /// Storage for a 2 dimensional vector defined by two points. 13 | /// Provide the vector function that returns the vector 14 | /// as a Coord3d, as well as dot product and norm. 15 | /// 16 | public class Vector2d 17 | { 18 | 19 | #region "Members" 20 | private double x1; 21 | private double x2; 22 | private double y1; 23 | #endregion 24 | private double y2; 25 | 26 | 27 | #region "Constructors" 28 | 29 | public Vector2d(double x1, double x2, double y1, double y2) 30 | { 31 | this.x1 = x1; 32 | this.x2 = x2; 33 | this.y1 = y1; 34 | this.y2 = y2; 35 | } 36 | 37 | public Vector2d(Coord2d p1, Coord2d p2) : this(p1.x, p2.x, p1.y, p2.y) 38 | { 39 | } 40 | 41 | #endregion 42 | 43 | #region "Functions" 44 | 45 | /// 46 | /// Return the vector (sizes) induced by this set of coordinates 47 | /// 48 | public Coord2d vector() 49 | { 50 | return new Coord2d(x2 - x1, y2 - y1); 51 | } 52 | 53 | /// 54 | /// Compute the dot product between the current and given vector 55 | /// 56 | public double dot(Vector2d v) 57 | { 58 | Coord2d v1 = this.vector(); 59 | Coord2d v2 = v.vector(); 60 | return v1.x * v2.x + v1.y * v2.y; 61 | } 62 | 63 | public double norm() 64 | { 65 | return Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2)); 66 | } 67 | #endregion 68 | 69 | } 70 | } 71 | 72 | 73 | //======================================================= 74 | //Service provided by Telerik (www.telerik.com) 75 | //Conversion powered by NRefactory. 76 | //Twitter: @telerik 77 | //Facebook: facebook.com/telerik 78 | //======================================================= 79 | -------------------------------------------------------------------------------- /nzy3d-api/Maths/Vector3d.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Maths 9 | { 10 | 11 | /// 12 | /// Storage for a 3 dimensional vector defined by two points. 13 | /// Provide the vector function that returns the vector 14 | /// as a Coord3d, as well as dot product and norm. 15 | /// 16 | public class Vector3d 17 | { 18 | 19 | private double m_x1; 20 | private double m_x2; 21 | private double m_y1; 22 | private double m_y2; 23 | private double m_z1; 24 | 25 | private double m_z2; 26 | public Vector3d(double x1, double x2, double y1, double y2, double z1, double z2) 27 | { 28 | m_x1 = x1; 29 | m_x2 = x2; 30 | m_y1 = y1; 31 | m_y2 = y2; 32 | m_z1 = z1; 33 | m_z2 = z2; 34 | } 35 | 36 | public Vector3d(Coord3d p1, Coord3d p2) : this(p1.x, p2.x, p1.y, p2.y, p1.z, p2.z) 37 | { 38 | } 39 | 40 | /// 41 | /// Return the vector induced by this set of coordinates 42 | /// 43 | public Coord3d vector { 44 | get { return new Coord3d(m_x2 - m_x1, m_y2 - m_y1, m_z2 - m_z1); } 45 | } 46 | 47 | /// 48 | /// Compute the dot product between and current and given vector. 49 | /// 50 | /// Remind that the dot product is 0 if vectors are perpendicular 51 | public double dot(Vector3d v) 52 | { 53 | return this.vector.dot(v.vector); 54 | } 55 | 56 | /// 57 | /// Computes the vectorial product of the current and the given vector. 58 | /// The result is a vector defined as a Coord3d, that is perpendicular to 59 | /// the plan induced by current vector and vector V. 60 | /// 61 | public Coord3d cross(Vector3d v) 62 | { 63 | Coord3d v1 = this.vector; 64 | Coord3d v2 = v.vector; 65 | Coord3d v3 = new Coord3d(); 66 | v3.x = v1.y * v2.z - v1.z * v2.y; 67 | v3.y = v1.z * v2.x - v1.x * v2.z; 68 | v3.z = v1.x * v2.y - v1.y * v2.x; 69 | return v3; 70 | } 71 | 72 | /// 73 | /// Compute the norm of this vector. 74 | /// 75 | public double norm() 76 | { 77 | return Math.Sqrt(this.vector.magSquared()); 78 | } 79 | 80 | /// 81 | /// Compute the distance between two coordinates. 82 | /// 83 | public double distance(Coord3d c) 84 | { 85 | return this.Center.distance(c); 86 | } 87 | 88 | public Coord3d Center { 89 | get { return new Coord3d((m_x1 + m_x2) / 2, (m_y1 + m_y2) / 2, (m_z1 + m_z2) / 2); } 90 | } 91 | 92 | } 93 | 94 | } 95 | 96 | //======================================================= 97 | //Service provided by Telerik (www.telerik.com) 98 | //Conversion powered by NRefactory. 99 | //Twitter: @telerik 100 | //Facebook: facebook.com/telerik 101 | //======================================================= 102 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Concrete/BufferedImageMapper.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using System.Drawing; 9 | 10 | namespace nzy3D.Plot3D.Builder.Concrete 11 | { 12 | 13 | /// 14 | /// Mapper which reads height information from the grayscale 15 | /// values of a BufferedImage, normalized to range [0..1]. 16 | /// 17 | public class BufferedImageMapper : Mapper 18 | { 19 | 20 | private Bitmap image; 21 | private int maxRow; 22 | 23 | private Rectangle maxViewPort; 24 | public BufferedImageMapper(Bitmap bi) 25 | { 26 | this.image = bi; 27 | this.maxRow = this.image.Height - 1; 28 | this.maxViewPort = new Rectangle(0, 0, bi.Width, bi.Height); 29 | } 30 | 31 | public Rectangle ClippedViewport(Rectangle roi) 32 | { 33 | return Rectangle.Intersect(this.maxViewPort, roi); 34 | } 35 | 36 | public override double f(double x, double y) 37 | { 38 | if (x == double.NaN | y == double.NaN) { 39 | return double.NaN; 40 | } 41 | Color rgbColor = image.GetPixel(Convert.ToInt32(x), maxRow - Convert.ToInt32(y)); 42 | return (rgbColor.R / 255 * 0.3) + (rgbColor.G / 255 * 0.59) + (rgbColor.B / 255 * 0.11); 43 | } 44 | } 45 | 46 | } 47 | 48 | //======================================================= 49 | //Service provided by Telerik (www.telerik.com) 50 | //Conversion powered by NRefactory. 51 | //Twitter: @telerik 52 | //Facebook: facebook.com/telerik 53 | //======================================================= 54 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Concrete/CustomGrid.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Builder.Concrete 11 | { 12 | public class CustomGrid : Grid 13 | { 14 | 15 | 16 | internal double[,] coordinates; 17 | public CustomGrid(double[,] coordinates) : base(null, 0) 18 | { 19 | if (coordinates.GetLength(1) != 2) { 20 | throw new ArgumentException("Input coordinates array must be have a length of 2 in second dimension. Current array second dimension has a lenght of " + coordinates.GetLength(1), "coordinates"); 21 | } 22 | this.coordinates = coordinates; 23 | } 24 | 25 | public override System.Collections.Generic.List Apply(Mapper mapper) 26 | { 27 | List output = new List(); 28 | for (int i = 0; i <= coordinates.Length - 1; i++) { 29 | output.Add(new Coord3d(coordinates[i, 0], coordinates[i, 1], mapper.f(coordinates[i, 0], coordinates[i, 1]))); 30 | } 31 | return output; 32 | } 33 | 34 | } 35 | } 36 | 37 | //======================================================= 38 | //Service provided by Telerik (www.telerik.com) 39 | //Conversion powered by NRefactory. 40 | //Twitter: @telerik 41 | //Facebook: facebook.com/telerik 42 | //======================================================= 43 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Concrete/OrthonormalGrid.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Builder.Concrete 11 | { 12 | public class OrthonormalGrid : Grid 13 | { 14 | 15 | public OrthonormalGrid(Range xrange, int xsteps, Range yrange, int ysteps) : base(xrange, xsteps, yrange, ysteps) 16 | { 17 | } 18 | 19 | public OrthonormalGrid(Range xyrange, int xysteps) : base(xyrange, xysteps) 20 | { 21 | } 22 | 23 | public override System.Collections.Generic.List Apply(Mapper mapper) 24 | { 25 | double xstep = xrange.Range / (xsteps - 1); 26 | double ystep = yrange.Range / (ysteps - 1); 27 | List output = new List(); 28 | for (int xi = 0; xi <= xsteps - 1; xi++) { 29 | for (int yi = 0; yi <= ysteps - 1; yi++) { 30 | double x = 0; 31 | double y = 0; 32 | x = xrange.Min + xi * xstep; 33 | y = yrange.Min + yi * ystep; 34 | output.Add(new Coord3d(x, y, mapper.f(x, y))); 35 | } 36 | } 37 | return output; 38 | } 39 | 40 | } 41 | } 42 | 43 | //======================================================= 44 | //Service provided by Telerik (www.telerik.com) 45 | //Conversion powered by NRefactory. 46 | //Twitter: @telerik 47 | //Facebook: facebook.com/telerik 48 | //======================================================= 49 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Concrete/RingGrid.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Builder.Concrete 11 | { 12 | 13 | public class RingGrid : Grid 14 | { 15 | 16 | 17 | internal double sqradius; 18 | public RingGrid(double radius, int xysteps, int enlargeSteps) : base(new Range(-radius - (enlargeSteps * radius / xysteps), radius + (enlargeSteps * radius / xysteps)), xysteps) 19 | { 20 | sqradius = (radius + (enlargeSteps * radius / xysteps)) * (radius + (enlargeSteps * radius / xysteps)); 21 | } 22 | 23 | public RingGrid(double radius, int xysteps) : this(radius, xysteps, 0) 24 | { 25 | } 26 | 27 | public override System.Collections.Generic.List Apply(Mapper mapper) 28 | { 29 | double xstep = xrange.Range / xsteps; 30 | double ystep = yrange.Range / ysteps; 31 | List output = new List(); 32 | for (int xi = -(xsteps - 1) / 2; xi <= (xsteps - 1) / 2; xi++) { 33 | for (int yi = -(ysteps - 1) / 2; yi <= (ysteps - 1) / 2; yi++) { 34 | double x = 0; 35 | double y = 0; 36 | x = xi * xstep; 37 | y = yi * ystep; 38 | if (sqradius > x * x + y * y) { 39 | output.Add(new Coord3d(x, y, mapper.f(x, y))); 40 | } 41 | } 42 | } 43 | return output; 44 | } 45 | 46 | } 47 | 48 | } 49 | 50 | //======================================================= 51 | //Service provided by Telerik (www.telerik.com) 52 | //Conversion powered by NRefactory. 53 | //Twitter: @telerik 54 | //Facebook: facebook.com/telerik 55 | //======================================================= 56 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Concrete/SphereScatterGenerator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Builder.Concrete 11 | { 12 | 13 | public class SphereScatterGenerator 14 | { 15 | 16 | public static object Generate(Coord3d center, double radius, int steps, bool half) 17 | { 18 | List coords = new List(); 19 | double inc = Math.PI / steps; 20 | double i = 0; 21 | int jrat = (half ? 1 : 2); 22 | while (i < (2 * Math.PI)) { 23 | double j = 0; 24 | while (j < (jrat * Math.PI)) { 25 | Coord3d c = (new Coord3d(i, j, radius)).cartesian(); 26 | if ((center != null)) { 27 | c.x += center.x; 28 | c.y += center.y; 29 | c.z += center.z; 30 | } 31 | coords.Add(c); 32 | j += inc; 33 | } 34 | i += inc; 35 | } 36 | return coords; 37 | } 38 | 39 | public static object Generate(Coord3d center, double radius, int steps) 40 | { 41 | return Generate(center, radius, steps, false); 42 | } 43 | 44 | public static object Generate(double radius, int steps) 45 | { 46 | return Generate(null, radius, steps, false); 47 | } 48 | 49 | } 50 | 51 | } 52 | 53 | //======================================================= 54 | //Service provided by Telerik (www.telerik.com) 55 | //Conversion powered by NRefactory. 56 | //Twitter: @telerik 57 | //Facebook: facebook.com/telerik 58 | //======================================================= 59 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Delaunay/DelaunayCoordinateValidator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Builder.Delaunay 11 | { 12 | 13 | public class DelaunayCoordinateValidator : ICoordinateValidator 14 | { 15 | 16 | private float[] _x; 17 | private float[] _y; 18 | 19 | private float[,] _z_as_fxy; 20 | public DelaunayCoordinateValidator(Coordinates coords) 21 | { 22 | if (coords == null) { 23 | throw new ArgumentException("Function call with illegal value 'Nothing' for parameter coords.", "coords"); 24 | } 25 | if (coords.x == null) { 26 | throw new ArgumentException("Illegal result value 'Nothing' on x property of parameter coords.", "coords"); 27 | } 28 | if (coords.y == null) { 29 | throw new ArgumentException("Illegal result value 'Nothing' on y property of parameter coords.", "coords"); 30 | } 31 | if (coords.z == null) { 32 | throw new ArgumentException("Illegal result value 'Nothing' on z property of parameter coords.", "coords"); 33 | } 34 | if (coords.x.Length != coords.y.Length) { 35 | throw new ArgumentException("Parameter coords has different x size (" + coords.x.Length + ") than y size (" + coords.y.Length + ")", "coords"); 36 | } 37 | if (coords.x.Length != coords.z.Length) { 38 | throw new ArgumentException("Parameter coords has different x size (" + coords.x.Length + ") than z size (" + coords.z.Length + ")", "coords"); 39 | } 40 | _x = coords.x; 41 | _y = coords.y; 42 | _z_as_fxy = setData(coords.z); 43 | } 44 | 45 | internal float[,] setData(float[] z) 46 | { 47 | int length = z.Length; 48 | float[,] z_as_fxy = new float[length, length]; 49 | for (int p = 0; p <= length - 1; p++) { 50 | z_as_fxy[p, p] = z[p]; 51 | } 52 | return z_as_fxy; 53 | } 54 | 55 | public float[,] get_Z_as_fxy() 56 | { 57 | return _z_as_fxy; 58 | } 59 | 60 | public float[] getX() 61 | { 62 | return _x; 63 | } 64 | 65 | public float[] getY() 66 | { 67 | return _y; 68 | } 69 | } 70 | 71 | } 72 | 73 | //======================================================= 74 | //Service provided by Telerik (www.telerik.com) 75 | //Conversion powered by NRefactory. 76 | //Twitter: @telerik 77 | //Facebook: facebook.com/telerik 78 | //======================================================= 79 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Delaunay/DelaunayTessellator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using nzy3D.Plot3D.Builder; 10 | using nzy3D.Plot3D.Builder.Delaunay.Jdt; 11 | using nzy3D.Plot3D.Primitives; 12 | 13 | namespace nzy3D.Plot3D.Builder.Delaunay 14 | { 15 | 16 | public class DelaunayTessellator : Tessellator 17 | { 18 | 19 | public AbstractComposite build(List Coordinates) 20 | { 21 | return this.build(new Coordinates(Coordinates)); 22 | } 23 | 24 | public AbstractComposite build(Coordinates coord) 25 | { 26 | ICoordinateValidator cv = new DelaunayCoordinateValidator(coord); 27 | Delaunay_Triangulation dt = new Delaunay_Triangulation(); 28 | DelaunayTriangulationManager tesselator = new DelaunayTriangulationManager(cv, dt); 29 | return (Shape)tesselator.buildDrawable(); 30 | } 31 | 32 | public override Primitives.AbstractComposite build(float[] x, float[] y, float[] z) 33 | { 34 | return this.build(new Coordinates(x, y, z)); 35 | } 36 | 37 | } 38 | 39 | } 40 | 41 | //======================================================= 42 | //Service provided by Telerik (www.telerik.com) 43 | //Conversion powered by NRefactory. 44 | //Twitter: @telerik 45 | //Facebook: facebook.com/telerik 46 | //======================================================= 47 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Delaunay/DelaunayTriangulationManager.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using nzy3D.Plot3D.Builder.Delaunay.Jdt; 10 | using nzy3D.Plot3D.Primitives; 11 | 12 | namespace nzy3D.Plot3D.Builder.Delaunay 13 | { 14 | 15 | public class DelaunayTriangulationManager 16 | { 17 | 18 | protected float[] _x; 19 | protected float[] _y; 20 | protected float[,] _z_as_fxy; 21 | 22 | protected ITriangulation _triangulator; 23 | public DelaunayTriangulationManager(ICoordinateValidator cv, ITriangulation triangulator) 24 | { 25 | _triangulator = triangulator; 26 | this.x = cv.getX(); 27 | this.y = cv.getY(); 28 | this.z_as_fxy = cv.get_Z_as_fxy(); 29 | } 30 | 31 | public AbstractDrawable buildDrawable() 32 | { 33 | Shape s = new Shape(); 34 | s.Add(getFacets()); 35 | return s; 36 | } 37 | 38 | // TODO: three different point classes coord3d, point_dt !! 39 | private List getFacets() 40 | { 41 | int xlen = _x.Length; 42 | for (int i = 0; i <= xlen - 1; i++) { 43 | Point_dt point_dt = new Point_dt(x[i], y[i], z_as_fxy[i, i]); 44 | _triangulator.insertPoint(point_dt); 45 | } 46 | List polygons = new List(); 47 | IEnumerator trianglesIter = _triangulator.trianglesIterator(); 48 | while ((trianglesIter.MoveNext())) { 49 | Triangle_dt triangle = trianglesIter.Current; 50 | // isHalfplane means a degenerated triangle 51 | if ((triangle.isHalfplane)) { 52 | continue; 53 | } 54 | Polygon newPolygon = buildPolygonFrom(triangle); 55 | polygons.Add(newPolygon); 56 | } 57 | return polygons; 58 | } 59 | 60 | private Polygon buildPolygonFrom(Triangle_dt triangle) 61 | { 62 | Coord3d c1 = triangle.p1.Coord3d; 63 | Coord3d c2 = triangle.p2.Coord3d; 64 | Coord3d c3 = triangle.p3.Coord3d; 65 | Polygon polygon = new Polygon(); 66 | polygon.Add(new Point(c1)); 67 | polygon.Add(new Point(c2)); 68 | polygon.Add(new Point(c3)); 69 | return polygon; 70 | } 71 | 72 | public float[] x { 73 | get { return _x; } 74 | set { _x = value; } 75 | } 76 | 77 | public float[] y { 78 | get { return _y; } 79 | set { _y = value; } 80 | } 81 | 82 | public float[,] z_as_fxy { 83 | get { return _z_as_fxy; } 84 | set { _z_as_fxy = value; } 85 | } 86 | 87 | } 88 | 89 | } 90 | 91 | //======================================================= 92 | //Service provided by Telerik (www.telerik.com) 93 | //Conversion powered by NRefactory. 94 | //Twitter: @telerik 95 | //Facebook: facebook.com/telerik 96 | //======================================================= 97 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Delaunay/ICoordinateValidator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Builder.Delaunay 9 | { 10 | 11 | public interface ICoordinateValidator 12 | { 13 | float[] getX(); 14 | float[] getY(); 15 | float[,] get_Z_as_fxy(); 16 | } 17 | 18 | } 19 | 20 | //======================================================= 21 | //Service provided by Telerik (www.telerik.com) 22 | //Conversion powered by NRefactory. 23 | //Twitter: @telerik 24 | //Facebook: facebook.com/telerik 25 | //======================================================= 26 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Delaunay/ITriangulation.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Builder.Delaunay.Jdt; 9 | 10 | namespace nzy3D.Plot3D.Builder.Delaunay 11 | { 12 | 13 | public interface ITriangulation 14 | { 15 | void insertPoint(Point_dt p); 16 | IEnumerator trianglesIterator(); 17 | IEnumerator verticesIterator(); 18 | int trianglesSize(); 19 | } 20 | 21 | } 22 | 23 | //======================================================= 24 | //Service provided by Telerik (www.telerik.com) 25 | //Conversion powered by NRefactory. 26 | //Twitter: @telerik 27 | //Facebook: facebook.com/telerik 28 | //======================================================= 29 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Delaunay/Jdt/Circle_dt.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Builder.Delaunay.Jdt 9 | { 10 | 11 | /// 12 | /// This class represents a 3D simple circle used by the Delaunay Triangulation class 13 | /// 14 | public class Circle_dt 15 | { 16 | private Point_dt m_c; 17 | 18 | private double m_r; 19 | /// 20 | /// Constructs a new Circle_dt. 21 | /// 22 | /// Center of the circle. 23 | /// Radius of the circle. 24 | /// 25 | public Circle_dt(Point_dt c, double r) 26 | { 27 | m_c = c; 28 | m_r = r; 29 | } 30 | 31 | /// 32 | /// Copy Constructor. Creates a new Circle with same properties of 33 | /// 34 | /// Circle to clone. 35 | /// 36 | public Circle_dt(Circle_dt circle) : this(circle.Center, circle.Radius) 37 | { 38 | } 39 | 40 | /// 41 | /// Gets the center of the circle. 42 | /// 43 | /// The center of the circle. 44 | public Point_dt Center { 45 | get { return m_c; } 46 | } 47 | 48 | /// 49 | /// Gets the radius of the circle. 50 | /// 51 | /// The radius of the circle. 52 | public double Radius { 53 | get { return m_r; } 54 | } 55 | 56 | } 57 | 58 | } 59 | 60 | //======================================================= 61 | //Service provided by Telerik (www.telerik.com) 62 | //Conversion powered by NRefactory. 63 | //Twitter: @telerik 64 | //Facebook: facebook.com/telerik 65 | //======================================================= 66 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Grid.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Builder 11 | { 12 | 13 | public abstract class Grid 14 | { 15 | 16 | protected internal Range xrange; 17 | protected internal Range yrange; 18 | protected internal int xsteps; 19 | 20 | protected internal int ysteps; 21 | public Grid(Range xrange, int xsteps, Range yrange, int ysteps) 22 | { 23 | this.xrange = xrange; 24 | this.yrange = yrange; 25 | this.xsteps = xsteps; 26 | this.ysteps = ysteps; 27 | } 28 | 29 | public Grid(Range xyrange, int xysteps) : this(xyrange, xysteps, xyrange, xysteps) 30 | { 31 | } 32 | 33 | public abstract List Apply(Mapper mapper); 34 | 35 | } 36 | 37 | } 38 | 39 | //======================================================= 40 | //Service provided by Telerik (www.telerik.com) 41 | //Conversion powered by NRefactory. 42 | //Twitter: @telerik 43 | //Facebook: facebook.com/telerik 44 | //======================================================= 45 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/IObjectTopology.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Builder 11 | { 12 | 13 | public interface IObjectTopology 14 | { 15 | Coord3d getCoord(O obj); 16 | string getXAxisLabel(); 17 | string getYAxisLabel(); 18 | string getZAxisLabel(); 19 | } 20 | 21 | } 22 | 23 | //======================================================= 24 | //Service provided by Telerik (www.telerik.com) 25 | //Conversion powered by NRefactory. 26 | //Twitter: @telerik 27 | //Facebook: facebook.com/telerik 28 | //======================================================= 29 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Builder/Tessellator.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using nzy3D.Plot3D.Primitives; 10 | 11 | namespace nzy3D.Plot3D.Builder 12 | { 13 | 14 | public abstract class Tessellator 15 | { 16 | 17 | 18 | public Tessellator() 19 | { 20 | } 21 | 22 | public AbstractComposite build(List coordinates) 23 | { 24 | Coordinates coords = new Coordinates(coordinates); 25 | return build(coords.x, coords.y, coords.z); 26 | } 27 | 28 | public abstract AbstractComposite build(float[] x, float[] y, float[] z); 29 | 30 | public AbstractComposite build(double[] x, double[] y, double[] z) 31 | { 32 | float[] xs = new float[x.Length]; 33 | System.Array.Copy(x, xs, x.Length); 34 | float[] ys = new float[y.Length]; 35 | System.Array.Copy(y, ys, y.Length); 36 | float[] zs = new float[z.Length]; 37 | System.Array.Copy(z, zs, z.Length); 38 | return build(xs, ys, zs); 39 | } 40 | 41 | } 42 | 43 | } 44 | 45 | //======================================================= 46 | //Service provided by Telerik (www.telerik.com) 47 | //Conversion powered by NRefactory. 48 | //Twitter: @telerik 49 | //Facebook: facebook.com/telerik 50 | //======================================================= 51 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/AbstractWireframeable.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Colors; 9 | 10 | namespace nzy3D.Plot3D.Primitives 11 | { 12 | 13 | /// 14 | /// An {@link AbstractWireframeable} is an 15 | /// that has a wireframe mode for display. 16 | /// 17 | /// Defining an object as Wireframeable means this object may have a wireframe 18 | /// mode status (on/off), a wireframe color, and a wireframe width. 19 | /// As a consequence of being wireframeable, a 3d object may have his faces 20 | /// displayed or not by setFaceDisplayed(). 21 | /// 22 | public abstract class AbstractWireframeable : AbstractDrawable 23 | { 24 | 25 | internal Color _wfcolor; 26 | internal float _wfwidth; 27 | internal bool _wfstatus; 28 | 29 | internal bool _facestatus; 30 | 31 | public AbstractWireframeable() : base() 32 | { 33 | _wfcolor = Color.WHITE; 34 | _wfwidth = 1; 35 | _wfstatus = true; 36 | _facestatus = true; 37 | } 38 | 39 | /// 40 | /// Get/Set the wireframe color 41 | /// 42 | public virtual Color WireframeColor { 43 | get { return _wfcolor; } 44 | set { _wfcolor = value; } 45 | } 46 | 47 | /// 48 | /// Get/Set the wireframe width 49 | /// 50 | public virtual float WireframeWidth { 51 | get { return _wfwidth; } 52 | set { _wfwidth = value; } 53 | } 54 | 55 | /// 56 | /// Get/Set the wireframe display status 57 | /// 58 | /// on (true) / off (false) 59 | public virtual bool WireframeDisplayed { 60 | get { return _wfstatus; } 61 | set { _wfstatus = value; } 62 | } 63 | 64 | /// 65 | /// Get/Set the face display status 66 | /// 67 | /// on (true) / off (false) 68 | public virtual bool FaceDisplayed { 69 | get { return _facestatus; } 70 | set { _facestatus = value; } 71 | } 72 | 73 | } 74 | 75 | } 76 | 77 | //======================================================= 78 | //Service provided by Telerik (www.telerik.com) 79 | //Conversion powered by NRefactory. 80 | //Twitter: @telerik 81 | //Facebook: facebook.com/telerik 82 | //======================================================= 83 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/AxeBase.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using OpenTK.Graphics.OpenGL; 9 | using nzy3D.Maths; 10 | using nzy3D.Plot3D.Primitives.Axes.Layout; 11 | using nzy3D.Plot3D.Rendering.View; 12 | 13 | namespace nzy3D.Plot3D.Primitives.Axes 14 | { 15 | 16 | /// 17 | /// An AxeBase provide a simple 3-segment object which is configured by 18 | /// a BoundingBox. 19 | /// @author Martin Pernollet 20 | /// 21 | public class AxeBase : IAxe 22 | { 23 | 24 | internal Coord3d _scale; 25 | internal BoundingBox3d _bbox; 26 | 27 | internal IAxeLayout _layout; 28 | /// 29 | /// Create a simple axe centered on (0,0,0), with a dimension of 1. 30 | /// 31 | public AxeBase() : this(new BoundingBox3d(0, 1, 0, 1, 0, 1)) 32 | { 33 | } 34 | 35 | /// 36 | /// Create a simple axe centered on (box.xmin, box.ymin, box.zmin) 37 | /// 38 | public AxeBase(BoundingBox3d box) 39 | { 40 | setAxe(box); 41 | setScale(new Coord3d(1, 1, 1)); 42 | } 43 | 44 | public void Dispose() 45 | { 46 | } 47 | 48 | public void Draw(Rendering.View.Camera camera) 49 | { 50 | GL.LoadIdentity(); 51 | GL.Scale(_scale.x, _scale.y, _scale.y); 52 | GL.LineWidth(2); 53 | GL.Begin(BeginMode.Lines); 54 | GL.Color3(1, 0, 0); 55 | // R 56 | GL.Vertex3(_bbox.xmin, _bbox.ymin, _bbox.zmin); 57 | GL.Vertex3(_bbox.xmax, 0, 0); 58 | GL.Color3(0, 1, 0); 59 | // G 60 | GL.Vertex3(_bbox.xmin, _bbox.ymin, _bbox.zmin); 61 | GL.Vertex3(0, _bbox.ymax, 0); 62 | GL.Color3(0, 0, 1); 63 | // B 64 | GL.Vertex3(_bbox.xmin, _bbox.ymin, _bbox.zmin); 65 | GL.Vertex3(0, 0, _bbox.zmax); 66 | GL.End(); 67 | } 68 | 69 | public Maths.BoundingBox3d getBoxBounds() 70 | { 71 | return _bbox; 72 | } 73 | 74 | public Maths.Coord3d getCenter() 75 | { 76 | return new Coord3d(_bbox.xmin, _bbox.ymin, _bbox.zmin); 77 | } 78 | 79 | public Layout.IAxeLayout getLayout() 80 | { 81 | return _layout; 82 | } 83 | 84 | public void setAxe(Maths.BoundingBox3d box) 85 | { 86 | _bbox = box; 87 | } 88 | 89 | public void setScale(Maths.Coord3d scale) 90 | { 91 | _scale = scale; 92 | } 93 | 94 | } 95 | 96 | } 97 | 98 | //======================================================= 99 | //Service provided by Telerik (www.telerik.com) 100 | //Conversion powered by NRefactory. 101 | //Twitter: @telerik 102 | //Facebook: facebook.com/telerik 103 | //======================================================= 104 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/IAxe.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using nzy3D.Plot3D.Primitives.Axes.Layout; 10 | using nzy3D.Plot3D.Rendering.View; 11 | 12 | namespace nzy3D.Plot3D.Primitives.Axes 13 | { 14 | 15 | public interface IAxe 16 | { 17 | void Dispose(); 18 | void setAxe(BoundingBox3d box); 19 | void Draw(Camera camera); 20 | void setScale(Coord3d scale); 21 | BoundingBox3d getBoxBounds(); 22 | Coord3d getCenter(); 23 | IAxeLayout getLayout(); 24 | } 25 | 26 | } 27 | 28 | //======================================================= 29 | //Service provided by Telerik (www.telerik.com) 30 | //Conversion powered by NRefactory. 31 | //Twitter: @telerik 32 | //Facebook: facebook.com/telerik 33 | //======================================================= 34 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/IAxeLayout.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Colors; 9 | using nzy3D.Plot3D.Primitives.Axes.Layout.Providers; 10 | using nzy3D.Plot3D.Primitives.Axes.Layout.Renderers; 11 | 12 | namespace nzy3D.Plot3D.Primitives.Axes.Layout 13 | { 14 | 15 | public interface IAxeLayout 16 | { 17 | Color MainColor { get; set; } 18 | Color GridColor { get; set; } 19 | bool FaceDisplayed { get; set; } 20 | Color QuadColor { get; set; } 21 | string XAxeLabel { get; set; } 22 | string YAxeLabel { get; set; } 23 | string ZAxeLabel { get; set; } 24 | bool XAxeLabelDisplayed { get; set; } 25 | bool YAxeLabelDisplayed { get; set; } 26 | bool ZAxeLabelDisplayed { get; set; } 27 | bool XTickLabelDisplayed { get; set; } 28 | bool YTickLabelDisplayed { get; set; } 29 | bool ZTickLabelDisplayed { get; set; } 30 | bool TickLineDisplayed { get; set; } 31 | ITickProvider XTickProvider { get; set; } 32 | ITickProvider YTickProvider { get; set; } 33 | ITickProvider ZTickProvider { get; set; } 34 | ITickRenderer XTickRenderer { get; set; } 35 | ITickRenderer YTickRenderer { get; set; } 36 | ITickRenderer ZTickRenderer { get; set; } 37 | Color XTickColor { get; set; } 38 | Color YTickColor { get; set; } 39 | Color ZTickColor { get; set; } 40 | float[] XTicks(); 41 | float[] YTicks(); 42 | float[] ZTicks(); 43 | float[] XTicks(float min, float max); 44 | float[] YTicks(float min, float max); 45 | float[] ZTicks(float min, float max); 46 | 47 | 48 | } 49 | 50 | } 51 | 52 | //======================================================= 53 | //Service provided by Telerik (www.telerik.com) 54 | //Conversion powered by NRefactory. 55 | //Twitter: @telerik 56 | //Facebook: facebook.com/telerik 57 | //======================================================= 58 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Providers/AbstractTickProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Providers 9 | { 10 | 11 | public abstract class AbstractTickProvider : ITickProvider 12 | { 13 | 14 | public float[] generateTicks(float min, float max) 15 | { 16 | return generateTicks(min, max, DefaultSteps); 17 | } 18 | 19 | public abstract int DefaultSteps { get; } 20 | 21 | public abstract float[] generateTicks(float min, float max, int steps); 22 | 23 | } 24 | 25 | } 26 | 27 | //======================================================= 28 | //Service provided by Telerik (www.telerik.com) 29 | //Conversion powered by NRefactory. 30 | //Twitter: @telerik 31 | //Facebook: facebook.com/telerik 32 | //======================================================= 33 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Providers/ITickProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Providers 9 | { 10 | 11 | public interface ITickProvider 12 | { 13 | float[] generateTicks(float min, float max); 14 | float[] generateTicks(float min, float max, int steps); 15 | int DefaultSteps { get; } 16 | } 17 | 18 | } 19 | 20 | //======================================================= 21 | //Service provided by Telerik (www.telerik.com) 22 | //Conversion powered by NRefactory. 23 | //Twitter: @telerik 24 | //Facebook: facebook.com/telerik 25 | //======================================================= 26 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Providers/RegularTickProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Providers 9 | { 10 | 11 | public class RegularTickProvider : AbstractTickProvider, ITickProvider 12 | { 13 | 14 | 15 | internal int _steps; 16 | public RegularTickProvider() : this(3) 17 | { 18 | } 19 | 20 | public RegularTickProvider(int steps) 21 | { 22 | _steps = steps; 23 | } 24 | 25 | public override int DefaultSteps { 26 | get { return _steps; } 27 | } 28 | 29 | public override float[] generateTicks(float min, float max, int steps) 30 | { 31 | float[] ticks = new float[steps]; 32 | float lstep = (max - min) / (steps - 1); 33 | ticks[0] = min; 34 | ticks[steps - 1] = max; 35 | for (int t = 1; t <= steps - 2; t++) { 36 | ticks[t] = min + t * lstep; 37 | } 38 | return ticks; 39 | } 40 | } 41 | 42 | } 43 | 44 | //======================================================= 45 | //Service provided by Telerik (www.telerik.com) 46 | //Conversion powered by NRefactory. 47 | //Twitter: @telerik 48 | //Facebook: facebook.com/telerik 49 | //======================================================= 50 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Providers/SmartTickProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Providers 9 | { 10 | 11 | public class SmartTickProvider : AbstractTickProvider, ITickProvider 12 | { 13 | 14 | 15 | internal int _steps; 16 | public SmartTickProvider() : this(5) 17 | { 18 | } 19 | 20 | public SmartTickProvider(int steps) 21 | { 22 | _steps = steps; 23 | } 24 | 25 | public override int DefaultSteps { 26 | get { return _steps; } 27 | } 28 | 29 | /// 30 | /// Compute the ticks placements automatically between values min and max. 31 | /// 32 | public override float[] generateTicks(float min, float max, int steps) 33 | { 34 | if ((min == max)) { 35 | float[] ticks = new float[1]; 36 | ticks[0] = min; 37 | return ticks; 38 | } else if ((min > max)) { 39 | return null; 40 | } else { 41 | double absscale = Math.Floor(Math.Log10(max - min)); 42 | double relscale = Math.Log10(max - min) - absscale; 43 | float ticksize = 0; 44 | if ((relscale < Math.Log10(0.2 * steps))) { 45 | ticksize = Convert.ToSingle(Math.Pow(10, absscale) * 0.2); 46 | } else if ((relscale < Math.Log10(0.5 * steps))) { 47 | ticksize = Convert.ToSingle(Math.Pow(10, absscale) * 0.5); 48 | } else if ((relscale < Math.Log10(1 * steps))) { 49 | ticksize = Convert.ToSingle(Math.Pow(10, absscale) * 1); 50 | } else { 51 | ticksize = Convert.ToSingle(Math.Pow(10, absscale) * 2); 52 | } 53 | int starti = Convert.ToInt32(Math.Ceiling(min / ticksize)); 54 | int stopi = Convert.ToInt32(Math.Floor(max / ticksize)); 55 | float[] ticks = new float[stopi - starti + 1]; 56 | for (int t = starti; t <= stopi; t++) { 57 | ticks[t - starti] = (t * ticksize); 58 | } 59 | return ticks; 60 | } 61 | } 62 | } 63 | 64 | } 65 | 66 | //======================================================= 67 | //Service provided by Telerik (www.telerik.com) 68 | //Conversion powered by NRefactory. 69 | //Twitter: @telerik 70 | //Facebook: facebook.com/telerik 71 | //======================================================= 72 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Providers/StaticTickProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Providers 9 | { 10 | 11 | public class StaticTickProvider : AbstractTickProvider, ITickProvider 12 | { 13 | 14 | 15 | internal float[] _values; 16 | public StaticTickProvider(float[] values) 17 | { 18 | _values = values; 19 | } 20 | 21 | public override int DefaultSteps { 22 | get { return 0; } 23 | } 24 | 25 | public override float[] generateTicks(float min, float max, int steps) 26 | { 27 | return _values; 28 | } 29 | 30 | } 31 | 32 | } 33 | 34 | //======================================================= 35 | //Service provided by Telerik (www.telerik.com) 36 | //Conversion powered by NRefactory. 37 | //Twitter: @telerik 38 | //Facebook: facebook.com/telerik 39 | //======================================================= 40 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Renderers/DateTickRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Renderers 9 | { 10 | 11 | /// 12 | /// Force number to be represented with a given number of decimals 13 | /// 14 | public class DateTickRenderer : ITickRenderer 15 | { 16 | 17 | 18 | internal string _format; 19 | public DateTickRenderer() : this("dd/MM/yyyy HH:mm:ss") 20 | { 21 | } 22 | 23 | public DateTickRenderer(string format) 24 | { 25 | _format = format; 26 | } 27 | 28 | public string Format(float value) 29 | { 30 | DateTime ldate = nzy3D.Maths.Utils.num2date(Convert.ToInt64(value)); 31 | return nzy3D.Maths.Utils.dat2str(ldate, _format); 32 | } 33 | 34 | } 35 | 36 | } 37 | 38 | 39 | 40 | //======================================================= 41 | //Service provided by Telerik (www.telerik.com) 42 | //Conversion powered by NRefactory. 43 | //Twitter: @telerik 44 | //Facebook: facebook.com/telerik 45 | //======================================================= 46 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Renderers/DefaultDecimalTickRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Renderers 9 | { 10 | 11 | /// 12 | /// Force number to be represented with a given number of decimals 13 | /// 14 | public class DefaultDecimalTickRenderer : ITickRenderer 15 | { 16 | 17 | 18 | internal int _precision; 19 | public DefaultDecimalTickRenderer() : this(6) 20 | { 21 | } 22 | 23 | public DefaultDecimalTickRenderer(int precision) 24 | { 25 | _precision = precision; 26 | } 27 | 28 | public string Format(float value) 29 | { 30 | return nzy3D.Maths.Utils.num2str('g', value, _precision); 31 | } 32 | 33 | } 34 | 35 | } 36 | 37 | 38 | //======================================================= 39 | //Service provided by Telerik (www.telerik.com) 40 | //Conversion powered by NRefactory. 41 | //Twitter: @telerik 42 | //Facebook: facebook.com/telerik 43 | //======================================================= 44 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Renderers/FixedDecimalTickRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Renderers 9 | { 10 | 11 | /// 12 | /// Force number to be represented with a given number of decimals 13 | /// 14 | public class FixedDecimalTickRenderer : ITickRenderer 15 | { 16 | 17 | 18 | internal int _precision; 19 | public FixedDecimalTickRenderer() : this(6) 20 | { 21 | } 22 | 23 | public FixedDecimalTickRenderer(int precision) 24 | { 25 | _precision = precision; 26 | } 27 | 28 | public string Format(float value) 29 | { 30 | return nzy3D.Maths.Utils.num2str('f', value, _precision); 31 | } 32 | 33 | } 34 | 35 | } 36 | 37 | 38 | //======================================================= 39 | //Service provided by Telerik (www.telerik.com) 40 | //Conversion powered by NRefactory. 41 | //Twitter: @telerik 42 | //Facebook: facebook.com/telerik 43 | //======================================================= 44 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Renderers/ITickRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Renderers 9 | { 10 | 11 | public interface ITickRenderer 12 | { 13 | string Format(float value); 14 | } 15 | 16 | } 17 | 18 | //======================================================= 19 | //Service provided by Telerik (www.telerik.com) 20 | //Conversion powered by NRefactory. 21 | //Twitter: @telerik 22 | //Facebook: facebook.com/telerik 23 | //======================================================= 24 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Renderers/IntegerTickRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Renderers 9 | { 10 | 11 | public class IntegerTickRenderer : ITickRenderer 12 | { 13 | 14 | public string Format(float value) 15 | { 16 | return Convert.ToInt32(value).ToString(); 17 | } 18 | 19 | } 20 | 21 | } 22 | 23 | //======================================================= 24 | //Service provided by Telerik (www.telerik.com) 25 | //Conversion powered by NRefactory. 26 | //Twitter: @telerik 27 | //Facebook: facebook.com/telerik 28 | //======================================================= 29 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Renderers/ScientificNotationTickRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Renderers 9 | { 10 | 11 | /// 12 | /// Formats 1000 to '1.0e3' 13 | /// 14 | public class ScientificNotationTickRenderer : ITickRenderer 15 | { 16 | 17 | 18 | internal int _precision; 19 | public ScientificNotationTickRenderer() : this(1) 20 | { 21 | } 22 | 23 | public ScientificNotationTickRenderer(int precision) 24 | { 25 | _precision = precision; 26 | } 27 | 28 | public string Format(float value) 29 | { 30 | return nzy3D.Maths.Utils.num2str('e', value, _precision); 31 | } 32 | 33 | } 34 | 35 | } 36 | 37 | //======================================================= 38 | //Service provided by Telerik (www.telerik.com) 39 | //Conversion powered by NRefactory. 40 | //Twitter: @telerik 41 | //Facebook: facebook.com/telerik 42 | //======================================================= 43 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Axes/Layout/Renderers/TickLabelMap.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives.Axes.Layout.Renderers 9 | { 10 | 11 | /// 12 | /// An that can store a list of labels for given axis values. 13 | /// 14 | /// Martin Pernollet 15 | public class TickLabelMap : ITickRenderer 16 | { 17 | 18 | 19 | internal Dictionary _tickvalues = new Dictionary(); 20 | public void Register(float value, string label) 21 | { 22 | _tickvalues.Add(value, label); 23 | } 24 | 25 | public bool Contains(float value) 26 | { 27 | return _tickvalues.ContainsKey(value); 28 | } 29 | 30 | public bool Contains(string label) 31 | { 32 | return _tickvalues.ContainsValue(label); 33 | } 34 | 35 | public string Format(float value) 36 | { 37 | if (Contains(value)) { 38 | return _tickvalues[value]; 39 | } else { 40 | return ""; 41 | } 42 | } 43 | 44 | } 45 | 46 | } 47 | 48 | 49 | //======================================================= 50 | //Service provided by Telerik (www.telerik.com) 51 | //Conversion powered by NRefactory. 52 | //Twitter: @telerik 53 | //Facebook: facebook.com/telerik 54 | //======================================================= 55 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Graphs/Layout/DefaultGraphLayout2d.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using nzy3D.Maths; 4 | using System; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | using System.Data; 8 | using System.Diagnostics; 9 | using System.Linq; 10 | namespace nzy3D.Plot3D.Primitives.Graphs.Layout 11 | { 12 | 13 | public class DefaultGraphLayout2d : IGraphLayout2d 14 | { 15 | 16 | private List> _values = new List>(); 17 | /* 18 | public Maths.Coord2d getV(V v) 19 | { 20 | return new Maths.Coord2d(); 21 | } 22 | 23 | public System.Collections.Generic.List values() 24 | { 25 | return _values; 26 | } 27 | */ 28 | 29 | 30 | 31 | public Coord2d VertexPosition 32 | { 33 | get 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | set 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | } 42 | 43 | public Coord2d getV(V v) 44 | { 45 | throw new NotImplementedException(); 46 | } 47 | 48 | public List values() 49 | { 50 | throw new NotImplementedException(); 51 | } 52 | } 53 | 54 | } 55 | 56 | //======================================================= 57 | //Service provided by Telerik (www.telerik.com) 58 | //Conversion powered by NRefactory. 59 | //Twitter: @telerik 60 | //Facebook: facebook.com/telerik 61 | //======================================================= 62 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Graphs/Layout/IGraphLayout2d.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Primitives.Graphs.Layout 11 | { 12 | 13 | public interface IGraphLayout2d 14 | { 15 | 16 | Coord2d VertexPosition { get; set; } 17 | Coord2d getV(V v); 18 | List values(); 19 | 20 | } 21 | 22 | } 23 | 24 | //======================================================= 25 | //Service provided by Telerik (www.telerik.com) 26 | //Conversion powered by NRefactory. 27 | //Twitter: @telerik 28 | //Facebook: facebook.com/telerik 29 | //======================================================= 30 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/IGLBindedResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.View; 9 | 10 | namespace nzy3D.Plot3D.Primitives 11 | { 12 | 13 | public interface IGLBindedResource 14 | { 15 | void Mount(); 16 | bool hasMountedOnce(); 17 | } 18 | 19 | } 20 | 21 | 22 | //======================================================= 23 | //Service provided by Telerik (www.telerik.com) 24 | //Conversion powered by NRefactory. 25 | //Twitter: @telerik 26 | //Facebook: facebook.com/telerik 27 | //======================================================= 28 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/IGLRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.View; 9 | 10 | namespace nzy3D.Plot3D.Primitives 11 | { 12 | 13 | public interface IGLRenderer 14 | { 15 | void Draw(Camera cam); 16 | } 17 | 18 | } 19 | 20 | //======================================================= 21 | //Service provided by Telerik (www.telerik.com) 22 | //Conversion powered by NRefactory. 23 | //Twitter: @telerik 24 | //Facebook: facebook.com/telerik 25 | //======================================================= 26 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/ISortableDraw.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Rendering.View; 9 | 10 | namespace nzy3D.Plot3D.Primitives 11 | { 12 | 13 | public interface ISortableDraw 14 | { 15 | double getDistance(Camera camera); 16 | double getShortestDistance(Camera camera); 17 | double getLongestDistance(Camera camera); 18 | } 19 | 20 | } 21 | 22 | 23 | 24 | //======================================================= 25 | //Service provided by Telerik (www.telerik.com) 26 | //Conversion powered by NRefactory. 27 | //Twitter: @telerik 28 | //Facebook: facebook.com/telerik 29 | //======================================================= 30 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/ScatterMultiColor.cs: -------------------------------------------------------------------------------- 1 | using nzy3D.Colors; 2 | using nzy3D.Maths; 3 | using nzy3D.Plot3D.Rendering.View; 4 | using OpenTK.Graphics.OpenGL; 5 | 6 | namespace nzy3D.Plot3D.Primitives 7 | { 8 | public class ScatterMultiColor : AbstractDrawable, IMultiColorable 9 | { 10 | 11 | private Coord3d[] _coordinates; 12 | private float _width; 13 | private ColorMapper _mapper; 14 | 15 | public ScatterMultiColor(Coord3d[] coordinates, ColorMapper mapper, float width = 1.0f) 16 | { 17 | _bbox = new BoundingBox3d(); 18 | Data = coordinates; 19 | Width = width; 20 | ColorMapper = mapper; 21 | } 22 | 23 | public void Clear() { 24 | _coordinates = null; 25 | _bbox.reset(); 26 | } 27 | 28 | 29 | public override void Draw(Camera cam) 30 | { 31 | 32 | _transform?.Execute(); 33 | 34 | GL.PointSize(_width); 35 | GL.Begin(BeginMode.Points); 36 | 37 | if (_coordinates != null) 38 | { 39 | foreach (Coord3d c in _coordinates) { 40 | var color = _mapper.Color(c); // TODO: should store result in the point color 41 | GL.Color4(color.r, color.g, color.b, color.a); 42 | GL.Vertex3(c.x, c.y, c.z); 43 | } 44 | } 45 | GL.End(); 46 | 47 | // doDrawBounds (MISSING) 48 | 49 | } 50 | 51 | private void UpdateBounds() { 52 | _bbox.reset(); 53 | foreach (var c in _coordinates) { 54 | _bbox.add(c); 55 | } 56 | 57 | } 58 | 59 | private Coord3d[] Data 60 | { 61 | get => _coordinates; 62 | set 63 | { 64 | _coordinates = value; 65 | UpdateBounds(); 66 | } 67 | } 68 | 69 | public override Transform.Transform Transform { 70 | get => _transform; 71 | set { 72 | _transform = value; 73 | UpdateBounds(); 74 | } 75 | } 76 | 77 | private float Width 78 | { 79 | get => _width; 80 | set => _width = value; 81 | } 82 | 83 | public ColorMapper ColorMapper 84 | { 85 | get => _mapper; 86 | set => _mapper = value; 87 | } 88 | } 89 | } -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Selectable/ISelectable.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using OpenTK.Graphics.OpenGL; 9 | using nzy3D.Colors; 10 | using nzy3D.Events; 11 | using nzy3D.Maths; 12 | using nzy3D.Plot3D.Rendering.View; 13 | using nzy3D.Plot3D.Transform; 14 | 15 | namespace nzy3D.Plot3D.Primitives 16 | { 17 | public interface ISelectable 18 | { 19 | 20 | void Project(Camera cam); 21 | 22 | List LastProjection { get; } 23 | } 24 | } 25 | 26 | 27 | //======================================================= 28 | //Service provided by Telerik (www.telerik.com) 29 | //Conversion powered by NRefactory. 30 | //Twitter: @telerik 31 | //Facebook: facebook.com/telerik 32 | //======================================================= 33 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Primitives/Shape.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Primitives 9 | { 10 | 11 | /// 12 | /// Allows building custom shapes defined by an {@link ArrayList} of {@link Polygon}s. 13 | /// Such {@link ArrayList} must be defined by the user. 14 | /// 15 | /// 16 | public class Shape : AbstractComposite 17 | { 18 | 19 | public Shape() : base() 20 | { 21 | } 22 | 23 | public Shape(List polygons) : base() 24 | { 25 | this.Add(polygons); 26 | } 27 | 28 | } 29 | 30 | } 31 | 32 | //======================================================= 33 | //Service provided by Telerik (www.telerik.com) 34 | //Conversion powered by NRefactory. 35 | //Twitter: @telerik 36 | //Facebook: facebook.com/telerik 37 | //======================================================= 38 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Canvas/ICanvas.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Events.Mouse; 9 | using nzy3D.Events.Keyboard; 10 | 11 | namespace nzy3D.Plot3D.Rendering.Canvas 12 | { 13 | 14 | public interface ICanvas 15 | { 16 | 17 | /// 18 | /// Returns a reference to the held view. 19 | /// 20 | 21 | View.View View { get; } 22 | /// 23 | /// Returns the renderer's width, i.e. the display width. 24 | /// 25 | 26 | int RendererWidth { get; } 27 | /// 28 | /// Returns the renderer's height, i.e. the display height. 29 | /// 30 | 31 | int RendererHeight { get; } 32 | /// 33 | /// Invoked when a user requires the Canvas to be repainted (e.g. a non 3d layer has changed). 34 | /// 35 | 36 | void ForceRepaint(); 37 | /// 38 | /// Returns an image with the current renderer's size. 39 | /// 40 | System.Drawing.Bitmap Screenshot(); 41 | 42 | /// 43 | /// Performs all required cleanup when destroying a Canvas. 44 | /// 45 | 46 | void Dispose(); 47 | void addMouseListener(IMouseListener listener); 48 | void removeMouseListener(IMouseListener listener); 49 | void addMouseWheelListener(IMouseWheelListener listener); 50 | void removeMouseWheelListener(IMouseWheelListener listener); 51 | void addMouseMotionListener(IMouseMotionListener listener); 52 | void removeMouseMotionListener(IMouseMotionListener listener); 53 | void addKeyListener(IKeyListener listener); 54 | 55 | void removeKeyListener(IKeyListener listener); 56 | } 57 | 58 | } 59 | 60 | //======================================================= 61 | //Service provided by Telerik (www.telerik.com) 62 | //Conversion powered by NRefactory. 63 | //Twitter: @telerik 64 | //Facebook: facebook.com/telerik 65 | //======================================================= 66 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Legends/Legend.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Primitives; 9 | using nzy3D.Events; 10 | using System.Drawing; 11 | using nzy3D.Plot3D.Rendering.View; 12 | using nzy3D.Chart; 13 | 14 | namespace nzy3D.Plot3D.Rendering.Legends 15 | { 16 | 17 | /// 18 | /// A represent information concerning a that may be 19 | /// displayed as a metadata in the . 20 | /// 21 | /// The constructor of a registers itself as listener of its 22 | /// parent , and unregister itself when it is disposed. 23 | /// 24 | /// When defining a concrete , one should: 25 | ///
    26 | ///
  • override the {@link toImage(int width, int height)} method, that defines the picture representation.
  • 27 | ///
  • override the {@link drawableChanged(DrawableChangedEvent e)} method, that must select events that actually triggers an image update.
  • 28 | ///
29 | /// 30 | /// Last, a optimizes rendering by : 31 | ///
    32 | ///
  • storing current image dimension,
  • 33 | ///
  • computing a new image only if the required dimensions changed.
  • 34 | ///
35 | /// 36 | /// @author Martin Pernollet 37 | ///
38 | /// 39 | public abstract class Legend : ImageViewport, IDrawableListener 40 | { 41 | 42 | 43 | internal AbstractDrawable _parent; 44 | public Legend(AbstractDrawable parent) 45 | { 46 | _parent = parent; 47 | if (((_parent != null))) { 48 | _parent.addDrawableListener(this); 49 | } 50 | } 51 | 52 | public void Dispose() 53 | { 54 | if (((_parent != null))) { 55 | _parent.removeDrawableListener(this); 56 | } 57 | } 58 | 59 | public abstract Bitmap toImage(int width, int height); 60 | public abstract void DrawableChanged(DrawableChangedEventArgs e); 61 | 62 | public override void SetViewPort(int width, int height, float left, float right) 63 | { 64 | base.SetViewPort(width, height, left, right); 65 | int imgWidth = (int)(width * (right - left)); 66 | if (_imageWidth != imgWidth | _imageHeight != height) { 67 | this.Image = toImage(imgWidth, height); 68 | } 69 | } 70 | 71 | /// 72 | /// Recompute the picture, using last used dimensions. 73 | /// 74 | public void UpdateImage() 75 | { 76 | this.Image = toImage(_imageWidth, _imageHeight); 77 | } 78 | 79 | } 80 | 81 | } 82 | 83 | //======================================================= 84 | //Service provided by Telerik (www.telerik.com) 85 | //Conversion powered by NRefactory. 86 | //Twitter: @telerik 87 | //Facebook: facebook.com/telerik 88 | //======================================================= 89 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Lights/LightSwitch.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using OpenTK.Graphics.OpenGL; 9 | 10 | namespace nzy3D.Plot3D.Rendering.Lights 11 | { 12 | 13 | public class LightSwitch 14 | { 15 | public static void Enable(int lightId) 16 | { 17 | switch (lightId) { 18 | case 0: 19 | GL.Enable(EnableCap.Light0); 20 | break; 21 | case 1: 22 | GL.Enable(EnableCap.Light1); 23 | break; 24 | case 2: 25 | GL.Enable(EnableCap.Light2); 26 | break; 27 | case 3: 28 | GL.Enable(EnableCap.Light3); 29 | break; 30 | case 4: 31 | GL.Enable(EnableCap.Light4); 32 | break; 33 | case 5: 34 | GL.Enable(EnableCap.Light5); 35 | break; 36 | case 6: 37 | GL.Enable(EnableCap.Light6); 38 | break; 39 | case 7: 40 | GL.Enable(EnableCap.Light7); 41 | break; 42 | default: 43 | throw new ArgumentException("Light id must belong to [0;7]", "lightId"); 44 | } 45 | } 46 | public static void Disable(int lightId) 47 | { 48 | switch (lightId) { 49 | case 0: 50 | GL.Disable(EnableCap.Light0); 51 | break; 52 | case 1: 53 | GL.Disable(EnableCap.Light1); 54 | break; 55 | case 2: 56 | GL.Disable(EnableCap.Light2); 57 | break; 58 | case 3: 59 | GL.Disable(EnableCap.Light3); 60 | break; 61 | case 4: 62 | GL.Disable(EnableCap.Light4); 63 | break; 64 | case 5: 65 | GL.Disable(EnableCap.Light5); 66 | break; 67 | case 6: 68 | GL.Disable(EnableCap.Light6); 69 | break; 70 | case 7: 71 | GL.Disable(EnableCap.Light7); 72 | break; 73 | default: 74 | throw new ArgumentException("Light id must belong to [0;7]", "lightId"); 75 | } 76 | } 77 | } 78 | } 79 | 80 | //======================================================= 81 | //Service provided by Telerik (www.telerik.com) 82 | //Conversion powered by NRefactory. 83 | //Twitter: @telerik 84 | //Facebook: facebook.com/telerik 85 | //======================================================= 86 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Ordering/AbstractOrderingStrategy.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Primitives; 9 | using nzy3D.Plot3D.Rendering.View; 10 | using nzy3D.Plot3D.Transform; 11 | 12 | namespace nzy3D.Plot3D.Rendering.Ordering 13 | { 14 | 15 | public abstract class AbstractOrderingStrategy : IComparer 16 | { 17 | 18 | internal Camera _camera; 19 | 20 | internal Transform.Transform _transform; 21 | 22 | public abstract int Compare(Primitives.AbstractDrawable x, Primitives.AbstractDrawable y); 23 | 24 | public void Sort(List monotypes, Camera cam) 25 | { 26 | _camera = cam; 27 | monotypes.Sort(this); 28 | } 29 | 30 | internal int Comparison(double dist1, double dist2) 31 | { 32 | if (dist1 == dist2) { 33 | return 0; 34 | } else if (dist1 < dist2) { 35 | return 1; 36 | //*Math.max((int)Math.abs(dist1-dist2),1) 37 | } else { 38 | return -1; 39 | //*Math.max((int)Math.abs(dist1-dist2),1); 40 | } 41 | } 42 | 43 | public void setAll(Camera camera, Transform.Transform transform) 44 | { 45 | this.Camera = camera; 46 | this.Transform = transform; 47 | } 48 | 49 | public Camera Camera { 50 | get { return _camera; } 51 | set { _camera = value; } 52 | } 53 | 54 | public Transform.Transform Transform { 55 | get { return _transform; } 56 | set { _transform = value; } 57 | } 58 | 59 | } 60 | 61 | } 62 | 63 | //======================================================= 64 | //Service provided by Telerik (www.telerik.com) 65 | //Conversion powered by NRefactory. 66 | //Twitter: @telerik 67 | //Facebook: facebook.com/telerik 68 | //======================================================= 69 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Ordering/BarycentreOrderingStrategy.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Primitives; 9 | using nzy3D.Plot3D.Rendering.View; 10 | 11 | namespace nzy3D.Plot3D.Rendering.Ordering 12 | { 13 | 14 | /// 15 | /// The compare two s by computing 16 | /// their respective distances to the , which must be referenced prior to any 17 | /// comparison. 18 | /// 19 | /// @author Martin Pernollet 20 | /// 21 | /// 22 | public class BarycentreOrderingStrategy : AbstractOrderingStrategy 23 | { 24 | 25 | public override int Compare(Primitives.AbstractDrawable d1, Primitives.AbstractDrawable d2) 26 | { 27 | if ((_camera == null)) { 28 | throw new Exception("No available camera for computing BarycentreOrderingStrategy"); 29 | } 30 | // Reflexivity 31 | if (d1.Equals(d2)) { 32 | return 0; 33 | } 34 | double dist1 = d1.getDistance(_camera); 35 | double dist2 = d2.getDistance(_camera); 36 | return Comparison(dist1, dist2); 37 | } 38 | 39 | // 40 | // Operation must be: 41 | // symetric: compare(a,b)=-compare(b,a) 42 | // transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0 true if all Drawables and the Camera don't change position! 43 | // consistency?: compare(x, y)==0 implies that sgn(compare(x, z))==sgn(compare(y, z)) 44 | // 45 | 46 | } 47 | 48 | } 49 | 50 | //======================================================= 51 | //Service provided by Telerik (www.telerik.com) 52 | //Conversion powered by NRefactory. 53 | //Twitter: @telerik 54 | //Facebook: facebook.com/telerik 55 | //======================================================= 56 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Ordering/DefaultOrderingStrategy.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Primitives; 9 | using nzy3D.Plot3D.Rendering.View; 10 | 11 | namespace nzy3D.Plot3D.Rendering.Ordering 12 | { 13 | 14 | /// 15 | /// The let drawables be displayed in their original order 16 | /// @author Martin Pernollet 17 | /// 18 | public class DefaultOrderingStrategy : AbstractOrderingStrategy 19 | { 20 | 21 | public override int Compare(Primitives.AbstractDrawable d1, Primitives.AbstractDrawable d2) 22 | { 23 | return 0; 24 | } 25 | 26 | // 27 | // Operation must be: 28 | // symetric: compare(a,b)=-compare(b,a) 29 | // transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0 true if all Drawables and the Camera don't change position! 30 | // consistency?: compare(x, y)==0 implies that sgn(compare(x, z))==sgn(compare(y, z)) 31 | // 32 | 33 | } 34 | 35 | } 36 | 37 | //======================================================= 38 | //Service provided by Telerik (www.telerik.com) 39 | //Conversion powered by NRefactory. 40 | //Twitter: @telerik 41 | //Facebook: facebook.com/telerik 42 | //======================================================= 43 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Ordering/PointOrderingStrategy.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using nzy3D.Plot3D.Primitives; 10 | using nzy3D.Plot3D.Rendering.View; 11 | 12 | namespace nzy3D.Plot3D.Rendering.Ordering 13 | { 14 | 15 | public class PointOrderingStrategy : IComparer 16 | { 17 | 18 | 19 | internal Camera _camera; 20 | public void Sort(List points, Camera cam) 21 | { 22 | _camera = cam; 23 | points.Sort(this); 24 | } 25 | 26 | public int Compare(Maths.Coord3d o1, Maths.Coord3d o2) 27 | { 28 | if ((_camera == null)) { 29 | throw new Exception("No available camera for computing PointOrderingStrategy"); 30 | } 31 | // Reflexivity 32 | if (o1.Equals(o2)) { 33 | return 0; 34 | } 35 | double dist1 = _camera.Eye.distance(o1); 36 | double dist2 = _camera.Eye.distance(o2); 37 | if (dist1 == dist2) { 38 | return 0; 39 | } else if (dist1 < dist2) { 40 | return 1; 41 | } else { 42 | return -1; 43 | } 44 | } 45 | // 46 | // Operation must be: 47 | // symetric: compare(a,b)=-compare(b,a) 48 | // transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0 true if all Drawables and the Camera don't change position! 49 | // consistency?: compare(x, y)==0 implies that sgn(compare(x, z))==sgn(compare(y, z)) 50 | // 51 | 52 | } 53 | 54 | } 55 | 56 | 57 | //======================================================= 58 | //Service provided by Telerik (www.telerik.com) 59 | //Conversion powered by NRefactory. 60 | //Twitter: @telerik 61 | //Facebook: facebook.com/telerik 62 | //======================================================= 63 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/Scene/Decomposition.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Primitives; 9 | 10 | namespace nzy3D.Plot3D.Rendering.Scene 11 | { 12 | 13 | public class Decomposition 14 | { 15 | 16 | public static List GetDecomposition(List drawables) 17 | { 18 | List monotypes = new List(); 19 | foreach (AbstractDrawable c in drawables) { 20 | if ((c != null) && c.Displayed) { 21 | AbstractComposite cAC = c as AbstractComposite; 22 | AbstractDrawable cAD = c as AbstractDrawable; 23 | if (cAC != null) 24 | { 25 | monotypes.AddRange(GetDecomposition(cAC)); 26 | } 27 | else if (cAD != null) 28 | { 29 | monotypes.Add(cAD); 30 | } 31 | } 32 | } 33 | return monotypes; 34 | } 35 | 36 | /// 37 | /// Recursively expand all monotype Drawables from the given Composite 38 | /// 39 | public static List GetDecomposition(AbstractComposite input) 40 | { 41 | List selection = new List(); 42 | foreach (AbstractDrawable c in input.GetDrawables) { 43 | if ((c != null) && c.Displayed) { 44 | AbstractComposite cAC = c as AbstractComposite; 45 | AbstractDrawable cAD = c as AbstractDrawable; 46 | if (cAC != null) 47 | { 48 | selection.AddRange(GetDecomposition(cAC)); 49 | } 50 | else if (cAD != null) 51 | { 52 | selection.Add(cAD); 53 | } 54 | } 55 | } 56 | return selection; 57 | } 58 | 59 | } 60 | 61 | } 62 | 63 | //======================================================= 64 | //Service provided by Telerik (www.telerik.com) 65 | //Conversion powered by NRefactory. 66 | //Twitter: @telerik 67 | //Facebook: facebook.com/telerik 68 | //======================================================= 69 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/View/IRenderer2D.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Rendering.View 9 | { 10 | 11 | public interface IRenderer2D 12 | { 13 | 14 | 15 | void Paint(System.Drawing.Graphics g); 16 | } 17 | 18 | } 19 | 20 | //======================================================= 21 | //Service provided by Telerik (www.telerik.com) 22 | //Conversion powered by NRefactory. 23 | //Twitter: @telerik 24 | //Facebook: facebook.com/telerik 25 | //======================================================= 26 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/View/ImageRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using OpenTK.Graphics.OpenGL; 9 | 10 | namespace nzy3D.Plot3D.Rendering.View 11 | { 12 | 13 | public class ImageRenderer 14 | { 15 | 16 | public static void RenderImage(IntPtr image, int imageWidth, int imageHeight, int screenWidth, int screenHeight) 17 | { 18 | RenderImage(image, imageWidth, imageHeight, screenWidth, screenHeight, 0.75); 19 | } 20 | 21 | public static void RenderImage(IntPtr image, int imageWidth, int imageHeight, int screenWidth, int screenHeight, double z) 22 | { 23 | if ((image == null)) { 24 | return; 25 | } 26 | double xratio = 1; 27 | double yratio = 1; 28 | double xpict = 0; 29 | double ypict = 0; 30 | if (imageWidth < screenWidth) { 31 | xpict = Convert.ToInt32(screenWidth / 2 - imageWidth / 2); 32 | } else { 33 | xratio = screenWidth / imageWidth; 34 | } 35 | if (imageHeight < screenHeight) { 36 | xpict = Convert.ToInt32(screenHeight / 2 - imageWidth / 2); 37 | } else { 38 | xratio = screenHeight / imageHeight; 39 | } 40 | // Draw 41 | GL.PixelZoom((float)xratio, (float)yratio); 42 | GL.RasterPos3(xpict, ypict, z); 43 | GL.DrawPixels(imageWidth, imageHeight, PixelFormat.Rgba, PixelType.UnsignedByte, image); 44 | } 45 | 46 | } 47 | 48 | } 49 | 50 | //======================================================= 51 | //Service provided by Telerik (www.telerik.com) 52 | //Conversion powered by NRefactory. 53 | //Twitter: @telerik 54 | //Facebook: facebook.com/telerik 55 | //======================================================= 56 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/View/ImageViewport.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using OpenTK.Graphics.OpenGL; 9 | 10 | namespace nzy3D.Plot3D.Rendering.View 11 | { 12 | 13 | public class ImageViewport : AbstractViewport 14 | { 15 | 16 | internal int _imageHeight; 17 | internal int _imageWidth; 18 | internal System.Drawing.Bitmap _imageObj; 19 | 20 | internal IntPtr _imageData; 21 | public ImageViewport() 22 | { 23 | StretchToFill = false; 24 | } 25 | 26 | /// 27 | /// Renders the picture into the window, according to the viewport settings. 28 | /// If the picture is bigger than the viewport, it is simply centered in it, 29 | /// otherwise, it is scaled in order to fit into the viewport. 30 | /// 31 | /// 32 | public virtual void Render() 33 | { 34 | GL.MatrixMode(MatrixMode.Projection); 35 | GL.PushMatrix(); 36 | GL.LoadIdentity(); 37 | ApplyViewPort(); 38 | GL.Ortho(0, _screenWidth, 0, _screenHeight, -1, 1); 39 | // Zoom and layout 40 | GL.MatrixMode(MatrixMode.Modelview); 41 | GL.PushMatrix(); 42 | GL.LoadIdentity(); 43 | ImageRenderer.RenderImage(_imageData, _imageWidth, _imageHeight, _screenWidth, _screenHeight); 44 | // Restore matrices state 45 | GL.PopMatrix(); 46 | GL.MatrixMode(MatrixMode.Projection); 47 | GL.PopMatrix(); 48 | } 49 | 50 | public System.Drawing.Bitmap Image { 51 | get { return _imageObj; } 52 | set { 53 | _imageObj = value; 54 | _imageHeight = value.Height; 55 | _imageWidth = value.Width; 56 | _imageData = value.GetHbitmap(); 57 | } 58 | } 59 | 60 | /// 61 | /// Return the minimum size for this graphic. 62 | /// 63 | public virtual System.Drawing.Size MinimumSize { 64 | get { return new System.Drawing.Size(0, 0); } 65 | } 66 | 67 | /// 68 | /// Return the prefered size for this graphic. 69 | /// 70 | public System.Drawing.Size PreferedSize { 71 | get { return new System.Drawing.Size(1, 1); } 72 | } 73 | 74 | 75 | } 76 | 77 | } 78 | 79 | //======================================================= 80 | //Service provided by Telerik (www.telerik.com) 81 | //Conversion powered by NRefactory. 82 | //Twitter: @telerik 83 | //Facebook: facebook.com/telerik 84 | //======================================================= 85 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/View/Modes/CameraMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Rendering.View.Modes 9 | { 10 | 11 | public enum CameraMode 12 | { 13 | ORTHOGONAL, 14 | PERSPECTIVE 15 | } 16 | 17 | } 18 | 19 | 20 | //======================================================= 21 | //Service provided by Telerik (www.telerik.com) 22 | //Conversion powered by NRefactory. 23 | //Twitter: @telerik 24 | //Facebook: facebook.com/telerik 25 | //======================================================= 26 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/View/Modes/ViewBoundMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Rendering.View.Modes 9 | { 10 | 11 | /// 12 | /// Indicates a bounding mode 13 | /// 14 | /// 15 | public enum ViewBoundMode 16 | { 17 | 18 | /// 19 | /// Automatically fits to the scene graph bounds. 20 | /// 21 | AUTO_FIT, 22 | 23 | /// 24 | /// Fits the view to the manual bounds. 25 | /// 26 | MANUAL 27 | 28 | } 29 | 30 | } 31 | 32 | //======================================================= 33 | //Service provided by Telerik (www.telerik.com) 34 | //Conversion powered by NRefactory. 35 | //Twitter: @telerik 36 | //Facebook: facebook.com/telerik 37 | //======================================================= 38 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/View/Modes/ViewPositionMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Rendering.View.Modes 9 | { 10 | 11 | /// 12 | /// Allows to apply a restriction on the degree of freedom that is 13 | /// let on the View control. 14 | /// 15 | public enum ViewPositionMode 16 | { 17 | 18 | /// 19 | /// Enforce view point on top of the scene. 20 | /// 21 | TOP, 22 | 23 | /// 24 | /// Enforce view point on profile of the scene. 25 | /// 26 | PROFILE, 27 | 28 | /// 29 | /// No enforcement of view point: let the user freely turn around the scene. 30 | /// 31 | FREE 32 | 33 | } 34 | 35 | } 36 | 37 | 38 | //======================================================= 39 | //Service provided by Telerik (www.telerik.com) 40 | //Conversion powered by NRefactory. 41 | //Twitter: @telerik 42 | //Facebook: facebook.com/telerik 43 | //======================================================= 44 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Rendering/View/ViewPort.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | namespace nzy3D.Plot3D.Rendering.View 9 | { 10 | 11 | public class ViewPort 12 | { 13 | 14 | internal int _width; 15 | internal int _height; 16 | internal int _x; 17 | 18 | internal int _y; 19 | public ViewPort(int width, int height) : this(width, height, 0, 0) 20 | { 21 | } 22 | 23 | public ViewPort(int width, int height, int x, int y) 24 | { 25 | _width = width; 26 | _height = height; 27 | _x = x; 28 | _y = y; 29 | } 30 | 31 | public static ViewPort Slice(int width, int height, float left, float right) 32 | { 33 | int thiswidth = Convert.ToInt32((right - left) * width); 34 | int thisheight = height; 35 | int thisx = Convert.ToInt32(left * width); 36 | int thisy = thisx + thiswidth; 37 | return new ViewPort(thiswidth, thisheight, thisx, thisy); 38 | } 39 | 40 | public int Width { 41 | get { return _width; } 42 | set { _width = value; } 43 | } 44 | 45 | public int Height { 46 | get { return _height; } 47 | set { _height = value; } 48 | } 49 | 50 | public int X { 51 | get { return _x; } 52 | set { _x = value; } 53 | } 54 | 55 | public int Y { 56 | get { return _y; } 57 | set { _y = value; } 58 | } 59 | 60 | public override string ToString() 61 | { 62 | return "(ViewPort) width=" + Width + " height=" + Height + " x=" + X + " y=" + Y; 63 | } 64 | 65 | } 66 | 67 | } 68 | 69 | //======================================================= 70 | //Service provided by Telerik (www.telerik.com) 71 | //Conversion powered by NRefactory. 72 | //Twitter: @telerik 73 | //Facebook: facebook.com/telerik 74 | //======================================================= 75 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Text/AbstractTextRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Text 11 | { 12 | 13 | public abstract class AbstractTextRenderer : ITextRenderer 14 | { 15 | 16 | internal Coord2d defScreenOffset; 17 | 18 | internal Coord3d defSceneOffset; 19 | public AbstractTextRenderer() 20 | { 21 | defScreenOffset = new Coord2d(); 22 | defSceneOffset = new Coord3d(); 23 | } 24 | 25 | public abstract void drawSimpleText(Rendering.View.Camera cam, string s, Maths.Coord3d position, Colors.Color color); 26 | 27 | public Maths.BoundingBox3d drawText(Rendering.View.Camera cam, string s, Maths.Coord3d position, Align.Halign halign, Align.Valign valign, Colors.Color color) 28 | { 29 | return drawText(cam, s, position, halign, valign, color, defScreenOffset, defSceneOffset); 30 | } 31 | 32 | public Maths.BoundingBox3d drawText(Rendering.View.Camera cam, string s, Maths.Coord3d position, Align.Halign halign, Align.Valign valign, Colors.Color color, Maths.Coord2d screenOffset) 33 | { 34 | return drawText(cam, s, position, halign, valign, color, screenOffset, defSceneOffset); 35 | } 36 | 37 | public abstract Maths.BoundingBox3d drawText(Rendering.View.Camera cam, string s, Maths.Coord3d position, Align.Halign halign, Align.Valign valign, Colors.Color color, Maths.Coord2d screenOffset, Maths.Coord3d sceneOffset); 38 | 39 | public Maths.BoundingBox3d drawText(Rendering.View.Camera cam, string s, Maths.Coord3d position, Align.Halign halign, Align.Valign valign, Colors.Color color, Maths.Coord3d sceneOffset) 40 | { 41 | return drawText(cam, s, position, halign, valign, color, defScreenOffset, sceneOffset); 42 | } 43 | 44 | } 45 | 46 | } 47 | 48 | //======================================================= 49 | //Service provided by Telerik (www.telerik.com) 50 | //Conversion powered by NRefactory. 51 | //Twitter: @telerik 52 | //Facebook: facebook.com/telerik 53 | //======================================================= 54 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Text/Align/Halign.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Text.Renderers; 9 | 10 | namespace nzy3D.Plot3D.Text.Align 11 | { 12 | 13 | /// 14 | /// Provides constants for defining the horizontal alignment of a 15 | /// , w.r.t. its position. 16 | /// 17 | /// 18 | public enum Halign 19 | { 20 | 21 | /// 22 | /// Left horizontal alignment. 23 | /// 24 | LEFT, 25 | 26 | /// 27 | /// Right horizontal alignment. 28 | /// 29 | RIGHT, 30 | 31 | /// 32 | /// Centered horizontal alignment. 33 | /// 34 | CENTER, 35 | 36 | /// 37 | /// Default horizontal alignment. 38 | /// 39 | DEFAULT 40 | 41 | } 42 | 43 | } 44 | 45 | //======================================================= 46 | //Service provided by Telerik (www.telerik.com) 47 | //Conversion powered by NRefactory. 48 | //Twitter: @telerik 49 | //Facebook: facebook.com/telerik 50 | //======================================================= 51 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Text/Align/Valign.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Plot3D.Text.Renderers; 9 | 10 | namespace nzy3D.Plot3D.Text.Align 11 | { 12 | 13 | /// 14 | /// Provides constants for defining the horizontal alignment of a 15 | /// , w.r.t. its position. 16 | /// 17 | /// 18 | public enum Valign 19 | { 20 | 21 | /// 22 | /// Top vertical alignment. 23 | /// 24 | TOP, 25 | 26 | /// 27 | /// Ground vertical alignment. 28 | /// 29 | GROUND, 30 | 31 | /// 32 | /// Centered vertical alignment. 33 | /// 34 | CENTER, 35 | 36 | /// 37 | /// Bottom vertical alignment. 38 | /// 39 | BOTTOM, 40 | 41 | /// 42 | /// Default vertical alignment. 43 | /// 44 | DEFAULT 45 | 46 | } 47 | 48 | } 49 | 50 | 51 | //======================================================= 52 | //Service provided by Telerik (www.telerik.com) 53 | //Conversion powered by NRefactory. 54 | //Twitter: @telerik 55 | //Facebook: facebook.com/telerik 56 | //======================================================= 57 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Text/ITextRenderer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Colors; 9 | using nzy3D.Maths; 10 | using nzy3D.Plot3D.Rendering.View; 11 | using nzy3D.Plot3D.Text.Align; 12 | 13 | namespace nzy3D.Plot3D.Text 14 | { 15 | 16 | public interface ITextRenderer 17 | { 18 | BoundingBox3d drawText(Camera cam, string s, Coord3d position, Halign halign, Valign valign, Color color); 19 | BoundingBox3d drawText(Camera cam, string s, Coord3d position, Halign halign, Valign valign, Color color, Coord2d screenOffset, Coord3d sceneOffset); 20 | BoundingBox3d drawText(Camera cam, string s, Coord3d position, Halign halign, Valign valign, Color color, Coord2d screenOffset); 21 | BoundingBox3d drawText(Camera cam, string s, Coord3d position, Halign halign, Valign valign, Color color, Coord3d sceneOffset); 22 | void drawSimpleText(Camera cam, string s, Coord3d position, Color color); 23 | } 24 | 25 | } 26 | 27 | //======================================================= 28 | //Service provided by Telerik (www.telerik.com) 29 | //Conversion powered by NRefactory. 30 | //Twitter: @telerik 31 | //Facebook: facebook.com/telerik 32 | //======================================================= 33 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Transform/ITransformer.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | 10 | namespace nzy3D.Plot3D.Transform 11 | { 12 | 13 | public interface ITransformer 14 | { 15 | 16 | // Execute the effective GL transformation held by this class. 17 | void Execute(); 18 | Coord3d Compute(Coord3d input); 19 | // Apply the transformations to the input coordinates. (Warning: this method is a utility that may not be implemented.) 20 | 21 | } 22 | 23 | } 24 | 25 | //======================================================= 26 | //Service provided by Telerik (www.telerik.com) 27 | //Conversion powered by NRefactory. 28 | //Twitter: @telerik 29 | //Facebook: facebook.com/telerik 30 | //======================================================= 31 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Transform/Scale.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using OpenTK.Graphics.OpenGL; 9 | using nzy3D.Maths; 10 | 11 | namespace nzy3D.Plot3D.Transform 12 | { 13 | 14 | public class Scale : ITransformer 15 | { 16 | 17 | 18 | private Coord3d _scale; 19 | public Scale(Coord3d scale) 20 | { 21 | _scale = scale; 22 | } 23 | 24 | public Maths.Coord3d Compute(Maths.Coord3d input) 25 | { 26 | return input.multiply(_scale); 27 | } 28 | 29 | public void Execute() 30 | { 31 | GL.Scale(_scale.x, _scale.y, _scale.z); 32 | } 33 | 34 | public override string ToString() 35 | { 36 | return "(Scale)" + _scale.ToString(); 37 | } 38 | } 39 | 40 | } 41 | 42 | //======================================================= 43 | //Service provided by Telerik (www.telerik.com) 44 | //Conversion powered by NRefactory. 45 | //Twitter: @telerik 46 | //Facebook: facebook.com/telerik 47 | //======================================================= 48 | -------------------------------------------------------------------------------- /nzy3d-api/Plot3D/Transform/Transform.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Diagnostics; 8 | using nzy3D.Maths; 9 | using OpenTK.Graphics.OpenGL; 10 | 11 | namespace nzy3D.Plot3D.Transform 12 | { 13 | 14 | public class Transform 15 | { 16 | 17 | 18 | private List _sequence; 19 | public Transform() 20 | { 21 | _sequence = new List(); 22 | } 23 | 24 | public Transform(ITransformer transformer) 25 | { 26 | _sequence = new List(); 27 | _sequence.Add(transformer); 28 | } 29 | 30 | public Transform(Transform transform) 31 | { 32 | _sequence = new List(); 33 | foreach (ITransformer nextT in transform.Sequence) { 34 | _sequence.Add(nextT); 35 | } 36 | } 37 | 38 | public IEnumerable Sequence 39 | { 40 | get { return _sequence; } 41 | } 42 | 43 | public void Add(ITransformer nextT) 44 | { 45 | _sequence.Add(nextT); 46 | } 47 | 48 | public void Add(Transform transform) 49 | { 50 | foreach (ITransformer nextT in transform.Sequence) { 51 | _sequence.Add(nextT); 52 | } 53 | } 54 | 55 | 56 | public void Execute() 57 | { 58 | } 59 | 60 | public void Execute(bool loadIdentity) 61 | { 62 | if (loadIdentity) { 63 | GL.LoadIdentity(); 64 | } 65 | foreach (ITransformer nextT in _sequence) { 66 | nextT.Execute(); 67 | } 68 | } 69 | 70 | public Coord3d Compute(Coord3d input) 71 | { 72 | Coord3d output = (Coord3d)input.Clone(); 73 | foreach (ITransformer nextT in _sequence) { 74 | output = nextT.Compute(output); 75 | } 76 | return output; 77 | } 78 | 79 | /// 80 | /// Returns the string representation 81 | /// 82 | public override string ToString() 83 | { 84 | string txt = ""; 85 | foreach (ITransformer nextT in _sequence) { 86 | txt += " * " + nextT.ToString(); 87 | } 88 | return txt; 89 | } 90 | 91 | } 92 | 93 | } 94 | 95 | //======================================================= 96 | //Service provided by Telerik (www.telerik.com) 97 | //Conversion powered by NRefactory. 98 | //Twitter: @telerik 99 | //Facebook: facebook.com/telerik 100 | //======================================================= 101 | -------------------------------------------------------------------------------- /nzy3d-api/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("nzy3d-api")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("nzy3d-api")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("54a9f519-5425-45c5-b0c4-c6a22ed9778e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /nzy3d-tests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /nzy3d-tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("nzy3d-tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("nzy3d-tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("25594567-bdd7-4539-a1fe-ea283d19d5aa")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /nzy3d-tests/Triangle_DtSteps.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using nzy3D.Plot3D.Builder.Delaunay.Jdt; 3 | using System; 4 | using TechTalk.SpecFlow; 5 | 6 | namespace nzy3d_tests 7 | { 8 | [Binding] 9 | public class Triangle_DtSteps 10 | { 11 | 12 | Triangle_dt triangle; 13 | Point_dt point; 14 | 15 | [Given(@"I have an initial test setup")] 16 | public void GivenIHaveAnInitialTestSetup() 17 | { 18 | System.Configuration.ConfigurationManager.RefreshSection("appSettings"); 19 | bool launchDebuger = false; 20 | Boolean.TryParse(System.Configuration.ConfigurationManager.AppSettings["launchDebugger"], out launchDebuger); 21 | if (launchDebuger) 22 | System.Diagnostics.Debugger.Launch(); 23 | } 24 | 25 | [Given(@"I have a triangle with coordinates \((.*),(.*)\)-\((.*),(.*)\)-\((.*),(.*)\)")] 26 | public void GivenIHaveATriangleWithCoordinates__(double p0, double p1, double p2, double p3, double p4, double p5) 27 | { 28 | triangle = new Triangle_dt(new Point_dt(p0, p1), new Point_dt(p2, p3), new Point_dt(p4, p5)); 29 | } 30 | 31 | [Then(@"the triangle has coordinates \((.*),(.*)\)-\((.*),(.*)\)-\((.*),(.*)\)")] 32 | public void ThenTheTriangleHasCoordinates__(double p0, double p1, double p2, double p3, double p4, double p5) 33 | { 34 | Assert.AreEqual(p0, triangle.a.x, "Unexpected coordinate for a.x"); 35 | Assert.AreEqual(p1, triangle.a.y, "Unexpected coordinate for a.y"); 36 | Assert.AreEqual(p2, triangle.b.x, "Unexpected coordinate for b.x"); 37 | Assert.AreEqual(p3, triangle.b.y, "Unexpected coordinate for b.y"); 38 | Assert.AreEqual(p4, triangle.c.x, "Unexpected coordinate for c.x"); 39 | Assert.AreEqual(p5, triangle.c.y, "Unexpected coordinate for c.y"); 40 | } 41 | 42 | [Given(@"I have a point with coordinates \((.*),(.*)\)")] 43 | public void GivenIHaveAPointWithCoordinates(double p0, double p1) 44 | { 45 | point = new Point_dt(p0, p1); 46 | } 47 | 48 | [Then(@"The point is inside the triangle")] 49 | public void ThenThePointIsInsideTheTriangle() 50 | { 51 | Assert.IsTrue(triangle.contains(point), "Point is not inside the triangle"); 52 | } 53 | 54 | [Then(@"The point is outside the triangle")] 55 | public void ThenThePointIsOutsideTheTriangle() 56 | { 57 | Assert.IsFalse(triangle.contains(point), "Point is inside the triangle"); 58 | } 59 | 60 | [Then(@"The point is on the boundary of the triangle")] 61 | public void ThenThePointIsOnTheBoundaryOfTheTriangle() 62 | { 63 | Assert.IsTrue(triangle.contains(point), "Point is not inside the triangle"); 64 | Assert.IsFalse(triangle.contains_BoundaryIsOutside(point), "Point is inside the triangle, boundary excluded"); 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /nzy3d-tests/Triangle_dt.feature: -------------------------------------------------------------------------------- 1 | Feature: Triangle_dt 2 | 3 | Scenario: Triangle setup in counterclockwise 4 | Given I have an initial test setup 5 | And I have a triangle with coordinates (0.0,0.0)-(1.0,0.0)-(0.0,1.0) 6 | Then the triangle has coordinates (0.0,0.0)-(1.0,0.0)-(0.0,1.0) 7 | 8 | Scenario: Triangle setup in clockwise 9 | Given I have an initial test setup 10 | And I have a triangle with coordinates (0.0,0.0)-(0.0,1.0)-(1.0,0.0) 11 | Then the triangle has coordinates (0.0,0.0)-(1.0,0.0)-(0.0,1.0) 12 | 13 | Scenario: Point inside triangle 14 | Given I have an initial test setup 15 | And I have a triangle with coordinates (0.0,0.0)-(0.0,1.0)-(1.0,0.0) 16 | And I have a point with coordinates (0.25,0.25) 17 | Then The point is inside the triangle 18 | 19 | Scenario: Point outside triangle 20 | Given I have an initial test setup 21 | And I have a triangle with coordinates (0.0,0.0)-(0.0,1.0)-(1.0,0.0) 22 | And I have a point with coordinates (0.75,0.75) 23 | Then The point is outside the triangle 24 | 25 | Scenario: Point on the boundary of triangle 26 | Given I have an initial test setup 27 | And I have a triangle with coordinates (0.0,0.0)-(0.0,1.0)-(1.0,0.0) 28 | And I have a point with coordinates (0.5,0.5) 29 | Then The point is on the boundary of the triangle 30 | -------------------------------------------------------------------------------- /nzy3d-tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /nzy3d-winformsDemo/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /nzy3d-winformsDemo/MyMapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace nzy3d_wpfDemo 7 | { 8 | class MyMapper : nzy3D.Plot3D.Builder.Mapper 9 | { 10 | 11 | public override double f(double x, double y) 12 | { 13 | return 10 * Math.Sin(x / 10) * Math.Cos(y / 20) * x; 14 | } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nzy3d-winformsDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace nzy3d_winformsDemo 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /nzy3d-winformsDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("nzy3d-winformsDemo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("nzy3d-winformsDemo")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9756be11-6603-437e-aa19-a038ccbdd8b0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /nzy3d-winformsDemo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace nzy3d_winformsDemo.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("nzy3d_winformsDemo.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /nzy3d-winformsDemo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace nzy3d_winformsDemo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /nzy3d-winformsDemo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace nzy3d_wpfDemo 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Display X ticks 13 | Display Y ticks 14 | Display Z ticks 15 | Display X axis label 16 | Display Y axis label 17 | Display Z axis label 18 | Display tick lines 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/MainWindow.xaml.bak: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/MyMapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace nzy3d_wpfDemo 7 | { 8 | class MyMapper : nzy3D.Plot3D.Builder.Mapper 9 | { 10 | 11 | public override double f(double x, double y) 12 | { 13 | return 10 * Math.Sin(x / 10) * Math.Cos(y / 20) * x; 14 | } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("nzy3d-wpfDemo")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("nzy3d-wpfDemo")] 15 | [assembly: AssemblyCopyright("Copyright © 2014")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace nzy3d_wpfDemo.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("nzy3d_wpfDemo.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace nzy3d_wpfDemo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /nzy3d-wpfDemo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------