From e6bdb0c33178097f10e3e6c47ed6efb3a174fc40 Mon Sep 17 00:00:00 2001 From: Oystein Bjorke Date: Sat, 17 Jun 2017 08:09:03 +0200 Subject: [PATCH] Move SharpDX projects to oxyplot-sharpdx repository #1109 --- .../SharpDX.Wpf/SimpleDemo/App.config | 6 - .../Examples/SharpDX.Wpf/SimpleDemo/App.xaml | 9 - .../SharpDX.Wpf/SimpleDemo/App.xaml.cs | 17 - .../SharpDX.Wpf/SimpleDemo/MainViewModel.cs | 27 - .../SharpDX.Wpf/SimpleDemo/MainWindow.xaml | 15 - .../SharpDX.Wpf/SimpleDemo/MainWindow.xaml.cs | 13 - .../SimpleDemo/Properties/AssemblyInfo.cs | 53 -- .../Properties/Resources.Designer.cs | 63 -- .../SimpleDemo/Properties/Resources.resx | 117 --- .../Properties/Settings.Designer.cs | 26 - .../SimpleDemo/Properties/Settings.settings | 7 - .../SharpDX.Wpf/SimpleDemo/SimpleDemo.csproj | 127 --- .../SharpDX.Wpf/SimpleDemo/packages.config | 5 - Source/OxyPlot.AppVeyor.sln | 32 - .../Converters/OxyColorConverter.cs | 82 -- .../Converters/ThicknessConverter.cs | 59 -- Source/OxyPlot.SharpDX.Wpf/D3D11Image.cs | 148 ---- .../OxyPlot.SharpDX.Wpf.csproj | 123 --- .../OxyPlot.SharpDX.Wpf.csproj.DotSettings | 6 - .../OxyPlot.SharpDX.Wpf.nuspec | 34 - .../OxyPlot.SharpDX.Wpf.snk | Bin 596 -> 0 bytes Source/OxyPlot.SharpDX.Wpf/PlotImage.cs | 711 ----------------- Source/OxyPlot.SharpDX.Wpf/PlotView.cs | 752 ------------------ .../Properties/AssemblyDescription.cs | 28 - .../Resources/designmode.png | Bin 28149 -> 0 bytes .../OxyPlot.SharpDX.Wpf/Themes/Generic.xaml | 70 -- .../Tracker/TrackerControl.cs | 725 ----------------- .../Tracker/TrackerDefinition.cs | 67 -- .../Utilities/ConverterExtensions.cs | 524 ------------ .../OxyPlot.SharpDX.Wpf/Utilities/Keyboard.cs | 49 -- Source/OxyPlot.SharpDX.Wpf/packages.config | 9 - Source/OxyPlot.SharpDX.sln | 95 --- Source/OxyPlot.SharpDX/CacherRenderContext.cs | 733 ----------------- .../OxyPlot.SharpDX/OxyPlot.SharpDX.projitems | 21 - Source/OxyPlot.SharpDX/OxyPlot.SharpDX.shproj | 13 - .../RenderUnits/EllipseRenderUnit.cs | 97 --- .../RenderUnits/GeometryRenderUnit.cs | 121 --- .../RenderUnits/IRenderUnit.cs | 33 - .../RenderUnits/ImageRenderUnit.cs | 94 --- .../RenderUnits/RectangleRenderUnit.cs | 91 --- .../RenderUnits/TextRenderUnit.cs | 98 --- .../OxyPlot.SharpDX/SharpDXOxyExtensions.cs | 90 --- appveyor.yml | 1 - 43 files changed, 5391 deletions(-) delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/App.config delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml.cs delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/MainViewModel.cs delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml.cs delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/AssemblyInfo.cs delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.Designer.cs delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.resx delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.Designer.cs delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.settings delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/SimpleDemo.csproj delete mode 100644 Source/Examples/SharpDX.Wpf/SimpleDemo/packages.config delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Converters/OxyColorConverter.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Converters/ThicknessConverter.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/D3D11Image.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj delete mode 100644 Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj.DotSettings delete mode 100644 Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.nuspec delete mode 100644 Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.snk delete mode 100644 Source/OxyPlot.SharpDX.Wpf/PlotImage.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/PlotView.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Properties/AssemblyDescription.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Resources/designmode.png delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Themes/Generic.xaml delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Tracker/TrackerControl.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Tracker/TrackerDefinition.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Utilities/ConverterExtensions.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/Utilities/Keyboard.cs delete mode 100644 Source/OxyPlot.SharpDX.Wpf/packages.config delete mode 100644 Source/OxyPlot.SharpDX.sln delete mode 100644 Source/OxyPlot.SharpDX/CacherRenderContext.cs delete mode 100644 Source/OxyPlot.SharpDX/OxyPlot.SharpDX.projitems delete mode 100644 Source/OxyPlot.SharpDX/OxyPlot.SharpDX.shproj delete mode 100644 Source/OxyPlot.SharpDX/RenderUnits/EllipseRenderUnit.cs delete mode 100644 Source/OxyPlot.SharpDX/RenderUnits/GeometryRenderUnit.cs delete mode 100644 Source/OxyPlot.SharpDX/RenderUnits/IRenderUnit.cs delete mode 100644 Source/OxyPlot.SharpDX/RenderUnits/ImageRenderUnit.cs delete mode 100644 Source/OxyPlot.SharpDX/RenderUnits/RectangleRenderUnit.cs delete mode 100644 Source/OxyPlot.SharpDX/RenderUnits/TextRenderUnit.cs delete mode 100644 Source/OxyPlot.SharpDX/SharpDXOxyExtensions.cs diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/App.config b/Source/Examples/SharpDX.Wpf/SimpleDemo/App.config deleted file mode 100644 index bae5d6d81..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml b/Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml deleted file mode 100644 index 2f0f49ea2..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml.cs b/Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml.cs deleted file mode 100644 index a43b56a7c..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/App.xaml.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace SimpleDemo -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - } -} diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/MainViewModel.cs b/Source/Examples/SharpDX.Wpf/SimpleDemo/MainViewModel.cs deleted file mode 100644 index 1195cb4d4..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/MainViewModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace SimpleDemo -{ - using OxyPlot; - using OxyPlot.Axes; - using OxyPlot.Series; - - public class MainViewModel - { - public MainViewModel() - { - var model = new PlotModel { Title = "Hello SharpDX from WPF" }; - model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom }); - model.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Title="Left Axis Title" }); - var lineSeries = new LineSeries { Title = "LineSeries", MarkerType = MarkerType.Circle }; - lineSeries.Points.Add(new DataPoint(0, 0)); - lineSeries.Points.Add(new DataPoint(10, 18)); - lineSeries.Points.Add(new DataPoint(20, 12)); - lineSeries.Points.Add(new DataPoint(30, 8)); - lineSeries.Points.Add(new DataPoint(40, 15)); - - model.Series.Add(lineSeries); - this.Model = model; - } - - public PlotModel Model { get; private set; } - } -} diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml b/Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml deleted file mode 100644 index 43a97f341..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml.cs b/Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml.cs deleted file mode 100644 index 7ccb389fb..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/MainWindow.xaml.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace SimpleDemo -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow - { - public MainWindow() - { - this.InitializeComponent(); - } - } -} diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/AssemblyInfo.cs b/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/AssemblyInfo.cs deleted file mode 100644 index 8af1a6adb..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SimpleDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SimpleDemo")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.Designer.cs b/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.Designer.cs deleted file mode 100644 index ae17dd6b7..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SimpleDemo.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SimpleDemo.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.resx b/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.Designer.cs b/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.Designer.cs deleted file mode 100644 index 7918a7597..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SimpleDemo.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.settings b/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/SimpleDemo.csproj b/Source/Examples/SharpDX.Wpf/SimpleDemo/SimpleDemo.csproj deleted file mode 100644 index 2314683b7..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/SimpleDemo.csproj +++ /dev/null @@ -1,127 +0,0 @@ - - - - - Debug - AnyCPU - {48C8FBE0-C817-43BE-AC11-895A69100A86} - WinExe - Properties - SimpleDemo - SimpleDemo - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\packages\SharpDX.3.0.2\lib\net45\SharpDX.dll - True - - - ..\..\..\packages\SharpDX.DXGI.3.0.2\lib\net45\SharpDX.DXGI.dll - True - - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - {92129d21-61e9-4952-ab75-6e5b27c8d3f7} - OxyPlot.SharpDX.Wpf - - - {7a0b35c0-dd17-4964-8e9a-44d6cecdc692} - OxyPlot - - - - - \ No newline at end of file diff --git a/Source/Examples/SharpDX.Wpf/SimpleDemo/packages.config b/Source/Examples/SharpDX.Wpf/SimpleDemo/packages.config deleted file mode 100644 index 20262708e..000000000 --- a/Source/Examples/SharpDX.Wpf/SimpleDemo/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Source/OxyPlot.AppVeyor.sln b/Source/OxyPlot.AppVeyor.sln index 035cc2853..6b934c4cc 100644 --- a/Source/OxyPlot.AppVeyor.sln +++ b/Source/OxyPlot.AppVeyor.sln @@ -23,17 +23,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{215581EE EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleLibrary", "Examples\ExampleLibrary\ExampleLibrary.csproj", "{FACB89E5-53A5-4748-9F5B-E0714EBB37B2}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "OxyPlot.SharpDX", "OxyPlot.SharpDX\OxyPlot.SharpDX.shproj", "{455376C6-4146-497C-BF77-61CBB67F5DF9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.SharpDX.Wpf", "OxyPlot.SharpDX.Wpf\OxyPlot.SharpDX.Wpf.csproj", "{92129D21-61E9-4952-AB75-6E5B27C8D3F7}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.Windows", "OxyPlot.Windows\OxyPlot.Windows.csproj", "{5AA87152-20D5-48F7-AD0F-6E6BAA61FC25}" EndProject Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - OxyPlot.SharpDX\OxyPlot.SharpDX.projitems*{455376c6-4146-497c-bf77-61cbb67f5df9}*SharedItemsImports = 13 - OxyPlot.SharpDX\OxyPlot.SharpDX.projitems*{92129d21-61e9-4952-ab75-6e5b27c8d3f7}*SharedItemsImports = 4 - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|ARM = Debug|ARM @@ -205,30 +197,6 @@ Global {FACB89E5-53A5-4748-9F5B-E0714EBB37B2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {FACB89E5-53A5-4748-9F5B-E0714EBB37B2}.Release|x64.ActiveCfg = Release|Any CPU {FACB89E5-53A5-4748-9F5B-E0714EBB37B2}.Release|x86.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|ARM.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|ARM.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|iPhone.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x64.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x64.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x86.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x86.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|Any CPU.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|ARM.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|ARM.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|iPhone.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|iPhone.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x64.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x64.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x86.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x86.Build.0 = Release|Any CPU {5AA87152-20D5-48F7-AD0F-6E6BAA61FC25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5AA87152-20D5-48F7-AD0F-6E6BAA61FC25}.Debug|Any CPU.Build.0 = Debug|Any CPU {5AA87152-20D5-48F7-AD0F-6E6BAA61FC25}.Debug|ARM.ActiveCfg = Debug|ARM diff --git a/Source/OxyPlot.SharpDX.Wpf/Converters/OxyColorConverter.cs b/Source/OxyPlot.SharpDX.Wpf/Converters/OxyColorConverter.cs deleted file mode 100644 index 61185c503..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/Converters/OxyColorConverter.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Converts from OxyPlot colors to Windows.UI.Color and vice versa. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX.Wpf -{ - using System; - using System.Globalization; - using System.Windows.Data; - using System.Windows.Media; - - /// - /// Converts from OxyPlot colors to Windows.UI.Color and vice versa. - /// - public class OxyColorConverter : IValueConverter - { - /// - /// Converts the specified value. - /// - /// The value. - /// Type of the target. - /// The parameter. - /// The language. - /// The maximum value of the thickness. - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (!(value is OxyColor)) - { - return null; - } - - var color = (OxyColor)value; - if (targetType == typeof(Color)) - { - return color.ToColor(); - } - - if (targetType == typeof(Brush)) - { - return color.ToBrush(); - } - - return null; - } - - /// - /// The convert. - /// - /// The value. - /// The target type. - /// The parameter. - /// The language. - /// The converted value. - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if (targetType != typeof(OxyColor)) - { - return null; - } - - if (value is Color) - { - var color = (Color)value; - return OxyColor.FromArgb(color.A, color.R, color.G, color.B); - } - - var scb = value as SolidColorBrush; - if (scb != null) - { - var color = scb.Color; - return OxyColor.FromArgb(color.A, color.R, color.G, color.B); - } - - return null; - } - } -} \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/Converters/ThicknessConverter.cs b/Source/OxyPlot.SharpDX.Wpf/Converters/ThicknessConverter.cs deleted file mode 100644 index 34482a6ec..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/Converters/ThicknessConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Converts Thickness to double. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX.Wpf -{ - using System; - using System.Globalization; - using System.Windows; - using System.Windows.Data; - - /// - /// Converts Thickness to double. - /// - /// This is used to convert BorderThickness properties to Path.StrokeThickness (double). - /// The maximum thickness value is used. - public class ThicknessConverter : IValueConverter - { - /// - /// Converts the specified value. - /// - /// The value. - /// Type of the target. - /// The parameter. - /// The language. - /// The maximum value of the thickness. - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is Thickness) - { - var t = (Thickness)value; - if (targetType == typeof(double)) - { - return Math.Max(Math.Max(t.Left, t.Right), Math.Max(t.Top, t.Bottom)); - } - } - - return null; - } - - /// - /// Converts back. - /// - /// The value. - /// Type of the target. - /// The parameter. - /// The language. - /// Not implemented. - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/D3D11Image.cs b/Source/OxyPlot.SharpDX.Wpf/D3D11Image.cs deleted file mode 100644 index 6fd629752..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/D3D11Image.cs +++ /dev/null @@ -1,148 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel -// -// -------------------------------------------------------------------------------------------------------------------- - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// The original source code can be found here https://github.com/sharpdx/Toolkit/blob/master/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/D3D11Image.cs - -namespace OxyPlot.SharpDX.Wpf -{ - using System; - using System.Windows; - using System.Windows.Interop; - using global::SharpDX.Direct3D11; - using global::SharpDX.Direct3D9; - using DXGIResource = global::SharpDX.DXGI.Resource; - - /// - /// Represents the Direct3D11 Image. - /// - internal class D3D11Image : D3DImage, IDisposable - { - /// - /// The texture. - /// - private Texture texture; - - /// - /// The texture surface handle - /// - private IntPtr textureSurfaceHandle; - - /// - /// Initializes a new instance of the class. Associates an D3D11 render target with the current instance. - /// - /// A valid D3D9 DeviceEx. - /// A valid D3D11 render target. It must be created with the "Shared" flag. - public D3D11Image(DeviceEx device, Texture2D renderTarget) - { - using (var resource = renderTarget.QueryInterface()) - { - var handle = resource.SharedHandle; - - this.texture = new Texture( - device, - renderTarget.Description.Width, - renderTarget.Description.Height, - 1, - Usage.RenderTarget, - Format.A8R8G8B8, - Pool.Default, - ref handle); - } - - using (var surface = this.texture.GetSurfaceLevel(0)) - { - this.textureSurfaceHandle = surface.NativePointer; - this.TrySetBackbufferPointer(this.textureSurfaceHandle); - } - - this.IsFrontBufferAvailableChanged += this.HandleIsFrontBufferAvailableChanged; - } - - /// - /// Marks the surface of element as invalid and requests its presentation on screen. - /// - public void InvalidateRendering() - { - if (this.texture == null) - { - return; - } - - this.Lock(); - this.AddDirtyRect(new Int32Rect(0, 0, this.PixelWidth, this.PixelHeight)); - this.Unlock(); - } - - /// - /// Try to set the back buffer pointer. - /// - /// A pointer to back buffer. - public void TrySetBackbufferPointer(IntPtr ptr) - { - // TODO: use TryLock and check multithreading scenarios - this.Lock(); - try - { - this.SetBackBuffer(D3DResourceType.IDirect3DSurface9, ptr); - } - finally - { - this.Unlock(); - } - } - - /// - /// Disposes associated D3D9 texture. - /// - public void Dispose() - { - if (this.texture != null) - { - this.Dispatcher.BeginInvoke( - (Action)delegate - { - this.IsFrontBufferAvailableChanged -= this.HandleIsFrontBufferAvailableChanged; - this.texture.Dispose(); - this.texture = null; - this.textureSurfaceHandle = IntPtr.Zero; - - this.TrySetBackbufferPointer(IntPtr.Zero); - }, - System.Windows.Threading.DispatcherPriority.Send); - } - } - - /// - /// Front buffer change event handler. - /// - /// The sender. - /// The event args. - private void HandleIsFrontBufferAvailableChanged(object sender, DependencyPropertyChangedEventArgs e) - { - if (this.IsFrontBufferAvailable) - { - this.TrySetBackbufferPointer(this.textureSurfaceHandle); - } - } - } -} \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj b/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj deleted file mode 100644 index bdd89e70c..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Debug - AnyCPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7} - Library - Properties - OxyPlot.SharpDX.Wpf - OxyPlot.SharpDX.Wpf - v4.5.2 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AnyCPU - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\OxyPlot.SharpDX.Wpf.XML - true - - - true - - - OxyPlot.SharpDX.Wpf.snk - - - - - - ..\packages\SharpDX.3.0.2\lib\net45\SharpDX.dll - True - - - ..\packages\SharpDX.Direct2D1.3.0.2\lib\net45\SharpDX.Direct2D1.dll - True - - - ..\packages\SharpDX.Direct3D11.3.0.2\lib\net45\SharpDX.Direct3D11.dll - True - - - ..\packages\SharpDX.Direct3D9.3.0.2\lib\net45\SharpDX.Direct3D9.dll - True - - - ..\packages\SharpDX.DXGI.3.0.2\lib\net45\SharpDX.DXGI.dll - True - - - ..\packages\SharpDX.Mathematics.3.0.2\lib\net45\SharpDX.Mathematics.dll - True - - - - - - - - - - - - - - - - - Properties\AssemblyInfo.cs - - - - - - - - - - - Designer - - - - - {7a0b35c0-dd17-4964-8e9a-44d6cecdc692} - OxyPlot - - - - - - - - MSBuild:Compile - Designer - - - - - - \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj.DotSettings b/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj.DotSettings deleted file mode 100644 index 75ca3519f..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.csproj.DotSettings +++ /dev/null @@ -1,6 +0,0 @@ - - True - True - True - True - True \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.nuspec b/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.nuspec deleted file mode 100644 index 567dcdcf7..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.nuspec +++ /dev/null @@ -1,34 +0,0 @@ - - - - OxyPlot.SharpDX.Wpf - OxyPlot for WPF with SharpDX based renderer - $version$ - Oystein Bjorke - OxyPlot is a plotting library for .NET. This package targets WPF applications. - - https://raw.githubusercontent.com/oxyplot/oxyplot/master/LICENSE - http://oxyplot.org/ - https://raw.githubusercontent.com/oxyplot/oxyplot/develop/Icons/OxyPlot_128.png - false - wpf plotting plot charting chart sharpdx - - - - - - - - - - - - - - - - - - - - diff --git a/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.snk b/Source/OxyPlot.SharpDX.Wpf/OxyPlot.SharpDX.Wpf.snk deleted file mode 100644 index 0133abf2af8753af18d3f9e43c832d13dc1a4bdf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098g5XbkMI`GujhC+mP9|T{kS#&du;1pvj zWpR2L2#zTJU{-Hq?!9bI%G91|qwqj^#dUILg=RE+9~0on>LyF+5yKFw9?Z=-Ukijp z(x20b_Vpu+(|S$Zu)7a`(pMZXrG+?QOt;)6j_=4<1my;;58;B>X9mDW#w3(dRPeu_ z(eeY_xsj%Z0_slVt%nMud)5vF9;Ywad4LH#PMa@JpL%95mU>=)5K!DX3AV{%gaz}) z(m%x2eSumo@<-84e5<=m{1X|Zm$?YvG|TD(q(fx-ZR(FBt&6j{RPw1L z%;_zoW3qllNmj(|_H1a3fUWwWP08x_v_?qZ3{6n^Pe~fxZZ6>U=f%PA&Is6jDkNYA zku%5u%o(}k%=!;rhMtr-CGv$w*a*9HoS_?IB<_(bd0_=fC)LKNy?EtQ1#?*ZC1``E z#=xm3;WNm1k0)YF -// Copyright (c) 2014 OxyPlot contributors -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX.Wpf -{ - using System; - using System.Windows; - using System.Windows.Controls; - using System.Windows.Interop; - using System.Windows.Media; - using System.Windows.Media.Imaging; - using OxyPlot.SharpDX; - using global::SharpDX; - using global::SharpDX.Direct3D; - using global::SharpDX.Direct3D11; - using global::SharpDX.DXGI; - using AlphaMode = global::SharpDX.Direct2D1.AlphaMode; - using D3D11Device = global::SharpDX.Direct3D11.Device; - using D3D9CreateFlags = global::SharpDX.Direct3D9.CreateFlags; - using D3D9Device = global::SharpDX.Direct3D9.DeviceEx; - using D3D9DeviceType = global::SharpDX.Direct3D9.DeviceType; - using D3D9PresentInterval = global::SharpDX.Direct3D9.PresentInterval; - using D3D9PresentParameters = global::SharpDX.Direct3D9.PresentParameters; - using D3D9SwapEffect = global::SharpDX.Direct3D9.SwapEffect; - using Direct3D = global::SharpDX.Direct3D9.Direct3DEx; - using DXGIResource = global::SharpDX.DXGI.Resource; - using PixelFormat = global::SharpDX.Direct2D1.PixelFormat; - using RenderTarget = global::SharpDX.Direct2D1.RenderTarget; - using RenderTargetProperties = global::SharpDX.Direct2D1.RenderTargetProperties; - - /// - /// Control, that renders Plot using SharpDX renderer, renders Tracker using WPF controls. - /// Adds scrolling support. - /// - public class PlotImage : FrameworkElement, System.Windows.Controls.Primitives.IScrollInfo - { - /// - /// DependencyProperty as the backing store for PlotWidth - /// - public static readonly DependencyProperty PlotWidthProperty = - DependencyProperty.Register(nameof(PlotWidth), typeof(double), typeof(PlotImage), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure)); - - /// - /// Using a DependencyProperty as the backing store for PlotHeight. - /// - public static readonly DependencyProperty PlotHeightProperty = - DependencyProperty.Register(nameof(PlotHeight), typeof(double), typeof(PlotImage), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure)); - - /// - /// DependencyProperty as the backing store for PlotModel - /// - public static readonly DependencyProperty PlotModelProperty = - DependencyProperty.Register(nameof(PlotModel), typeof(IPlotModel), typeof(PlotImage), new PropertyMetadata(null)); - - // stolen from scrollviewer MS source code - - // Scrolling physical "line" metrics. - - /// - /// The scroll line delta. - /// - internal const double ScrollLineDelta = 16.0; // Default physical amount to scroll with one Up/Down/Left/Right key - - /// - /// The mouse wheel delta/ - /// - internal const double MouseWheelDelta = 48.0; // Default physical amount to scroll with one MouseWheel. - - /// - /// The Direct3D11 device. - /// - private D3D11Device d3d11Device; - - /// - /// The Direct3D9 device. - /// - private D3D9Device d3d9Device; - - /// - /// The render target. - /// - private RenderTarget renderTarget; - - /// - /// The oxy render target. - /// - private readonly CacherRenderContext oxyRenderContext; - - /// - /// The image source. - /// - private D3D11Image imageSource; - - /// - /// The overlay transform. - /// - private readonly TranslateTransform overlayTransform; - - /// - /// The extent. - /// - private Size extent; - - /// - /// The viewport. - /// - private Size viewport; - - /// - /// The offset vector. - /// - private Vector offset; - - /// - /// The placeholder image for design time. - /// - private BitmapImage designModeImage; - - /// - /// Initializes a new instance of the class. - /// - public PlotImage() - { - this.oxyRenderContext = new CacherRenderContext(); - this.overlayTransform = new TranslateTransform(); - this.Overlay = new Canvas - { - RenderTransform = this.overlayTransform, - }; - - this.AddVisualChild(this.Overlay); - this.AddLogicalChild(this.Overlay); - - this.Loaded += (s, e) => this.Dispatcher.Invoke(this.InvalidateVisual, System.Windows.Threading.DispatcherPriority.Background); - this.Unloaded += (s, e) => this.OnUnloaded(); - } - - /// - /// Gets or sets the plot model. - /// - public IPlotModel PlotModel - { - get { return (IPlotModel)this.GetValue(PlotModelProperty); } - set { this.SetValue(PlotModelProperty, value); } - } - - /// - /// Gets or sets the plot height. - /// - public double PlotHeight - { - get { return (double)this.GetValue(PlotHeightProperty); } - set { this.SetValue(PlotHeightProperty, value); } - } - - /// - /// Gets or sets the plot width. - /// - public double PlotWidth - { - get { return (double)this.GetValue(PlotWidthProperty); } - set { this.SetValue(PlotWidthProperty, value); } - } - - /// - /// Gets or sets a value indicating whether scrolling on the vertical axis is possible. - /// - public bool CanVerticallyScroll - { - get; set; - } - - /// - /// Gets or sets a value indicating whether scrolling on the vertical axis is possible. - /// - public bool CanHorizontallyScroll - { - get; set; - } - - /// - /// Gets the horizontal size of the extent. - /// - public double ExtentWidth => this.extent.Width; - - /// - /// Gets the vertical size of the extent. - /// - public double ExtentHeight => this.extent.Height; - - /// - /// Gets the horizontal size of the viewport for this content. - /// - public double ViewportWidth => this.viewport.Width; - - /// - /// Gets the vertical size of the viewport for this content. - /// - public double ViewportHeight => this.viewport.Height; - - /// - /// Gets the horizontal offset of the scrolled content. - /// - public double HorizontalOffset => this.offset.X; - - /// - /// Gets the vertical offset of the scrolled content. - /// - public double VerticalOffset => this.offset.Y; - - /// - /// Gets the offset vector of the scrolled content. - /// - public Vector Offset => this.offset; - - /// - /// Gets or sets a System.Windows.Controls.ScrollViewer element that controls scrolling behavior. - /// - public ScrollViewer ScrollOwner { get; set; } - - /// - /// Gets the overlay canvas. - /// - internal Canvas Overlay { get; } - - /// - /// Gets the number of visual child elements within this element. - /// - protected override int VisualChildrenCount => 1; - - /// - /// Renders to surface. - /// - /// Indicates whether on not surface should be recreated. - /// Indicates whether on not render units should be recreated. - public void Render(bool invalidateSurface, bool invalidateUnits) - { - if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) - { - return; - } - - if (!this.IsLoaded) - { - return; - } - - if (invalidateSurface || this.renderTarget == null) - { - this.CleanResources(); - this.InitRendering(); - - invalidateUnits = true; - } - - if (this.PlotModel == null) - { - return; - } - - if (invalidateUnits) - { - this.oxyRenderContext.ResetRenderUnits(); - - // Creates renderUnits that can be rendered later - this.PlotModel.Render(this.oxyRenderContext, this.extent.Width, this.extent.Height); - } - - var backColor = OxyColors.White; - if (!this.PlotModel.Background.IsUndefined()) - { - backColor = this.PlotModel.Background; - } - - this.renderTarget.BeginDraw(); - this.renderTarget.Clear(backColor.ToDXColor()); - this.oxyRenderContext.Render(new RectangleF((float)this.offset.X, (float)this.offset.Y, (float)this.viewport.Width, (float)this.viewport.Height)); // TODO: add clip rectangle - this.renderTarget.EndDraw(); - - this.d3d11Device.ImmediateContext.Flush(); - - this.imageSource.Lock(); - this.imageSource.AddDirtyRect(new Int32Rect() - { - X = 0, - Y = 0, - Height = this.imageSource.PixelHeight, - Width = this.imageSource.PixelWidth - }); - this.imageSource.Unlock(); - } - - /// - /// Scrolls up within content by one logical unit. - /// - public void LineUp() - { - this.AddOffset(0, -ScrollLineDelta); - } - - /// - /// Scrolls down within content by one logical unit. - /// - public void LineDown() - { - this.AddOffset(0, ScrollLineDelta); - } - - /// - /// Scrolls left within content by one logical unit. - /// - public void LineLeft() - { - this.AddOffset(-ScrollLineDelta, 0); - } - - /// - /// Scrolls right within content by one logical unit. - /// - public void LineRight() - { - this.AddOffset(ScrollLineDelta, 0); - } - - /// - /// Scrolls up within content by one page. - /// - public void PageUp() - { - this.AddOffset(0, -this.viewport.Height); - } - - /// - /// Scrolls down within content by one page. - /// - public void PageDown() - { - this.AddOffset(0, this.viewport.Height); - } - - /// - /// Scrolls left within content by one page. - /// - public void PageLeft() - { - this.AddOffset(-this.viewport.Height, 0); - } - - /// - /// Scrolls right within content by one page. - /// - public void PageRight() - { - this.AddOffset(this.viewport.Height, 0); - } - - /// - /// Scrolls up within content after a user clicks the wheel button on a mouse. - /// - public void MouseWheelUp() - { - this.AddOffset(0, -MouseWheelDelta); - } - - /// - /// Scrolls down within content after a user clicks the wheel button on a mouse. - /// - public void MouseWheelDown() - { - this.AddOffset(0, MouseWheelDelta); - } - - /// - /// Scrolls left within content after a user clicks the wheel button on a mouse. - /// - public void MouseWheelLeft() - { - this.AddOffset(-MouseWheelDelta, 0); - } - - /// - /// Scrolls right within content after a user clicks the wheel button on a mouse. - /// - public void MouseWheelRight() - { - this.AddOffset(MouseWheelDelta, 0); - } - - /// - /// Sets the amount of horizontal offset. - /// - /// The degree to which content is horizontally offset from the containing viewport. - public void SetHorizontalOffset(double offset) - { - this.offset.X = offset; - this.InvalidateVisual(); - } - - /// - /// Sets the amount of vertical offset. - /// - /// The degree to which content is vertically offset from the containing viewport. - public void SetVerticalOffset(double offset) - { - this.offset.Y = offset; - this.InvalidateVisual(); - } - - /// - /// Forces content to scroll until the coordinate space of a System.Windows.Media.Visual - /// object is visible. - /// - /// A System.Windows.Media.Visual that becomes visible. - /// A bounding rectangle that identifies the coordinate space to make visible. - /// A that is visible. - public Rect MakeVisible(Visual visual, Rect rectangle) - { - return rectangle; - - // TODO: implement this???????? - } - - /// - /// Invalidates current instance. - /// - internal void Invalidate() - { - this.Render(false, true); - this.InvalidateVisual(); - } - - /// - /// Overrides System.Windows.Media.Visual.GetVisualChild(), and returns a child at the specified index from a collection of child elements. - /// - /// The zero-based index of the requested child element in the collection. - /// The requested child element. This should not return null; if the provided index is out of range, an exception is thrown. - protected override Visual GetVisualChild(int index) - { - if (index != 0) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - - return this.Overlay; - } - - /// - /// When overridden in a derived class, participates in rendering operations that - /// are directed by the layout system. The rendering instructions for this element - /// are not used directly when this method is invoked, and are instead preserved - /// for later asynchronous use by layout and drawing. - /// - /// The drawing instructions for a specific element. This context is provided to the layout system. - protected override void OnRender(DrawingContext drawingContext) - { - base.OnRender(drawingContext); - if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) - { - if (this.designModeImage == null) - { - var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("OxyPlot.SharpDX.Wpf.Resources.designmode.png"); - - this.designModeImage = new BitmapImage(); - - this.designModeImage.BeginInit(); - this.designModeImage.StreamSource = stream; - this.designModeImage.EndInit(); - } - - drawingContext.DrawImage(this.designModeImage, new Rect(0, 0, this.ActualWidth, this.ActualHeight)); - } - - if (this.imageSource != null) - { - drawingContext.DrawImage(this.imageSource, new Rect(0, 0, this.imageSource.Width, this.imageSource.Height)); - } - } - - /// - /// When overridden in a derived class, measures the size in layout required for - /// child elements and determines a size for the System.Windows.FrameworkElement-derived - /// class. - /// - /// The available size that this element can give to child elements. Infinity can - /// be specified as a value to indicate that the element will size to whatever content - /// is available. - /// - /// The size that this element determines it needs during layout, based on its calculations - /// of child element sizes. - protected override Size MeasureOverride(Size availableSize) - { - double desiredHeight; - double desiredWidth; - - if (!double.IsNaN(this.PlotHeight)) - { - this.extent.Height = this.PlotHeight; - desiredHeight = Math.Min(this.PlotHeight, availableSize.Height); - } - else - { - this.extent.Height = !double.IsInfinity(availableSize.Height) ? availableSize.Height : 1; - desiredHeight = this.extent.Height; - } - - if (!double.IsNaN(this.PlotWidth)) - { - this.extent.Width = this.PlotWidth; - desiredWidth = Math.Min(this.PlotWidth, availableSize.Width); - } - else - { - this.extent.Width = !double.IsInfinity(availableSize.Width) ? availableSize.Width : 1; - desiredWidth = this.extent.Width; - } - - var desired = new Size(desiredWidth, desiredHeight); - - this.Overlay.Measure(desired); - if (this.ScrollOwner != null) - { - this.ScrollOwner.InvalidateScrollInfo(); - } - - return desired; - } - - /// - /// When overridden in a derived class, positions child elements and determines a - /// size for a System.Windows.FrameworkElement derived class. - /// - /// - /// The final area within the parent that this element should use to arrange itself - /// and its children. - /// - /// The actual size used. - protected override Size ArrangeOverride(Size finalSize) - { - var overlaySize = this.extent; - - if (!this.CanVerticallyScroll) - { - overlaySize.Height = finalSize.Height; - this.offset.Y = 0; - } - else - { - this.overlayTransform.Y = -this.offset.Y; - } - - if (!this.CanHorizontallyScroll) - { - overlaySize.Width = finalSize.Width; - this.offset.X = 0; - } - else - { - this.overlayTransform.X = -this.offset.X; - } - - this.Overlay.Arrange(new Rect(overlaySize)); - - bool sizeChanged = this.viewport != finalSize; - - this.viewport = finalSize; - - if (this.ScrollOwner != null) - { - this.ScrollOwner.InvalidateScrollInfo(); - } - - this.Render(sizeChanged, false); - - return finalSize; - } - - /// - /// Initializes DirectX rendering resources. - /// - private void InitRendering() - { - double dpiScale = 1.0; // default value for 96 dpi - - var hwndTarget = PresentationSource.FromVisual(this).CompositionTarget as HwndTarget; - if (hwndTarget != null) - { - dpiScale = hwndTarget.TransformToDevice.M11; - } - - int surfWidth = (int)(this.viewport.Width < 0 ? 0 : Math.Ceiling(this.viewport.Width * dpiScale)); - int surfHeight = (int)(this.viewport.Height < 0 ? 0 : Math.Ceiling(this.viewport.Height * dpiScale)); - - var windowHandle = (new WindowInteropHelper(Window.GetWindow(this))).Handle; - - this.d3d11Device = new D3D11Device( - DriverType.Hardware, - DeviceCreationFlags.BgraSupport, - FeatureLevel.Level_11_0, - FeatureLevel.Level_10_1, - FeatureLevel.Level_10_0, - FeatureLevel.Level_9_3, - FeatureLevel.Level_9_2, - FeatureLevel.Level_9_1); - - var backBuffer = new Texture2D( - this.d3d11Device, - new Texture2DDescription - { - Height = surfHeight, - Width = surfWidth, - ArraySize = 1, - MipLevels = 1, - Format = Format.B8G8R8A8_UNorm, - SampleDescription = { Count = 1, Quality = 0 }, - Usage = ResourceUsage.Default, - OptionFlags = ResourceOptionFlags.Shared, - BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource, - CpuAccessFlags = 0 - }); - - var surface = backBuffer.QueryInterface(); - this.renderTarget = new RenderTarget( - this.oxyRenderContext.D2DFactory, - surface, - new RenderTargetProperties(new PixelFormat(Format.Unknown, AlphaMode.Premultiplied))); - - this.d3d9Device = new D3D9Device( - new Direct3D(), - 0, - D3D9DeviceType.Hardware, - windowHandle, - D3D9CreateFlags.HardwareVertexProcessing | D3D9CreateFlags.Multithreaded | D3D9CreateFlags.FpuPreserve, - new D3D9PresentParameters(surfWidth, surfHeight) - { - PresentationInterval = D3D9PresentInterval.Immediate, - DeviceWindowHandle = windowHandle, - SwapEffect = D3D9SwapEffect.Discard, - Windowed = true - }); - - this.imageSource = new D3D11Image(this.d3d9Device, backBuffer); - - this.oxyRenderContext.ResetRenderTarget(this.renderTarget); - } - - /// - /// Free used resources. - /// - private void CleanResources() - { - this.oxyRenderContext.ResetRenderTarget(null); - - this.d3d11Device?.ImmediateContext.ClearState(); - this.d3d11Device?.ImmediateContext.Flush(); - - this.imageSource?.Dispose(); - this.d3d9Device?.Dispose(); - this.renderTarget?.Dispose(); - this.d3d11Device?.Dispose(); - - this.imageSource = null; - this.d3d9Device = null; - this.renderTarget = null; - this.d3d11Device = null; - } - - /// - /// Called when control unloaded. - /// - private void OnUnloaded() - { - this.CleanResources(); - } - - /// - /// Changes offset by , vector. - /// - /// The X axis delta. - /// The Y axis delta. - private void AddOffset(double deltaX, double deltaY) - { - this.offset.X += deltaX; - this.offset.Y += deltaY; - - if (this.offset.X < 0) - { - this.offset.X = 0; - } - - if (this.offset.X + this.viewport.Width > this.extent.Width) - { - this.offset.X = Math.Max(0, this.extent.Width - this.viewport.Width); - } - - if (this.offset.Y < 0) - { - this.offset.Y = 0; - } - - if (this.offset.Y + this.viewport.Height > this.extent.Height) - { - this.offset.Y = Math.Max(0, this.extent.Height - this.viewport.Height); - } - - this.InvalidateVisual(); - } - } -} diff --git a/Source/OxyPlot.SharpDX.Wpf/PlotView.cs b/Source/OxyPlot.SharpDX.Wpf/PlotView.cs deleted file mode 100644 index ccdc78ec4..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/PlotView.cs +++ /dev/null @@ -1,752 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -------------------------------------------------------------------------------------------------------------------- -namespace OxyPlot.SharpDX.Wpf -{ - using System; - using System.Collections.ObjectModel; - using System.Linq; - using System.Threading; - using System.Windows; - using System.Windows.Controls; - using System.Windows.Input; - using System.Windows.Media.Imaging; - - /// - /// Represents a control that displays a using SharpDX based renderer. - /// - [TemplatePart(Name = PartPlotImage, Type = typeof(PlotImage))] - public class PlotView : Control, IPlotView - { - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty ControllerProperty = - DependencyProperty.Register("Controller", typeof(IPlotController), typeof(PlotView), new PropertyMetadata(null)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty DefaultTrackerTemplateProperty = - DependencyProperty.Register( - "DefaultTrackerTemplate", typeof(ControlTemplate), typeof(PlotView), new PropertyMetadata(null)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty HandleRightClicksProperty = - DependencyProperty.Register("HandleRightClicks", typeof(bool), typeof(PlotView), new PropertyMetadata(true)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty IsMouseWheelEnabledProperty = - DependencyProperty.Register("IsMouseWheelEnabled", typeof(bool), typeof(PlotView), new PropertyMetadata(true)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( - "Model", typeof(PlotModel), typeof(PlotView), new PropertyMetadata(null, ModelChanged)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty ZoomRectangleTemplateProperty = - DependencyProperty.Register( - "ZoomRectangleTemplate", typeof(ControlTemplate), typeof(PlotView), new PropertyMetadata(null)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty PlotHeightProperty = - DependencyProperty.Register("PlotHeight", typeof(double), typeof(PlotView), new PropertyMetadata(double.NaN)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty PlotWidthProperty = - DependencyProperty.Register("PlotWidth", typeof(double), typeof(PlotView), new PropertyMetadata(double.NaN)); - - /// - /// The Grid PART constant. - /// - private const string PartPlotImage = "PART_PlotImage"; - - /// - /// The model lock. - /// - private readonly object modelLock = new object(); - - /// - /// The tracker definitions. - /// - private readonly ObservableCollection trackerDefinitions; - - /// - /// The mouse down point. - /// - private ScreenPoint mouseDownPoint; - - /// - /// The current model. - /// - private PlotModel currentModel; - - /// - /// The current tracker. - /// - private FrameworkElement currentTracker; - - /// - /// The default controller. - /// - private IPlotController defaultController; - - /// - /// The zoom control. - /// - private ContentControl zoomRectangle; - - /// - /// Plot DirectX rendering goes here - /// - private PlotImage plotImage; - - /// - /// Invalidate count. - /// - private int invalidated = 0; - - /// - /// Initializes static members of the class. - /// - static PlotView() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(PlotView), new FrameworkPropertyMetadata(typeof(PlotView))); - global::SharpDX.Configuration.EnableReleaseOnFinalizer = true; -#if DEBUG - // global::SharpDX.Configuration.EnableReleaseOnFinalizer EnableObjectTracking = true; -#endif - } - - /// - /// Initializes a new instance of the class. - /// - public PlotView() - { - this.DefaultStyleKey = typeof(PlotView); - - this.trackerDefinitions = new ObservableCollection(); - } - - /// - /// Gets or sets the plot height - /// - public double PlotHeight - { - get { return (double)this.GetValue(PlotHeightProperty); } - set { this.SetValue(PlotHeightProperty, value); } - } - - /// - /// Gets or sets the plot width - /// - public double PlotWidth - { - get { return (double)this.GetValue(PlotWidthProperty); } - set { this.SetValue(PlotWidthProperty, value); } - } - - /// - /// Gets or sets the PlotView controller. - /// - /// The PlotView controller. - public IPlotController Controller - { - get { return (IPlotController)this.GetValue(ControllerProperty); } - set { this.SetValue(ControllerProperty, value); } - } - - /// - /// Gets or sets the default tracker template. - /// - public ControlTemplate DefaultTrackerTemplate - { - get - { - return (ControlTemplate)this.GetValue(DefaultTrackerTemplateProperty); - } - - set - { - this.SetValue(DefaultTrackerTemplateProperty, value); - } - } - - /// - /// Gets or sets a value indicating whether to handle right clicks. - /// - public bool HandleRightClicks - { - get - { - return (bool)this.GetValue(HandleRightClicksProperty); - } - - set - { - this.SetValue(HandleRightClicksProperty, value); - } - } - - /// - /// Gets or sets a value indicating whether IsMouseWheelEnabled. - /// - public bool IsMouseWheelEnabled - { - get - { - return (bool)this.GetValue(IsMouseWheelEnabledProperty); - } - - set - { - this.SetValue(IsMouseWheelEnabledProperty, value); - } - } - - /// - /// Gets or sets the to show. - /// - /// The . - public PlotModel Model - { - get - { - return (PlotModel)this.GetValue(ModelProperty); - } - - set - { - this.SetValue(ModelProperty, value); - } - } - - /// - /// Gets or sets the zoom rectangle template. - /// - /// The zoom rectangle template. - public ControlTemplate ZoomRectangleTemplate - { - get - { - return (ControlTemplate)this.GetValue(ZoomRectangleTemplateProperty); - } - - set - { - this.SetValue(ZoomRectangleTemplateProperty, value); - } - } - - /// - /// Gets the tracker definitions. - /// - /// The tracker definitions. - public ObservableCollection TrackerDefinitions - { - get - { - return this.trackerDefinitions; - } - } - - /// - /// Gets the actual model in the view. - /// - /// - /// The actual model. - /// - Model IView.ActualModel - { - get - { - return this.Model; - } - } - - /// - /// Gets the actual model. - /// - /// The actual model. - public PlotModel ActualModel - { - get - { - return this.currentModel; - } - } - - /// - /// Gets the actual controller. - /// - /// - /// The actual . - /// - IController IView.ActualController - { - get - { - return this.ActualController; - } - } - - /// - /// Gets the coordinates of the client area of the view. - /// - public OxyRect ClientArea - { - get - { - return new OxyRect(0, 0, this.ActualWidth, this.ActualHeight); - } - } - - /// - /// Gets the actual PlotView controller. - /// - /// The actual PlotView controller. - public IPlotController ActualController - { - get - { - return this.Controller ?? (this.defaultController ?? (this.defaultController = new PlotController())); - } - } - - /// - /// Hides the tracker. - /// - public void HideTracker() - { - if (this.currentTracker != null) - { - this.plotImage.Overlay.Children.Remove(this.currentTracker); - this.currentTracker = null; - } - } - - /// - /// Hides the zoom rectangle. - /// - public void HideZoomRectangle() - { - this.zoomRectangle.Visibility = Visibility.Collapsed; - } - - /// - /// Invalidate the PlotView (not blocking the UI thread) - /// - /// if set to true, the data collections will be updated. - public void InvalidatePlot(bool update = true) - { - this.UpdateModel(update); - if (this.plotImage != null) - { - this.plotImage.PlotModel = this.ActualModel; - - if (Interlocked.Exchange(ref this.invalidated, 1) == 1) - { - return; - } - - this.Dispatcher.InvokeAsync( - () => - { - this.plotImage.Invalidate(); - this.invalidated = 0; - }, - System.Windows.Threading.DispatcherPriority.Background); - } - } - - /// - /// Sets the cursor. - /// - /// The cursor. - public void SetCursorType(OxyPlot.CursorType cursor) - { - var type = Cursors.Arrow; - switch (cursor) - { - case OxyPlot.CursorType.Default: - type = null; - break; - case OxyPlot.CursorType.Pan: - type = Cursors.Hand; - break; - case OxyPlot.CursorType.ZoomHorizontal: - type = Cursors.SizeWE; - break; - case OxyPlot.CursorType.ZoomVertical: - type = Cursors.SizeNS; - break; - case OxyPlot.CursorType.ZoomRectangle: - type = Cursors.SizeNWSE; - break; - } - - Mouse.OverrideCursor = type; - } - - /// - /// Shows the tracker. - /// - /// The tracker data. - public void ShowTracker(TrackerHitResult trackerHitResult) - { - if (trackerHitResult == null) - { - this.HideTracker(); - return; - } - - var trackerTemplate = this.DefaultTrackerTemplate; - if (trackerHitResult.Series != null && !string.IsNullOrEmpty(trackerHitResult.Series.TrackerKey)) - { - var match = this.TrackerDefinitions.FirstOrDefault(t => t.TrackerKey == trackerHitResult.Series.TrackerKey); - if (match != null) - { - trackerTemplate = match.TrackerTemplate; - } - } - - if (trackerTemplate == null) - { - this.HideTracker(); - return; - } - - var tracker = new ContentControl { Template = trackerTemplate }; - - if (tracker != this.currentTracker) - { - this.HideTracker(); - this.plotImage.Overlay.Children.Add(tracker); - this.currentTracker = tracker; - } - - if (this.currentTracker != null) - { - this.currentTracker.DataContext = trackerHitResult; - } - } - - /// - /// Shows the zoom rectangle. - /// - /// The rectangle. - public void ShowZoomRectangle(OxyRect r) - { - this.zoomRectangle.Width = r.Width; - this.zoomRectangle.Height = r.Height; - Canvas.SetLeft(this.zoomRectangle, r.Left); - Canvas.SetTop(this.zoomRectangle, r.Top); - this.zoomRectangle.Template = this.ZoomRectangleTemplate; - this.zoomRectangle.Visibility = Visibility.Visible; - } - - /// - /// Renders the PlotView to a bitmap. - /// - /// A bitmap. - public WriteableBitmap ToBitmap() - { - throw new NotImplementedException(); - } - - /// - /// Stores text on the clipboard. - /// - /// The text. - void IPlotView.SetClipboardText(string text) - { - Clipboard.SetText(text); - } - - /// - /// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. - /// - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) - { - return; - } - - this.plotImage = (PlotImage)this.GetTemplateChild(PartPlotImage); - - this.zoomRectangle = new ContentControl(); - this.plotImage.Overlay.Children.Add(this.zoomRectangle); - } - - /// - /// Called before the event occurs. - /// - /// The data for the event. - protected override void OnKeyDown(KeyEventArgs e) - { - base.OnKeyDown(e); - if (e.Handled) - { - return; - } - - var args = new OxyKeyEventArgs { ModifierKeys = Keyboard.GetModifierKeys(), Key = e.Key.Convert() }; - e.Handled = this.ActualController.HandleKeyDown(this, args); - } - - /// - /// Called when the event occurs. - /// - /// The data for the event. - protected override void OnManipulationStarted(ManipulationStartedEventArgs e) - { - base.OnManipulationStarted(e); - if (e.Handled) - { - return; - } - - e.Handled = this.ActualController.HandleTouchStarted(this, e.ToTouchEventArgs(this, this.plotImage, this.plotImage.Offset)); - } - - /// - /// Called when the event occurs. - /// - /// The data for the event. - protected override void OnManipulationDelta(ManipulationDeltaEventArgs e) - { - base.OnManipulationDelta(e); - if (e.Handled) - { - return; - } - - e.Handled = this.ActualController.HandleTouchDelta(this, e.ToTouchEventArgs(this, this.plotImage, this.plotImage.Offset)); - } - - /// - /// Called when the event occurs. - /// - /// The data for the event. - protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e) - { - base.OnManipulationCompleted(e); - if (e.Handled) - { - return; - } - - e.Handled = this.ActualController.HandleTouchCompleted(this, e.ToTouchEventArgs(this, this.plotImage, this.plotImage.Offset)); - } - - /// - /// Called before the event occurs to provide handling for the event in a derived class without attaching a delegate. - /// - /// A that contains the event data. - protected override void OnMouseWheel(MouseWheelEventArgs e) - { - base.OnMouseWheel(e); - if (e.Handled || !this.IsMouseWheelEnabled) - { - return; - } - - e.Handled = this.ActualController.HandleMouseWheel(this, e.ToMouseWheelEventArgs(this, this.plotImage.Offset)); - } - - /// - /// Invoked when an unhandled MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. - /// - /// The that contains the event data. This event data reports details about the mouse button that was pressed and the handled state. - protected override void OnMouseDown(MouseButtonEventArgs e) - { - base.OnMouseDown(e); - if (e.Handled) - { - return; - } - - this.Focus(); - this.CaptureMouse(); - - // store the mouse down point, check it when mouse button is released to determine if the context menu should be shown - this.mouseDownPoint = e.GetPosition(this).ToScreenPoint(); - - e.Handled = this.ActualController.HandleMouseDown(this, e.ToMouseDownEventArgs(this, this.plotImage.Offset)); - } - - /// - /// Invoked when an unhandled MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. - /// - /// The that contains the event data. - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (e.Handled) - { - return; - } - - e.Handled = this.ActualController.HandleMouseMove(this, e.ToMouseEventArgs(this, this.plotImage.Offset)); - } - - /// - /// Invoked when an unhandled MouseUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. - /// - /// The that contains the event data. The event data reports that the mouse button was released. - protected override void OnMouseUp(MouseButtonEventArgs e) - { - base.OnMouseUp(e); - if (e.Handled) - { - return; - } - - this.ReleaseMouseCapture(); - - e.Handled = this.ActualController.HandleMouseUp(this, e.ToMouseReleasedEventArgs(this, this.plotImage.Offset)); - - // Open the context menu - var p = e.GetPosition(this).ToScreenPoint(); - var d = p.DistanceTo(this.mouseDownPoint); - - if (this.ContextMenu != null) - { - if (Math.Abs(d) < 1e-8 && e.ChangedButton == MouseButton.Right) - { - // TODO: why is the data context not passed to the context menu?? - this.ContextMenu.DataContext = this.DataContext; - this.ContextMenu.PlacementTarget = this; - this.ContextMenu.Visibility = Visibility.Visible; - this.ContextMenu.IsOpen = true; - } - else - { - this.ContextMenu.Visibility = Visibility.Collapsed; - this.ContextMenu.IsOpen = false; - } - } - } - - /// - /// Invoked when an unhandled  attached event is raised on this element. Implement this method to add class handling for this event. - /// - /// The that contains the event data. - protected override void OnMouseEnter(MouseEventArgs e) - { - base.OnMouseEnter(e); - if (e.Handled) - { - return; - } - - e.Handled = this.ActualController.HandleMouseEnter(this, e.ToMouseEventArgs(this, this.plotImage.Offset)); - } - - /// - /// Invoked when an unhandled  attached event is raised on this element. Implement this method to add class handling for this event. - /// - /// The that contains the event data. - protected override void OnMouseLeave(MouseEventArgs e) - { - base.OnMouseEnter(e); - if (e.Handled) - { - return; - } - - e.Handled = this.ActualController.HandleMouseLeave(this, e.ToMouseEventArgs(this, this.plotImage.Offset)); - } - - /// - /// Called when the property is changed. - /// - /// The sender. - /// The instance containing the event data. - private static void ModelChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) - { - ((PlotView)sender).OnModelChanged(); - } - - /// - /// Invokes the specified action on the UI Thread (without blocking the calling thread). - /// - /// The action. - private void BeginInvoke(Action action) - { - this.Dispatcher.InvokeAsync(action, System.Windows.Threading.DispatcherPriority.Background); - } - - /// - /// Called when the control is loaded. - /// - /// The sender. - /// The instance containing the event data. - private void OnLoaded(object sender, RoutedEventArgs e) - { - this.InvalidatePlot(); - } - - /// - /// Called when the size of the control is changed. - /// - /// The sender. - /// The instance containing the event data. - private void OnSizeChanged(object sender, SizeChangedEventArgs e) - { - this.InvalidatePlot(false); - } - - /// - /// Called when the model is changed. - /// - private void OnModelChanged() - { - lock (this.modelLock) - { - if (this.currentModel != null) - { - ((IPlotModel)this.currentModel).AttachPlotView(null); - this.currentModel = null; - } - - if (this.Model != null) - { - ((IPlotModel)this.Model).AttachPlotView(this); - this.currentModel = this.Model; - } - } - - this.InvalidatePlot(); - } - - /// - /// Updates the model. - /// - /// if set to true, the data collections will be updated. - private void UpdateModel(bool update) - { - if (this.ActualModel != null) - { - ((IPlotModel)this.ActualModel).Update(update); - } - } - } -} \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/Properties/AssemblyDescription.cs b/Source/OxyPlot.SharpDX.Wpf/Properties/AssemblyDescription.cs deleted file mode 100644 index ec1d56b8b..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/Properties/AssemblyDescription.cs +++ /dev/null @@ -1,28 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -------------------------------------------------------------------------------------------------------------------- - -using System; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Windows; -using System.Windows.Markup; - -[assembly: AssemblyTitle("OxyPlot for WPF with SharpDX based renderer")] -[assembly: AssemblyDescription("OxyPlot controls for WPF with SharpDX based renderer")] -[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] - -[assembly: CLSCompliant(false)] - -[assembly: XmlnsPrefix("http://oxyplot.org/sharpdx/wpf", "oxydx")] -[assembly: XmlnsDefinition("http://oxyplot.org/sharpdx/wpf", "OxyPlot.SharpDX.Wpf")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("92129d21-61e9-4952-ab75-6e5b27c8d3f7")] \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/Resources/designmode.png b/Source/OxyPlot.SharpDX.Wpf/Resources/designmode.png deleted file mode 100644 index a59eff62ba62f6d0b323afd42d1bf7242f78f398..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28149 zcmd4(cT`hr7d;9`Q4tYT6j5m^O{p5BR|_K2R0O08(z}G-Z6K(iAi>arC?LIqbQBc> zfuL0BHArt#LcME8&+mJ`aqqZ)-!sNL-g6k)dq4YmR-JRM9dbiMnPK0FeJB))LFL+& zTPW0SQ50(D%e_0{FT_V)I`DrxFt?O1p|YFU#^FD9SzT1Wh(hIs({GsWhX1B>zNUvk zp%`nC|Lv%A`e2SiIfSZQxp>>tc)B;hux)8`dwWFzKkHx2>0oE)le2l(r=-$uwkWH( ztNm3ZW71FY)JvMNCFwEu$_im)V^ZCsbJOC|(2{qRvBv?nt!XA$8VWVX9w9~j zm#QmhTI649qOXyue^_NAu%S>nbo=(Ll{Bao7?e1s=-s$+m*40l8lC@0#8VJqUbB)4%A2PQ|;zA2|xAMUZ<&!w7X|iydh?JvazvcCO4?v{MhR#B<6R@&M4tx zc{f3aU?|?QpIq-}J?(J6k(C}5$o>*;k$Vqa5;Q{jsiVf6px0WF?e$)v(#kQ&^g=gV zmbdk?$uSg4axbzf8D7kfsb7yDYib>8zmfIHMV7y;pZ zB#-p&2%=oIPGN+9>~0OamyJy2%)Y$BH z%Md<(XM(Jqd8q!8x>JF9pW38>`JEqKq9q2IR_E01`0f}u1UbCWNod^HmO#`kdjCuQ z2)tdaNM>~IHxw$c0NFEZWpv5IBpdykEnn^me2VF_O#5l8AJUQjMx;8z>(b%`uS@Kl z%>?h7clI-EM5z~(DTfG=CbQ1qV#kFi$5WT~x2xV^UgT*PePdi8Occ<+sNbF?Qdrz! zuOSdKefc8T#40CZAz4Z?S|w&#HpYbaR|NjV&`PLAS@tg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cs deleted file mode 100644 index 9051a67d0..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/Tracker/TrackerControl.cs +++ /dev/null @@ -1,725 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX.Wpf -{ - using System; - using System.Windows; - using System.Windows.Controls; - using System.Windows.Media; - using System.Windows.Shapes; - - ///

- /// Provides a tracker control. - /// - public class TrackerControl : ContentControl - { - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty HorizontalLineVisibilityProperty = - DependencyProperty.Register( - "HorizontalLineVisibility", - typeof(Visibility), - typeof(TrackerControl), - new PropertyMetadata(Visibility.Visible)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty VerticalLineVisibilityProperty = - DependencyProperty.Register( - "VerticalLineVisibility", - typeof(Visibility), - typeof(TrackerControl), - new PropertyMetadata(Visibility.Visible)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty LineStrokeProperty = DependencyProperty.Register( - "LineStroke", typeof(Brush), typeof(TrackerControl), new PropertyMetadata(null)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty LineExtentsProperty = DependencyProperty.Register( - "LineExtents", typeof(OxyRect), typeof(TrackerControl), new PropertyMetadata(new OxyRect())); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty LineDashArrayProperty = DependencyProperty.Register( - "LineDashArray", typeof(DoubleCollection), typeof(TrackerControl), new PropertyMetadata(null)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty BorderEdgeModeProperty = DependencyProperty.Register( - "BorderEdgeMode", typeof(EdgeMode), typeof(TrackerControl)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty ShowPointerProperty = DependencyProperty.Register( - "ShowPointer", typeof(bool), typeof(TrackerControl), new PropertyMetadata(true)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register( - "CornerRadius", typeof(double), typeof(TrackerControl), new PropertyMetadata(0.0)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty DistanceProperty = DependencyProperty.Register( - "Distance", typeof(double), typeof(TrackerControl), new PropertyMetadata(7.0)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty CanCenterHorizontallyProperty = - DependencyProperty.Register( - "CanCenterHorizontally", typeof(bool), typeof(TrackerControl), new PropertyMetadata(true)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty CanCenterVerticallyProperty = - DependencyProperty.Register( - "CanCenterVertically", typeof(bool), typeof(TrackerControl), new PropertyMetadata(true)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty PositionProperty = DependencyProperty.Register( - "Position", - typeof(ScreenPoint), - typeof(TrackerControl), - new PropertyMetadata(new ScreenPoint(), PositionChanged)); - - /// - /// The path part. - /// - private const string PartPath = "PART_Path"; - - /// - /// The content part. - /// - private const string PartContent = "PART_Content"; - - /// - /// The content container part. - /// - private const string PartContentcontainer = "PART_ContentContainer"; - - /// - /// The horizontal line part. - /// - private const string PartHorizontalline = "PART_HorizontalLine"; - - /// - /// The vertical line part. - /// - private const string PartVerticalline = "PART_VerticalLine"; - - /// - /// The content. - /// - private ContentPresenter content; - - /// - /// The horizontal line. - /// - private Line horizontalLine; - - /// - /// The path. - /// - private Path path; - - /// - /// The content container. - /// - private Grid contentContainer; - - /// - /// The vertical line. - /// - private Line verticalLine; - - /// - /// Initializes static members of the class. - /// - static TrackerControl() - { - DefaultStyleKeyProperty.OverrideMetadata( - typeof(TrackerControl), new FrameworkPropertyMetadata(typeof(TrackerControl))); - } - - /// - /// Gets or sets BorderEdgeMode. - /// - public EdgeMode BorderEdgeMode - { - get - { - return (EdgeMode)this.GetValue(BorderEdgeModeProperty); - } - - set - { - this.SetValue(BorderEdgeModeProperty, value); - } - } - - /// - /// Gets or sets HorizontalLineVisibility. - /// - public Visibility HorizontalLineVisibility - { - get - { - return (Visibility)this.GetValue(HorizontalLineVisibilityProperty); - } - - set - { - this.SetValue(HorizontalLineVisibilityProperty, value); - } - } - - /// - /// Gets or sets VerticalLineVisibility. - /// - public Visibility VerticalLineVisibility - { - get - { - return (Visibility)this.GetValue(VerticalLineVisibilityProperty); - } - - set - { - this.SetValue(VerticalLineVisibilityProperty, value); - } - } - - /// - /// Gets or sets LineStroke. - /// - public Brush LineStroke - { - get - { - return (Brush)this.GetValue(LineStrokeProperty); - } - - set - { - this.SetValue(LineStrokeProperty, value); - } - } - - /// - /// Gets or sets LineExtents. - /// - public OxyRect LineExtents - { - get - { - return (OxyRect)this.GetValue(LineExtentsProperty); - } - - set - { - this.SetValue(LineExtentsProperty, value); - } - } - - /// - /// Gets or sets LineDashArray. - /// - public DoubleCollection LineDashArray - { - get - { - return (DoubleCollection)this.GetValue(LineDashArrayProperty); - } - - set - { - this.SetValue(LineDashArrayProperty, value); - } - } - - /// - /// Gets or sets a value indicating whether to show a 'pointer' on the border. - /// - public bool ShowPointer - { - get - { - return (bool)this.GetValue(ShowPointerProperty); - } - - set - { - this.SetValue(ShowPointerProperty, value); - } - } - - /// - /// Gets or sets the corner radius (only used when ShowPoint=false). - /// - public double CornerRadius - { - get - { - return (double)this.GetValue(CornerRadiusProperty); - } - - set - { - this.SetValue(CornerRadiusProperty, value); - } - } - - /// - /// Gets or sets the distance of the content container from the trackers Position. - /// - public double Distance - { - get - { - return (double)this.GetValue(DistanceProperty); - } - - set - { - this.SetValue(DistanceProperty, value); - } - } - - /// - /// Gets or sets a value indicating whether the tracker can center its content box horizontally. - /// - public bool CanCenterHorizontally - { - get - { - return (bool)this.GetValue(CanCenterHorizontallyProperty); - } - - set - { - this.SetValue(CanCenterHorizontallyProperty, value); - } - } - - /// - /// Gets or sets a value indicating whether the tracker can center its content box vertically. - /// - public bool CanCenterVertically - { - get - { - return (bool)this.GetValue(CanCenterVerticallyProperty); - } - - set - { - this.SetValue(CanCenterVerticallyProperty, value); - } - } - - /// - /// Gets or sets Position of the tracker. - /// - public ScreenPoint Position - { - get - { - return (ScreenPoint)this.GetValue(PositionProperty); - } - - set - { - this.SetValue(PositionProperty, value); - } - } - - /// - /// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. - /// - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - this.path = this.GetTemplateChild(PartPath) as Path; - this.content = this.GetTemplateChild(PartContent) as ContentPresenter; - this.contentContainer = this.GetTemplateChild(PartContentcontainer) as Grid; - this.horizontalLine = this.GetTemplateChild(PartHorizontalline) as Line; - this.verticalLine = this.GetTemplateChild(PartVerticalline) as Line; - - if (this.contentContainer == null) - { - throw new InvalidOperationException(string.Format("The TrackerControl template must contain a content container with name +'{0}'", PartContentcontainer)); - } - - if (this.path == null) - { - throw new InvalidOperationException(string.Format("The TrackerControl template must contain a Path with name +'{0}'", PartPath)); - } - - if (this.content == null) - { - throw new InvalidOperationException(string.Format("The TrackerControl template must contain a ContentPresenter with name +'{0}'", PartContent)); - } - - this.UpdatePositionAndBorder(); - } - - /// - /// Called when the position is changed. - /// - /// The sender. - /// The instance containing the event data. - private static void PositionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) - { - ((TrackerControl)sender).OnPositionChanged(e); - } - - /// - /// Called when the position is changed. - /// - /// The dependency property changed event args. - // ReSharper disable once UnusedParameter.Local - private void OnPositionChanged(DependencyPropertyChangedEventArgs e) - { - this.UpdatePositionAndBorder(); - } - - /// - /// Update the position and border of the tracker. - /// - private void UpdatePositionAndBorder() - { - if (this.contentContainer == null) - { - return; - } - - Canvas.SetLeft(this.contentContainer, this.Position.X); - Canvas.SetTop(this.contentContainer, this.Position.Y); - FrameworkElement parent = this; - while (!(parent is Canvas) && parent != null) - { - parent = VisualTreeHelper.GetParent(parent) as FrameworkElement; - } - - if (parent == null) - { - return; - } - - // throw new InvalidOperationException("The TrackerControl must have a Canvas parent."); - double canvasWidth = parent.ActualWidth; - double canvasHeight = parent.ActualHeight; - - this.content.Measure(new Size(canvasWidth, canvasHeight)); - this.content.Arrange(new Rect(0, 0, this.content.DesiredSize.Width, this.content.DesiredSize.Height)); - - double contentWidth = this.content.DesiredSize.Width; - double contentHeight = this.content.DesiredSize.Height; - - // Minimum allowed margins around the tracker - const double MarginLimit = 10; - - var ha = HorizontalAlignment.Center; - if (this.CanCenterHorizontally) - { - if (this.Position.X - (contentWidth / 2) < MarginLimit) - { - ha = HorizontalAlignment.Left; - } - - if (this.Position.X + (contentWidth / 2) > canvasWidth - MarginLimit) - { - ha = HorizontalAlignment.Right; - } - } - else - { - ha = this.Position.X < canvasWidth / 2 ? HorizontalAlignment.Left : HorizontalAlignment.Right; - } - - var va = VerticalAlignment.Center; - if (this.CanCenterVertically) - { - if (this.Position.Y - (contentHeight / 2) < MarginLimit) - { - va = VerticalAlignment.Top; - } - - if (ha == HorizontalAlignment.Center) - { - va = VerticalAlignment.Bottom; - if (this.Position.Y - contentHeight < MarginLimit) - { - va = VerticalAlignment.Top; - } - } - - if (va == VerticalAlignment.Center && this.Position.Y + (contentHeight / 2) > canvasHeight - MarginLimit) - { - va = VerticalAlignment.Bottom; - } - - if (va == VerticalAlignment.Top && this.Position.Y + contentHeight > canvasHeight - MarginLimit) - { - va = VerticalAlignment.Bottom; - } - } - else - { - va = this.Position.Y < canvasHeight / 2 ? VerticalAlignment.Top : VerticalAlignment.Bottom; - } - - double dx = ha == HorizontalAlignment.Center ? -0.5 : ha == HorizontalAlignment.Left ? 0 : -1; - double dy = va == VerticalAlignment.Center ? -0.5 : va == VerticalAlignment.Top ? 0 : -1; - - Thickness margin; - this.path.Data = this.ShowPointer - ? this.CreatePointerBorderGeometry(ha, va, contentWidth, contentHeight, out margin) - : this.CreateBorderGeometry(ha, va, contentWidth, contentHeight, out margin); - - this.content.Margin = margin; - - this.contentContainer.Measure(new Size(canvasWidth, canvasHeight)); - Size contentSize = this.contentContainer.DesiredSize; - - this.contentContainer.RenderTransform = new TranslateTransform - { - X = dx * contentSize.Width, - Y = dy * contentSize.Height - }; - - ScreenPoint pos = this.Position; - - if (this.horizontalLine != null) - { - if (this.LineExtents.Width > 0) - { - this.horizontalLine.X1 = this.LineExtents.Left; - this.horizontalLine.X2 = this.LineExtents.Right; - } - else - { - this.horizontalLine.X1 = 0; - this.horizontalLine.X2 = canvasWidth; - } - - this.horizontalLine.Y1 = pos.Y; - this.horizontalLine.Y2 = pos.Y; - } - - if (this.verticalLine != null) - { - if (this.LineExtents.Width > 0) - { - this.verticalLine.Y1 = this.LineExtents.Top; - this.verticalLine.Y2 = this.LineExtents.Bottom; - } - else - { - this.verticalLine.Y1 = 0; - this.verticalLine.Y2 = canvasHeight; - } - - this.verticalLine.X1 = pos.X; - this.verticalLine.X2 = pos.X; - } - } - - /// - /// Create the border geometry. - /// - /// The horizontal alignment. - /// The vertical alignment. - /// The width. - /// The height. - /// The margin. - /// The border geometry. - private Geometry CreateBorderGeometry( - HorizontalAlignment ha, VerticalAlignment va, double width, double height, out Thickness margin) - { - double m = this.Distance; - var rect = new Rect( - ha == HorizontalAlignment.Left ? m : 0, va == VerticalAlignment.Top ? m : 0, width, height); - margin = new Thickness - { - Left = ha == HorizontalAlignment.Left ? m : 0, - Top = va == VerticalAlignment.Top ? m : 0, - Right = ha == HorizontalAlignment.Right ? m : 0, - Bottom = va == VerticalAlignment.Bottom ? m : 0 - }; - return new RectangleGeometry { Rect = rect /*, RadiusX = this.CornerRadius, RadiusY = this.CornerRadius*/ }; - } - - /// - /// Creates a border geometry with a 'pointer'. - /// - /// The horizontal alignment. - /// The vertical alignment. - /// The width. - /// The height. - /// The margin. - /// The border geometry. - private Geometry CreatePointerBorderGeometry( - HorizontalAlignment ha, VerticalAlignment va, double width, double height, out Thickness margin) - { - Point[] points = null; - double m = this.Distance; - margin = new Thickness(); - - if (ha == HorizontalAlignment.Center && va == VerticalAlignment.Bottom) - { - double x0 = 0; - double x1 = width; - double x2 = (x0 + x1) / 2; - double y0 = 0; - double y1 = height; - margin = new Thickness { Bottom = m }; - points = new[] - { - new Point(x0, y0), new Point(x1, y0), new Point(x1, y1), new Point(x2 + (m / 2), y1), - new Point(x2, y1 + m), new Point(x2 - (m / 2), y1), new Point(x0, y1) - }; - } - - if (ha == HorizontalAlignment.Center && va == VerticalAlignment.Top) - { - double x0 = 0; - double x1 = width; - double x2 = (x0 + x1) / 2; - double y0 = m; - double y1 = m + height; - margin = new Thickness { Top = m }; - points = new[] - { - new Point(x0, y0), new Point(x2 - (m / 2), y0), new Point(x2, 0), new Point(x2 + (m / 2), y0), - new Point(x1, y0), new Point(x1, y1), new Point(x0, y1) - }; - } - - if (ha == HorizontalAlignment.Left && va == VerticalAlignment.Center) - { - double x0 = m; - double x1 = m + width; - double y0 = 0; - double y1 = height; - double y2 = (y0 + y1) / 2; - margin = new Thickness { Left = m }; - points = new[] - { - new Point(0, y2), new Point(x0, y2 - (m / 2)), new Point(x0, y0), new Point(x1, y0), - new Point(x1, y1), new Point(x0, y1), new Point(x0, y2 + (m / 2)) - }; - } - - if (ha == HorizontalAlignment.Right && va == VerticalAlignment.Center) - { - double x0 = 0; - double x1 = width; - double y0 = 0; - double y1 = height; - double y2 = (y0 + y1) / 2; - margin = new Thickness { Right = m }; - points = new[] - { - new Point(x1 + m, y2), new Point(x1, y2 + (m / 2)), new Point(x1, y1), new Point(x0, y1), - new Point(x0, y0), new Point(x1, y0), new Point(x1, y2 - (m / 2)) - }; - } - - if (ha == HorizontalAlignment.Left && va == VerticalAlignment.Top) - { - m *= 0.67; - double x0 = m; - double x1 = m + width; - double y0 = m; - double y1 = m + height; - margin = new Thickness { Left = m, Top = m }; - points = new[] - { - new Point(0, 0), new Point(m * 2, y0), new Point(x1, y0), new Point(x1, y1), new Point(x0, y1), - new Point(x0, m * 2) - }; - } - - if (ha == HorizontalAlignment.Right && va == VerticalAlignment.Top) - { - m *= 0.67; - double x0 = 0; - double x1 = width; - double y0 = m; - double y1 = m + height; - margin = new Thickness { Top = m, Right = m }; - points = new[] - { - new Point(x1 + m, 0), new Point(x1, y0 + m), new Point(x1, y1), new Point(x0, y1), - new Point(x0, y0), new Point(x1 - m, y0) - }; - } - - if (ha == HorizontalAlignment.Left && va == VerticalAlignment.Bottom) - { - m *= 0.67; - double x0 = m; - double x1 = m + width; - double y0 = 0; - double y1 = height; - margin = new Thickness { Left = m, Bottom = m }; - points = new[] - { - new Point(0, y1 + m), new Point(x0, y1 - m), new Point(x0, y0), new Point(x1, y0), - new Point(x1, y1), new Point(x0 + m, y1) - }; - } - - if (ha == HorizontalAlignment.Right && va == VerticalAlignment.Bottom) - { - m *= 0.67; - double x0 = 0; - double x1 = width; - double y0 = 0; - double y1 = height; - margin = new Thickness { Right = m, Bottom = m }; - points = new[] - { - new Point(x1 + m, y1 + m), new Point(x1 - m, y1), new Point(x0, y1), new Point(x0, y0), - new Point(x1, y0), new Point(x1, y1 - m) - }; - } - - if (points == null) - { - return null; - } - - var pointCollection = new PointCollection(); - foreach (var point in points) - { - pointCollection.Add(point); - } - - var segments = new PathSegmentCollection { new PolyLineSegment { Points = pointCollection } }; - var pf = new PathFigure { StartPoint = points[0], Segments = segments, IsClosed = true }; - return new PathGeometry { Figures = new PathFigureCollection { pf } }; - } - } -} diff --git a/Source/OxyPlot.SharpDX.Wpf/Tracker/TrackerDefinition.cs b/Source/OxyPlot.SharpDX.Wpf/Tracker/TrackerDefinition.cs deleted file mode 100644 index 9947239ac..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/Tracker/TrackerDefinition.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX.Wpf -{ - using System.Windows; - using System.Windows.Controls; - - /// - /// Represents a tracker definition. - /// - /// The tracker definitions make it possible to show different trackers for different series. - /// The property is matched with the - /// in the TrackerDefinitions collection in the control. - public class TrackerDefinition : DependencyObject - { - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty TrackerKeyProperty = DependencyProperty.Register( - "TrackerKey", typeof(string), typeof(TrackerDefinition), new PropertyMetadata(null)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty TrackerTemplateProperty = - DependencyProperty.Register("TrackerTemplate", typeof(ControlTemplate), typeof(TrackerDefinition), new PropertyMetadata(null)); - - /// - /// Gets or sets the tracker key. - /// - /// The Plot will use this property to find the TrackerDefinition that matches the TrackerKey of the current series. - public string TrackerKey - { - get - { - return (string)this.GetValue(TrackerKeyProperty); - } - - set - { - this.SetValue(TrackerKeyProperty, value); - } - } - - /// - /// Gets or sets the tracker template. - /// - /// The tracker control will be added/removed from the Tracker overlay as necessary. - /// The DataContext of the tracker will be set to a TrackerHitResult with the current tracker data. - public ControlTemplate TrackerTemplate - { - get - { - return (ControlTemplate)this.GetValue(TrackerTemplateProperty); - } - - set - { - this.SetValue(TrackerTemplateProperty, value); - } - } - } -} diff --git a/Source/OxyPlot.SharpDX.Wpf/Utilities/ConverterExtensions.cs b/Source/OxyPlot.SharpDX.Wpf/Utilities/ConverterExtensions.cs deleted file mode 100644 index 46a859422..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/Utilities/ConverterExtensions.cs +++ /dev/null @@ -1,524 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Extension method used to convert to/from Windows/Windows.Media classes. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX.Wpf -{ - using System; - using System.Windows; - using System.Windows.Input; - using System.Windows.Media; - using Color4 = global::SharpDX.Color4; - using DXColor = global::SharpDX.Color; - using HorizontalAlignment = OxyPlot.HorizontalAlignment; - using VerticalAlignment = OxyPlot.VerticalAlignment; - - /// - /// Extension method used to convert to/from Windows/Windows.Media classes. - /// - internal static class ConverterExtensions - { - /// - /// Byte to float converting coefficient. - /// - private static readonly float ByteToFloat = 1f / 255f; - - /// - /// Calculate the distance between two points. - /// - /// The first point. - /// The second point. - /// The distance. - public static double DistanceTo(this Point p1, Point p2) - { - double dx = p1.X - p2.X; - double dy = p1.Y - p2.Y; - return Math.Sqrt((dx * dx) + (dy * dy)); - } - - /// - /// Converts an to a . - /// - /// The color. - /// A . - public static Brush ToBrush(this OxyColor c) - { - return !c.IsUndefined() ? new SolidColorBrush(c.ToColor()) : null; - } - - /// - /// Converts an to a . - /// - /// The color. - /// A Color. - public static Color ToColor(this OxyColor c) - { - return Color.FromArgb(c.A, c.R, c.G, c.B); - } - - /// - /// Converts an to a . - /// - /// The color. - /// A Color. - public static Color4 ToColor4(this OxyColor c) - { - return new Color4(c.R * ByteToFloat, c.G * ByteToFloat, c.B * ByteToFloat, c.A * ByteToFloat); - } - - /// - /// Converts an to a . - /// - /// The color. - /// A Color. - public static DXColor ToDXColor(this OxyColor c) - { - return new DXColor(c.R, c.G, c.B, c.A); - } - - /// - /// Converts an OxyThickness to a Thickness. - /// - /// The thickness. - /// A instance. - public static Thickness ToThickness(this OxyThickness c) - { - return new Thickness(c.Left, c.Top, c.Right, c.Bottom); - } - - /// - /// Converts a ScreenVector to a Vector. - /// - /// The c. - /// A instance. - public static Vector ToVector(this ScreenVector c) - { - return new Vector(c.X, c.Y); - } - - /// - /// Converts a HorizontalAlignment to a HorizontalAlignment. - /// - /// The alignment. - /// A HorizontalAlignment. - public static HorizontalAlignment ToHorizontalAlignment(this System.Windows.HorizontalAlignment alignment) - { - switch (alignment) - { - case System.Windows.HorizontalAlignment.Center: - return HorizontalAlignment.Center; - case System.Windows.HorizontalAlignment.Right: - return HorizontalAlignment.Right; - default: - return HorizontalAlignment.Left; - } - } - - /// - /// Converts a HorizontalAlignment to a VerticalAlignment. - /// - /// The alignment. - /// A VerticalAlignment. - public static VerticalAlignment ToVerticalAlignment(this System.Windows.VerticalAlignment alignment) - { - switch (alignment) - { - case System.Windows.VerticalAlignment.Center: - return VerticalAlignment.Middle; - case System.Windows.VerticalAlignment.Top: - return VerticalAlignment.Top; - default: - return VerticalAlignment.Bottom; - } - } - - /// - /// Converts a Color to an OxyColor. - /// - /// The color. - /// An OxyColor. - public static OxyColor ToOxyColor(this Color color) - { - return OxyColor.FromArgb(color.A, color.R, color.G, color.B); - } - - /// - /// Converts a to an . - /// - /// The brush. - /// An . - public static OxyColor ToOxyColor(this Brush brush) - { - var scb = brush as SolidColorBrush; - return scb != null ? scb.Color.ToOxyColor() : OxyColors.Undefined; - } - - /// - /// Converts a Thickness to an . - /// - /// The thickness. - /// An . - public static OxyThickness ToOxyThickness(this Thickness t) - { - return new OxyThickness(t.Left, t.Top, t.Right, t.Bottom); - } - - /// - /// Converts a to a . - /// - /// The point. - /// A . - public static ScreenPoint ToScreenPoint(this Point pt) - { - return new ScreenPoint(pt.X, pt.Y); - } - - /// - /// Converts a Point array to a ScreenPoint array. - /// - /// The points. - /// A ScreenPoint array. - public static ScreenPoint[] ToScreenPointArray(this Point[] points) - { - if (points == null) - { - return null; - } - - var pts = new ScreenPoint[points.Length]; - for (int i = 0; i < points.Length; i++) - { - pts[i] = points[i].ToScreenPoint(); - } - - return pts; - } - - /// - /// Converts the specified vector to a ScreenVector. - /// - /// The vector. - /// A . - public static ScreenVector ToScreenVector(this Vector vector) - { - return new ScreenVector(vector.X, vector.Y); - } - - /// - /// Converts the specified key. - /// - /// The key to convert. - /// The converted key. - public static OxyKey Convert(this Key k) - { - switch (k) - { - case Key.A: - return OxyKey.A; - case Key.Add: - return OxyKey.Add; - case Key.B: - return OxyKey.B; - case Key.Back: - return OxyKey.Backspace; - case Key.C: - return OxyKey.C; - case Key.D: - return OxyKey.D; - case Key.D0: - return OxyKey.D0; - case Key.D1: - return OxyKey.D1; - case Key.D2: - return OxyKey.D2; - case Key.D3: - return OxyKey.D3; - case Key.D4: - return OxyKey.D4; - case Key.D5: - return OxyKey.D5; - case Key.D6: - return OxyKey.D6; - case Key.D7: - return OxyKey.D7; - case Key.D8: - return OxyKey.D8; - case Key.D9: - return OxyKey.D9; - case Key.Decimal: - return OxyKey.Decimal; - case Key.Delete: - return OxyKey.Delete; - case Key.Divide: - return OxyKey.Divide; - case Key.Down: - return OxyKey.Down; - case Key.E: - return OxyKey.E; - case Key.End: - return OxyKey.End; - case Key.Enter: - return OxyKey.Enter; - case Key.Escape: - return OxyKey.Escape; - case Key.F: - return OxyKey.F; - case Key.F1: - return OxyKey.F1; - case Key.F10: - return OxyKey.F10; - case Key.F11: - return OxyKey.F11; - case Key.F12: - return OxyKey.F12; - case Key.F2: - return OxyKey.F2; - case Key.F3: - return OxyKey.F3; - case Key.F4: - return OxyKey.F4; - case Key.F5: - return OxyKey.F5; - case Key.F6: - return OxyKey.F6; - case Key.F7: - return OxyKey.F7; - case Key.F8: - return OxyKey.F8; - case Key.F9: - return OxyKey.F9; - case Key.G: - return OxyKey.G; - case Key.H: - return OxyKey.H; - case Key.Home: - return OxyKey.Home; - case Key.I: - return OxyKey.I; - case Key.Insert: - return OxyKey.Insert; - case Key.J: - return OxyKey.J; - case Key.K: - return OxyKey.K; - case Key.L: - return OxyKey.L; - case Key.Left: - return OxyKey.Left; - case Key.M: - return OxyKey.M; - case Key.Multiply: - return OxyKey.Multiply; - case Key.N: - return OxyKey.N; - case Key.NumPad0: - return OxyKey.NumPad0; - case Key.NumPad1: - return OxyKey.NumPad1; - case Key.NumPad2: - return OxyKey.NumPad2; - case Key.NumPad3: - return OxyKey.NumPad3; - case Key.NumPad4: - return OxyKey.NumPad4; - case Key.NumPad5: - return OxyKey.NumPad5; - case Key.NumPad6: - return OxyKey.NumPad6; - case Key.NumPad7: - return OxyKey.NumPad7; - case Key.NumPad8: - return OxyKey.NumPad8; - case Key.NumPad9: - return OxyKey.NumPad9; - case Key.O: - return OxyKey.O; - case Key.P: - return OxyKey.P; - case Key.PageDown: - return OxyKey.PageDown; - case Key.PageUp: - return OxyKey.PageUp; - case Key.Q: - return OxyKey.Q; - case Key.R: - return OxyKey.R; - case Key.Right: - return OxyKey.Right; - case Key.S: - return OxyKey.S; - case Key.Space: - return OxyKey.Space; - case Key.Subtract: - return OxyKey.Subtract; - case Key.T: - return OxyKey.T; - case Key.Tab: - return OxyKey.Tab; - case Key.U: - return OxyKey.U; - case Key.Up: - return OxyKey.Up; - case Key.V: - return OxyKey.V; - case Key.W: - return OxyKey.W; - case Key.X: - return OxyKey.X; - case Key.Y: - return OxyKey.Y; - case Key.Z: - return OxyKey.Z; - default: - return OxyKey.Unknown; - } - } - - /// - /// Converts the specified button. - /// - /// The button to convert. - /// The converted mouse button. - public static OxyMouseButton Convert(this MouseButton button) - { - switch (button) - { - case MouseButton.Left: - return OxyMouseButton.Left; - case MouseButton.Middle: - return OxyMouseButton.Middle; - case MouseButton.Right: - return OxyMouseButton.Right; - case MouseButton.XButton1: - return OxyMouseButton.XButton1; - case MouseButton.XButton2: - return OxyMouseButton.XButton2; - default: - return OxyMouseButton.None; - } - } - - /// - /// Converts to for a mouse wheel event. - /// - /// The instance containing the event data. - /// The that the event is relative to. - /// The offset that event is relative to. - /// A containing the converted event arguments. - public static OxyMouseWheelEventArgs ToMouseWheelEventArgs(this MouseWheelEventArgs e, IInputElement relativeTo, Vector offset) - { - return new OxyMouseWheelEventArgs - { - Position = (e.GetPosition(relativeTo) + offset).ToScreenPoint(), - ModifierKeys = Keyboard.GetModifierKeys(), - Delta = e.Delta - }; - } - - /// - /// Converts to for a mouse down event. - /// - /// The instance containing the event data. - /// The that the event is relative to. - /// The offset that event is relative to. - /// A containing the converted event arguments. - public static OxyMouseDownEventArgs ToMouseDownEventArgs(this MouseButtonEventArgs e, IInputElement relativeTo, Vector offset) - { - return new OxyMouseDownEventArgs - { - ChangedButton = e.ChangedButton.Convert(), - ClickCount = e.ClickCount, - Position = (e.GetPosition(relativeTo) + offset).ToScreenPoint(), - ModifierKeys = Keyboard.GetModifierKeys() - }; - } - - /// - /// Converts to for a mouse up event. - /// - /// The instance containing the event data. - /// The that the event is relative to. - /// The offset that event is relative to. - /// A containing the converted event arguments. - public static OxyMouseEventArgs ToMouseReleasedEventArgs(this MouseButtonEventArgs e, IInputElement relativeTo, Vector offset) - { - return new OxyMouseEventArgs - { - Position = (e.GetPosition(relativeTo) + offset).ToScreenPoint(), - ModifierKeys = Keyboard.GetModifierKeys() - }; - } - - /// - /// Converts to for a mouse event. - /// - /// The instance containing the event data. - /// The that the event is relative to. - /// The offset that event is relative to. - /// A containing the converted event arguments. - public static OxyMouseEventArgs ToMouseEventArgs(this MouseEventArgs e, IInputElement relativeTo, Vector offset) - { - return new OxyMouseEventArgs - { - Position = (e.GetPosition(relativeTo) + offset).ToScreenPoint(), - ModifierKeys = Keyboard.GetModifierKeys() - }; - } - - /// - /// Converts to for a touch started event. - /// - /// The instance containing the event data. - /// The that is event source - /// The that the event is relative to. - /// The offset that event is relative to. - /// A containing the converted event arguments. - public static OxyTouchEventArgs ToTouchEventArgs(this ManipulationStartedEventArgs e, FrameworkElement source, FrameworkElement relativeTo, Vector offset) - { - return new OxyTouchEventArgs - { - Position = (source.TranslatePoint(e.ManipulationOrigin, relativeTo) + offset).ToScreenPoint(), - }; - } - - /// - /// Converts to for a touch delta event. - /// - /// The instance containing the event data. - /// The that is event source - /// The that the event is relative to. - /// The offset that event is relative to. - /// A containing the converted event arguments. - public static OxyTouchEventArgs ToTouchEventArgs(this ManipulationDeltaEventArgs e, FrameworkElement source, FrameworkElement relativeTo, Vector offset) - { - // TODO: does relativeTo rotation affects delta? - return new OxyTouchEventArgs - { - Position = (source.TranslatePoint(e.ManipulationOrigin, relativeTo) + offset).ToScreenPoint(), - DeltaTranslation = e.DeltaManipulation.Translation.ToScreenVector(), - DeltaScale = e.DeltaManipulation.Scale.ToScreenVector() - }; - } - - /// - /// Converts to for a touch completed event. - /// - /// The instance containing the event data. - /// The that is event source - /// The that the event is relative to. - /// The offset that event is relative to. - /// A containing the converted event arguments. - public static OxyTouchEventArgs ToTouchEventArgs(this ManipulationCompletedEventArgs e, FrameworkElement source, FrameworkElement relativeTo, Vector offset) - { - return new OxyTouchEventArgs - { - Position = (source.TranslatePoint(e.ManipulationOrigin, relativeTo) + offset).ToScreenPoint(), - }; - } - } -} \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/Utilities/Keyboard.cs b/Source/OxyPlot.SharpDX.Wpf/Utilities/Keyboard.cs deleted file mode 100644 index e47dd4fa9..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/Utilities/Keyboard.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Provides utility methods related to the keyboard. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX.Wpf -{ - using System.Windows.Input; - - /// - /// Provides utility methods related to the keyboard. - /// - internal static class Keyboard - { - /// - /// Gets the current modifier keys. - /// - /// A value. - public static OxyModifierKeys GetModifierKeys() - { - var modifiers = OxyModifierKeys.None; - if (System.Windows.Input.Keyboard.IsKeyDown(Key.LeftShift) || System.Windows.Input.Keyboard.IsKeyDown(Key.RightShift)) - { - modifiers |= OxyModifierKeys.Shift; - } - - if (System.Windows.Input.Keyboard.IsKeyDown(Key.LeftCtrl) || System.Windows.Input.Keyboard.IsKeyDown(Key.RightCtrl)) - { - modifiers |= OxyModifierKeys.Control; - } - - if (System.Windows.Input.Keyboard.IsKeyDown(Key.LeftAlt) || System.Windows.Input.Keyboard.IsKeyDown(Key.RightAlt)) - { - modifiers |= OxyModifierKeys.Alt; - } - - if (System.Windows.Input.Keyboard.IsKeyDown(Key.LWin) || System.Windows.Input.Keyboard.IsKeyDown(Key.RWin)) - { - modifiers |= OxyModifierKeys.Windows; - } - - return modifiers; - } - } -} \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.Wpf/packages.config b/Source/OxyPlot.SharpDX.Wpf/packages.config deleted file mode 100644 index 97c6dc562..000000000 --- a/Source/OxyPlot.SharpDX.Wpf/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX.sln b/Source/OxyPlot.SharpDX.sln deleted file mode 100644 index a75132676..000000000 --- a/Source/OxyPlot.SharpDX.sln +++ /dev/null @@ -1,95 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot", "OxyPlot\OxyPlot.csproj", "{7A0B35C0-DD17-4964-8E9A-44D6CECDC692}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Change log", "Change log", "{4334530D-EBDE-4F04-838A-DA5A8A598124}" - ProjectSection(SolutionItems) = preProject - ..\AUTHORS = ..\AUTHORS - ..\CHANGELOG.md = ..\CHANGELOG.md - ..\CONTRIBUTORS = ..\CONTRIBUTORS - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{06B2EDA4-A30B-493A-A0A1-9DA28A2F4B0B}" - ProjectSection(SolutionItems) = preProject - ..\.github\CONTRIBUTING.md = ..\.github\CONTRIBUTING.md - ..\README.md = ..\README.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.SharpDX.Wpf", "OxyPlot.SharpDX.Wpf\OxyPlot.SharpDX.Wpf.csproj", "{92129D21-61E9-4952-AB75-6E5B27C8D3F7}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "OxyPlot.SharpDX", "OxyPlot.SharpDX\OxyPlot.SharpDX.shproj", "{455376C6-4146-497C-BF77-61CBB67F5DF9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleDemo", "Examples\SharpDX.Wpf\SimpleDemo\SimpleDemo.csproj", "{48C8FBE0-C817-43BE-AC11-895A69100A86}" -EndProject -Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - OxyPlot.SharpDX\OxyPlot.SharpDX.projitems*{455376c6-4146-497c-bf77-61cbb67f5df9}*SharedItemsImports = 13 - OxyPlot.SharpDX\OxyPlot.SharpDX.projitems*{92129d21-61e9-4952-ab75-6e5b27c8d3f7}*SharedItemsImports = 4 - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|ARM.ActiveCfg = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|ARM.Build.0 = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|x64.Build.0 = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|x86.ActiveCfg = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Debug|x86.Build.0 = Debug|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|Any CPU.Build.0 = Release|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|ARM.ActiveCfg = Release|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|ARM.Build.0 = Release|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|x64.ActiveCfg = Release|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|x64.Build.0 = Release|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|x86.ActiveCfg = Release|Any CPU - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692}.Release|x86.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|ARM.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|ARM.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x64.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x64.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x86.ActiveCfg = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Debug|x86.Build.0 = Debug|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|Any CPU.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|ARM.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|ARM.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x64.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x64.Build.0 = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x86.ActiveCfg = Release|Any CPU - {92129D21-61E9-4952-AB75-6E5B27C8D3F7}.Release|x86.Build.0 = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|ARM.ActiveCfg = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|ARM.Build.0 = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|x64.ActiveCfg = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|x64.Build.0 = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|x86.ActiveCfg = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Debug|x86.Build.0 = Debug|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|Any CPU.Build.0 = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|ARM.ActiveCfg = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|ARM.Build.0 = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|x64.ActiveCfg = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|x64.Build.0 = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|x86.ActiveCfg = Release|Any CPU - {48C8FBE0-C817-43BE-AC11-895A69100A86}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Source/OxyPlot.SharpDX/CacherRenderContext.cs b/Source/OxyPlot.SharpDX/CacherRenderContext.cs deleted file mode 100644 index acc758bb8..000000000 --- a/Source/OxyPlot.SharpDX/CacherRenderContext.cs +++ /dev/null @@ -1,733 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents class, that implements IRenderContext and caches render units to use them later render -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using global::SharpDX; - using global::SharpDX.Direct2D1; - using global::SharpDX.DirectWrite; - using global::SharpDX.WIC; - using Bitmap = global::SharpDX.Direct2D1.Bitmap; - using BitmapInterpolationMode = global::SharpDX.Direct2D1.BitmapInterpolationMode; - using D2DFactory = global::SharpDX.Direct2D1.Factory; - using DWFactory = global::SharpDX.DirectWrite.Factory; - using dx = global::SharpDX; - using WICFactory = global::SharpDX.WIC.ImagingFactory; - - /// - /// Represents class, that implements IRenderContext and caches render units to use them later render - /// - internal class CacherRenderContext : IRenderContext, IDisposable - { - /// - /// The brush cache. - /// - private readonly Dictionary brushCache = new Dictionary(); - - /// - /// The images in use - /// - private readonly HashSet imagesInUse = new HashSet(); - - /// - /// The image cache - /// - private readonly Dictionary imageCache = new Dictionary(); - - /// - /// The Direct2D factory - /// - private D2DFactory d2dFactory; - - /// - /// The DirectWrite factory - /// - private DWFactory dwtFactory; - - /// - /// The WIC factory - /// - private WICFactory wicFactory; - - /// - /// The render target - /// - private RenderTarget renderTarget; - - /// - /// Units that will be rendered on Render call - /// - private List renderUnits = new List(); - - /// - /// The current tool tip - /// - private string currentToolTip; - - /// - /// The clip rectangle. - /// - private RectangleF clipRect; - - /// - /// Initializes a new instance of the class. - /// - public CacherRenderContext() - { - this.d2dFactory = new D2DFactory(); - this.dwtFactory = new DWFactory(); - this.wicFactory = new WICFactory(); - this.RendersToScreen = true; - } - - /// - /// Gets a value indicating whether to paint the background. - /// - /// true if the background should be painted; otherwise, false. - public bool PaintBackground - { - get - { - return false; - } - } - - /// - /// Gets or sets a value indicating whether the context renders to screen. - /// - /// true if the context renders to screen; otherwise, false. - public bool RendersToScreen { get; set; } - - /// - /// Gets or sets the Direct2D factory - /// - public D2DFactory D2DFactory - { - get - { - return this.d2dFactory; - } - - set - { - this.d2dFactory = value; - } - } - - /// - /// Draws an ellipse. - /// - /// The rectangle. - /// The fill color. - /// The stroke color. - /// The thickness. - public void DrawEllipse(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness) - { - var el = rect.ToEllipse(); - - this.renderUnits.Add(new EllipseRenderUnit(el, this.GetBrush(stroke), this.GetBrush(fill), (float)thickness)); - } - - /// - /// Draws the collection of ellipses, where all have the same stroke and fill. - /// This performs better than calling DrawEllipse multiple times. - /// - /// The rectangles. - /// The fill color. - /// The stroke color. - /// The stroke thickness. - public void DrawEllipses(IList rectangles, OxyColor fill, OxyColor stroke, double thickness) - { - var ellipseGeometries = rectangles.Select(x => new EllipseGeometry(this.d2dFactory, x.ToEllipse())).ToArray(); - var group = new GeometryGroup(this.d2dFactory, FillMode.Alternate, ellipseGeometries); - - this.renderUnits.Add(new GeometryRenderUnit(group, this.GetBrush(stroke), this.GetBrush(fill), (float)thickness, null)); - - foreach (var geometry in ellipseGeometries) - { - geometry.Dispose(); - } - } - - /// - /// Draws the polyline from the specified points. - /// - /// The points. - /// The stroke color. - /// The stroke thickness. - /// The dash array. - /// The line join type. - /// if set to true the shape will be aliased. - public void DrawLine( - IList points, - OxyColor stroke, - double thickness, - double[] dashArray, - OxyPlot.LineJoin lineJoin, - bool aliased) - { - var path = new PathGeometry(this.d2dFactory); - var sink = path.Open(); - sink.BeginFigure(points[0].ToVector2(aliased), new FigureBegin()); - - sink.AddLines(points.Skip(1).Select(pt => (dx.Mathematics.Interop.RawVector2)pt.ToVector2(aliased)).ToArray()); - sink.EndFigure(new FigureEnd()); - sink.Close(); - sink.Dispose(); - - var strokeStyle = this.GetStroke(dashArray, lineJoin); - - this.renderUnits.Add(new GeometryRenderUnit(path, this.GetBrush(stroke), null, (float)thickness, strokeStyle)); - } - - /// - /// Draws the multiple line segments defined by points (0,1) (2,3) (4,5) etc. - /// This should have better performance than calling DrawLine for each segment. - /// - /// The points. - /// The stroke color. - /// The stroke thickness. - /// The dash array. - /// The line join type. - /// if set to true the shape will be aliased. - public void DrawLineSegments( - IList points, - OxyColor stroke, - double thickness, - double[] dashArray, - OxyPlot.LineJoin lineJoin, - bool aliased) - { - var path = new PathGeometry(this.d2dFactory); - var sink = path.Open(); - for (int i = 0; i + 1 < points.Count; i += 2) - { - sink.BeginFigure(points[i].ToVector2(aliased), new FigureBegin()); - - sink.AddLine(points[i + 1].ToVector2(aliased)); - sink.EndFigure(new FigureEnd()); - } - - sink.Close(); - sink.Dispose(); - - var strokeStyle = this.GetStroke(dashArray, lineJoin); - - this.renderUnits.Add(new GeometryRenderUnit(path, this.GetBrush(stroke), null, (float)thickness, strokeStyle)); - } - - /// - /// Draws the polygon from the specified points. The polygon can have stroke and/or fill. - /// - /// The points. - /// The fill color. - /// The stroke color. - /// The stroke thickness. - /// The dash array. - /// The line join type. - /// if set to true the shape will be aliased. - public void DrawPolygon( - IList points, - OxyColor fill, - OxyColor stroke, - double thickness, - double[] dashArray, - OxyPlot.LineJoin lineJoin, - bool aliased) - { - var path = new PathGeometry(this.d2dFactory); - var sink = path.Open(); - sink.BeginFigure(points[0].ToVector2(aliased), new FigureBegin()); - - sink.AddLines(points.Skip(1).Select(pt => (dx.Mathematics.Interop.RawVector2)pt.ToVector2(aliased)).ToArray()); - sink.EndFigure(new FigureEnd()); - sink.Close(); - sink.Dispose(); - - var strokeStyle = this.GetStroke(dashArray, lineJoin); - - this.renderUnits.Add(new GeometryRenderUnit(path, this.GetBrush(stroke), this.GetBrush(fill), (float)thickness, strokeStyle)); - } - - /// - /// Draws a collection of polygons, where all polygons have the same stroke and fill. - /// This performs better than calling DrawPolygon multiple times. - /// - /// The polygons. - /// The fill color. - /// The stroke color. - /// The stroke thickness. - /// The dash array. - /// The line join type. - /// if set to true the shape will be aliased. - public void DrawPolygons( - IList> polygons, - OxyColor fill, - OxyColor stroke, - double thickness, - double[] dashArray, - OxyPlot.LineJoin lineJoin, - bool aliased) - { - var path = new PathGeometry(this.d2dFactory); - var sink = path.Open(); - foreach (var points in polygons) - { - sink.BeginFigure(points[0].ToVector2(aliased), new FigureBegin()); - - sink.AddLines(points.Skip(1).Select(pt => (dx.Mathematics.Interop.RawVector2)pt.ToVector2(aliased)).ToArray()); - sink.EndFigure(new FigureEnd()); - } - - sink.Close(); - sink.Dispose(); - - var strokeStyle = this.GetStroke(dashArray, lineJoin); - this.renderUnits.Add(new GeometryRenderUnit(path, this.GetBrush(stroke), this.GetBrush(fill), (float)thickness, strokeStyle)); - } - - /// - /// Draws the rectangle. - /// - /// The rectangle. - /// The fill color. - /// The stroke color. - /// The stroke thickness. - public void DrawRectangle(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness) - { - this.renderUnits.Add(new RectangleRenderUnit(rect.ToRectangleF(), this.GetBrush(stroke), this.GetBrush(fill), (float)thickness)); - } - - /// - /// Draws a collection of rectangles, where all have the same stroke and fill. - /// This performs better than calling DrawRectangle multiple times. - /// - /// The rectangles. - /// The fill color. - /// The stroke color. - /// The stroke thickness. - public void DrawRectangles(IList rectangles, OxyColor fill, OxyColor stroke, double thickness) - { - var rectangleGeometries = rectangles.Select(x => new RectangleGeometry(this.d2dFactory, x.ToRectangleF())).ToArray(); - var group = new GeometryGroup(this.d2dFactory, FillMode.Winding, rectangleGeometries); - - this.renderUnits.Add(new GeometryRenderUnit(group, this.GetBrush(stroke), this.GetBrush(fill), (float)thickness, null)); - - foreach (var rectangle in rectangleGeometries) - { - rectangle.Dispose(); - } - } - - /// - /// Draws the text. - /// - /// The position. - /// The text. - /// The fill color. - /// The font family. - /// Size of the font. - /// The font weight. - /// The rotation angle. - /// The horizontal alignment. - /// The vertical alignment. - /// The maximum size of the text. - public void DrawText( - ScreenPoint p, - string text, - OxyColor fill, - string fontFamily, - double fontSize, - double fontWeight, - double rotate, - OxyPlot.HorizontalAlignment halign, - OxyPlot.VerticalAlignment valign, - OxySize? maxSize) - { - if (string.IsNullOrWhiteSpace(fontFamily)) - { - fontFamily = "Arial"; - } - - if (text == null) - { - text = string.Empty; - } - - var format = new TextFormat(this.dwtFactory, fontFamily, GetFontWeight(fontWeight), FontStyle.Normal, FontStretch.Normal, (float)fontSize); - var maxWidth = 1000f; - var maxHeight = 1000f; - if (maxSize != null) - { - maxHeight = (float)maxSize.Value.Height; - maxWidth = (float)maxSize.Value.Width; - } - - var layout = new TextLayout(this.dwtFactory, text, format, maxWidth, maxHeight); - - var size = new Size2F(layout.Metrics.Width, layout.Metrics.Height); - if (maxSize != null) - { - if (size.Width > maxSize.Value.Width) - { - size.Width = (float)maxSize.Value.Width; - } - - if (size.Height > maxSize.Value.Height) - { - size.Height = (float)maxSize.Value.Height; - } - } - - float dx = 0; - if (halign == OxyPlot.HorizontalAlignment.Center) - { - dx = -size.Width / 2; - } - - if (halign == OxyPlot.HorizontalAlignment.Right) - { - dx = -size.Width; - } - - float dy = 0; - if (valign == OxyPlot.VerticalAlignment.Middle) - { - dy = -size.Height / 2; - } - - if (valign == OxyPlot.VerticalAlignment.Bottom) - { - dy = -size.Height; - } - - this.renderUnits.Add(new TextRenderUnit(layout, this.GetBrush(fill), Matrix3x2.Translation(dx, dy) * Matrix3x2.Rotation(MathUtil.DegreesToRadians((float)rotate)) * Matrix3x2.Translation(p.ToVector2()))); - format.Dispose(); - } - - /// - /// Measures the text. - /// - /// The text. - /// The font family. - /// Size of the font. - /// The font weight. - /// The text size. - public OxySize MeasureText(string text, string fontFamily, double fontSize, double fontWeight) - { - if (string.IsNullOrWhiteSpace(fontFamily)) - { - fontFamily = "Arial"; - } - - if (text == null) - { - text = string.Empty; - } - - var format = new TextFormat(this.dwtFactory, fontFamily, GetFontWeight(fontWeight), FontStyle.Normal, FontStretch.Normal, (float)fontSize); - - var layout = new TextLayout(this.dwtFactory, text, format, 1000f, 1000f); - var res = new OxySize(layout.Metrics.Width, layout.Metrics.Height); - - format.Dispose(); - layout.Dispose(); - - return res; - } - - /// - /// Sets the tool tip for the following items. - /// - /// The text in the tooltip. - public void SetToolTip(string text) - { - this.currentToolTip = text; - } - - /// - /// Draws the specified portion of the specified at the specified location and with the specified size. - /// - /// The source. - /// The x-coordinate of the upper-left corner of the portion of the source image to draw. - /// The y-coordinate of the upper-left corner of the portion of the source image to draw. - /// Width of the portion of the source image to draw. - /// Height of the portion of the source image to draw. - /// The x-coordinate of the upper-left corner of drawn image. - /// The y-coordinate of the upper-left corner of drawn image. - /// The width of the drawn image. - /// The height of the drawn image. - /// The opacity. - /// interpolate if set to true. - public void DrawImage( - OxyImage source, - double srcX, - double srcY, - double srcWidth, - double srcHeight, - double destX, - double destY, - double destWidth, - double destHeight, - double opacity, - bool interpolate) - { - if (destWidth <= 0 || destHeight <= 0 || srcWidth <= 0 || srcHeight <= 0) - { - return; - } - - var bmp = this.GetBitmap(source); - - this.renderUnits.Add( - new ImageRenderUnit( - bmp, - new RectangleF((float)srcX, (float)srcY, (float)srcWidth, (float)srcHeight), - new RectangleF((float)destX, (float)destY, (float)destWidth, (float)destHeight), - (float)opacity, - interpolate ? BitmapInterpolationMode.Linear : BitmapInterpolationMode.NearestNeighbor)); - } - - /// - /// Sets the clipping rectangle. - /// - /// The clipping rectangle. - /// True if the clipping rectangle was set. - public bool SetClip(OxyRect clippingRect) - { - this.clipRect = clippingRect.ToRectangleF(); - return true; - } - - /// - /// Resets the clipping rectangle. - /// - public void ResetClip() - { - } - - /// - /// Cleans up resources not in use. - /// - /// This method is called at the end of each rendering. - public void CleanUp() - { - // Find the images in the cache that has not been used since last call to this method - var imagesToRelease = this.imageCache.Keys.Where(i => !this.imagesInUse.Contains(i)).ToList(); - - // Remove the images from the cache - foreach (var i in imagesToRelease) - { - this.imageCache.Remove(i); - } - - this.imagesInUse.Clear(); - } - - /// - /// On changing renderTarget (on resize for example), this method should be called. - /// Clears invalid for new renderTarget resources (like brushes). - /// - /// The render target. - public void ResetRenderTarget(RenderTarget renderTarget) - { - this.ResetRenderUnits(); - - if (this.renderTarget == renderTarget) - { - return; - } - - foreach (var brush in this.brushCache.Values) - { - brush.Dispose(); - } - - this.brushCache.Clear(); - - foreach (var image in this.imageCache.Values) - { - image.Dispose(); - } - - this.imageCache.Clear(); - - this.imagesInUse.Clear(); - - this.renderTarget = renderTarget; - } - - /// - /// On plot invalidate this method should be called - /// Clear current cached geometries - /// - public void ResetRenderUnits() - { - foreach (var unit in this.renderUnits) - { - unit.Dispose(); - } - - this.renderUnits.Clear(); - } - - /// - /// Renders cached render units. - /// This method should be called on redraw required - /// - /// The viewport. - public void Render(RectangleF viewport) - { - if (this.renderTarget == null) - { - return; - } - - var original = this.renderTarget.Transform; - - this.renderTarget.Transform = original * Matrix3x2.Translation(-viewport.X, -viewport.Y); - - // TODO: can be optimized to use something like quad-tree - // https://en.wikipedia.org/wiki/Quadtree - foreach (var unit in this.renderUnits) - { - if (unit.CheckBounds(viewport)) - { - unit.Render(this.renderTarget); - } - } - - this.renderTarget.Transform = original; - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - foreach (var item in this.brushCache.Values) - { - item.Dispose(); - } - - foreach (var item in this.imageCache.Values) - { - item.Dispose(); - } - - this.imageCache.Clear(); - this.brushCache.Clear(); - if (this.renderTarget != null) - { - this.renderTarget.Dispose(); - } - - foreach (var unit in this.renderUnits) - { - unit.Dispose(); - } - - this.renderUnits.Clear(); - - // d2dFactory.Dispose(); - this.dwtFactory.Dispose(); - this.wicFactory.Dispose(); - - this.renderTarget = null; - this.d2dFactory = null; - this.dwtFactory = null; - this.wicFactory = null; - } - - /// - /// Gets the font weight. - /// - /// The font weight. - /// A - private static FontWeight GetFontWeight(double fontWeight) - { - return fontWeight > (int)FontWeight.Normal ? FontWeight.Bold : FontWeight.Normal; - } - - /// - /// Gets the stroke. - /// - /// The dashes array. - /// The line join type. - /// Returns stroke stroke style. - private StrokeStyle GetStroke(double[] dashArray, OxyPlot.LineJoin lineJoin) - { - if (dashArray == null) - { - return new StrokeStyle(this.d2dFactory, new StrokeStyleProperties { LineJoin = lineJoin.ToDXLineJoin() }); - } - - return new StrokeStyle(this.d2dFactory, new StrokeStyleProperties { LineJoin = lineJoin.ToDXLineJoin(), DashStyle = DashStyle.Custom }, dashArray.Select(x => (float)x).ToArray()); - } - - /// - /// Get the brush with color. - /// - /// The color. - /// Return the brush. - private Brush GetBrush(OxyColor color) - { - if (!color.IsVisible()) - { - return null; - } - - Brush brush; - if (!this.brushCache.TryGetValue(color, out brush)) - { - brush = new SolidColorBrush(this.renderTarget, color.ToDXColor()); - this.brushCache.Add(color, brush); - } - - return brush; - } - - /// - /// Gets bitmap. - /// - /// The image. - /// Returns bitmap. - private Bitmap GetBitmap(OxyImage image) - { - if (image == null) - { - return null; - } - - if (!this.imagesInUse.Contains(image)) - { - this.imagesInUse.Add(image); - } - - Bitmap res; - using (var stream = new MemoryStream(image.GetData())) - { - var decoder = new BitmapDecoder(this.wicFactory, stream, DecodeOptions.CacheOnDemand); - var frame = decoder.GetFrame(0); - var converter = new FormatConverter(this.wicFactory); - converter.Initialize(frame, dx.WIC.PixelFormat.Format32bppPRGBA); - - res = Bitmap.FromWicBitmap(this.renderTarget, converter); - } - - this.imageCache.Add(image, res); - return res; - } - } -} diff --git a/Source/OxyPlot.SharpDX/OxyPlot.SharpDX.projitems b/Source/OxyPlot.SharpDX/OxyPlot.SharpDX.projitems deleted file mode 100644 index 3d9092f59..000000000 --- a/Source/OxyPlot.SharpDX/OxyPlot.SharpDX.projitems +++ /dev/null @@ -1,21 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 455376c6-4146-497c-bf77-61cbb67f5df9 - - - OxyPlot.SharpDX - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/OxyPlot.SharpDX/OxyPlot.SharpDX.shproj b/Source/OxyPlot.SharpDX/OxyPlot.SharpDX.shproj deleted file mode 100644 index 5747af4fc..000000000 --- a/Source/OxyPlot.SharpDX/OxyPlot.SharpDX.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - 455376c6-4146-497c-bf77-61cbb67f5df9 - 14.0 - - - - - - - - diff --git a/Source/OxyPlot.SharpDX/RenderUnits/EllipseRenderUnit.cs b/Source/OxyPlot.SharpDX/RenderUnits/EllipseRenderUnit.cs deleted file mode 100644 index 7595c89dc..000000000 --- a/Source/OxyPlot.SharpDX/RenderUnits/EllipseRenderUnit.cs +++ /dev/null @@ -1,97 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents a Ellipse IRenderUnit implementation. -// -// -------------------------------------------------------------------------------------------------------------------- -namespace OxyPlot.SharpDX -{ - using global::SharpDX; - using global::SharpDX.Direct2D1; - - /// - /// Represents a Ellipse IRenderUnit implementation. - /// - internal class EllipseRenderUnit : IRenderUnit - { - /// - /// The bounds. - /// - private readonly RectangleF bounds; - - /// - /// The ellipse. - /// - private readonly Ellipse ellipse; - - /// - /// The thickness; - /// - private readonly float thickness; - - /// - /// The stroke. - /// - private Brush stroke; - - /// - /// The fill. - /// - private Brush fill; - - /// - /// Initializes a new instance of the class. - /// - /// The ellipse. - /// The stroke. - /// The fill. - /// The thickness. - public EllipseRenderUnit(Ellipse ellipse, Brush stroke, Brush fill, float thickness) - { - this.ellipse = ellipse; - this.bounds = new RectangleF(ellipse.Point.X - ellipse.RadiusX, ellipse.Point.Y - ellipse.RadiusY, ellipse.RadiusX * 2, ellipse.RadiusY * 2); - this.stroke = stroke; - this.fill = fill; - this.thickness = thickness; - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - this.stroke = null; - this.fill = null; - } - - /// - /// Renders ellipse represented by current instance to render target. - /// - /// The render target. - public void Render(RenderTarget renderTarget) - { - if (this.stroke != null) - { - renderTarget.DrawEllipse(this.ellipse, this.stroke, this.thickness); - } - - if (this.fill != null) - { - renderTarget.FillEllipse(this.ellipse, this.fill); - } - } - - /// - /// Checks if current instance bounds intersects with viewport or not. - /// - /// The viewport. - /// Return True if bounds intersects with viewport, otherwise False. - public bool CheckBounds(RectangleF viewport) - { - return viewport.Intersects(this.bounds); - } - } -} diff --git a/Source/OxyPlot.SharpDX/RenderUnits/GeometryRenderUnit.cs b/Source/OxyPlot.SharpDX/RenderUnits/GeometryRenderUnit.cs deleted file mode 100644 index b134ec6f1..000000000 --- a/Source/OxyPlot.SharpDX/RenderUnits/GeometryRenderUnit.cs +++ /dev/null @@ -1,121 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents a Geometry IRenderUnit implementation. -// -// -------------------------------------------------------------------------------------------------------------------- -namespace OxyPlot.SharpDX -{ - using global::SharpDX; - using global::SharpDX.Direct2D1; - - /// - /// Represents a Geometry IRenderUnit implementation. - /// - internal class GeometryRenderUnit : IRenderUnit - { - /// - /// The geometry. - /// - private Geometry geometry; - - /// - /// The bounds. - /// - private RectangleF bounds; - - /// - /// The fill. - /// - private Brush fill; - - /// - /// The stroke. - /// - private Brush stroke; - - /// - /// The stroke style. - /// - private StrokeStyle strokeStyle; - - /// - /// The stroke width. - /// - private readonly float strokeWidth; - - /// - /// Initializes a new instance of the class. - /// - /// The geometry. - /// The stroke. - /// The fill. - /// The stroke width. - /// The stroke style. - public GeometryRenderUnit(Geometry geometry, Brush stroke, Brush fill, float strokeWidth, StrokeStyle strokeStyle) - { - this.geometry = geometry; - this.fill = fill; - this.stroke = stroke; - this.strokeWidth = strokeWidth; - this.strokeStyle = strokeStyle; - var raw = geometry.GetBounds(); - this.bounds = new RectangleF(raw.Left, raw.Top, raw.Right - raw.Left, raw.Bottom - raw.Top); - } - - /// - /// Renders geometry represented by current instance to render target. - /// - /// The render target. - public void Render(RenderTarget renderTarget) - { - if (this.stroke != null) - { - if (this.strokeStyle != null) - { - renderTarget.DrawGeometry(this.geometry, this.stroke, this.strokeWidth, this.strokeStyle); - } - else - { - renderTarget.DrawGeometry(this.geometry, this.stroke, this.strokeWidth); - } - } - - if (this.fill != null) - { - renderTarget.FillGeometry(this.geometry, this.fill); - } - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - if (this.strokeStyle != null) - { - this.strokeStyle.Dispose(); - } - - this.geometry.Dispose(); - - this.fill = null; - this.geometry = null; - this.stroke = null; - this.strokeStyle = null; - } - - /// - /// Checks if current instance bounds intersects with viewport or not. - /// - /// The viewport. - /// Return True if bounds intersects with viewport, otherwise False. - public bool CheckBounds(RectangleF viewport) - { - return this.bounds.Intersects(viewport); - } - } -} diff --git a/Source/OxyPlot.SharpDX/RenderUnits/IRenderUnit.cs b/Source/OxyPlot.SharpDX/RenderUnits/IRenderUnit.cs deleted file mode 100644 index 95cb210c8..000000000 --- a/Source/OxyPlot.SharpDX/RenderUnits/IRenderUnit.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents a IRenderUnit definition. -// -// -------------------------------------------------------------------------------------------------------------------- -namespace OxyPlot.SharpDX -{ - using System; - using global::SharpDX; - using global::SharpDX.Direct2D1; - - /// - /// Represents a IRenderUnit definition. - /// - internal interface IRenderUnit : IDisposable - { - /// - /// Renders image represented by current instance to render target. - /// - /// The render target. - void Render(RenderTarget renderTarget); - - /// - /// Checks if current instance bounds intersects with viewport or not. - /// - /// The viewport. - /// Return True if bounds intersects with viewport, otherwise False. - bool CheckBounds(RectangleF viewport); - } -} diff --git a/Source/OxyPlot.SharpDX/RenderUnits/ImageRenderUnit.cs b/Source/OxyPlot.SharpDX/RenderUnits/ImageRenderUnit.cs deleted file mode 100644 index 470c2c92c..000000000 --- a/Source/OxyPlot.SharpDX/RenderUnits/ImageRenderUnit.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents a Image IRenderUnit implementation. -// -// -------------------------------------------------------------------------------------------------------------------- -namespace OxyPlot.SharpDX -{ - using global::SharpDX; - using global::SharpDX.Direct2D1; - - /// - /// Represents a Image IRenderUnit implementation. - /// - internal class ImageRenderUnit : IRenderUnit - { - /// - /// The bitmap. - /// - private Bitmap bitmap; - - /// - /// The source rectangle. - /// - private readonly RectangleF src; - - /// - /// The destination rectangle. - /// - private readonly RectangleF dest; - - /// - /// The opacity. - /// - private readonly float opacity; - - /// - /// The interpolation mode. - /// - private readonly BitmapInterpolationMode mode; - - /// - /// Initializes a new instance of the class. - /// - /// The bitmap. - /// The source rectangle. - /// The destination rectangle. - /// The opacity. - /// The interpolation mode. - public ImageRenderUnit( - Bitmap bitmap, - RectangleF src, - RectangleF dest, - float opacity, - BitmapInterpolationMode mode) - { - this.bitmap = bitmap; - this.src = src; - this.dest = dest; - this.opacity = opacity; - this.mode = mode; - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - this.bitmap = null; - } - - /// - /// Renders image represented by current instance to render target. - /// - /// The render target. - public void Render(RenderTarget renderTarget) - { - renderTarget.DrawBitmap(this.bitmap, this.dest, this.opacity, this.mode, this.src); - } - - /// - /// Checks if current instance bounds intersects with viewport or not. - /// - /// The viewport. - /// Return True if bounds intersects with viewport, otherwise False. - public bool CheckBounds(RectangleF viewport) - { - return viewport.Intersects(this.dest); - } - } -} diff --git a/Source/OxyPlot.SharpDX/RenderUnits/RectangleRenderUnit.cs b/Source/OxyPlot.SharpDX/RenderUnits/RectangleRenderUnit.cs deleted file mode 100644 index 3ace58485..000000000 --- a/Source/OxyPlot.SharpDX/RenderUnits/RectangleRenderUnit.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents a Rectangle IRenderUnit implementation. -// -// -------------------------------------------------------------------------------------------------------------------- -namespace OxyPlot.SharpDX -{ - using global::SharpDX; - using global::SharpDX.Direct2D1; - - /// - /// Represents a Rectangle IRenderUnit implementation. - /// - internal class RectangleRenderUnit : IRenderUnit - { - /// - /// The rectangle. - /// - private readonly RectangleF rectangle; - - /// - /// The stroke. - /// - private Brush stroke; - - /// - /// The fill. - /// - private Brush fill; - - /// - /// The thickness. - /// - private readonly float thickness; - - /// - /// Initializes a new instance of the class. - /// - /// The rectangle. - /// The stroke. - /// The fill. - /// The thickness. - public RectangleRenderUnit(RectangleF rectangle, Brush stroke, Brush fill, float thickness) - { - this.rectangle = rectangle; - this.stroke = stroke; - this.fill = fill; - this.thickness = thickness; - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - this.stroke = null; - this.fill = null; - } - - /// - /// Renders rectangle represented by current instance to render target. - /// - /// The render target. - public void Render(RenderTarget renderTarget) - { - if (this.stroke != null) - { - renderTarget.DrawRectangle(this.rectangle, this.stroke, this.thickness); - } - - if (this.fill != null) - { - renderTarget.FillRectangle(this.rectangle, this.fill); - } - } - - /// - /// Checks if current instance bounds intersects with viewport or not. - /// - /// The viewport. - /// Return True if bounds intersects with viewport, otherwise False. - public bool CheckBounds(RectangleF viewport) - { - return viewport.Intersects(this.rectangle); - } - } -} diff --git a/Source/OxyPlot.SharpDX/RenderUnits/TextRenderUnit.cs b/Source/OxyPlot.SharpDX/RenderUnits/TextRenderUnit.cs deleted file mode 100644 index acebcc8f6..000000000 --- a/Source/OxyPlot.SharpDX/RenderUnits/TextRenderUnit.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents a Text IRenderUnit implementation. -// -// -------------------------------------------------------------------------------------------------------------------- -namespace OxyPlot.SharpDX -{ - using global::SharpDX; - using global::SharpDX.Direct2D1; - using global::SharpDX.DirectWrite; - - /// - /// Represents a Text IRenderUnit implementation. - /// - internal class TextRenderUnit : IRenderUnit - { - /// - /// The text transform. - /// - private readonly Matrix3x2 transform; - - /// - /// The text layout. - /// - private readonly TextLayout layout; - - /// - /// The brush. - /// - private Brush brush; - - /// - /// The bounds. - /// - private readonly RectangleF bounds; - - /// - /// Initializes a new instance of the class. - /// - /// The text layout. - /// The brush. - /// The text transform. - public TextRenderUnit(TextLayout textLayout, Brush brush, Matrix3x2 transform) - { - this.layout = textLayout; - this.brush = brush; - this.transform = transform; - - var topleft = Matrix3x2.TransformPoint(transform, new Vector2(0, 0)); - var bottomRight = Matrix3x2.TransformPoint(transform, new Vector2(textLayout.Metrics.Width, textLayout.Metrics.Height)); - - this.bounds = new RectangleF - { - Top = topleft.Y, - Left = topleft.X, - Right = bottomRight.X, - Bottom = bottomRight.Y - }; - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - this.layout.Dispose(); - this.brush = null; - } - - /// - /// Renders text represented by current instance to render target. - /// - /// The render target. - public void Render(RenderTarget renderTarget) - { - var currentTransform = renderTarget.Transform; - renderTarget.Transform = this.transform * currentTransform; - - renderTarget.DrawTextLayout(new Vector2(), this.layout, this.brush); - - renderTarget.Transform = currentTransform; - } - - /// - /// Checks if current instance bounds intersects with viewport or not. - /// - /// The viewport. - /// Return True if bounds intersects with viewport, otherwise False. - public bool CheckBounds(RectangleF viewport) - { - return viewport.Intersects(this.bounds); - } - } -} diff --git a/Source/OxyPlot.SharpDX/SharpDXOxyExtensions.cs b/Source/OxyPlot.SharpDX/SharpDXOxyExtensions.cs deleted file mode 100644 index 684640931..000000000 --- a/Source/OxyPlot.SharpDX/SharpDXOxyExtensions.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) 2014 OxyPlot contributors -// -// -// Represents class, that contains SharpDX and Oxy extensions. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace OxyPlot.SharpDX -{ - using global::SharpDX; - using DXLineJoin = global::SharpDX.Direct2D1.LineJoin; - using Ellipse = global::SharpDX.Direct2D1.Ellipse; - - /// - /// Represents class, that contains SharpDX and Oxy extensions. - /// - internal static class SharpDXOxyExtensions - { - /// - /// Converts to . - /// - /// The point to convert, - /// Indicate, whether result should be aliased - /// Return - public static Vector2 ToVector2(this ScreenPoint point, bool aliased = false) - { - // adding 0.5 to get pixel boundary alignment, seems to work - // http://weblogs.asp.net/mschwarz/archive/2008/01/04/silverlight-rectangles-paths-and-line-comparison.aspx - // http://www.wynapse.com/Silverlight/Tutor/Silverlight_Rectangles_Paths_And_Lines_Comparison.aspx - if (aliased) - { - return new Vector2(0.5f + (int)point.X, 0.5f + (int)point.Y); - } - - return new Vector2((float)point.X, (float)point.Y); - } - - /// - /// Converts to . - /// - /// The rectangle to convert. - /// Return - public static Ellipse ToEllipse(this OxyRect rect) - { - return new Ellipse(rect.Center.ToVector2(), (float)rect.Width / 2, (float)rect.Height / 2); - } - - /// - /// Converts to . - /// - /// The rectangle to convert. - /// Return - public static RectangleF ToRectangleF(this OxyRect rect) - { - return new RectangleF((float)rect.Left, (float)rect.Top, (float)rect.Width, (float)rect.Height); - } - - /// - /// Converts to . - /// - /// The to convert. - /// Return - public static DXLineJoin ToDXLineJoin(this LineJoin lineJoin) - { - switch (lineJoin) - { - case LineJoin.Miter: - return DXLineJoin.Miter; - case LineJoin.Round: - return DXLineJoin.Round; - case LineJoin.Bevel: - return DXLineJoin.Bevel; - default: - return DXLineJoin.MiterOrBevel; - } - } - - /// - /// Converts to . - /// - /// The color to convert. - /// Return - public static Color4 ToDXColor(this OxyColor color) - { - return new Color4(color.R * 1f / 255f, color.G * 1f / 255f, color.B * 1f / 255f, color.A * 1f / 255f); - } - } -} diff --git a/appveyor.yml b/appveyor.yml index 3b6251a56..6d5b222de 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,7 +25,6 @@ after_build: - NuGet pack Source\OxyPlot.WindowsForms\OxyPlot.WindowsForms.nuspec -version "%GitVersion_NuGetVersion%" -OutputDirectory Source\OxyPlot.WindowsForms\bin\Release - NuGet pack Source\OxyPlot.OpenXml\OxyPlot.OpenXml.nuspec -version "%GitVersion_NuGetVersion%" -OutputDirectory Source\OxyPlot.OpenXml\bin\Release - NuGet pack Source\OxyPlot.Pdf\OxyPlot.Pdf.nuspec -version "%GitVersion_NuGetVersion%" -OutputDirectory Source\OxyPlot.Pdf\bin\Release - - NuGet pack Source\OxyPlot.SharpDX.Wpf\OxyPlot.SharpDX.Wpf.nuspec -version "%GitVersion_NuGetVersion%" -OutputDirectory Source\OxyPlot.SharpDX.Wpf\bin\Release artifacts: - path: '**/bin/Release/**/*.nupkg'