프로젝트

일반

사용자정보

개정판 9f26701c

ID9f26701c7de9b8f6832110617761ffc890b488fc
상위 0d323d8f
하위 d2d4f84b

백흠경이(가) 일년 이상 전에 추가함

Fix: myModel 추가

Change-Id: I19a225c516d01ac817c858852eac770c85bf56fc

차이점 보기:

ID2.Manager/ID2.Manager/Model/MyModel.Designer.cs
1

2
namespace Xtractor.Viewer
3
{
4
    partial class MyModel
5
    {
6
        /// <summary>
7
        /// 필수 디자이너 변수입니다.
8
        /// </summary>
9
        private System.ComponentModel.IContainer components = null;
10

  
11
        /// <summary> 
12
        /// 사용 중인 모든 리소스를 정리합니다.
13
        /// </summary>
14
        /// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
15
        protected override void Dispose(bool disposing)
16
        {
17
            if (disposing && (components != null))
18
            {
19
                components.Dispose();
20
            }
21
            base.Dispose(disposing);
22
        }
23

  
24
        #region 구성 요소 디자이너에서 생성한 코드
25

  
26
        /// <summary>
27
        /// 디자이너 지원에 필요한 메서드입니다. 
28
        /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
29
        /// </summary>
30
        private void InitializeComponent()
31
        {
32
            components = new System.ComponentModel.Container();
33
        }
34

  
35
        #endregion
36
    }
37
}
ID2.Manager/ID2.Manager/Model/MyModel.cs
1
using devDept;
2
using devDept.Eyeshot;
3
using devDept.Eyeshot.Entities;
4
using devDept.Graphics;
5
using System;
6
using System.Collections.Generic;
7
using System.ComponentModel;
8
using System.Diagnostics;
9
using System.Drawing;
10
using System.Linq;
11
using System.Text;
12
using System.Threading.Tasks;
13
using System.Windows.Forms;
14

  
15
namespace Xtractor.Viewer
16
{
17
    public partial class MyModel : Design
18
    {
19
        private int entityUnderMouseID;
20
        private Entity selEntity = null;
21

  
22
        /// <summary>
23
        /// WorkUnit Queue
24
        /// </summary>
25
        private WorkManager<WorkUnit> _WorkUnitQueue = new WorkManager<WorkUnit>();
26
        public WorkManager<WorkUnit> WorkUnitQueue { get { return _WorkUnitQueue; } }
27

  
28
        public MyModel(IContainer container)
29
        {
30
            container.Add(this);
31
            InitializeComponent();
32

  
33
            ProgressBar = new devDept.Eyeshot.ProgressBar();
34
        }
35

  
36
        public void ClearEntity()
37
        {
38
            this.Entities.Clear();            
39
        }
40

  
41

  
42
        public void SetPerformanceCondition()
43
        {
44
            this.ActiveViewport.DisplayMode = displayType.Rendered;
45
            this.SetView(viewType.vcFrontFaceTopLeft);
46
            //this.ActiveViewport.SmallSizeRatioMoving = 1;
47
            //this.MinimumFramerate = 8;
48
            this.Shaded.ShowEdges = false;
49
            this.Shaded.ShowInternalWires = false;
50
            this.Rendered.ShowEdges = true;
51
            this.Rendered.ShadowMode = shadowType.None;
52

  
53
            /// IsolateBlocks에 필수 
54
            this.UseShaders = true;
55

  
56
            this.Wireframe.SilhouettesDrawingMode = silhouettesDrawingType.Never;
57
            this.Shaded.SilhouettesDrawingMode = silhouettesDrawingType.Never;
58
            this.Rendered.SilhouettesDrawingMode = silhouettesDrawingType.Never;
59
        }
60

  
61
        public List<Entity> GetHidedEntities()
62
        {
63
            return this.Entities.Where(x => x.Visible == false).ToList();
64
        }
65

  
66
        public List<Entity> GetSelectedEntities()
67
        {
68
            return this.Entities.Where(x => x.Selected).ToList();
69
        }
70

  
71
        protected override void OnKeyDown(KeyEventArgs e)
72
        {
73
            if (e.KeyCode == Keys.F8) // ProjectionType 변경
74
            {
75
                if (ActiveViewport.Camera.ProjectionMode == projectionType.Orthographic)
76
                {
77
                    ActiveViewport.Camera.ProjectionMode = projectionType.Perspective;
78
                }
79
                else
80
                {
81
                    ActiveViewport.Camera.ProjectionMode = projectionType.Orthographic;
82
                }
83

  
84
                AdjustNearAndFarPlanes();
85
                Invalidate();
86
            }
87
            else
88
            {
89
                base.OnKeyDown(e);
90
            }
91
        }
92

  
93
        protected override void OnMouseMove(MouseEventArgs e)
94
        {
95

  
96
            if (ActiveViewport.ToolBar.Contains(e.Location) || ActiveViewport.ViewCubeIcon.Contains(e.Location) || this.IsBusy)
97
            {
98
                base.OnMouseMove(e);
99

  
100
                return;
101
            }
102

  
103

  
104
            base.OnMouseMove(e);
105
        }
106

  
107
        protected override void OnMouseDown(MouseEventArgs e)
108
        {
109
            if ((ActiveViewport.ToolBar.Contains(e.Location) || ActiveViewport.ViewCubeIcon.Contains(e.Location)))
110
            {
111
                base.OnMouseDown(e);
112
                return;
113
            }
114

  
115
            entityUnderMouseID = GetEntityUnderMouseCursor(e.Location);
116

  
117
            if (e.Button == MouseButtons.Left)
118
            {
119
                if (entityUnderMouseID > -1)
120
                {
121
                    this.selEntity = Entities[entityUnderMouseID];
122
                    
123

  
124
                }
125
            }
126

  
127
            base.OnMouseDown(e);
128
        }
129
    }
130
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)