• 大小: 2.57MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-16
  • 语言: 其他
  • 标签: CadLib4.0  

资源简介

CadLib4.0解密及示例

资源截图

代码片段和文件信息

#region (C) Wout Ware 2005-2007
//
// File: DxfViewExample.cs
//
// (c) 2005-2007 Wout Ware All Rights Reserved.
//
#endregion

using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

using WW.Cad.base;
using WW.Cad.Drawing;
using WW.Cad.Drawing.GDI;
using WW.Cad.IO;
using WW.Cad.Model;
using WW.Math;
using Color = System.Drawing.Color;
using System.Collections.Generic;
using WW.Cad.Model.Entities;
using WW.Actions;
using WW.Cad.Model.Tables;
using WW.Cad.Model.objects;


namespace DxfViewExample {
    /// 
    /// A basic DXF viewer example.
    /// 

    public partial class DxfView : Form {
        private DxfModel model;
        private GDIGraphics3D gdiGraphics3D;
        private Bounds3D bounds;
        private Matrix4D modelTransform = Matrix4D.Identity;
        private double scaleFactor = 1d;
        private Matrix4D from2DTransform;
        private Vector3D translation = Vector3D.Zero;
        private bool mouseDown;
        private bool shiftPressed;
        private Point lastMouseLocation;
        private Point mouseClickLocation;
        public event EventHandler EntitySelected;
        
        public DxfView() {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //

            gdiGraphics3D = new GDIGraphics3D(GraphicsConfig.BlackBackgroundCorrectForBackColor);
            InitializeComponent();
        }
        
        private void CalculateTo2DTransform() {
            if (bounds != null) {
                Matrix4D to2DTransform = DxfUtil.GetScaleTransform(
                    bounds.Corner1
                    bounds.Corner2
                    bounds.Center
                    new Point3D(0d ClientSize.Height 0d)
                    new Point3D(ClientSize.Width 0d 0d)
                    new Point3D(ClientSize.Width / 2 ClientSize.Height / 2 0d)
                );
                gdiGraphics3D.To2DTransform = to2DTransform * modelTransform;
            }
        }
        
        protected override void onresize(EventArgs e) {
            base.onresize(e);
            CalculateTo2DTransform1();
            Invalidate();
        }
        
        protected override void OnPaint(PaintEventArgs e) {
            //if (this.toolStripButton4.Text == “高清显示“)
            //e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            ////else
            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            gdiGraphics3D.Draw(e.Graphics ClientRectangle);
        }

        protected override void onmousedown(MouseEventArgs e)
        {
            base.onmousedown(e);
            lastMouseLocation = e.Location;
            mouseClickLocation = e.Location;
            mouseDown = true;
            //shiftPressed = ModifierKeys == Keys.Shift

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-11-22 14:54  CadLib4.0解密及示例\
     目录           0  2016-11-22 14:56  CadLib4.0解密及示例\WinFormsViewDwg2013\
     文件         144  2010-07-10 12:04  CadLib4.0解密及示例\WinFormsViewDwg2013\app.config
     目录           0  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\
     文件       19787  2013-12-30 21:40  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\Image Example.dxf
     文件       27648  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WinFormsViewExample.exe
     文件         144  2010-07-10 12:04  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WinFormsViewExample.exe.config
     文件       32256  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WinFormsViewExample.pdb
     文件       22472  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WinFormsViewExample.vshost.exe
     文件         144  2010-07-10 12:04  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WinFormsViewExample.vshost.exe.config
     文件         490  2012-06-06 02:06  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WinFormsViewExample.vshost.exe.manifest
     文件     3018752  2015-08-31 11:23  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WW.Cad.dll
     文件      758272  2015-08-31 11:23  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WW.dll
     文件       88064  2015-08-31 11:23  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WW.GL.dll
     文件        7168  2015-09-02 19:16  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WW.License.dll
     文件      160768  2015-08-31 11:23  CadLib4.0解密及示例\WinFormsViewDwg2013\bin\WW.Pdf.dll
     文件       16408  2015-01-27 09:32  CadLib4.0解密及示例\WinFormsViewDwg2013\DxfViewExample.cs
     文件        7138  2013-12-30 21:36  CadLib4.0解密及示例\WinFormsViewDwg2013\DxfViewExample.Designer.cs
     文件       18579  2013-12-30 21:36  CadLib4.0解密及示例\WinFormsViewDwg2013\DxfViewExample.resx
     目录           0  2013-12-23 17:46  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\
     目录           0  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\
     文件        2162  2016-11-22 15:28  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6867  2016-11-22 14:56  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件        9315  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\DxfViewExample.DxfView.resources
     目录           0  2013-12-23 17:46  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\TempPE\
     文件        4608  2013-12-23 10:23  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
     文件       27648  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\WinFormsViewExample.exe
     文件       32256  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\WinFormsViewExample.pdb
     文件         180  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\WinFormsViewExample.Properties.Resources.resources
     文件        6191  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\WinFormsViewExampleCS VS2010.csproj.FileListAbsolute.txt
     文件         984  2016-11-22 15:29  CadLib4.0解密及示例\WinFormsViewDwg2013\obj\Debug\WinFormsViewExampleCS VS2010.csproj.GenerateResource.Cache
............此处省略18个文件信息

评论

共有 条评论