Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
Added 3D viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
martin2250 committed Sep 26, 2015
1 parent 90326a9 commit f13eb72
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CNCTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="HelixToolkit, Version=2015.1.629.0, Culture=neutral, PublicKeyToken=52aa3500039caf0d, processorArchitecture=MSIL">
<HintPath>..\packages\HelixToolkit.2015.1.629\lib\portable-net4+sl4+wp71+win8\HelixToolkit.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HelixToolkit.Wpf, Version=2015.1.629.0, Culture=neutral, PublicKeyToken=52aa3500039caf0d, processorArchitecture=MSIL">
<HintPath>..\packages\HelixToolkit.Wpf.2015.1.629\lib\net45\HelixToolkit.Wpf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
Expand Down Expand Up @@ -89,6 +97,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
44 changes: 39 additions & 5 deletions MainWindow/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,53 @@
<Window x:Class="CNCTool.MainWindow"
<Window x:Class="CNCTool.MainWindow.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CNCTool"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
xmlns:local="clr-namespace:CNCTool.MainWindow"
xmlns:h="http://helix-toolkit.org/wpf"
Title="CNCTool" Height="600" Width="800">

<Window.Resources>
<Style x:Key="iconStyle" TargetType="Image">
<Setter Property="Width" Value="16"/>
<Setter Property="Height" Value="16"/>
</Style>
</Window.Resources>

<TabControl>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/Icons/Code.png" Width="16"/>
<Label Content="G-Code Editor"/>
<Label Content="G-Code Editor"/>
</StackPanel>
</TabItem.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<GridSplitter Width="2" VerticalAlignment="Stretch" Grid.Column="1" ResizeBehavior="PreviousAndNext" Grid.RowSpan="3"/>
<GridSplitter Height="2" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="2" ResizeBehavior="PreviousAndNext"/>

<RichTextBox Name="editor_textBoxGCode" VerticalScrollBarVisibility="Visible" Grid.Column="0" Grid.RowSpan="3" IsUndoEnabled="True" UndoLimit="1024"/>

<h:HelixViewport3D Name="view" Grid.Row="0" Grid.Column="2">
<h:DefaultLights/>
<h:GridLinesVisual3D MajorDistance="10" MinorDistance="1" Center="0,0,0" Thickness="0.04" Normal="0,0,1" Width="20" Length="20"/>
<h:ArrowVisual3D Point1="0,0,0" Point2="0,0,2" Diameter="0.2"/>


</h:HelixViewport3D>
</Grid>

</TabItem>

<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
Expand Down Expand Up @@ -51,4 +84,5 @@
</TabItem.Header>
</TabItem>
</TabControl>

</Window>
2 changes: 1 addition & 1 deletion MainWindow/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CNCTool
namespace CNCTool.MainWindow
{
/// <summary>
/// Interaction logic for MainWindow.xaml
Expand Down
5 changes: 5 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HelixToolkit" version="2015.1.629" targetFramework="net452" />
<package id="HelixToolkit.Wpf" version="2015.1.629" targetFramework="net452" />
</packages>

0 comments on commit f13eb72

Please sign in to comment.