资源简介
C# 实现的3D 打印实例,比较适合初学这学习。操作简明。
代码片段和文件信息
//---------------------------------------------------------------------------
//
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Limited Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/limitedpermissivelicense.mspx
// All other rights reserved.
//
// This file is part of the 3D Tools for Windows Presentation Foundation
// project. For more information see:
//
// http://CodePlex.com/Wiki/View.aspx?ProjectName=3DTools
//
//---------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Shapes;
using System.Windows.Input;
using System.Windows.Markup; // IAddChild ContentPropertyAttribute
namespace _3DTools
{
///
/// Class causes a Viewport3D to become interactive. To cause the interactivity
/// a hidden visual corresponding to the Visual being interacted with is placed
/// on the PostViewportChildren layer and is then interacted with giving the illusion
/// of interacting with the 3D object.
///
public class Interactive3DDecorator : Viewport3DDecorator
{
///
/// Constructs the InteractiveViewport3D
///
public Interactive3DDecorator() : base()
{
// keep everything within our bounds so that the hidden visuals are only
// accessable over the Viewport3D
ClipToBounds = true;
// the offset of the hidden visual and the transform associated with it
_offsetX = _offsetY = 0.0;
_scale = 1;
// set up the hidden visual transforms
_hiddenVisTranslate = new TranslateTransform(_offsetX _offsetY);
_hiddenVisScale = new ScaleTransform(_scale _scale);
_hiddenVisTransform = new TransformGroup();
_hiddenVisTransform.Children.Add(_hiddenVisScale);
_hiddenVisTransform.Children.Add(_hiddenVisTranslate);
// the layer that contains our moving visual
_hiddenVisual = new Decorator();
_hiddenVisual.Opacity = 0.0;
_hiddenVisual.RenderTransform = _hiddenVisTransform;
// where we store the previous hidden visual so that it can be in the tree
// after it is removed so any state (i.e. mouse over) can be updated.
_oldHiddenVisual = new Decorator();
_oldHiddenVisual.Opacity = 0.0;
// the keyboard focus visual
_oldKeyboardFocusVisual = new Decorator();
_oldKeyboardFocusVisual.Opacity
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-11-10 15:36 3DTools\
文件 6331 2010-02-24 02:20 3DTools\3DTools.csproj
文件 557 2010-02-24 02:20 3DTools\3DTools.csproj.user
文件 39457 2006-12-13 15:24 3DTools\Interactive3DDecorator.cs
文件 53227 2007-02-20 18:16 3DTools\InteractiveVisual3D.cs
文件 16349 2006-12-12 15:45 3DTools\MathUtils.cs
文件 3224 2006-12-12 15:45 3DTools\Matrix3DStack.cs
文件 13335 2006-12-12 15:45 3DTools\MeshUtils.cs
目录 0 2014-11-10 15:36 3DTools\Properties\
文件 2101 2006-12-12 15:23 3DTools\Properties\AssemblyInfo.cs
文件 2840 2010-02-24 02:20 3DTools\Properties\Resources.Designer.cs
文件 5618 2006-12-12 15:23 3DTools\Properties\Resources.resx
文件 1087 2010-02-24 02:20 3DTools\Properties\Settings.Designer.cs
文件 203 2006-12-12 15:23 3DTools\Properties\Settings.settings
文件 11349 2006-12-13 15:30 3DTools\README.txt
文件 12730 2006-12-12 15:45 3DTools\ScreenSpaceLines3D.cs
文件 7535 2006-12-12 16:11 3DTools\Trackball.cs
文件 7211 2006-12-13 15:12 3DTools\TrackballDecorator.cs
文件 2163 2006-12-12 15:47 3DTools\Trackport3D.xaml
文件 3855 2006-12-12 15:47 3DTools\Trackport3D.xaml.cs
文件 715 2006-12-12 15:48 3DTools\ViewMode.cs
文件 16542 2006-12-12 15:48 3DTools\Viewport3DDecorator.cs
目录 0 2014-11-10 14:42 3DTools\bin\
目录 0 2014-11-10 15:36 3DTools\bin\Debug\
文件 68096 2014-11-10 15:37 3DTools\bin\Debug\3DTools.dll
文件 163328 2014-11-10 15:37 3DTools\bin\Debug\3DTools.pdb
目录 0 2014-11-10 14:42 3DTools\obj\
目录 0 2014-11-10 15:37 3DTools\obj\Debug\
文件 2594 2014-11-10 15:37 3DTools\obj\Debug\3DTools.csproj.FileListAbsolute.txt
文件 789 2014-11-10 15:37 3DTools\obj\Debug\3DTools.csproj.GenerateResource.Cache
文件 68096 2014-11-10 15:37 3DTools\obj\Debug\3DTools.dll
............此处省略130个文件信息
评论
共有 条评论