From 2b91dc0c7f940a9c57df6cdafd2e830d25fa4084 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sun, 31 Aug 2014 10:33:23 +0000 Subject: [PATCH] TestEIn 1.5h1 : - primo commit. --- EgtInterface.vb | 158 +++++++++++ Form1.Designer.vb | 433 +++++++++++++++++++++++++++++ Form1.resx | 138 +++++++++ Form1.vb | 207 ++++++++++++++ My Project/Application.Designer.vb | 38 +++ My Project/Application.myapp | 10 + My Project/AssemblyInfo.vb | 35 +++ My Project/Resources.Designer.vb | 63 +++++ My Project/Resources.resx | 117 ++++++++ My Project/Settings.Designer.vb | 73 +++++ My Project/Settings.settings | 7 + My Project/app.manifest | 48 ++++ Resources/Pan.cur | Bin 0 -> 326 bytes Resources/Pointer.cur | Bin 0 -> 326 bytes Resources/Rotate.cur | Bin 0 -> 326 bytes Resources/ZoomWin.cur | Bin 0 -> 326 bytes Scene.Designer.vb | 29 ++ Scene.vb | 172 ++++++++++++ TestEIn.sln | 26 ++ TestEIn.vbproj | 242 ++++++++++++++++ 20 files changed, 1796 insertions(+) create mode 100644 EgtInterface.vb create mode 100644 Form1.Designer.vb create mode 100644 Form1.resx create mode 100644 Form1.vb create mode 100644 My Project/Application.Designer.vb create mode 100644 My Project/Application.myapp create mode 100644 My Project/AssemblyInfo.vb create mode 100644 My Project/Resources.Designer.vb create mode 100644 My Project/Resources.resx create mode 100644 My Project/Settings.Designer.vb create mode 100644 My Project/Settings.settings create mode 100644 My Project/app.manifest create mode 100644 Resources/Pan.cur create mode 100644 Resources/Pointer.cur create mode 100644 Resources/Rotate.cur create mode 100644 Resources/ZoomWin.cur create mode 100644 Scene.Designer.vb create mode 100644 Scene.vb create mode 100644 TestEIn.sln create mode 100644 TestEIn.vbproj diff --git a/EgtInterface.vb b/EgtInterface.vb new file mode 100644 index 0000000..20332f4 --- /dev/null +++ b/EgtInterface.vb @@ -0,0 +1,158 @@ +Imports System.Runtime.InteropServices + +Public Class EgtInterface + +Structure Point3d + Dim x, y, z As Double +End Structure + +#If PLATFORM = "x64" Then +#If DEBUG Then +Const EgtInterface As String = "EgtInterfaceD64.dll" +#Else +Const EgtInterface As String = "EgtInterfaceR64.dll" +#End If +#Else +#If DEBUG Then +Const EgtInterface As String = "EgtInterfaceD32.dll" +#Else +Const EgtInterface As String = "EgtInterfaceR32.dll" +#End If +#End If + +'API di test + +Public Shared Function Summ(ByVal dA As Double, ByVal dB As Double) As Double +End Function + +Public Shared Function Summ2(ByRef dA As Double, ByVal dB As Double) As Boolean +End Function + +Public Shared Function Append(ByVal sA As String, ByRef sB As IntPtr) As Boolean +End Function + +Public Shared Function FreeMemory(ByVal sB As IntPtr) As Boolean +End Function + +Public Shared Function SetPoint(ByRef ptP As Point3d) As Boolean +End Function + +Public Shared Function OutText(ByVal hW As IntPtr, ByVal sA As String) As Boolean +End Function + +Public Shared Function DrawCross(ByVal hW As IntPtr, ByVal nX As Integer, ByVal nY As Integer, ByVal nDim As Integer) As Boolean +End Function + + Public Shared Function Append(ByVal sA As String, ByRef sB As String) As Boolean + Dim sD As IntPtr + Dim bOk As Boolean = Append(sA, sD) + sB = Marshal.PtrToStringUni(sD) + FreeMemory(sD) + Return bOk + End Function + +'API reali + +Public Shared Function EgtSetLog(ByVal nDebug As Integer, ByVal sLogFile As String) As Boolean +End Function + +Public Shared Function EgtSetFont(ByVal sNfeFontDir As String, ByVal sDefaultFont As String) As Boolean +End Function + +Public Shared Function EgtInit(ByVal hWnd As IntPtr, ByVal nDriver As Integer, ByVal b2Buff As Boolean, + ByVal nColorBits As Integer, ByVal nDepthBits As Integer) As Boolean +End Function + +Public Shared Function EgtExit() As Boolean +End Function + +Public Shared Function EgtSetDefaultMaterial(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Boolean +End Function + +Public Shared Function EgtSetBackground(ByVal nTopRed As Integer, ByVal nTopGreen As Integer, ByVal nTopBlue As Integer, + ByVal nBottomRed As Integer, ByVal nBottomGreen As Integer, ByVal nBottomBlue As Integer) As Boolean +End Function + +Public Shared Function EgtNewFile() As Boolean +End Function + +Public Shared Function EgtOpenFile(ByVal sFilePath As String) As Boolean +End Function + +Public Shared Function EgtTestImportExt(ByVal sFilePath As String) As Integer +End Function + +Public Shared Function EgtImportDxf(ByVal sFilePath As String) As Boolean +End Function + +Public Shared Function EgtImportStl(ByVal sFilePath As String) As Boolean +End Function + +Public Shared Function EgtDraw() As Boolean +End Function + +Public Shared Function EgtResize(ByVal nW As Integer, ByVal nH As Integer) As Boolean +End Function + +Public Shared Function EgtSetShowMode(ByVal nShowMode As Integer) As Boolean +End Function + +Public Shared Function EgtSetShowCurveDirection(ByVal bShow As Boolean) As Boolean +End Function + +Public Shared Function EgtZoom(ByVal nZoom As Integer) As Boolean +End Function + +Public Shared Function EgtZoomOnPoint(ByVal nWinX As Integer, ByVal nWinY As Integer, ByVal dCoeff As Double) As Boolean +End Function + +Public Shared Function EgtSetWinRect(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean +End Function + +Public Shared Function EgtResetWinRect() As Boolean +End Function + +Public Shared Function EgtZoomWin(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean +End Function + +Public Shared Function EgtSetView(ByVal nView As Integer) As Boolean +End Function + +Public Shared Function EgtPanCamera(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean +End Function + +Public Shared Function EgtRotateCamera(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean +End Function + +Public Shared Function EgtGetCameraDir(ByRef nDir As Integer) As Boolean +End Function + +Public Shared Function EgtUnProject(ByVal nWinX As Integer, ByVal nWinY As Integer, ByRef ptP As Point3d) As Boolean +End Function + +'Costanti : TIPO VISUALIZZAZIONE +Public Const SM_WIREFRAME As Integer = 0 +Public Const SM_HIDDENLINE As Integer = 1 +Public Const SM_SHADING As Integer = 2 +'Costanti : TIPO ZOOM +Public Const ZM_ALL As Integer = 1 +Public Const ZM_IN As Integer = 2 +Public Const ZM_OUT As Integer = 3 +'Costanti : TIPO VISTA +Public Const CT_NONE As Integer = 0 +Public Const CT_TOP As Integer = 1 +Public Const CT_FRONT As Integer = 2 +Public Const CT_RIGHT As Integer = 3 +Public Const CT_BACK As Integer = 4 +Public Const CT_LEFT As Integer = 5 +Public Const CT_BOTTOM As Integer = 6 +Public Const CT_ISO_SW As Integer = 7 +Public Const CT_ISO_SE As Integer = 8 +Public Const CT_ISO_NE As Integer = 9 +Public Const CT_ISO_NW As Integer = 10 +'Costanti : TIPO FILE DA IMPORTARE +Public Const FT_NULL As Integer = 0 +Public Const FT_DXF As Integer = 1 +Public Const FT_STL As Integer = 2 + +End Class diff --git a/Form1.Designer.vb b/Form1.Designer.vb new file mode 100644 index 0000000..583b58b --- /dev/null +++ b/Form1.Designer.vb @@ -0,0 +1,433 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Richiesto da Progettazione Windows Form + Private components As System.ComponentModel.IContainer + + 'NOTA: la procedura che segue è richiesta da Progettazione Windows Form + 'Può essere modificata in Progettazione Windows Form. + 'Non modificarla nell'editor del codice. + _ + Private Sub InitializeComponent() + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.Scene1 = New TestEIn.Scene() + Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.Panel1 = New System.Windows.Forms.Panel() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.rbtShading = New System.Windows.Forms.RadioButton() + Me.rbtHiddenLine = New System.Windows.Forms.RadioButton() + Me.rbtWireFrame = New System.Windows.Forms.RadioButton() + Me.chkCurveDir = New System.Windows.Forms.CheckBox() + Me.btnZoomOut = New System.Windows.Forms.Button() + Me.btnZoomIn = New System.Windows.Forms.Button() + Me.btnZoomAll = New System.Windows.Forms.Button() + Me.btnRight = New System.Windows.Forms.Button() + Me.btnBack = New System.Windows.Forms.Button() + Me.btnLeft = New System.Windows.Forms.Button() + Me.btnFront = New System.Windows.Forms.Button() + Me.btnIso = New System.Windows.Forms.Button() + Me.btnTop = New System.Windows.Forms.Button() + Me.btnImport = New System.Windows.Forms.Button() + Me.btnNew = New System.Windows.Forms.Button() + Me.btnExport = New System.Windows.Forms.Button() + Me.btnExec = New System.Windows.Forms.Button() + Me.btnSave = New System.Windows.Forms.Button() + Me.btnOpen = New System.Windows.Forms.Button() + Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() + Me.ToolStripStatusLabel2 = New System.Windows.Forms.ToolStripStatusLabel() + Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel() + Me.OpenFileDialog = New System.Windows.Forms.OpenFileDialog() + Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog() + Me.ImportFileDialog = New System.Windows.Forms.OpenFileDialog() + Me.TableLayoutPanel1.SuspendLayout() + Me.FlowLayoutPanel1.SuspendLayout() + Me.Panel1.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.StatusStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.ColumnCount = 3 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle()) + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle()) + Me.TableLayoutPanel1.Controls.Add(Me.Scene1, 1, 0) + Me.TableLayoutPanel1.Controls.Add(Me.FlowLayoutPanel1, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.Panel1, 2, 0) + Me.TableLayoutPanel1.Controls.Add(Me.StatusStrip1, 0, 1) + Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0) + Me.TableLayoutPanel1.Margin = New System.Windows.Forms.Padding(2) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 2 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle()) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(685, 386) + Me.TableLayoutPanel1.TabIndex = 0 + ' + 'Scene1 + ' + Me.Scene1.Dock = System.Windows.Forms.DockStyle.Fill + Me.Scene1.Location = New System.Drawing.Point(105, 3) + Me.Scene1.Name = "Scene1" + Me.Scene1.Size = New System.Drawing.Size(376, 358) + Me.Scene1.TabIndex = 1 + ' + 'FlowLayoutPanel1 + ' + Me.FlowLayoutPanel1.Controls.Add(Me.TextBox1) + Me.FlowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.FlowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown + Me.FlowLayoutPanel1.Location = New System.Drawing.Point(2, 2) + Me.FlowLayoutPanel1.Margin = New System.Windows.Forms.Padding(2) + Me.FlowLayoutPanel1.Name = "FlowLayoutPanel1" + Me.FlowLayoutPanel1.Size = New System.Drawing.Size(98, 360) + Me.FlowLayoutPanel1.TabIndex = 1 + ' + 'TextBox1 + ' + Me.TextBox1.Location = New System.Drawing.Point(3, 3) + Me.TextBox1.Multiline = True + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.Size = New System.Drawing.Size(94, 67) + Me.TextBox1.TabIndex = 3 + ' + 'Panel1 + ' + Me.Panel1.Controls.Add(Me.GroupBox1) + Me.Panel1.Controls.Add(Me.chkCurveDir) + Me.Panel1.Controls.Add(Me.btnZoomOut) + Me.Panel1.Controls.Add(Me.btnZoomIn) + Me.Panel1.Controls.Add(Me.btnZoomAll) + Me.Panel1.Controls.Add(Me.btnRight) + Me.Panel1.Controls.Add(Me.btnBack) + Me.Panel1.Controls.Add(Me.btnLeft) + Me.Panel1.Controls.Add(Me.btnFront) + Me.Panel1.Controls.Add(Me.btnIso) + Me.Panel1.Controls.Add(Me.btnTop) + Me.Panel1.Controls.Add(Me.btnImport) + Me.Panel1.Controls.Add(Me.btnNew) + Me.Panel1.Controls.Add(Me.btnExport) + Me.Panel1.Controls.Add(Me.btnExec) + Me.Panel1.Controls.Add(Me.btnSave) + Me.Panel1.Controls.Add(Me.btnOpen) + Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill + Me.Panel1.Location = New System.Drawing.Point(487, 3) + Me.Panel1.Name = "Panel1" + Me.Panel1.Size = New System.Drawing.Size(195, 358) + Me.Panel1.TabIndex = 5 + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.rbtShading) + Me.GroupBox1.Controls.Add(Me.rbtHiddenLine) + Me.GroupBox1.Controls.Add(Me.rbtWireFrame) + Me.GroupBox1.ForeColor = System.Drawing.SystemColors.ControlText + Me.GroupBox1.Location = New System.Drawing.Point(0, 53) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(195, 39) + Me.GroupBox1.TabIndex = 22 + Me.GroupBox1.TabStop = False + ' + 'rbtShading + ' + Me.rbtShading.Appearance = System.Windows.Forms.Appearance.Button + Me.rbtShading.Location = New System.Drawing.Point(130, 10) + Me.rbtShading.Name = "rbtShading" + Me.rbtShading.Size = New System.Drawing.Size(60, 23) + Me.rbtShading.TabIndex = 23 + Me.rbtShading.TabStop = True + Me.rbtShading.Text = "Shading" + Me.rbtShading.UseVisualStyleBackColor = True + ' + 'rbtHiddenLine + ' + Me.rbtHiddenLine.Appearance = System.Windows.Forms.Appearance.Button + Me.rbtHiddenLine.Location = New System.Drawing.Point(66, 10) + Me.rbtHiddenLine.Name = "rbtHiddenLine" + Me.rbtHiddenLine.Size = New System.Drawing.Size(60, 23) + Me.rbtHiddenLine.TabIndex = 22 + Me.rbtHiddenLine.TabStop = True + Me.rbtHiddenLine.Text = "HiddLine" + Me.rbtHiddenLine.UseVisualStyleBackColor = True + ' + 'rbtWireFrame + ' + Me.rbtWireFrame.Appearance = System.Windows.Forms.Appearance.Button + Me.rbtWireFrame.Location = New System.Drawing.Point(3, 10) + Me.rbtWireFrame.Name = "rbtWireFrame" + Me.rbtWireFrame.Size = New System.Drawing.Size(60, 23) + Me.rbtWireFrame.TabIndex = 21 + Me.rbtWireFrame.TabStop = True + Me.rbtWireFrame.Text = "WireFrm" + Me.rbtWireFrame.UseVisualStyleBackColor = True + ' + 'chkCurveDir + ' + Me.chkCurveDir.Appearance = System.Windows.Forms.Appearance.Button + Me.chkCurveDir.Location = New System.Drawing.Point(3, 97) + Me.chkCurveDir.Name = "chkCurveDir" + Me.chkCurveDir.Size = New System.Drawing.Size(60, 23) + Me.chkCurveDir.TabIndex = 20 + Me.chkCurveDir.Text = "CurveDir" + Me.chkCurveDir.UseVisualStyleBackColor = True + ' + 'btnZoomOut + ' + Me.btnZoomOut.Location = New System.Drawing.Point(132, 134) + Me.btnZoomOut.Name = "btnZoomOut" + Me.btnZoomOut.Size = New System.Drawing.Size(60, 23) + Me.btnZoomOut.TabIndex = 15 + Me.btnZoomOut.Text = "ZoomOut" + Me.btnZoomOut.UseVisualStyleBackColor = False + ' + 'btnZoomIn + ' + Me.btnZoomIn.Location = New System.Drawing.Point(69, 134) + Me.btnZoomIn.Name = "btnZoomIn" + Me.btnZoomIn.Size = New System.Drawing.Size(60, 23) + Me.btnZoomIn.TabIndex = 14 + Me.btnZoomIn.Text = "ZoomIn" + Me.btnZoomIn.UseVisualStyleBackColor = False + ' + 'btnZoomAll + ' + Me.btnZoomAll.Location = New System.Drawing.Point(3, 134) + Me.btnZoomAll.Name = "btnZoomAll" + Me.btnZoomAll.Size = New System.Drawing.Size(60, 23) + Me.btnZoomAll.TabIndex = 13 + Me.btnZoomAll.Text = "ZoomAll" + Me.btnZoomAll.UseVisualStyleBackColor = False + ' + 'btnRight + ' + Me.btnRight.Location = New System.Drawing.Point(130, 204) + Me.btnRight.Name = "btnRight" + Me.btnRight.Size = New System.Drawing.Size(60, 23) + Me.btnRight.TabIndex = 12 + Me.btnRight.Text = "Right" + Me.btnRight.UseVisualStyleBackColor = False + ' + 'btnBack + ' + Me.btnBack.Location = New System.Drawing.Point(68, 204) + Me.btnBack.Name = "btnBack" + Me.btnBack.Size = New System.Drawing.Size(60, 23) + Me.btnBack.TabIndex = 11 + Me.btnBack.Text = "Back" + Me.btnBack.UseVisualStyleBackColor = False + ' + 'btnLeft + ' + Me.btnLeft.Location = New System.Drawing.Point(130, 174) + Me.btnLeft.Name = "btnLeft" + Me.btnLeft.Size = New System.Drawing.Size(60, 23) + Me.btnLeft.TabIndex = 10 + Me.btnLeft.Text = "Left" + Me.btnLeft.UseVisualStyleBackColor = False + ' + 'btnFront + ' + Me.btnFront.Location = New System.Drawing.Point(66, 174) + Me.btnFront.Name = "btnFront" + Me.btnFront.Size = New System.Drawing.Size(60, 23) + Me.btnFront.TabIndex = 9 + Me.btnFront.Text = "Front" + Me.btnFront.UseVisualStyleBackColor = False + ' + 'btnIso + ' + Me.btnIso.Location = New System.Drawing.Point(3, 204) + Me.btnIso.Name = "btnIso" + Me.btnIso.Size = New System.Drawing.Size(60, 23) + Me.btnIso.TabIndex = 8 + Me.btnIso.Text = "Iso" + Me.btnIso.UseVisualStyleBackColor = False + ' + 'btnTop + ' + Me.btnTop.Location = New System.Drawing.Point(3, 174) + Me.btnTop.Name = "btnTop" + Me.btnTop.Size = New System.Drawing.Size(60, 23) + Me.btnTop.TabIndex = 7 + Me.btnTop.Text = "Top" + Me.btnTop.UseVisualStyleBackColor = False + ' + 'btnImport + ' + Me.btnImport.Location = New System.Drawing.Point(2, 30) + Me.btnImport.Name = "btnImport" + Me.btnImport.Size = New System.Drawing.Size(60, 23) + Me.btnImport.TabIndex = 6 + Me.btnImport.Text = "Import" + Me.btnImport.UseVisualStyleBackColor = True + ' + 'btnNew + ' + Me.btnNew.AutoSize = True + Me.btnNew.Location = New System.Drawing.Point(2, 2) + Me.btnNew.Margin = New System.Windows.Forms.Padding(2) + Me.btnNew.Name = "btnNew" + Me.btnNew.Size = New System.Drawing.Size(60, 23) + Me.btnNew.TabIndex = 5 + Me.btnNew.Text = "New" + Me.btnNew.UseVisualStyleBackColor = True + ' + 'btnExport + ' + Me.btnExport.Location = New System.Drawing.Point(66, 30) + Me.btnExport.Name = "btnExport" + Me.btnExport.Size = New System.Drawing.Size(60, 23) + Me.btnExport.TabIndex = 4 + Me.btnExport.Text = "Export" + Me.btnExport.UseVisualStyleBackColor = True + ' + 'btnExec + ' + Me.btnExec.Location = New System.Drawing.Point(130, 30) + Me.btnExec.Name = "btnExec" + Me.btnExec.Size = New System.Drawing.Size(60, 23) + Me.btnExec.TabIndex = 2 + Me.btnExec.Text = "Exec" + Me.btnExec.UseVisualStyleBackColor = True + ' + 'btnSave + ' + Me.btnSave.AutoSize = True + Me.btnSave.Location = New System.Drawing.Point(130, 2) + Me.btnSave.Margin = New System.Windows.Forms.Padding(2) + Me.btnSave.Name = "btnSave" + Me.btnSave.Size = New System.Drawing.Size(60, 23) + Me.btnSave.TabIndex = 1 + Me.btnSave.Text = "Save" + Me.btnSave.UseVisualStyleBackColor = True + ' + 'btnOpen + ' + Me.btnOpen.AutoSize = True + Me.btnOpen.Location = New System.Drawing.Point(66, 2) + Me.btnOpen.Margin = New System.Windows.Forms.Padding(2) + Me.btnOpen.Name = "btnOpen" + Me.btnOpen.Size = New System.Drawing.Size(60, 23) + Me.btnOpen.TabIndex = 0 + Me.btnOpen.Text = "Open" + Me.btnOpen.UseVisualStyleBackColor = True + ' + 'StatusStrip1 + ' + Me.TableLayoutPanel1.SetColumnSpan(Me.StatusStrip1, 3) + Me.StatusStrip1.Dock = System.Windows.Forms.DockStyle.Fill + Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabel2, Me.ToolStripStatusLabel1}) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 364) + Me.StatusStrip1.MaximumSize = New System.Drawing.Size(0, 22) + Me.StatusStrip1.MinimumSize = New System.Drawing.Size(0, 22) + Me.StatusStrip1.Name = "StatusStrip1" + Me.StatusStrip1.Size = New System.Drawing.Size(685, 22) + Me.StatusStrip1.TabIndex = 6 + Me.StatusStrip1.Text = "StatusStrip1" + ' + 'ToolStripStatusLabel2 + ' + Me.ToolStripStatusLabel2.AutoSize = False + Me.ToolStripStatusLabel2.Name = "ToolStripStatusLabel2" + Me.ToolStripStatusLabel2.Size = New System.Drawing.Size(485, 17) + Me.ToolStripStatusLabel2.Spring = True + ' + 'ToolStripStatusLabel1 + ' + Me.ToolStripStatusLabel1.AutoSize = False + Me.ToolStripStatusLabel1.BorderSides = CType((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) _ + Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) _ + Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom), System.Windows.Forms.ToolStripStatusLabelBorderSides) + Me.ToolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text + Me.ToolStripStatusLabel1.MergeIndex = 1 + Me.ToolStripStatusLabel1.Name = "ToolStripStatusLabel1" + Me.ToolStripStatusLabel1.Size = New System.Drawing.Size(185, 17) + Me.ToolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'OpenFileDialog + ' + Me.OpenFileDialog.DefaultExt = "Nge" + Me.OpenFileDialog.Title = "Open" + ' + 'SaveFileDialog + ' + Me.SaveFileDialog.Title = "Save" + ' + 'ImportFileDialog + ' + Me.ImportFileDialog.DefaultExt = "DXF" + Me.ImportFileDialog.Title = "Import" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None + Me.ClientSize = New System.Drawing.Size(685, 386) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.ForeColor = System.Drawing.SystemColors.ControlText + Me.Margin = New System.Windows.Forms.Padding(2) + Me.Name = "Form1" + Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide + Me.Text = "Egaltech Interface Prova 1" + Me.TableLayoutPanel1.ResumeLayout(False) + Me.TableLayoutPanel1.PerformLayout() + Me.FlowLayoutPanel1.ResumeLayout(False) + Me.FlowLayoutPanel1.PerformLayout() + Me.Panel1.ResumeLayout(False) + Me.Panel1.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.StatusStrip1.ResumeLayout(False) + Me.StatusStrip1.PerformLayout() + Me.ResumeLayout(False) + +End Sub + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel + Friend WithEvents FlowLayoutPanel1 As System.Windows.Forms.FlowLayoutPanel + Friend WithEvents OpenFileDialog As System.Windows.Forms.OpenFileDialog + Friend WithEvents SaveFileDialog As System.Windows.Forms.SaveFileDialog + Friend WithEvents btnOpen As System.Windows.Forms.Button + Friend WithEvents btnSave As System.Windows.Forms.Button + Friend WithEvents btnExec As System.Windows.Forms.Button + Friend WithEvents TextBox1 As System.Windows.Forms.TextBox + Friend WithEvents btnExport As System.Windows.Forms.Button + Friend WithEvents Panel1 As System.Windows.Forms.Panel + Friend WithEvents btnNew As System.Windows.Forms.Button + Friend WithEvents btnImport As System.Windows.Forms.Button + Friend WithEvents ImportFileDialog As System.Windows.Forms.OpenFileDialog + Friend WithEvents btnIso As System.Windows.Forms.Button + Friend WithEvents btnTop As System.Windows.Forms.Button + Friend WithEvents btnRight As System.Windows.Forms.Button + Friend WithEvents btnBack As System.Windows.Forms.Button + Friend WithEvents btnLeft As System.Windows.Forms.Button + Friend WithEvents btnFront As System.Windows.Forms.Button + Friend WithEvents btnZoomOut As System.Windows.Forms.Button + Friend WithEvents btnZoomIn As System.Windows.Forms.Button + Friend WithEvents btnZoomAll As System.Windows.Forms.Button + Friend WithEvents chkCurveDir As System.Windows.Forms.CheckBox + Friend WithEvents rbtWireFrame As System.Windows.Forms.RadioButton + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents rbtShading As System.Windows.Forms.RadioButton + Friend WithEvents rbtHiddenLine As System.Windows.Forms.RadioButton + Friend WithEvents Scene1 As TestEIn.Scene + Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip + Friend WithEvents ToolStripStatusLabel1 As System.Windows.Forms.ToolStripStatusLabel + Friend WithEvents ToolStripStatusLabel2 As System.Windows.Forms.ToolStripStatusLabel + +End Class diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..af80a05 --- /dev/null +++ b/Form1.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 440, 6 + + + 440, 6 + + + 18, 8 + + + 165, 7 + + + 298, 6 + + + 34 + + \ No newline at end of file diff --git a/Form1.vb b/Form1.vb new file mode 100644 index 0000000..743338e --- /dev/null +++ b/Form1.vb @@ -0,0 +1,207 @@ +Imports System.Runtime.InteropServices +Imports System.Text +Imports System.Math +Imports TestEIn.EgtInterface + + +Public Class Form1 + +'-------------------------------- Form ------------------------------------------------------------ + Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + Text = "EgalTech TestEngine" + rbtShading.Checked = True + Scene1.Init() + End Sub + + Private Sub CursorPos(ByVal sender As Object, ByVal sCursorPos As String) Handles Scene1.CursorPos + ToolStripStatusLabel1.Text = sCursorPos + End Sub + + '-------------------------------- Buttons -------------------------------------------------------- + Private Sub btnNew_Click(sender As System.Object, e As System.EventArgs) Handles btnNew.Click + If EgtNewFile() Then + EgtZoom(ZM_ALL) + Scene1.Invalidate() + End If + End Sub + + Private Sub btnOpen_Click(sender As System.Object, e As System.EventArgs) Handles btnOpen.Click + OpenFileDialog.Filter = "New geometry EgalTech(*.nge)|*.nge|New font EgalTech(*.nfe)|*.nfe|All Files (*.*)|*.*" + OpenFileDialog.FilterIndex = 1 + If OpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then + Cursor = Cursors.WaitCursor + If EgtOpenFile(OpenFileDialog.FileName) Then + EgtZoom(ZM_ALL) + Scene1.Invalidate() + End If + Cursor = Cursors.Default + End If + End Sub + + Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click + If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then + + End If + End Sub + + Private Sub btnImport_Click(sender As System.Object, e As System.EventArgs) Handles btnImport.Click + ImportFileDialog.Filter = "Drawing Exchange Fmt(*.dxf)|*.dxf|Stereolithography (*.stl)|*.stl|All Files (*.*)|*.*" + ImportFileDialog.FilterIndex = 1 + If ImportFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then + Dim nFileType As Integer = EgtTestImportExt(ImportFileDialog.FileName) + If nFileType = FT_DXF Then + Cursor = Cursors.WaitCursor + EgtNewFile() + If EgtImportDxf(ImportFileDialog.FileName) Then + EgtZoom(ZM_ALL) + Scene1.Invalidate() + End If + Cursor = Cursors.Default + ElseIf nFileType = FT_STL Then + Cursor = Cursors.WaitCursor + EgtNewFile() + If EgtImportStl(ImportFileDialog.FileName) Then + EgtZoom(ZM_ALL) + Scene1.Invalidate() + End If + Cursor = Cursors.Default + End If + End If + End Sub + + Private Sub btnExec_Click(sender As System.Object, e As System.EventArgs) Handles btnExec.Click + Dim bOk As Boolean + Dim hWnd As IntPtr + ' emetto testo in editor + hWnd = TextBox1.Handle + bOk = OutText(hWnd, "Testo di prova abbastanza lungo") + ' emetto croci in picture + hWnd = Scene1.Handle + bOk = DrawCross(hWnd, 100, 100, 10) + bOk = DrawCross(hWnd, 150, 100, 10) + bOk = DrawCross(hWnd, 150, 150, 10) + bOk = DrawCross(hWnd, 200, 150, 10) + + End Sub + + Private Sub rbtWireFrame_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rbtWireFrame.CheckedChanged + EgtSetShowMode(SM_WIREFRAME) + Scene1.Invalidate() + End Sub + + Private Sub rbtHiddenLine_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rbtHiddenLine.CheckedChanged + EgtSetShowMode(SM_HIDDENLINE) + Scene1.Invalidate() + End Sub + + Private Sub rbtShading_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rbtShading.CheckedChanged + EgtSetShowMode(SM_SHADING) + Scene1.Invalidate() + End Sub + + Private Sub chkCurveDir_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkCurveDir.CheckedChanged + EgtSetShowCurveDirection(chkCurveDir.Checked) + Scene1.Invalidate() + End Sub + + Private Sub btnZoomAll_Click(sender As System.Object, e As System.EventArgs) Handles btnZoomAll.Click + EgtZoom(ZM_ALL) + Scene1.Invalidate() + End Sub + + Private Sub btnZoomIn_Click(sender As System.Object, e As System.EventArgs) Handles btnZoomIn.Click + EgtZoom(ZM_IN) + Scene1.Invalidate() + End Sub + + Private Sub btnZoomOut_Click(sender As System.Object, e As System.EventArgs) Handles btnZoomOut.Click + EgtZoom(ZM_OUT) + Scene1.Invalidate() + End Sub + + Private Sub btnTop_Click(sender As System.Object, e As System.EventArgs) Handles btnTop.Click + EgtSetView(CT_TOP) + Scene1.Invalidate() + End Sub + + Private Sub btnFront_Click(sender As System.Object, e As System.EventArgs) Handles btnFront.Click + EgtSetView(CT_FRONT) + Scene1.Invalidate() + End Sub + + Private Sub btnLeft_Click(sender As System.Object, e As System.EventArgs) Handles btnLeft.Click + EgtSetView(CT_LEFT) + Scene1.Invalidate() + End Sub + + Private Sub btnBack_Click(sender As System.Object, e As System.EventArgs) Handles btnBack.Click + EgtSetView(CT_BACK) + Scene1.Invalidate() + End Sub + + Private Sub btnRight_Click(sender As System.Object, e As System.EventArgs) Handles btnRight.Click + EgtSetView(CT_RIGHT) + Scene1.Invalidate() + End Sub + Private Sub btnIso_Click(sender As System.Object, e As System.EventArgs) Handles btnIso.Click + EgtSetView(CT_ISO_SW) + Scene1.Invalidate() + End Sub + + Private Sub btnExport_Click(sender As System.Object, e As System.EventArgs) Handles btnExport.Click + Dim dA As Double + dA = Summ(12.5, 0.5) + MessageBox.Show(dA.ToString, "Summ", MessageBoxButtons.OK, MessageBoxIcon.Information) + + Dim bOk As Boolean + Dim sA As String + sA = "PiΣpΣpo" + Dim sB As String = "" + bOk = Append(sA, sB) + If bOk Then + MessageBox.Show(sB, "Append", MessageBoxButtons.OK, MessageBoxIcon.Information) + Else + MessageBox.Show("Error", "Append", MessageBoxButtons.OK, MessageBoxIcon.Error) + End If + + Dim dC As Double + dC = 22.5 + bOk = Summ2(dC, 0.5) + If bOk Then + MessageBox.Show(dC.ToString, "Summ2", MessageBoxButtons.OK, MessageBoxIcon.Information) + Else + MessageBox.Show("Error", "Summ2", MessageBoxButtons.OK, MessageBoxIcon.Error) + End If + + Dim ptP As Point3d + ptP.x = 1 + ptP.y = 2 + ptP.z = 3 + bOk = SetPoint(ptP) + MessageBox.Show(ptP.x.ToString, "Summ2", MessageBoxButtons.OK, MessageBoxIcon.Information) + End Sub + +Private Sub PictureBox1_HandleDestroyed(sender As System.Object, e As System.EventArgs) + +End Sub + +Private Sub PictureBox1_HandleCreated(sender As System.Object, e As System.EventArgs) + +End Sub + +Private Sub PictureBox1_Resize(sender As System.Object, e As System.EventArgs) + +End Sub + +Private Sub PictureBox1_MouseWheel(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) + +End Sub + +Private Sub PictureBox1_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) + +End Sub + +Private Sub CursorPos(nType As System.Int32, dVal1 As System.Double, dVal2 As System.Double) + +End Sub +End Class diff --git a/My Project/Application.Designer.vb b/My Project/Application.Designer.vb new file mode 100644 index 0000000..03a290d --- /dev/null +++ b/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' Il codice è stato generato da uno strumento. +' Versione runtime:4.0.30319.34014 +' +' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se +' il codice viene rigenerato. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTA: il file è generato automaticamente e non può essere modificato direttamente. Per effettuare modifiche + ' o se vengono rilevati errori di compilazione nel file, andare alla Progettazione progetti + ' (aprire le proprietà del progetto o fare doppio clic sul nodo Progetto in + ' Esplora soluzioni) ed effettuare le modifiche nella scheda Applicazione. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.ApplicationDefined) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = false + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.TestEIn.Form1 + End Sub + End Class +End Namespace diff --git a/My Project/Application.myapp b/My Project/Application.myapp new file mode 100644 index 0000000..28f35e7 --- /dev/null +++ b/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Form1 + false + 0 + true + 1 + false + \ No newline at end of file diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..0a9bd9a --- /dev/null +++ b/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' Le informazioni generali relative a un assembly sono controllate dal seguente +' insieme di attributi. Per modificare le informazioni associate a un assembly +' è necessario modificare i valori di questi attributi. + +' Controllare i valori degli attributi dell'assembly + + + + + + + + + + +'Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi + + +' Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: +' +' Numero di versione principale +' Numero di versione secondario +' Numero build +' Revisione +' +' È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build +' utilizzando l'asterisco (*) come descritto di seguito: +' + + + diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb new file mode 100644 index 0000000..eeb7586 --- /dev/null +++ b/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' Il codice è stato generato da uno strumento. +' Versione runtime:4.0.30319.34014 +' +' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se +' il codice viene rigenerato. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder. + 'tramite uno strumento quale ResGen o Visual Studio. + 'Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen + 'con l'opzione /str oppure ricompilare il progetto VS. + ''' + ''' Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("TestEIn.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le + ''' ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/My Project/Resources.resx b/My Project/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb new file mode 100644 index 0000000..f6876c6 --- /dev/null +++ b/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' Il codice è stato generato da uno strumento. +' Versione runtime:4.0.30319.34014 +' +' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se +' il codice viene rigenerato. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "Funzionalità di salvataggio automatico My.Settings" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.TestEIn.My.MySettings + Get + Return Global.TestEIn.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/My Project/Settings.settings b/My Project/Settings.settings new file mode 100644 index 0000000..377f56d --- /dev/null +++ b/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/My Project/app.manifest b/My Project/app.manifest new file mode 100644 index 0000000..71a28bd --- /dev/null +++ b/My Project/app.manifest @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/Pan.cur b/Resources/Pan.cur new file mode 100644 index 0000000000000000000000000000000000000000..390939733db71e5f80164207d022ed74517a1def GIT binary patch literal 326 zcmZuru?+$-5OcyyP#|a!E$N_S1AYWXV3TA6Mqm|6#z0~LB$_XxKkPq2@%lUYF19S^ zfQW#UfHnIVfGvOnK?yAp*s3y2ACXH?nVCN{WsL=BT40fY)zi7O5tgxBHnE)dy*=n| zw8f>5y??GebYt*>rQ6xokM&ApPFy4ny+_Y&ZL>Pxb!Lip#3tHuT1^N F`T|rCeRTi; literal 0 HcmV?d00001 diff --git a/Resources/Pointer.cur b/Resources/Pointer.cur new file mode 100644 index 0000000000000000000000000000000000000000..6298d968ed60034a05aac5142365b6324ccf72a1 GIT binary patch literal 326 zcmb7;u?@f=3Tr6`&PJYMwZqmLW=XWIZyjW3UCCA_hw1@*F1w|UfS-3$OTF$^RTv%Ra9r9W0 zd9@$U$Up*vJO`FoqcFe*z=5!ZiWnY^Cf@y(Few@$!X-x*tlA!PVSOeQ7n=#o@z%q1 zY4bVx+v}Y^o)*{EVs*FJd5aRdGcbRvT2YhQqYpjlEg_SLFe|a%GnXR1o^Tw0Qwcy_ e=$DTkaMEOsT_>F)x-&3;8>kgj^Y1bGWby;~xOj*F literal 0 HcmV?d00001 diff --git a/Resources/ZoomWin.cur b/Resources/ZoomWin.cur new file mode 100644 index 0000000000000000000000000000000000000000..b1be252cdfaf2a491a1e1c9ead46b7f7633e2dd4 GIT binary patch literal 326 zcmZ9GJ#NB45QX2Gh`5MwA|gbAGEPL{GB@xRDY(_Hlmd=1SR8-L8K`sDCVHsqCD+o_jX1F-{2tLtFfCfM#6Y literal 0 HcmV?d00001 diff --git a/Scene.Designer.vb b/Scene.Designer.vb new file mode 100644 index 0000000..4bb8d03 --- /dev/null +++ b/Scene.Designer.vb @@ -0,0 +1,29 @@ + _ +Partial Class Scene + Inherits System.Windows.Forms.UserControl + + 'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Richiesto da Progettazione controlli + Private components As System.ComponentModel.IContainer + + ' NOTA: la procedura che segue è richiesta da Progettazione componenti + ' Può essere modificata in Progettazione componenti. Non modificarla + ' nell'editor del codice. + _ + Private Sub InitializeComponent() + components = New System.ComponentModel.Container() + End Sub + +End Class + diff --git a/Scene.vb b/Scene.vb new file mode 100644 index 0000000..766032f --- /dev/null +++ b/Scene.vb @@ -0,0 +1,172 @@ +Imports System.Math +Imports System.Globalization +Imports TestEIn.EgtInterface + +Public Class Scene + + Private m_nStatus As Integer + Private Enum ST As Integer + NULL = 0 + PAN = 1 + ROT = 2 + ZOOMWIN = 3 + End Enum + Private m_PrevPoint As Point + + Sub New() + ' Chiamata richiesta dalla finestra di progettazione. + InitializeComponent() + ' Istruzioni di inizializzazione. + SetStyle(ControlStyles.Opaque, True) + SetStyle(ControlStyles.UserPaint, True) + SetStyle(ControlStyles.AllPaintingInWmPaint, True) + m_nStatus = ST.NULL + m_PrevPoint = Point.Empty + Cursor = New Cursor(Me.GetType(), "Pointer.cur") + End Sub + + Public Sub Init() + EgtSetLog(0, "TestEngine.log") + EgtSetFont("C:\EgtProg\Fonts", "ModernProp.Nfe") + EgtInit(Handle, 3, True, 24, 32) + EgtSetDefaultMaterial(255, 165, 0) + EgtSetBackground(140, 154, 168, 40, 44, 48) + End Sub + + Protected Overrides Sub OnHandleDestroyed(e As EventArgs) + EgtExit() + End Sub + + Protected Overrides Sub OnPaint(e As PaintEventArgs) + MyBase.OnPaint(e) + EgtDraw() + End Sub + + Protected Overrides Sub OnPaintBackground(pevent As PaintEventArgs) + MyBase.OnPaintBackground(pevent) + End Sub + + Protected Overrides Sub OnResize(e As System.EventArgs) + MyBase.OnResize(e) + EgtResize(Width, Height) + End Sub + + Protected Overrides Sub OnMouseEnter(e As System.EventArgs) + MyBase.OnMouseEnter(e) + Focus() + End Sub + + Protected Overrides Sub OnMouseDown(e As System.Windows.Forms.MouseEventArgs) + If e.Button = Windows.Forms.MouseButtons.Middle Then + If (Control.ModifierKeys And Keys.Shift) = Keys.Shift Then + m_nStatus = ST.ZOOMWIN + Cursor = New Cursor(Me.GetType(), "ZoomWin.cur") + ElseIf (Control.ModifierKeys And Keys.Control) = Keys.Control Then + m_nStatus = ST.ROT + Cursor = New Cursor(Me.GetType(), "Rotate.cur") + Else + m_nStatus = ST.PAN + Cursor = New Cursor(Me.GetType(), "Pan.cur") + End If + m_PrevPoint = e.Location + Else + MyBase.OnMouseDown(e) + End If + Focus() + End Sub + + Protected Overrides Sub OnMouseUp(e As System.Windows.Forms.MouseEventArgs) + If e.Button = Windows.Forms.MouseButtons.Middle Then + If m_nStatus = ST.ZOOMWIN Then + EgtResetWinRect() + EgtZoomWin(m_PrevPoint.X, m_PrevPoint.Y, e.Location.X, e.Location.Y) + Invalidate() + End If + If m_nStatus <> ST.NULL Then + m_nStatus = ST.NULL + Cursor = New Cursor(Me.GetType(), "Pointer.cur") + End If + Else + MyBase.OnMouseUp(e) + End If + End Sub + + Protected Overrides Sub OnMouseMove(e As System.Windows.Forms.MouseEventArgs) + 'Visualizzo le coordinate del mouse + ShowCursorPos(e.Location) + 'Secondo lo stato... + If e.Button = Windows.Forms.MouseButtons.Middle Then + If m_nStatus = ST.ZOOMWIN Then + Cursor = New Cursor(Me.GetType(), "ZoomWin.cur") + EgtSetWinRect(m_PrevPoint.X, m_PrevPoint.Y, e.Location.X, e.Location.Y) + Invalidate() + 'Il punto di riferimento deve rimanere quello originale + ElseIf m_nStatus = ST.ROT Then + Cursor = New Cursor(Me.GetType(), "Rotate.cur") + EgtRotateCamera(m_PrevPoint.X, m_PrevPoint.Y, e.Location.X, e.Location.Y) + Invalidate() + m_PrevPoint = e.Location + ElseIf m_nStatus = ST.PAN Then + Cursor = New Cursor(Me.GetType(), "Pan.cur") + EgtPanCamera(m_PrevPoint.X, m_PrevPoint.Y, e.Location.X, e.Location.Y) + Invalidate() + m_PrevPoint = e.Location + Else + m_nStatus = ST.NULL + Cursor = New Cursor(Me.GetType(), "Pointer.cur") + End If + Else + MyBase.OnMouseMove(e) + End If + End Sub + + Protected Overrides Sub OnMouseWheel(e As System.Windows.Forms.MouseEventArgs) + If Abs(e.Delta) < 30 Then + Return + End If + ' calcolo coefficiente + Const WHEEL_DELTA As Double = 120 + Dim dCoeff As Double = 1 - 0.1 * Abs(e.Delta) / WHEEL_DELTA + If e.Delta < 0 Then + dCoeff = 1 / dCoeff + End If + ' eseguo zoom + EgtZoomOnPoint(e.X, e.Y, dCoeff) + Invalidate() + End Sub + + Private Sub ShowCursorPos(ByVal WinXY As Point) + 'ricavo punto 3d + Dim ptWorld As Point3d + EgtUnProject(WinXY.X, WinXY.Y, ptWorld) + 'ricavo direzione di vista + Dim nDir As Integer + EgtGetCameraDir(nDir) + 'costruisco stringa con dati + Dim sCursorPos As New System.Text.StringBuilder + Select Case nDir + Case CT_TOP, CT_BOTTOM + sCursorPos.Append("X=") + sCursorPos.Append(ptWorld.x.ToString("F4", CultureInfo.InvariantCulture)) + sCursorPos.Append(" Y=") + sCursorPos.Append(ptWorld.y.ToString("F4", CultureInfo.InvariantCulture)) + Case CT_FRONT, CT_BACK + sCursorPos.Append("X=") + sCursorPos.Append(ptWorld.x.ToString("F4", CultureInfo.InvariantCulture)) + sCursorPos.Append(" Z=") + sCursorPos.Append(ptWorld.z.ToString("F4", CultureInfo.InvariantCulture)) + Case CT_LEFT, CT_RIGHT + sCursorPos.Append("Y=") + sCursorPos.Append(ptWorld.y.ToString("F4", CultureInfo.InvariantCulture)) + sCursorPos.Append(" Z=") + sCursorPos.Append(ptWorld.z.ToString("F4", CultureInfo.InvariantCulture)) + Case Else + sCursorPos.Append(" ") + End Select + ' lancio l'evento per visualizzare la stringa + RaiseEvent CursorPos(Me, sCursorPos.ToString) + End Sub + + Public Event CursorPos(ByVal sender As Object, ByVal sCursorPos As String) + +End Class diff --git a/TestEIn.sln b/TestEIn.sln new file mode 100644 index 0000000..d00a23f --- /dev/null +++ b/TestEIn.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestEIn", "TestEIn.vbproj", "{579B15B3-63F6-4805-B293-7B8FB6CCD17C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Debug|x64.ActiveCfg = Debug|x64 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Debug|x64.Build.0 = Debug|x64 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Debug|x86.ActiveCfg = Debug|x86 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Debug|x86.Build.0 = Debug|x86 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Release|x64.ActiveCfg = Release|x64 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Release|x64.Build.0 = Release|x64 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Release|x86.ActiveCfg = Release|x86 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TestEIn.vbproj b/TestEIn.vbproj new file mode 100644 index 0000000..5cc683d --- /dev/null +++ b/TestEIn.vbproj @@ -0,0 +1,242 @@ + + + + Debug + x86 + + + 2.0 + {579B15B3-63F6-4805-B293-7B8FB6CCD17C} + WinExe + TestEIn.My.MyApplication + TestEIn + TestEIn + 512 + WindowsForms + v4.0 + Client + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + x86 + true + full + true + true + bin\Debug32\ + + + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + x86 + None + false + true + true + bin\Release32\ + + + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Text + + + Off + + + On + + + true + true + true + bin\Debug64\ + + + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + full + x64 + false + false + + + true + bin\Release64\ + + + true + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + None + x64 + false + false + + + My Project\app.manifest + + + OnOutputUpdated + + + true + true + true + bin\Debug\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + full + AnyCPU + false + + + true + bin\Release\ + true + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + None + AnyCPU + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + Scene.vb + + + UserControl + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + False + Microsoft .NET Framework 4 Client Profile %28x86 e x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + copy c:\EgtDev\TestEIn\bin\Release32\TestEIn.exe c:\EgtProg\TestEIn\TestEInR32.exe +copy c:\EgtDev\TestEIn\bin\Debug32\TestEIn.exe c:\EgtProg\TestEIn\TestEInD32.exe +copy c:\EgtDev\TestEIn\bin\Release64\TestEIn.exe c:\EgtProg\TestEIn\TestEInR64.exe +copy c:\EgtDev\TestEIn\bin\Debug64\TestEIn.exe c:\EgtProg\TestEIn\TestEInD64.exe + + + \ No newline at end of file