0024699: Visualization - prototype interoperation of TKOpenGl viewer with Direct3D viewer
Add new C# sample which allow to render the OCCT scene to a Direct3D context in a WPF application. DirectX SDK is required in order to build this sample.
18
samples/CSharp/WPF_WinForms/About.xaml
Normal file
@@ -0,0 +1,18 @@
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="IE_WPF_WinForms.AboutDialog"
|
||||
x:Name="Window"
|
||||
xmlns:local="clr-namespace:IE_WPF_WinForms"
|
||||
Title="About Import/Export Sample"
|
||||
Width="312" Height="285">
|
||||
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="Import/Export Sample," HorizontalAlignment="Center"/>
|
||||
<Label Content="Open CASCADE Technology " HorizontalAlignment="Center"/>
|
||||
<Image Source="occ_logo.bmp" Width="194" Height="100" />
|
||||
<Label Content="Copyright (C) 2004-2013, Open CASCADE S.A.S" HorizontalAlignment="Center"/>
|
||||
<Label Content="http://www.opencascade.com" HorizontalAlignment="Center"/>
|
||||
<Button Content="OK" HorizontalAlignment="Center" Width="75" Command="local:IECommands.AboutOk"/>
|
||||
</StackPanel>
|
||||
</Window>
|
40
samples/CSharp/WPF_WinForms/About.xaml.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace IE_WPF_WinForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for About.xaml
|
||||
/// </summary>
|
||||
public partial class AboutDialog : Window
|
||||
{
|
||||
public AboutDialog()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
CommandBinding aBind_Ok = new CommandBinding( IECommands.AboutOk );
|
||||
aBind_Ok.Executed += OkCommand_Executed;
|
||||
aBind_Ok.CanExecute += OkCommand_CanExecute;
|
||||
CommandBindings.Add( aBind_Ok );
|
||||
}
|
||||
|
||||
private void OkCommand_Executed( object sender, ExecutedRoutedEventArgs e )
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void OkCommand_CanExecute( object sender, CanExecuteRoutedEventArgs e )
|
||||
{
|
||||
e.CanExecute = true;
|
||||
}
|
||||
}
|
||||
}
|
14
samples/CSharp/WPF_WinForms/App.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Application x:Class="IE_WPF_WinForms.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Simple Styles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
16
samples/CSharp/WPF_WinForms/App.xaml.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace IE_WPF_WinForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
44
samples/CSharp/WPF_WinForms/IECommands.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace IE_WPF_WinForms
|
||||
{
|
||||
public class IECommands
|
||||
{
|
||||
public static RoutedUICommand New { get; private set; }
|
||||
public static RoutedUICommand Close { get; private set; }
|
||||
public static RoutedUICommand Quit { get; private set; }
|
||||
public static RoutedUICommand About { get; private set; }
|
||||
public static RoutedUICommand AboutOk { get; private set; }
|
||||
|
||||
static IECommands()
|
||||
{
|
||||
#region menu
|
||||
|
||||
InputGestureCollection inputsNew = new InputGestureCollection();
|
||||
inputsNew.Add( new KeyGesture( Key.N, ModifierKeys.Control, "Ctrl + N" ) );
|
||||
New = new RoutedUICommand( "New", "New", typeof(IECommands), inputsNew );
|
||||
|
||||
Close = new RoutedUICommand( "Close", "Close", typeof(IECommands) );
|
||||
|
||||
InputGestureCollection inputsQuit = new InputGestureCollection();
|
||||
inputsQuit.Add( new KeyGesture( Key.F4, ModifierKeys.Alt, "Alt + F4" ) );
|
||||
Quit = new RoutedUICommand( "Quit", "Quit", typeof(IECommands), inputsQuit );
|
||||
|
||||
InputGestureCollection inputsAbout = new InputGestureCollection();
|
||||
inputsAbout.Add( new KeyGesture( Key.F1 ) );
|
||||
About = new RoutedUICommand( "About", "About", typeof(IECommands), inputsAbout );
|
||||
|
||||
#endregion
|
||||
|
||||
#region aboutDlg
|
||||
InputGestureCollection inputsAboutOk = new InputGestureCollection();
|
||||
inputsAboutOk.Add( new KeyGesture( Key.Enter ) );
|
||||
AboutOk = new RoutedUICommand( "AboutOk", "AboutOk", typeof(IECommands), inputsAboutOk );
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
263
samples/CSharp/WPF_WinForms/IE_WPF_WinForms.csproj
Normal file
@@ -0,0 +1,263 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>IE_WPF_WinForms</RootNamespace>
|
||||
<AssemblyName>IE_WPF_WinForms</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ExpressionBlendVersion>3.0.1927.0</ExpressionBlendVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<TargetFrameworkProfile />
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\win32\bind\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>..\win32\bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\win64\bind\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<OutputPath>..\win64\bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UIAutomationProvider">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsFormsIntegration">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="About.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MaterialDlg.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Simple Styles.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="About.xaml.cs">
|
||||
<DependentUpon>About.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="IECommands.cs" />
|
||||
<Compile Include="MaterialDlg.xaml.cs">
|
||||
<DependentUpon>MaterialDlg.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="OCCViewer.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TransparencyDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="TransparencyDialog.resx">
|
||||
<DependentUpon>TransparencyDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="res\help.png" />
|
||||
<Resource Include="res\lamp.png" />
|
||||
<Resource Include="res\MainFrame.ico" />
|
||||
<Resource Include="res\new.png" />
|
||||
<Resource Include="res\tool_color.png" />
|
||||
<Resource Include="res\tool_delete.png" />
|
||||
<Resource Include="res\tool_material.png" />
|
||||
<Resource Include="res\tool_shading.png" />
|
||||
<Resource Include="res\tool_transparency.png" />
|
||||
<Resource Include="res\tool_wireframe.png" />
|
||||
<Resource Include="res\view_axo.png" />
|
||||
<Resource Include="res\view_back.png" />
|
||||
<Resource Include="res\view_bottom.png" />
|
||||
<Resource Include="res\view_comp_off.png" />
|
||||
<Resource Include="res\view_comp_on.png" />
|
||||
<Resource Include="res\view_fitall.png" />
|
||||
<Resource Include="res\view_fitarea.png" />
|
||||
<Resource Include="res\view_front.png" />
|
||||
<Resource Include="res\view_glpan.png" />
|
||||
<Resource Include="res\view_left.png" />
|
||||
<Resource Include="res\view_pan.png" />
|
||||
<Resource Include="res\view_reset.png" />
|
||||
<Resource Include="res\view_right.png" />
|
||||
<Resource Include="res\view_rotate.png" />
|
||||
<Resource Include="res\view_top.png" />
|
||||
<Resource Include="res\view_zoom.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="res\occ_logo.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OCCTProxy\OCCTProxy.vcxproj">
|
||||
<Project>{969912D9-78E7-4AB8-B4FF-6B52B4F03991}</Project>
|
||||
<Name>OCCTProxy</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
169
samples/CSharp/WPF_WinForms/MainWindow.xaml
Normal file
@@ -0,0 +1,169 @@
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="IE_WPF_WinForms.MainWindow"
|
||||
xmlns:local="clr-namespace:IE_WPF_WinForms"
|
||||
Title="Sample Import/Export" Height="600" Width="900" Icon="res/MainFrame.ico">
|
||||
|
||||
<Window.Background>
|
||||
<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ControlDarkColorKey}}"/>
|
||||
</Window.Background>
|
||||
|
||||
<Window.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="boolToVisibilityConverter"/>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Menu Height="25" Grid.Row="0">
|
||||
<MenuItem Header="File">
|
||||
<MenuItem Command="local:IECommands.New"/>
|
||||
<MenuItem Command="local:IECommands.Close"/>
|
||||
<MenuItem Header="Import" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}">
|
||||
<MenuItem Name="ImportBrep" Header="BRep..." Click="ImportBRep_Click"/>
|
||||
<MenuItem Name="ImportIges" Header="Iges..." Click="ImportIges_Click"/>
|
||||
<MenuItem Name="ImportStep" Header="Step..." Click="ImportStep_Click"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Export" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}">
|
||||
<MenuItem Name="ExportBrep" Header="BRep..." Click="ExportBRep_Click"/>
|
||||
<MenuItem Name="ExportIges" Header="Iges..." Click="ExportIges_Click"/>
|
||||
<MenuItem Name="ExportStep" Header="Step..." Click="ExportStep_Click"/>
|
||||
<MenuItem Name="ExportStl" Header="Stl..." Click="ExportStl_Click"/>
|
||||
<MenuItem Name="ExportVrml" Header="Vrml..." Click="ExportVrml_Click"/>
|
||||
<Separator/>
|
||||
<MenuItem Name="ExportImage" Header="Image..." Click="ExportImage_Click"/>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
<MenuItem Command="local:IECommands.Quit"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="View">
|
||||
<MenuItem Name="ActivateToolbar" IsCheckable="True" IsChecked="True" Header="Toolbar"/>
|
||||
<MenuItem Name="ActivateStatusbar" IsCheckable="True" IsChecked="True" Header="Statusbar"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Help">
|
||||
<MenuItem Header="About" Command="local:IECommands.About"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
|
||||
<ToolBarTray Background="White" Grid.Row="1">
|
||||
<ToolBar Name="ToolBar" Band="1" BandIndex="1"
|
||||
Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
|
||||
MouseEnter="ToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
|
||||
<Button ToolTip="New" Command="local:IECommands.New">
|
||||
<Image Source="res/new.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="About" Command="local:IECommands.About">
|
||||
<Image Source="res/help.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
<ToolBar Name="DocumentToolBar" Band="1" BandIndex="2"
|
||||
Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}"
|
||||
MouseEnter="DocumentToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
|
||||
<Button ToolTip="Wireframe" Click="Wireframe_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsWireframeEnabled}">
|
||||
<Image Source="res/tool_wireframe.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Shading" Click="Shading_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsShadingEnabled}">
|
||||
<Image Source="res/tool_shading.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Color" Click="Color_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsColorEnabled}">
|
||||
<Image Source="res/tool_color.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Material" Click="Material_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsMaterialEnabled}">
|
||||
<Image Source="res/tool_material.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Transparency" Click="Transparency_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsTransparencyEnabled}">
|
||||
<Image Source="res/tool_transparency.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Delete" Click="Delete_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDeleteEnabled}">
|
||||
<Image Source="res/tool_delete.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
<ToolBar Name="ViewToolBar" Band="1" BandIndex="1"
|
||||
Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}"
|
||||
MouseEnter="ViewToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
|
||||
<Button ToolTip="FitAll" Name="FitAllBtn" Click="FitAllBtn_Click">
|
||||
<Image Source="res/view_fitall.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Zoom Window" Name="ZoomWindowBtn" Click="ZoomWindowBtn_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsZoomWinEnabled}">
|
||||
<Image Source="res/view_fitarea.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Dynamic Zooming" Name="DynamicZoomingBtn" Click="DynamicZoomingBtn_Click">
|
||||
<Image Source="res/view_zoom.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Dynamic Panning" Name="DynamicPanningBtn" Click="DynamicPanningBtn_Click">
|
||||
<Image Source="res/view_pan.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Global Panning" Name="GlobalPanningBtn" Click="GlobalPanningBtn_Click">
|
||||
<Image Source="res/view_glpan.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Front" Name="FrontBtn" Click="FrontBtn_Click">
|
||||
<Image Source="res/view_front.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Back" Name="BackBtn" Click="BackBtn_Click">
|
||||
<Image Source="res/view_back.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Top" Name="TopBtn" Click="TopBtn_Click">
|
||||
<Image Source="res/view_top.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Bottom" Name="BottomBtn" Click="BottomBtn_Click">
|
||||
<Image Source="res/view_bottom.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Left" Name="LeftBtn" Click="LeftBtn_Click">
|
||||
<Image Source="res/view_left.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Right" Name="RightBtn" Click="RightBtn_Click">
|
||||
<Image Source="res/view_right.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Axo" Name="AxoBtn" Click="AxoBtn_Click">
|
||||
<Image Source="res/view_axo.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Dynamic Rotation" Name="DynamicRotationBtn" Click="DynamicRotationBtn_Click">
|
||||
<Image Source="res/view_rotate.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Reset" Name="ResetBtn" Click="ResetBtn_Click">
|
||||
<Image Source="res/view_reset.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Hidden Off" Name="HiddenOffBtn" Click="HiddenOffBtn_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsHlrOnPushed}">
|
||||
<Image Source="vres/iew_comp_on.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
<Button ToolTip="Hidden On" Name="HiddenOnBtn" Click="HiddenOnBtn_Click"
|
||||
IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsHlrOffPushed}">
|
||||
<Image Source="res/view_comp_off.png" Style="{StaticResource toolbarImageStyle}"/>
|
||||
</Button>
|
||||
</ToolBar>
|
||||
</ToolBarTray>
|
||||
|
||||
<TabControl Name="ViewPanel" Grid.Row="2"
|
||||
SelectionChanged="OnViewerChanged"
|
||||
Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen, Converter={StaticResource boolToVisibilityConverter}}">
|
||||
|
||||
<TabControl.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Command="local:IECommands.New" Style="{StaticResource popupItem}"/>
|
||||
<MenuItem Command="local:IECommands.Close" Style="{StaticResource popupItem}"/>
|
||||
</ContextMenu>
|
||||
</TabControl.ContextMenu>
|
||||
|
||||
</TabControl>
|
||||
|
||||
<StatusBar Background="White" Grid.Row="3" Visibility="{Binding ElementName=ActivateStatusbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}">
|
||||
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=StatusBarText}"/>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</Window>
|
614
samples/CSharp/WPF_WinForms/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,614 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms.Integration;
|
||||
|
||||
namespace IE_WPF_WinForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected void RaisePropertyChanged( string thePropertyName )
|
||||
{
|
||||
if ( PropertyChanged != null )
|
||||
{
|
||||
PropertyChanged( this, new PropertyChangedEventArgs( thePropertyName ) );
|
||||
}
|
||||
}
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
StatusBarText = String.Empty;
|
||||
IsHlrOffPushed = false;
|
||||
IsHlrOnPushed = true;
|
||||
IsZoomWinEnabled = true;
|
||||
|
||||
#region menu operations
|
||||
|
||||
CommandBinding aBind_New = new CommandBinding( IECommands.New );
|
||||
aBind_New.Executed += NewCommand_Executed;
|
||||
CommandBindings.Add( aBind_New );
|
||||
|
||||
CommandBinding aBind_Close = new CommandBinding( IECommands.Close );
|
||||
aBind_Close.Executed += CloseCommand_Executed;
|
||||
aBind_Close.CanExecute += CloseCommand_CanExecute;
|
||||
CommandBindings.Add( aBind_Close );
|
||||
|
||||
CommandBinding aBind_Quit = new CommandBinding( IECommands.Quit );
|
||||
aBind_Quit.Executed += QuitCommand_Executed;
|
||||
CommandBindings.Add( aBind_Quit );
|
||||
|
||||
CommandBinding aBind_About = new CommandBinding( IECommands.About );
|
||||
aBind_About.Executed += AboutCommand_Executed;
|
||||
CommandBindings.Add( aBind_About );
|
||||
|
||||
# endregion
|
||||
|
||||
PreviewKeyDown += new KeyEventHandler( OnPreviewKeyDown );
|
||||
PreviewKeyUp += new KeyEventHandler( OnPreviewKeyUp );
|
||||
}
|
||||
|
||||
private String myStatusBarText;
|
||||
public String StatusBarText
|
||||
{
|
||||
get
|
||||
{
|
||||
return myStatusBarText;
|
||||
}
|
||||
private set
|
||||
{
|
||||
myStatusBarText = value;
|
||||
RaisePropertyChanged( "StatusBarText" );
|
||||
}
|
||||
}
|
||||
|
||||
private bool isHlrOffPushed;
|
||||
public Boolean IsHlrOffPushed
|
||||
{
|
||||
get
|
||||
{
|
||||
return isHlrOffPushed;
|
||||
}
|
||||
set
|
||||
{
|
||||
isHlrOffPushed = value;
|
||||
RaisePropertyChanged("isHlrOffPushed");
|
||||
}
|
||||
}
|
||||
|
||||
private bool isHlrOnPushed;
|
||||
public Boolean IsHlrOnPushed
|
||||
{
|
||||
get
|
||||
{
|
||||
return isHlrOnPushed;
|
||||
}
|
||||
set
|
||||
{
|
||||
isHlrOnPushed = value;
|
||||
RaisePropertyChanged("IsHlrOnPushed");
|
||||
}
|
||||
}
|
||||
|
||||
private bool isZoomWinEnabled;
|
||||
public Boolean IsZoomWinEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return isZoomWinEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
isZoomWinEnabled = value;
|
||||
RaisePropertyChanged("IsZoomWinEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
private OCCViewer ActiveViewer
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( !IsDocumentOpen )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
WindowsFormsHost aHost = ( ViewPanel.SelectedContent ) as WindowsFormsHost;
|
||||
if( aHost == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return aHost.Child as OCCViewer;
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean IsDocumentOpen
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewPanel.Items.Count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
private int myDocumentCounter = 1;
|
||||
|
||||
private void NewCommand_Executed( object sender, ExecutedRoutedEventArgs e )
|
||||
{
|
||||
WindowsFormsHost aHost = new WindowsFormsHost();
|
||||
OCCViewer aForm = new OCCViewer();
|
||||
aForm.Show();
|
||||
aHost.Child = aForm;
|
||||
|
||||
TabItem aNewTab = new TabItem();
|
||||
aNewTab.Content = aHost;
|
||||
aNewTab.IsSelected = true;
|
||||
aNewTab.Header = "Document " + myDocumentCounter.ToString();
|
||||
myDocumentCounter++;
|
||||
|
||||
ViewPanel.Items.Add( aNewTab );
|
||||
|
||||
// update XAML property
|
||||
RaisePropertyChanged("IsDocumentOpen");
|
||||
}
|
||||
|
||||
private void CloseCommand_Executed(object sender, ExecutedRoutedEventArgs e)
|
||||
{
|
||||
if ( ViewPanel.Items.Count > 0 )
|
||||
{
|
||||
ViewPanel.Items.Remove( ViewPanel.SelectedItem );
|
||||
}
|
||||
|
||||
// update XAML property
|
||||
RaisePropertyChanged( "IsDocumentOpen" );
|
||||
}
|
||||
|
||||
private void CloseCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
|
||||
{
|
||||
e.CanExecute = IsDocumentOpen;
|
||||
}
|
||||
|
||||
private void QuitCommand_Executed( object sender, ExecutedRoutedEventArgs e )
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void ImportBRep_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ImportModel( ModelFormat.BREP );
|
||||
}
|
||||
}
|
||||
|
||||
private void ImportIges_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ImportModel( ModelFormat.IGES );
|
||||
}
|
||||
}
|
||||
|
||||
private void ImportStep_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ImportModel( ModelFormat.STEP );
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportBRep_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ExportModel( ModelFormat.BREP );
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportStep_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ExportModel( ModelFormat.STEP );
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportIges_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ExportModel( ModelFormat.IGES );
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportStl_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ExportModel( ModelFormat.STL );
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportVrml_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ExportModel( ModelFormat.VRML );
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportImage_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.ExportModel( ModelFormat.IMAGE );
|
||||
}
|
||||
}
|
||||
|
||||
private void FitAllBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.FitAll();
|
||||
}
|
||||
}
|
||||
|
||||
private void ZoomWindowBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
IsZoomWinEnabled = false;
|
||||
ActiveViewer.ZoomWindow();
|
||||
}
|
||||
}
|
||||
|
||||
private void DynamicZoomingBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.DynamicZooming();
|
||||
}
|
||||
}
|
||||
|
||||
private void DynamicPanningBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.DynamicPanning();
|
||||
}
|
||||
}
|
||||
|
||||
private void GlobalPanningBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.GlobalPanning();
|
||||
}
|
||||
}
|
||||
|
||||
private void FrontBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.FrontView();
|
||||
}
|
||||
}
|
||||
|
||||
private void BackBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.BackView();
|
||||
}
|
||||
}
|
||||
|
||||
private void TopBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.TopView();
|
||||
}
|
||||
}
|
||||
|
||||
private void BottomBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.BottomView();
|
||||
}
|
||||
}
|
||||
|
||||
private void LeftBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.LeftView();
|
||||
}
|
||||
}
|
||||
|
||||
private void RightBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.RightView();
|
||||
}
|
||||
}
|
||||
|
||||
private void AxoBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.AxoView();
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
private void DynamicRotationBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.DynamicRotation();
|
||||
}
|
||||
}
|
||||
|
||||
private void HiddenOffBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
IsHlrOffPushed = true;
|
||||
IsHlrOnPushed = false;
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.HiddenOff();
|
||||
}
|
||||
}
|
||||
|
||||
private void HiddenOnBtn_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
IsHlrOffPushed = false;
|
||||
IsHlrOnPushed = true;
|
||||
if (ActiveViewer != null)
|
||||
{
|
||||
ActiveViewer.HiddenOn();
|
||||
}
|
||||
}
|
||||
|
||||
private void AboutCommand_Executed( object sender, ExecutedRoutedEventArgs e )
|
||||
{
|
||||
AboutDialog aDlg = new AboutDialog();
|
||||
aDlg.ShowDialog();
|
||||
}
|
||||
|
||||
private void ToolBar_MouseEnter( object sender, MouseEventArgs e )
|
||||
{
|
||||
StatusBarText = "Toolbar";
|
||||
}
|
||||
|
||||
private void DocumentToolBar_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
StatusBarText = "Document toolbar";
|
||||
}
|
||||
|
||||
private void ViewToolBar_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
StatusBarText = "View toolbar";
|
||||
}
|
||||
|
||||
private void ToolBar_MouseLeave( object sender, MouseEventArgs e )
|
||||
{
|
||||
StatusBarText = "";
|
||||
}
|
||||
|
||||
public void OnZoomingFinished( object sender, EventArgs e )
|
||||
{
|
||||
IsZoomWinEnabled = true;
|
||||
}
|
||||
|
||||
public bool IsWireframeEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
return ActiveViewer.IsWireframeEnabled;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Wireframe_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.Wireframe();
|
||||
}
|
||||
}
|
||||
|
||||
private void Shading_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.Shading();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsShadingEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
return ActiveViewer.IsShadingEnabled;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Color_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.Color();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsColorEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
return ActiveViewer.IsColorEnabled;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Material_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.Material();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsMaterialEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
return ActiveViewer.IsMaterialEnabled;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Transparency_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.Transparency();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsTransparencyEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
return ActiveViewer.IsTransparencyEnabled;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Delete_Click( object sender, RoutedEventArgs e )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDeleteEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
return ActiveViewer.IsDeleteEnabled;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void AvaliabiltyOfOperationToolbarChanged()
|
||||
{
|
||||
RaisePropertyChanged( "IsWireframeEnabled" );
|
||||
RaisePropertyChanged( "IsShadingEnabled" );
|
||||
RaisePropertyChanged( "IsTransparencyEnabled" );
|
||||
RaisePropertyChanged( "IsColorEnabled" );
|
||||
RaisePropertyChanged( "IsMaterialEnabled" );
|
||||
RaisePropertyChanged( "IsDeleteEnabled" );
|
||||
}
|
||||
|
||||
public void OnAvaliabiltyOfOperationsChanged( object sender, EventArgs e )
|
||||
{
|
||||
AvaliabiltyOfOperationToolbarChanged();
|
||||
}
|
||||
|
||||
private void OnViewerChanged( object sender, SelectionChangedEventArgs e )
|
||||
{
|
||||
if ( e.RemovedItems.Count > 0 )
|
||||
{
|
||||
WindowsFormsHost aHost = ( ( e.RemovedItems[0] as TabItem).Content ) as WindowsFormsHost;
|
||||
if( aHost == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
OCCViewer aViewer = aHost.Child as OCCViewer;
|
||||
if( aViewer != null )
|
||||
{
|
||||
aViewer.ZoomingFinished -= new EventHandler( OnZoomingFinished );
|
||||
aViewer.AvaliabiltyOfOperationsChanged -= new EventHandler( OnAvaliabiltyOfOperationsChanged );
|
||||
}
|
||||
}
|
||||
|
||||
if ( e.AddedItems.Count > 0 )
|
||||
{
|
||||
WindowsFormsHost aHost = ( (e.AddedItems[0] as TabItem).Content ) as WindowsFormsHost;
|
||||
if ( aHost == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
OCCViewer aViewer = aHost.Child as OCCViewer;
|
||||
if ( aViewer != null )
|
||||
{
|
||||
aViewer.ZoomingFinished += new EventHandler( OnZoomingFinished );
|
||||
aViewer.AvaliabiltyOfOperationsChanged += new EventHandler( OnAvaliabiltyOfOperationsChanged );
|
||||
}
|
||||
}
|
||||
|
||||
AvaliabiltyOfOperationToolbarChanged();
|
||||
}
|
||||
|
||||
private void OnPreviewKeyDown( object sender, KeyEventArgs args )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.OnKeyDown( args.Key );
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPreviewKeyUp( object sender, KeyEventArgs args )
|
||||
{
|
||||
if ( ActiveViewer != null )
|
||||
{
|
||||
ActiveViewer.OnKeyUp();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
20
samples/CSharp/WPF_WinForms/MaterialDlg.xaml
Normal file
@@ -0,0 +1,20 @@
|
||||
<Window
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Class="IE_WPF_WinForms.MaterialDlg"
|
||||
x:Name="Window"
|
||||
Title="Material"
|
||||
Width="133" Height="181" mc:Ignorable="d">
|
||||
|
||||
<StackPanel Orientation="Vertical" d:LayoutOverrides="Height" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<RadioButton Name="PlasterBtn" Content="Plaster" Checked="PlasterBtn_Checked"/>
|
||||
<RadioButton Name="BrassBtn" Content="Brass" Checked="BrassBtn_Checked"/>
|
||||
<RadioButton Name="BronzeBtn" Content="Bronze" Checked="BronzeBtn_Checked"/>
|
||||
<RadioButton Name="CopperBtn" Content="Copper" Checked="CopperBtn_Checked"/>
|
||||
<RadioButton Name="GoldBtn" Content="Gold" Checked="GoldBtn_Checked"/>
|
||||
<RadioButton Name="PewterBtn" Content="Pewter" Checked="PewterBtn_Checked"/>
|
||||
<RadioButton Name="PlasticBtn" Content="Plastic" Checked="PlasticBtn_Checked"/>
|
||||
<RadioButton Name="SilverBtn" Content="Silver" Checked="SilverBtn_Checked"/>
|
||||
</StackPanel>
|
||||
</Window>
|
101
samples/CSharp/WPF_WinForms/MaterialDlg.xaml.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace IE_WPF_WinForms
|
||||
{
|
||||
public enum Material
|
||||
{
|
||||
Brass,
|
||||
Bronze,
|
||||
Copper,
|
||||
Gold,
|
||||
Pewter,
|
||||
Plaster,
|
||||
Plastic,
|
||||
Silver
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for MaterialDlg.xaml
|
||||
/// </summary>
|
||||
public partial class MaterialDlg : Window
|
||||
{
|
||||
public MaterialDlg( OCCTProxy theView )
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
if ( theView == null )
|
||||
{
|
||||
MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" );
|
||||
}
|
||||
|
||||
View = theView;
|
||||
|
||||
SetInitialState();
|
||||
}
|
||||
|
||||
public OCCTProxy View { get; private set; }
|
||||
|
||||
private void PlasterBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Plaster );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void BrassBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Brass );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void BronzeBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Bronze );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void CopperBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Copper );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void GoldBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Gold );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void PewterBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Pewter );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void PlasticBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Plastic );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void SilverBtn_Checked( object sender, RoutedEventArgs e )
|
||||
{
|
||||
View.SetMaterial( (int)Material.Silver );
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
private void SetInitialState()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
}
|
840
samples/CSharp/WPF_WinForms/OCCViewer.cs
Normal file
@@ -0,0 +1,840 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace IE_WPF_WinForms
|
||||
{
|
||||
public enum CurrentAction3d
|
||||
{
|
||||
CurAction3d_Nothing,
|
||||
CurAction3d_DynamicZooming,
|
||||
CurAction3d_WindowZooming,
|
||||
CurAction3d_DynamicPanning,
|
||||
CurAction3d_GlobalPanning,
|
||||
CurAction3d_DynamicRotation
|
||||
}
|
||||
public enum CurrentPressedKey
|
||||
{
|
||||
CurPressedKey_Nothing,
|
||||
CurPressedKey_Ctrl,
|
||||
CurPressedKey_Shift
|
||||
}
|
||||
public enum ModelFormat
|
||||
{
|
||||
BREP,
|
||||
CSFDB,
|
||||
STEP,
|
||||
IGES,
|
||||
VRML,
|
||||
STL,
|
||||
IMAGE
|
||||
}
|
||||
|
||||
public enum DisplayMode
|
||||
{
|
||||
Wireframe,
|
||||
Shading
|
||||
}
|
||||
|
||||
public class OCCViewer : System.Windows.Forms.Form
|
||||
{
|
||||
public event EventHandler ZoomingFinished;
|
||||
protected void RaiseZoomingFinished()
|
||||
{
|
||||
if ( ZoomingFinished != null )
|
||||
{
|
||||
ZoomingFinished( this, EventArgs.Empty );
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler AvaliabiltyOfOperationsChanged;
|
||||
protected void RaiseAvaliabiltyOfOperationsChanged()
|
||||
{
|
||||
if ( AvaliabiltyOfOperationsChanged != null )
|
||||
{
|
||||
AvaliabiltyOfOperationsChanged( this, EventArgs.Empty );
|
||||
}
|
||||
}
|
||||
|
||||
public OCCTProxy View { get; private set; }
|
||||
public CurrentAction3d CurrentMode { get; private set; }
|
||||
private CurrentPressedKey CurrentPressedKey { get; set; }
|
||||
private bool IsRectVisible { get; set; }
|
||||
public bool DegenerateMode { get; private set; }
|
||||
|
||||
public bool IsWireframeEnabled { get; private set; }
|
||||
public bool IsShadingEnabled { get; private set; }
|
||||
public bool IsTransparencyEnabled { get; private set; }
|
||||
public bool IsColorEnabled { get; private set; }
|
||||
public bool IsMaterialEnabled { get; private set; }
|
||||
public bool IsDeleteEnabled { get; private set; }
|
||||
|
||||
private float myCurZoom;// ~ Quantity_Factor
|
||||
private int myXmin;
|
||||
private int myYmin;
|
||||
private int myXmax;
|
||||
private int myYmax;
|
||||
private int myRectDownX;
|
||||
private int myRectDownY;
|
||||
private int myButtonDownX;
|
||||
private int myButtonDownY;
|
||||
|
||||
private ContextMenu Popup { get; set; }
|
||||
private MenuItem ContextWireframe;
|
||||
private MenuItem ContextShading;
|
||||
private MenuItem ContextColor;
|
||||
private MenuItem ContextMaterial;
|
||||
private MenuItem ContextDelete;
|
||||
private MenuItem ContextBackground;
|
||||
private MenuItem ContextTransparency;
|
||||
|
||||
|
||||
public OCCViewer()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
View = new OCCTProxy();
|
||||
View.InitOCCTProxy();
|
||||
if ( !View.InitViewer( this.Handle ) )
|
||||
{
|
||||
MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" );
|
||||
}
|
||||
|
||||
CurrentMode = CurrentAction3d.CurAction3d_Nothing;
|
||||
CurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing;
|
||||
IsRectVisible = false;
|
||||
DegenerateMode = true;
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
ControlBox = false;
|
||||
TopLevel = false;
|
||||
|
||||
this.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
|
||||
SizeChanged += new System.EventHandler( OnSizeChanged );
|
||||
Paint += new System.Windows.Forms.PaintEventHandler( OnPaint );
|
||||
|
||||
MouseDown += new System.Windows.Forms.MouseEventHandler( OnMouseDown );
|
||||
MouseUp += new System.Windows.Forms.MouseEventHandler( OnMouseUp );
|
||||
MouseMove += new System.Windows.Forms.MouseEventHandler( OnMouseMove );
|
||||
|
||||
Popup = new ContextMenu();
|
||||
ContextWireframe = new MenuItem();
|
||||
ContextShading = new MenuItem();
|
||||
ContextColor = new MenuItem();
|
||||
ContextMaterial = new MenuItem();
|
||||
ContextTransparency = new MenuItem();
|
||||
ContextDelete = new MenuItem();
|
||||
ContextBackground = new MenuItem();
|
||||
|
||||
ContextWireframe.Text = "Wireframe";
|
||||
ContextShading.Text = "Shading";
|
||||
ContextColor.Text = "Color";
|
||||
ContextMaterial.Text = "Material";
|
||||
ContextTransparency.Text = "Transparency";
|
||||
ContextDelete.Text = "Delete";
|
||||
ContextBackground.Text = "Background";
|
||||
|
||||
ContextWireframe.Click += new System.EventHandler( ContextWireframe_Click );
|
||||
ContextShading.Click += new System.EventHandler( ContextShading_Click );
|
||||
ContextColor.Click += new System.EventHandler( ContextColor_Click );
|
||||
ContextMaterial.Click += new System.EventHandler( ContextMaterial_Click );
|
||||
ContextTransparency.Click += new System.EventHandler( ContextTransparency_Click );
|
||||
ContextDelete.Click += new System.EventHandler( ContextDelete_Click );
|
||||
ContextBackground.Click += new System.EventHandler( ContextBackground_Click );
|
||||
|
||||
Popup.MenuItems.AddRange( new MenuItem[] { ContextWireframe,
|
||||
ContextShading,
|
||||
ContextColor,
|
||||
ContextMaterial,
|
||||
ContextTransparency,
|
||||
ContextDelete,
|
||||
ContextBackground } );
|
||||
Popup.Popup += new System.EventHandler( OnPopup );
|
||||
}
|
||||
|
||||
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)
|
||||
{
|
||||
View.RedrawView();
|
||||
View.UpdateView();
|
||||
}
|
||||
|
||||
private void OnSizeChanged(object sender, System.EventArgs e)
|
||||
{
|
||||
View.UpdateView();
|
||||
}
|
||||
|
||||
public void ImportModel( ModelFormat theFormat )
|
||||
{
|
||||
int aFormat = 10;
|
||||
OpenFileDialog anOpenDialog = new OpenFileDialog();
|
||||
string aDataDir = ( (Environment.GetEnvironmentVariable("CASROOT")) + "\\..\\data" );
|
||||
string aFilter = "";
|
||||
|
||||
switch ( theFormat )
|
||||
{
|
||||
case ModelFormat.BREP:
|
||||
anOpenDialog.InitialDirectory = (aDataDir + "\\occ");
|
||||
aFormat = 0;
|
||||
aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle";
|
||||
break;
|
||||
case ModelFormat.CSFDB:
|
||||
aFormat = 1;
|
||||
aFilter = "CSFDB Files (*.csfdb)|*.csfdb";
|
||||
break;
|
||||
case ModelFormat.STEP:
|
||||
anOpenDialog.InitialDirectory = (aDataDir + "\\step");
|
||||
aFormat = 2;
|
||||
aFilter = "STEP Files (*.stp *.step)|*.stp; *.step";
|
||||
break;
|
||||
case ModelFormat.IGES:
|
||||
anOpenDialog.InitialDirectory = (aDataDir + "\\iges");
|
||||
aFormat = 3;
|
||||
aFilter = "IGES Files (*.igs *.iges)|*.igs; *.iges";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
anOpenDialog.Filter = aFilter + "|All files (*.*)|*.*";
|
||||
if (anOpenDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string aFileName = anOpenDialog.FileName;
|
||||
if (aFileName == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Cursor = System.Windows.Forms.Cursors.WaitCursor;
|
||||
if ( !View.TranslateModel( aFileName, aFormat, true ) )
|
||||
{
|
||||
MessageBox.Show( "Cann't read this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning );
|
||||
}
|
||||
Cursor = System.Windows.Forms.Cursors.Default;
|
||||
}
|
||||
View.ZoomAllView();
|
||||
}
|
||||
|
||||
public void ExportModel( ModelFormat theFormat )
|
||||
{
|
||||
int aFormat = 10;
|
||||
SaveFileDialog saveDialog = new SaveFileDialog();
|
||||
string aDataDir = ( (Environment.GetEnvironmentVariable("CASROOT") ) + "\\..\\data" );
|
||||
string aFilter = "";
|
||||
|
||||
switch ( theFormat )
|
||||
{
|
||||
case ModelFormat.BREP:
|
||||
saveDialog.InitialDirectory = ( aDataDir + "\\occ" );
|
||||
aFormat = 0;
|
||||
aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle";
|
||||
break;
|
||||
case ModelFormat.CSFDB:
|
||||
aFormat = 1;
|
||||
aFilter = "CSFDB Files (*.csfdb)|*.csfdb";
|
||||
break;
|
||||
case ModelFormat.STEP:
|
||||
saveDialog.InitialDirectory = ( aDataDir + "\\step" );
|
||||
aFormat = 2;
|
||||
aFilter = "STEP Files (*.stp *.step)|*.step; *.stp";
|
||||
break;
|
||||
case ModelFormat.IGES:
|
||||
saveDialog.InitialDirectory = ( aDataDir + "\\iges" );
|
||||
aFormat = 3;
|
||||
aFilter = "IGES Files (*.igs *.iges)| *.iges; *.igs";
|
||||
break;
|
||||
case ModelFormat.VRML:
|
||||
saveDialog.InitialDirectory = ( aDataDir + "\\vrml" );
|
||||
aFormat = 4;
|
||||
aFilter = "VRML Files (*.vrml)|*.vrml";
|
||||
break;
|
||||
case ModelFormat.STL:
|
||||
saveDialog.InitialDirectory = ( aDataDir + "\\stl" );
|
||||
aFormat = 5;
|
||||
aFilter = "STL Files (*.stl)|*.stl";
|
||||
break;
|
||||
case ModelFormat.IMAGE:
|
||||
saveDialog.InitialDirectory = ( aDataDir + "\\images" );
|
||||
aFormat = 6;
|
||||
aFilter = "Images Files (*.bmp)|*.bmp";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
saveDialog.Filter = aFilter;
|
||||
if ( saveDialog.ShowDialog() == DialogResult.OK )
|
||||
{
|
||||
string aFileName = saveDialog.FileName;
|
||||
if ( aFileName == "" )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Cursor = System.Windows.Forms.Cursors.WaitCursor;
|
||||
if ( !View.TranslateModel( aFileName, aFormat, false ) )
|
||||
{
|
||||
MessageBox.Show( "Can not write this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning );
|
||||
}
|
||||
Cursor = System.Windows.Forms.Cursors.Default;
|
||||
}
|
||||
}
|
||||
|
||||
public void FitAll()
|
||||
{
|
||||
View.ZoomAllView();
|
||||
}
|
||||
|
||||
public void ZoomWindow()
|
||||
{
|
||||
CurrentMode = CurrentAction3d.CurAction3d_WindowZooming;
|
||||
}
|
||||
|
||||
public void DynamicZooming()
|
||||
{
|
||||
CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming;
|
||||
}
|
||||
|
||||
public void DynamicPanning()
|
||||
{
|
||||
CurrentMode = CurrentAction3d.CurAction3d_DynamicPanning;
|
||||
}
|
||||
|
||||
public void GlobalPanning()
|
||||
{
|
||||
myCurZoom = View.Scale();
|
||||
CurrentMode = CurrentAction3d.CurAction3d_GlobalPanning;
|
||||
}
|
||||
|
||||
public void AxoView()
|
||||
{
|
||||
View.AxoView();
|
||||
}
|
||||
|
||||
public void FrontView()
|
||||
{
|
||||
View.FrontView();
|
||||
}
|
||||
|
||||
public void TopView()
|
||||
{
|
||||
View.TopView();
|
||||
}
|
||||
|
||||
public void LeftView()
|
||||
{
|
||||
View.LeftView();
|
||||
}
|
||||
|
||||
public void BackView()
|
||||
{
|
||||
View.BackView();
|
||||
}
|
||||
|
||||
public void RightView()
|
||||
{
|
||||
View.RightView();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
View.Reset();
|
||||
}
|
||||
|
||||
public void BottomView()
|
||||
{
|
||||
View.BottomView();
|
||||
}
|
||||
|
||||
public void HiddenOff()
|
||||
{
|
||||
View.SetDegenerateModeOff();
|
||||
DegenerateMode = false;
|
||||
}
|
||||
|
||||
public void HiddenOn()
|
||||
{
|
||||
View.SetDegenerateModeOn();
|
||||
DegenerateMode = true;
|
||||
}
|
||||
|
||||
public void DynamicRotation()
|
||||
{
|
||||
CurrentMode = CurrentAction3d.CurAction3d_DynamicRotation;
|
||||
}
|
||||
|
||||
public void SelectionChanged()
|
||||
{
|
||||
switch ( View.DisplayMode() )
|
||||
{
|
||||
case -1:
|
||||
IsShadingEnabled = false;
|
||||
IsWireframeEnabled = false;
|
||||
break;
|
||||
case 0:
|
||||
IsWireframeEnabled = false;
|
||||
IsShadingEnabled = true;
|
||||
IsTransparencyEnabled = false;
|
||||
break;
|
||||
case 1:
|
||||
IsWireframeEnabled = true;
|
||||
IsShadingEnabled = false;
|
||||
IsTransparencyEnabled = true;
|
||||
break;
|
||||
case 10:
|
||||
IsWireframeEnabled = true;
|
||||
IsShadingEnabled = true;
|
||||
IsTransparencyEnabled = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ( View.IsObjectSelected() )
|
||||
{
|
||||
IsColorEnabled = true;
|
||||
IsMaterialEnabled = true;
|
||||
IsDeleteEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsColorEnabled = false;
|
||||
IsMaterialEnabled = false;
|
||||
IsTransparencyEnabled = false;
|
||||
IsDeleteEnabled = false;
|
||||
}
|
||||
|
||||
RaiseAvaliabiltyOfOperationsChanged();
|
||||
}
|
||||
|
||||
public void ChangeColor( bool IsObjectColor )
|
||||
{
|
||||
int r, g, b;
|
||||
if ( IsObjectColor )
|
||||
{
|
||||
r = View.GetObjColR();
|
||||
g = View.GetObjColG();
|
||||
b = View.GetObjColB();
|
||||
}
|
||||
else
|
||||
{
|
||||
r = View.GetBGColR();
|
||||
g = View.GetBGColG();
|
||||
b = View.GetBGColB();
|
||||
}
|
||||
System.Windows.Forms.ColorDialog ColDlg = new System.Windows.Forms.ColorDialog();
|
||||
ColDlg.Color = System.Drawing.Color.FromArgb( r, g, b );
|
||||
if ( ColDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK )
|
||||
{
|
||||
System.Drawing.Color c = ColDlg.Color;
|
||||
r = c.R;
|
||||
g = c.G;
|
||||
b = c.B;
|
||||
if ( IsObjectColor )
|
||||
{
|
||||
View.SetColor( r, g, b );
|
||||
}
|
||||
else
|
||||
{
|
||||
View.SetBackgroundColor( r, g, b );
|
||||
}
|
||||
}
|
||||
View.UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
public void Wireframe()
|
||||
{
|
||||
View.SetDisplayMode( (int)DisplayMode.Wireframe );
|
||||
View.UpdateCurrentViewer();
|
||||
|
||||
SelectionChanged();
|
||||
RaiseZoomingFinished();
|
||||
}
|
||||
|
||||
public void Shading()
|
||||
{
|
||||
View.SetDisplayMode( (int)DisplayMode.Shading );
|
||||
View.UpdateCurrentViewer();
|
||||
|
||||
SelectionChanged();
|
||||
RaiseZoomingFinished();
|
||||
}
|
||||
|
||||
public void Color()
|
||||
{
|
||||
ChangeColor( true );
|
||||
}
|
||||
|
||||
public void Background()
|
||||
{
|
||||
ChangeColor( false );
|
||||
}
|
||||
|
||||
public void Material()
|
||||
{
|
||||
MaterialDlg aDlg = new MaterialDlg( View );
|
||||
aDlg.ShowDialog();
|
||||
}
|
||||
|
||||
public void Transparency()
|
||||
{
|
||||
TransparencyDialog dlg = new TransparencyDialog();
|
||||
dlg.View = View;
|
||||
dlg.ShowDialog( this );
|
||||
}
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
View.EraseObjects();
|
||||
}
|
||||
|
||||
public void OnKeyDown( System.Windows.Input.Key theKey )
|
||||
{
|
||||
if ( theKey == System.Windows.Input.Key.LeftShift ||
|
||||
theKey == System.Windows.Input.Key.RightShift )
|
||||
{
|
||||
CurrentPressedKey = CurrentPressedKey.CurPressedKey_Shift;
|
||||
}
|
||||
else if (theKey == System.Windows.Input.Key.LeftCtrl ||
|
||||
theKey == System.Windows.Input.Key.RightCtrl )
|
||||
{
|
||||
CurrentPressedKey = CurrentPressedKey.CurPressedKey_Ctrl;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnKeyUp()
|
||||
{
|
||||
CurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing;
|
||||
}
|
||||
|
||||
protected void MultiDragEvent( int x, int y, int theState )
|
||||
{
|
||||
if ( theState == -1 ) //mouse is down
|
||||
{
|
||||
myButtonDownX = x;
|
||||
myButtonDownY = y;
|
||||
}
|
||||
else if ( theState == 1) //mouse is up
|
||||
{
|
||||
View.ShiftSelect( Math.Min( myButtonDownX, x ), Math.Min( myButtonDownY, y ),
|
||||
Math.Max( myButtonDownX, x ), Math.Max( myButtonDownY, y ) );
|
||||
}
|
||||
}
|
||||
|
||||
protected void DragEvent( int x, int y, int theState )
|
||||
{
|
||||
if ( theState == -1 ) //mouse is down
|
||||
{
|
||||
myButtonDownX = x;
|
||||
myButtonDownY = y;
|
||||
}
|
||||
else if ( theState == 1 ) //mouse is up
|
||||
{
|
||||
View.Select( Math.Min( myButtonDownX, x ), Math.Min( myButtonDownY, y ),
|
||||
Math.Max( myButtonDownX, x ), Math.Max( myButtonDownY, y ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawRectangle( bool draw )
|
||||
{
|
||||
System.Drawing.Graphics gr = System.Drawing.Graphics.FromHwnd(Handle);
|
||||
System.Drawing.Pen p = null;
|
||||
if ( IsRectVisible || !draw )//erase the rect
|
||||
{
|
||||
int r = View.GetBGColR();
|
||||
int g = View.GetBGColG();
|
||||
int b = View.GetBGColB();
|
||||
p = new System.Drawing.Pen( System.Drawing.Color.FromArgb(r, g, b) );
|
||||
IsRectVisible = false;
|
||||
View.UpdateView();
|
||||
}
|
||||
else if ( draw )
|
||||
{
|
||||
p = new System.Drawing.Pen( System.Drawing.Color.White );
|
||||
IsRectVisible = true;
|
||||
}
|
||||
if ( p == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
int x = Math.Min( myXmin, myXmax );
|
||||
int y = Math.Min( myYmin, myYmax );
|
||||
gr.DrawRectangle( p, x, y, Math.Abs(myXmax - myXmin), Math.Abs(myYmax - myYmin) );
|
||||
myRectDownX = Math.Max( myXmin, myXmax );
|
||||
myRectDownY = Math.Max( myYmin, myYmax );
|
||||
}
|
||||
|
||||
private void OnMouseDown( object sender, System.Windows.Forms.MouseEventArgs e )
|
||||
{
|
||||
if ( e.Button == MouseButtons.Left )
|
||||
{
|
||||
myXmin = e.X;
|
||||
myXmax = e.X;
|
||||
myYmin = e.Y;
|
||||
myYmax = e.Y;
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
|
||||
{
|
||||
// start the dinamic zooming....
|
||||
CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ( CurrentMode )
|
||||
{
|
||||
case CurrentAction3d.CurAction3d_Nothing:
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift )
|
||||
{
|
||||
MultiDragEvent( myXmax, myYmax, -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
DragEvent( myXmax, myYmax, -1 );
|
||||
}
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_DynamicRotation:
|
||||
if ( !DegenerateMode )
|
||||
{
|
||||
View.SetDegenerateModeOn();
|
||||
}
|
||||
View.StartRotation( e.X, e.Y );
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_WindowZooming:
|
||||
Cursor = Cursors.Hand;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( e.Button == MouseButtons.Right )
|
||||
{
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
|
||||
{
|
||||
if ( !DegenerateMode )
|
||||
{
|
||||
View.SetDegenerateModeOn();
|
||||
}
|
||||
View.StartRotation( e.X, e.Y );
|
||||
}
|
||||
else
|
||||
{
|
||||
Popup.Show( this, new System.Drawing.Point( e.X, e.Y ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMouseUp( object sender, System.Windows.Forms.MouseEventArgs e )
|
||||
{
|
||||
if ( e.Button == MouseButtons.Left )
|
||||
{
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch ( CurrentMode )
|
||||
{
|
||||
case CurrentAction3d.CurAction3d_Nothing:
|
||||
if ( e.X == myXmin && e.Y == myYmin )
|
||||
{
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift )
|
||||
{
|
||||
View.ShiftSelect();
|
||||
}
|
||||
else
|
||||
{
|
||||
View.Select();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
DrawRectangle( false );
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift )
|
||||
{
|
||||
MultiDragEvent( myXmax, myYmax, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
DragEvent( myXmax, myYmax, 1 );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_DynamicZooming:
|
||||
CurrentMode = CurrentAction3d.CurAction3d_Nothing;
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_WindowZooming:
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
DrawRectangle( false );
|
||||
int ValZWMin = 1;
|
||||
if ( Math.Abs(myXmax - myXmin) > ValZWMin &&
|
||||
Math.Abs(myXmax - myYmax) > ValZWMin )
|
||||
{
|
||||
View.WindowFitAll( myXmin, myYmin, myXmax, myYmax );
|
||||
}
|
||||
Cursor = Cursors.Arrow;
|
||||
RaiseZoomingFinished();
|
||||
CurrentMode = CurrentAction3d.CurAction3d_Nothing;
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_DynamicPanning:
|
||||
CurrentMode = CurrentAction3d.CurAction3d_Nothing;
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_GlobalPanning:
|
||||
View.Place( e.X, e.Y, myCurZoom );
|
||||
CurrentMode = CurrentAction3d.CurAction3d_Nothing;
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_DynamicRotation:
|
||||
CurrentMode = CurrentAction3d.CurAction3d_Nothing;
|
||||
if ( !DegenerateMode )
|
||||
{
|
||||
View.SetDegenerateModeOff();
|
||||
}
|
||||
else
|
||||
{
|
||||
View.SetDegenerateModeOn();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ( e.Button == MouseButtons.Right )
|
||||
{
|
||||
if ( !DegenerateMode )
|
||||
{
|
||||
View.SetDegenerateModeOff();
|
||||
}
|
||||
else
|
||||
{
|
||||
View.SetDegenerateModeOn();
|
||||
}
|
||||
}
|
||||
|
||||
SelectionChanged();
|
||||
}
|
||||
|
||||
private void OnMouseMove( object sender, System.Windows.Forms.MouseEventArgs e )
|
||||
{
|
||||
if ( e.Button == MouseButtons.Left ) //left button is pressed
|
||||
{
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
|
||||
{
|
||||
View.Zoom(myXmax, myYmax, e.X, e.Y);
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ( CurrentMode )
|
||||
{
|
||||
case CurrentAction3d.CurAction3d_Nothing:
|
||||
DrawRectangle( false );
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
DrawRectangle( true );
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_DynamicZooming:
|
||||
View.Zoom( myXmax, myYmax, e.X, e.Y );
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_WindowZooming:
|
||||
DrawRectangle( false );
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
DrawRectangle( true );//add brush here
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_DynamicPanning:
|
||||
View.Pan( e.X - myXmax, myYmax - e.Y );
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_GlobalPanning:
|
||||
break;
|
||||
case CurrentAction3d.CurAction3d_DynamicRotation:
|
||||
View.Rotation( e.X, e.Y );
|
||||
View.RedrawView();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( e.Button == MouseButtons.Middle ) //middle button is pressed
|
||||
{
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
|
||||
{
|
||||
View.Pan( e.X - myXmax, myYmax - e.Y );
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
}
|
||||
}
|
||||
else if ( e.Button == MouseButtons.Right ) //right button is pressed
|
||||
{
|
||||
if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl)
|
||||
{
|
||||
View.Rotation( e.X, e.Y );
|
||||
}
|
||||
}
|
||||
else // no buttons are pressed
|
||||
{
|
||||
myXmax = e.X;
|
||||
myYmax = e.Y;
|
||||
View.MoveTo( e.X, e.Y );
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPopup( object sender, System.EventArgs e )
|
||||
{
|
||||
ContextWireframe.Enabled = IsWireframeEnabled;
|
||||
ContextShading.Enabled = IsShadingEnabled;
|
||||
ContextColor.Enabled = IsColorEnabled;
|
||||
ContextMaterial.Enabled = IsMaterialEnabled;
|
||||
ContextDelete.Enabled = IsDeleteEnabled;
|
||||
ContextTransparency.Enabled = IsTransparencyEnabled;
|
||||
ContextBackground.Enabled = true;
|
||||
}
|
||||
|
||||
private void ContextWireframe_Click( object sender, System.EventArgs e )
|
||||
{
|
||||
Wireframe();
|
||||
}
|
||||
|
||||
private void ContextShading_Click( object sender, System.EventArgs e )
|
||||
{
|
||||
Shading();
|
||||
}
|
||||
|
||||
private void ContextColor_Click( object sender, System.EventArgs e )
|
||||
{
|
||||
Color();
|
||||
}
|
||||
|
||||
private void ContextMaterial_Click( object sender, System.EventArgs e )
|
||||
{
|
||||
Material();
|
||||
}
|
||||
|
||||
private void ContextTransparency_Click( object sender, System.EventArgs e )
|
||||
{
|
||||
Transparency();
|
||||
}
|
||||
|
||||
private void ContextDelete_Click( object sender, System.EventArgs e )
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
|
||||
private void ContextBackground_Click( object sender, System.EventArgs e )
|
||||
{
|
||||
Background();
|
||||
}
|
||||
}
|
||||
}
|
55
samples/CSharp/WPF_WinForms/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
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("IE")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("IE")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[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
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> 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")]
|
63
samples/CSharp/WPF_WinForms/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace IE_WPF_WinForms.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// 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() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[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("IE_WPF_WinForms.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
samples/CSharp/WPF_WinForms/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
26
samples/CSharp/WPF_WinForms/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace IE_WPF_WinForms.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
samples/CSharp/WPF_WinForms/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
1134
samples/CSharp/WPF_WinForms/Simple Styles.xaml
Normal file
108
samples/CSharp/WPF_WinForms/TransparencyDialog.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace IE_WPF_WinForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for TransparencyDialog.
|
||||
/// </summary>
|
||||
public class TransparencyDialog : System.Windows.Forms.Form
|
||||
{
|
||||
private System.Windows.Forms.NumericUpDown MyTransparency;
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
private OCCTProxy myView;
|
||||
|
||||
public TransparencyDialog()
|
||||
{
|
||||
//
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add any constructor code after InitializeComponent call
|
||||
//
|
||||
myView = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (components != null)
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog));
|
||||
this.MyTransparency = new System.Windows.Forms.NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// MyTransparency
|
||||
//
|
||||
this.MyTransparency.Location = new System.Drawing.Point(16, 16);
|
||||
this.MyTransparency.Maximum = new System.Decimal(new int[] {
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MyTransparency.Name = "MyTransparency";
|
||||
this.MyTransparency.Size = new System.Drawing.Size(96, 20);
|
||||
this.MyTransparency.TabIndex = 0;
|
||||
this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged);
|
||||
//
|
||||
// TransparencyDialog
|
||||
//
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
||||
this.ClientSize = new System.Drawing.Size(128, 53);
|
||||
this.Controls.Add(this.MyTransparency);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TransparencyDialog";
|
||||
this.Text = "TransparencyDialog";
|
||||
((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void MyTransparency_ValueChanged(object sender, System.EventArgs e)
|
||||
{
|
||||
if (this.myView == null)
|
||||
return;
|
||||
int transp = (int)this.MyTransparency.Value;
|
||||
this.myView.SetTransparency(transp);
|
||||
}
|
||||
|
||||
public OCCTProxy View
|
||||
{
|
||||
set
|
||||
{
|
||||
this.myView = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
206
samples/CSharp/WPF_WinForms/TransparencyDialog.resx
Normal file
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used forserialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="MyTransparency.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="MyTransparency.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="MyTransparency.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>(Default)</value>
|
||||
</data>
|
||||
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>8, 8</value>
|
||||
</data>
|
||||
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>80</value>
|
||||
</data>
|
||||
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>Private</value>
|
||||
</data>
|
||||
<data name="$this.Name">
|
||||
<value>TransparencyDialog</value>
|
||||
</data>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW
|
||||
FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA
|
||||
MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm
|
||||
/wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/
|
||||
zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm
|
||||
ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM
|
||||
/wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz
|
||||
mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM
|
||||
MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz
|
||||
MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnM
|
||||
AACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/mQCZ/8wAmf//AMwAAACZADMAzABmAMwA
|
||||
mQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxmMwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZ
|
||||
MwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzMzADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/
|
||||
zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8zzAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9m
|
||||
zADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/MMwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/
|
||||
ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEApQBfX18Ad3d3AIaGhgCWlpYAy8vLALKy
|
||||
sgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
|
||||
AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMT
|
||||
ExMTExMTEyIiQiI8HTyCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwDODg4Nzc4MQMdAAAA
|
||||
AADDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOw4ODgyOCQAAAAdAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODIyMSIAHewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAA7DI3MSIdCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAADEyMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs4JAALAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwxJAAhAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4IgC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAJAxJB0LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
ALwLCx0dIh0dCwATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACx0dAB0dIiIiIiId
|
||||
CxMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAsdAB0dIiQkAyQkIiIiHSIAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIgMxMVhZmZqZAyQiHR0AAAAAkAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAvAsdISIDMThZWVmgvaCZWVIkIh0AAB0dIh0hCwALCwALtgAAAAAAAAAAAAAAAOwAAB0iMTEx
|
||||
ODhYWZrDw8Ofn1hSJCIAHQAdACIAHSIkAwsdOAAAAADeExMTCwsLIiIkMTEyODg3MllZmprDw8PDwllS
|
||||
MSQdHQAAAB0AIiQkAAAAvDi8AAAxAzExMTExMTI4Nzg4ODc4ODhZXpnDw8PDml1YNwMkIh0AAB0hIiQA
|
||||
AAAAACIAAAA4ODc4Nzg4ODg4ODg4ODg4ODhZWV6avb2gmllZODcxJCIAAAAdIgMLAAAAACIAAACGE0+G
|
||||
T4bs7Oy8vLy8vAAxODg4ODg4NzIyMSQdHQAAvADsCwAiJDExAAAAwjjsAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAALMSQAAAAAAAAAAAAAAAAAEyI4MQsiOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMSQAAAAA
|
||||
AAAAAAAAAAAAAAC8CwsAEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8AAsAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA////////
|
||||
AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP//
|
||||
/////wAA//8AAH//AAD//wAAf/8AAP//4AP//wAA///4B///AAD///gP//8AAP///B///wAA///8H///
|
||||
AAD///wf//8AAP///h///wAA///8H///AAD//+AD//8AAP//wAD//wAA//4AAD//AAD//AAAB/8AAP/w
|
||||
AAAAAwAA/8AAAAABAADAAAAAADgAAMAAAAAAPAAAwAAAAAA8AADAAAAAIDgAAP///j/+AQAA///+P/+D
|
||||
AAD///4///8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP//
|
||||
/////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
3
samples/CSharp/WPF_WinForms/app.config
Normal file
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
BIN
samples/CSharp/WPF_WinForms/res/MainFrame.ico
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
samples/CSharp/WPF_WinForms/res/document.png
Normal file
After Width: | Height: | Size: 241 B |
BIN
samples/CSharp/WPF_WinForms/res/help.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
samples/CSharp/WPF_WinForms/res/lamp.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
samples/CSharp/WPF_WinForms/res/new.png
Normal file
After Width: | Height: | Size: 177 B |
BIN
samples/CSharp/WPF_WinForms/res/occ_logo.bmp
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
samples/CSharp/WPF_WinForms/res/tool_color.png
Normal file
After Width: | Height: | Size: 283 B |
BIN
samples/CSharp/WPF_WinForms/res/tool_delete.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
samples/CSharp/WPF_WinForms/res/tool_material.png
Normal file
After Width: | Height: | Size: 283 B |
BIN
samples/CSharp/WPF_WinForms/res/tool_shading.png
Normal file
After Width: | Height: | Size: 256 B |
BIN
samples/CSharp/WPF_WinForms/res/tool_transparency.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
samples/CSharp/WPF_WinForms/res/tool_wireframe.png
Normal file
After Width: | Height: | Size: 186 B |
BIN
samples/CSharp/WPF_WinForms/res/view_axo.png
Normal file
After Width: | Height: | Size: 262 B |
BIN
samples/CSharp/WPF_WinForms/res/view_back.png
Normal file
After Width: | Height: | Size: 233 B |
BIN
samples/CSharp/WPF_WinForms/res/view_bottom.png
Normal file
After Width: | Height: | Size: 233 B |
BIN
samples/CSharp/WPF_WinForms/res/view_comp_off.png
Normal file
After Width: | Height: | Size: 199 B |
BIN
samples/CSharp/WPF_WinForms/res/view_comp_on.png
Normal file
After Width: | Height: | Size: 180 B |
BIN
samples/CSharp/WPF_WinForms/res/view_fitall.png
Normal file
After Width: | Height: | Size: 231 B |
BIN
samples/CSharp/WPF_WinForms/res/view_fitarea.png
Normal file
After Width: | Height: | Size: 224 B |
BIN
samples/CSharp/WPF_WinForms/res/view_front.png
Normal file
After Width: | Height: | Size: 238 B |
BIN
samples/CSharp/WPF_WinForms/res/view_glpan.png
Normal file
After Width: | Height: | Size: 205 B |
BIN
samples/CSharp/WPF_WinForms/res/view_left.png
Normal file
After Width: | Height: | Size: 231 B |
BIN
samples/CSharp/WPF_WinForms/res/view_pan.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
samples/CSharp/WPF_WinForms/res/view_reset.png
Normal file
After Width: | Height: | Size: 204 B |
BIN
samples/CSharp/WPF_WinForms/res/view_right.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
samples/CSharp/WPF_WinForms/res/view_rotate.png
Normal file
After Width: | Height: | Size: 224 B |
BIN
samples/CSharp/WPF_WinForms/res/view_top.png
Normal file
After Width: | Height: | Size: 235 B |
BIN
samples/CSharp/WPF_WinForms/res/view_zoom.png
Normal file
After Width: | Height: | Size: 222 B |