1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Renamed AngularBrush to ConicalBrush

This commit is contained in:
Darth Affe 2017-01-15 13:22:25 +01:00
parent 4cc519c8e2
commit e028467bbb
8 changed files with 51 additions and 53 deletions

View File

@ -493,13 +493,13 @@
<Compile Include="Profiles\Layers\Types\AmbientLight\ScreenCapturing\DX9ScreenCapture.cs" />
<Compile Include="Profiles\Layers\Types\AmbientLight\ScreenCapturing\IScreenCapture.cs" />
<Compile Include="Profiles\Layers\Types\AmbientLight\ScreenCapturing\ScreenCaptureManager.cs" />
<Compile Include="Profiles\Layers\Types\AngularBrush\AngularBrushPropertiesModel.cs" />
<Compile Include="Profiles\Layers\Types\AngularBrush\AngularBrushPropertiesView.xaml.cs">
<DependentUpon>AngularBrushPropertiesView.xaml</DependentUpon>
<Compile Include="Profiles\Layers\Types\ConicalBrush\ConicalBrushPropertiesModel.cs" />
<Compile Include="Profiles\Layers\Types\ConicalBrush\ConicalBrushPropertiesView.xaml.cs">
<DependentUpon>ConicalBrushPropertiesView.xaml</DependentUpon>
</Compile>
<Compile Include="Profiles\Layers\Types\AngularBrush\AngularBrushPropertiesViewModel.cs" />
<Compile Include="Profiles\Layers\Types\AngularBrush\AngularBrushType.cs" />
<Compile Include="Profiles\Layers\Types\AngularBrush\Drawing\GradientDrawer.cs" />
<Compile Include="Profiles\Layers\Types\ConicalBrush\ConicalBrushPropertiesViewModel.cs" />
<Compile Include="Profiles\Layers\Types\ConicalBrush\ConicalBrushType.cs" />
<Compile Include="Profiles\Layers\Types\ConicalBrush\Drawing\ConicalGradientDrawer.cs" />
<Compile Include="Profiles\Layers\Types\Audio\AudioCapturing\AudioCapture.cs" />
<Compile Include="Profiles\Layers\Types\Audio\AudioCapturing\AudioCaptureManager.cs" />
<Compile Include="Events\AudioDeviceChangedEventArgs.cs" />
@ -871,7 +871,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Profiles\Layers\Types\AngularBrush\AngularBrushPropertiesView.xaml">
<Page Include="Profiles\Layers\Types\ConicalBrush\ConicalBrushPropertiesView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>

View File

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace Artemis.Profiles.Layers.Types.AngularBrush
{
public partial class AngularBrushPropertiesView : UserControl
{
public AngularBrushPropertiesView()
{
InitializeComponent();
}
}
}

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Windows.Media;
using Artemis.Profiles.Layers.Models;
namespace Artemis.Profiles.Layers.Types.AngularBrush
namespace Artemis.Profiles.Layers.Types.ConicalBrush
{
public class AngularBrushPropertiesModel : LayerPropertiesModel
public class ConicalBrushPropertiesModel : LayerPropertiesModel
{
#region Properties & Fields
@ -15,7 +15,7 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush
#region Constructors
public AngularBrushPropertiesModel(LayerPropertiesModel properties = null)
public ConicalBrushPropertiesModel(LayerPropertiesModel properties = null)
: base(properties)
{ }

View File

@ -1,4 +1,4 @@
<UserControl x:Class="Artemis.Profiles.Layers.Types.AngularBrush.AngularBrushPropertiesView"
<UserControl x:Class="Artemis.Profiles.Layers.Types.ConicalBrush.ConicalBrushPropertiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

View File

@ -0,0 +1,12 @@
using System.Windows.Controls;
namespace Artemis.Profiles.Layers.Types.ConicalBrush
{
public partial class ConicalBrushPropertiesView : UserControl
{
public ConicalBrushPropertiesView()
{
InitializeComponent();
}
}
}

View File

@ -1,6 +1,4 @@
using System;
using System.Linq;
using System.Windows.Media;
using System.Linq;
using Artemis.Profiles.Layers.Abstract;
using Artemis.Profiles.Layers.Interfaces;
using Artemis.Utilities;
@ -8,9 +6,9 @@ using Artemis.ViewModels;
using Artemis.ViewModels.Profiles;
using Caliburn.Micro;
namespace Artemis.Profiles.Layers.Types.AngularBrush
namespace Artemis.Profiles.Layers.Types.ConicalBrush
{
public class AngularBrushPropertiesViewModel : LayerPropertiesViewModel
public class ConicalBrushPropertiesViewModel : LayerPropertiesViewModel
{
#region Properties & Fields
@ -38,7 +36,7 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush
#region Constructors
public AngularBrushPropertiesViewModel(LayerEditorViewModel editorVm)
public ConicalBrushPropertiesViewModel(LayerEditorViewModel editorVm)
: base(editorVm)
{
LayerAnimations = new BindableCollection<ILayerAnimation>(editorVm.LayerAnimations);

View File

@ -7,42 +7,42 @@ using Artemis.Profiles.Layers.Abstract;
using Artemis.Profiles.Layers.Animations;
using Artemis.Profiles.Layers.Interfaces;
using Artemis.Profiles.Layers.Models;
using Artemis.Profiles.Layers.Types.AngularBrush.Drawing;
using Artemis.Profiles.Layers.Types.ConicalBrush.Drawing;
using Artemis.ViewModels;
namespace Artemis.Profiles.Layers.Types.AngularBrush
namespace Artemis.Profiles.Layers.Types.ConicalBrush
{
public class AngularBrushType : ILayerType
public class ConicalBrushType : ILayerType
{
#region Properties & Fields
private GradientDrawer _gradientDrawer;
private GradientDrawer _gradientDrawerThumbnail;
private ConicalGradientDrawer _conicalGradientDrawer;
private ConicalGradientDrawer _conicalGradientDrawerThumbnail;
public string Name => "Angular Brush";
public string Name => "Conical Brush";
public bool ShowInEdtor => true;
public DrawType DrawType => DrawType.Keyboard;
#endregion
public AngularBrushType()
public ConicalBrushType()
{
_gradientDrawer = new GradientDrawer();
_gradientDrawerThumbnail = new GradientDrawer(18, 18);
_conicalGradientDrawer = new ConicalGradientDrawer();
_conicalGradientDrawerThumbnail = new ConicalGradientDrawer(18, 18);
}
#region Methods
public ImageSource DrawThumbnail(LayerModel layer)
{
_gradientDrawerThumbnail.GradientStops = GetGradientStops(layer.Brush).Select(x => new Tuple<double, Color>(x.Offset, x.Color)).ToList();
_gradientDrawerThumbnail.Update();
_conicalGradientDrawerThumbnail.GradientStops = GetGradientStops(layer.Brush).Select(x => new Tuple<double, Color>(x.Offset, x.Color)).ToList();
_conicalGradientDrawerThumbnail.Update();
Rect thumbnailRect = new Rect(0, 0, 18, 18);
DrawingVisual visual = new DrawingVisual();
using (DrawingContext c = visual.RenderOpen())
if (_gradientDrawerThumbnail.Brush != null)
c.DrawRectangle(_gradientDrawerThumbnail.Brush.Clone(), new Pen(new SolidColorBrush(Colors.White), 1), thumbnailRect);
if (_conicalGradientDrawerThumbnail.Brush != null)
c.DrawRectangle(_conicalGradientDrawerThumbnail.Brush.Clone(), new Pen(new SolidColorBrush(Colors.White), 1), thumbnailRect);
DrawingImage image = new DrawingImage(visual.Drawing);
return image;
@ -50,14 +50,14 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush
public void Draw(LayerModel layerModel, DrawingContext c)
{
AngularBrushPropertiesModel properties = layerModel.Properties as AngularBrushPropertiesModel;
ConicalBrushPropertiesModel properties = layerModel.Properties as ConicalBrushPropertiesModel;
if (properties == null) return;
Brush origBrush = layerModel.Brush;
_gradientDrawer.GradientStops = GetGradientStops(layerModel.Brush).Select(x => new Tuple<double, Color>(x.Offset, x.Color)).ToList();
_gradientDrawer.Update();
layerModel.Brush = _gradientDrawer.Brush;
_conicalGradientDrawer.GradientStops = GetGradientStops(layerModel.Brush).Select(x => new Tuple<double, Color>(x.Offset, x.Color)).ToList();
_conicalGradientDrawer.Update();
layerModel.Brush = _conicalGradientDrawer.Brush;
// If an animation is present, let it handle the drawing
if (layerModel.LayerAnimation != null && !(layerModel.LayerAnimation is NoneAnimation))
@ -98,15 +98,15 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush
public void SetupProperties(LayerModel layerModel)
{
if (layerModel.Properties is AngularBrushPropertiesModel)
if (layerModel.Properties is ConicalBrushPropertiesModel)
return;
layerModel.Properties = new AngularBrushPropertiesModel(layerModel.Properties);
layerModel.Properties = new ConicalBrushPropertiesModel(layerModel.Properties);
}
public LayerPropertiesViewModel SetupViewModel(LayerEditorViewModel layerEditorViewModel, LayerPropertiesViewModel layerPropertiesViewModel)
{
return (layerPropertiesViewModel as AngularBrushPropertiesViewModel) ?? new AngularBrushPropertiesViewModel(layerEditorViewModel);
return (layerPropertiesViewModel as ConicalBrushPropertiesViewModel) ?? new ConicalBrushPropertiesViewModel(layerEditorViewModel);
}
private GradientStopCollection GetGradientStops(Brush brush)

View File

@ -8,9 +8,9 @@ using System.Windows.Media.Imaging;
using Brush = System.Windows.Media.Brush;
using Color = System.Windows.Media.Color;
namespace Artemis.Profiles.Layers.Types.AngularBrush.Drawing
namespace Artemis.Profiles.Layers.Types.ConicalBrush.Drawing
{
public class GradientDrawer
public class ConicalGradientDrawer
{
#region Constants
@ -63,11 +63,11 @@ namespace Artemis.Profiles.Layers.Types.AngularBrush.Drawing
#region Constructors
public GradientDrawer()
public ConicalGradientDrawer()
: this(100, 100)
{ }
public GradientDrawer(int width, int height)
public ConicalGradientDrawer(int width, int height)
{
this._width = width;
this._height = height;