From 9e22b7870ea3a9a38bed10d5f681c3f96c8b25ed Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 30 Oct 2014 08:53:46 +0000 Subject: [PATCH] TestEIn 1.5j6 : - notevoli miglioramenti a disegno e gestione pezzi/layer. --- EgtInterface.vb | 416 ++++++++++--- Form1.Designer.vb | 522 ++++++++++++++--- Form1.resx | 68 ++- Form1.vb | 963 ++++++++++++++++++++++++++----- GenInterface.vb | 4 +- My Project/AssemblyInfo.vb | 4 +- My Project/Resources.Designer.vb | 110 ++++ My Project/Resources.resx | 125 ++-- Resources/Arc3P.png | Bin 0 -> 340 bytes Resources/ArcCSE.png | Bin 0 -> 382 bytes Resources/Copy.png | Bin 0 -> 329 bytes Resources/Delete.png | Bin 0 -> 1063 bytes Resources/InvertCurve.png | Bin 0 -> 326 bytes Resources/Line2P.png | Bin 0 -> 321 bytes Resources/Mirror.png | Bin 0 -> 273 bytes Resources/Move.png | Bin 0 -> 374 bytes Resources/Plane.png | Bin 0 -> 277 bytes Resources/Point.png | Bin 0 -> 233 bytes Resources/Rotate.png | Bin 0 -> 334 bytes Resources/WinSelect.cur | Bin 0 -> 326 bytes Scene.Designer.vb | 55 +- Scene.vb | 427 ++++++++------ SelectMulti.vb | 6 +- TestEIn.vbproj | 36 ++ 24 files changed, 2156 insertions(+), 580 deletions(-) create mode 100644 Resources/Arc3P.png create mode 100644 Resources/ArcCSE.png create mode 100644 Resources/Copy.png create mode 100644 Resources/Delete.png create mode 100644 Resources/InvertCurve.png create mode 100644 Resources/Line2P.png create mode 100644 Resources/Mirror.png create mode 100644 Resources/Move.png create mode 100644 Resources/Plane.png create mode 100644 Resources/Point.png create mode 100644 Resources/Rotate.png create mode 100644 Resources/WinSelect.cur diff --git a/EgtInterface.vb b/EgtInterface.vb index d630271..e90294c 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -120,6 +120,27 @@ Structure Vector3d Return False End If End Function + ' Restituisce vettore in globale partendo da espressione nel riferimento dell'oggetto + Function Glob(ByVal nId As Integer) As Vector3d + Dim vtV As New Vector3d(x, y, z) + EgtVectorToIdGlob(vtV, nId) + Return vtV + End Function + ' Restituisce vettore nel riferimento dell'oggetto partendo da espressione in globale + Function Loc(ByVal nId As Integer) As Vector3d + Dim vtV As New Vector3d(x, y, z) + EgtVectorToIdLoc(vtV, nId) + Return vtV + End Function + ' Restituisce vettore nel riferimento del 2°oggetto partendo da espressione nel riferimento del 1° oggetto + Function LocLoc(ByVal nIdSou As Integer, ByVal nIdDest As Integer) As Vector3d + Dim vtV As New Vector3d(x, y, z) + If EgtVectorToIdGlob(vtV, nIdSou) And EgtVectorToIdLoc(vtV, nIdDest) Then + Return vtV + Else + Return Me + End If + End Function ' Versore Asse X Shared Function X_AX() As Vector3d Dim vtZ As New Vector3d(1, 0, 0) @@ -219,6 +240,27 @@ Structure Point3d Return False End If End Function + ' Restituisce punto in globale partendo da espressione nel riferimento dell'oggetto + Function Glob(ByVal nId As Integer) As Point3d + Dim ptP As New Point3d(x, y, z) + EgtPointToIdGlob(ptP, nId) + Return ptP + End Function + ' Restituisce punto nel riferimento dell'oggetto partendo da espressione in globale + Function Loc(ByVal nId As Integer) As Point3d + Dim ptP As New Point3d(x, y, z) + EgtPointToIdLoc(ptP, nId) + Return ptP + End Function + ' Restituisce punto nel riferimento del 2°oggetto partendo da espressione nel riferimento del 1° oggetto + Function LocLoc(ByVal nIdSou As Integer, ByVal nIdDest As Integer) As Point3d + Dim ptP As New Point3d(x, y, z) + If EgtPointToIdGlob(ptP, nIdSou) And EgtPointToIdLoc(ptP, nIdDest) Then + Return ptP + Else + Return Me + End If + End Function ' Punto Origine Shared Function ORIG() As Point3d Dim ptP As New Point3d(0, 0, 0) @@ -347,22 +389,42 @@ Class Frame3d Return False End If End Function + ' Riferimento Globale o Identità + Shared Function GLOB() As Frame3d + Dim frRef As New Frame3d + Return frRef + End Function End Class -Structure Color +Structure Color3d + ' Membri Dim R, G, B, A As Integer + ' Costruttori Sub New(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer, Optional ByVal nAlpha As Integer = 100) R = nRed G = nGreen B = nBlue A = nAlpha End Sub + ' Inizializzatori Sub Setup(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer, Optional ByVal nAlpha As Integer = 100) R = nRed G = nGreen B = nBlue A = nAlpha End Sub + ' Conversione a System.Drawing.Color + Function ToColor() As System.Drawing.Color + Return System.Drawing.Color.FromArgb(A * 255 / 100, R, G, B) + End Function + ' Conversione da System.Drawing.Color + Sub FromColor(ByVal SysCol As System.Drawing.Color) + R = SysCol.R + G = SysCol.G + B = SysCol.B + A = SysCol.A * 100 / 255 + End Sub + End Structure #If PLATFORM = "x64" Then @@ -445,6 +507,12 @@ Private Shared Function EgtVectorLocToLoc(ByRef X As Double, ByRef Y As Double, ByRef PtO2 As Point3d, ByRef VtX2 As Vector3d, ByRef VtY2 As Vector3d, ByRef VtZ2 As Vector3d) As Boolean End Function + +Public Shared Function EgtGetVectorRotation(ByRef VtS As Vector3d, ByRef VtE As Vector3d, ByRef VtAx As Vector3d, + ByRef dAngRotDeg As Double, ByRef bDet As Boolean) As Boolean +End Function + + Private Shared Function EgtPointTranslate(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef VtMove As Vector3d) As Boolean @@ -532,7 +600,7 @@ Public Shared Function EgtGetCurrentContext() As Integer End Function -Public Shared Function EgtSetDefaultMaterial(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Boolean +Public Shared Function EgtSetDefaultMaterial(ByRef DefCol As Color3d) As Boolean End Function @@ -544,7 +612,7 @@ Public Shared Function EgtOpenFile(ByVal sFilePath As String) As Boolean End Function -Public Shared Function EgtSaveFile(ByVal sFilePath As String, ByVal nFlag As Integer) As Boolean +Public Shared Function EgtSaveFile(ByVal sFilePath As String, ByVal nFlag As NGE) As Boolean End Function @@ -584,8 +652,40 @@ Public Shared Function EgtCreateGroup(ByVal nParentId As Integer) As Integer Return EgtCreateGroup(nParentId, Point3d.ORIG(), Vector3d.X_AX(), Vector3d.Y_AX(), Vector3d.Z_AX()) End Function + +Public Shared Function EgtCreateGeoPoint(ByVal nParentId As Integer, + ByRef PtP As Point3d) As Integer +End Function + + +Public Shared Function EgtCreateCurveLine(ByVal nParentId As Integer, + ByRef PtStart As Point3d, ByRef PtEnd As Point3d) As Integer +End Function + + +Public Shared Function EgtCreateCurveArc3P(ByVal nParentId As Integer, + ByRef PtStart As Point3d, ByRef PtMid As Point3d, ByRef PtEnd As Point3d) As Integer +End Function + + +Public Shared Function EgtCreateCurveArcC2PN(ByVal nParentId As Integer, + ByRef PtCen As Point3d, ByRef PtStart As Point3d, ByRef PtEnd As Point3d, + ByRef VtNorm As Vector3d) As Integer +End Function + + +Public Shared Function EgtCreateSurfTriMeshByContour(ByVal nParentId As Integer, ByVal nCrvId As Integer, ByVal dLinTol As Double) As Integer +End Function '---------- GeomDb Objects Modify ---------------------------------------------- + +Private Shared Function EgtChangeGroupFrame(ByVal nId As Integer, + ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean +End Function +Public Shared Function EgtChangeGroupFrame(ByVal nId As Integer, ByRef frRef As Frame3d) As Boolean + Return EgtChangeGroupFrame(nId, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) +End Function + Public Shared Function EgtFlipText(ByVal nId As Integer) As Boolean End Function @@ -595,9 +695,45 @@ Public Shared Function EgtMirrorText(ByVal nId As Integer, ByVal bOnL As Boolean End Function +'---------- GeomDb Curves Modify ----------------------------------------------- + +Public Shared Function EgtInvertCurve(ByVal nId As Integer) As Boolean +End Function + + +Public Shared Function EgtModifyCurveEndPoint(ByVal nId As Integer, ByRef PtEnd As Point3d) As Boolean +End Function + + +Public Shared Function EgtModifyCurveArc3P(ByVal nId As Integer, ByRef PtMid As Point3d) As Boolean +End Function + + +Public Shared Function EgtModifyCurveArcC2PN(ByVal nId As Integer, ByRef PtEnd As Point3d) As Boolean +End Function + + '---------- GeomDb Objects ----------------------------------------------------- -Public Shared Function EgtExistsObj(ByVal nGroupId As Integer) As Boolean +Public Shared Function EgtExistsObj(ByVal nId As Integer) As Boolean +End Function + + +Public Shared Function EgtGetParent(ByVal nId As Integer) As Integer +End Function + + +Private Shared Function EgtGetGroupGlobFrame(ByVal nId As Integer, + ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean +End Function +Public Shared Function EgtGetGroupGlobFrame(ByVal nId As Integer, ByRef frGRef As Frame3d) As Boolean + Dim PtOrig As Point3d + Dim VtDirX, VtDirY, VtDirZ As Vector3d + If Not EgtGetGroupGlobFrame(nId, PtOrig, VtDirX, VtDirY, VtDirZ) Then + Return False + Else + Return frGRef.Setup(PtOrig, VtDirX, VtDirY, VtDirZ) + End If End Function @@ -620,6 +756,22 @@ End Function Public Shared Function EgtGetPrev(ByVal nId As Integer) As Integer End Function + +Public Shared Function EgtGetFirstGroupInGroup(ByVal nGroupId As Integer) As Integer +End Function + + +Public Shared Function EgtGetNextGroup(ByVal nId As Integer) As Integer +End Function + + +Public Shared Function EgtGetLastGroupInGroup(ByVal nGroupId As Integer) As Integer +End Function + + +Public Shared Function EgtGetPrevGroup(ByVal nId As Integer) As Integer +End Function + Public Shared Function EgtGetBBox(ByVal nId As Integer, ByVal nFlag As Integer, ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean @@ -631,23 +783,23 @@ Public Shared Function EgtGetBBoxGlob(ByVal nId As Integer, ByVal nFlag As Integ End Function -Public Shared Function EgtCopy(ByVal nId As Integer, ByVal nRefId As Integer, ByVal nSonBeforeAfter As Integer) As Integer +Public Shared Function EgtCopy(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function -Public Shared Function EgtCopyGlob(ByVal nId As Integer, ByVal nRefId As Integer, ByVal nSonBeforeAfter As Integer) As Integer +Public Shared Function EgtCopyGlob(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function -Public Shared Function EgtRelocate(ByVal nId As Integer, ByVal nRefId As Integer, ByVal nSonBeforeAfter As Integer) As Integer +Public Shared Function EgtRelocate(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function -Public Shared Function EgtRelocateGlob(ByVal nId As Integer, ByVal nRefId As Integer, ByVal nSonBeforeAfter As Integer) As Integer +Public Shared Function EgtRelocateGlob(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function -Public Shared Function EgtErase(ByVal nId As Integer) As Integer +Public Shared Function EgtErase(ByVal nId As Integer) As Boolean End Function @@ -753,6 +905,18 @@ End Function Public Shared Function EgtGetCalcMark(ByVal nId As Integer, ByRef bMark As Boolean) As Boolean End Function + +Public Shared Function EgtSetColor(ByVal nId As Integer, ByRef ColObj As Color3d) As Boolean +End Function + + +Public Shared Function EgtGetColor(ByVal nId As Integer, ByRef ColObj As Color3d) As Boolean +End Function + + +Public Shared Function EgtGetCalcColor(ByVal nId As Integer, ByRef ColObj As Color3d) As Boolean +End Function + Public Shared Function EgtSetName(ByVal nId As Integer, ByVal sName As String) As Boolean End Function @@ -909,6 +1073,24 @@ Public Shared Function EgtShearGroup(ByVal nId As Integer, ByRef PtOn As Point3d End Function +'---------- GeomDb Snap Vector/Point/Frame ------------------------------------- + +Private Shared Function EgtVectorToIdGlob(ByRef VtV As Vector3d, ByVal nId As Integer) As Boolean +End Function + + +Private Shared Function EgtVectorToIdLoc(ByRef VtV As Vector3d, ByVal nId As Integer) As Boolean +End Function + + +Private Shared Function EgtPointToIdGlob(ByRef PtP As Point3d, ByVal nId As Integer) As Boolean +End Function + + +Private Shared Function EgtPointToIdLoc(ByRef PtP As Point3d, ByVal nId As Integer) As Boolean +End Function + + '---------- Scene -------------------------------------------------------------- Public Shared Function EgtInitScene(ByVal hWnd As IntPtr, ByVal nDriver As Integer, @@ -916,21 +1098,58 @@ Public Shared Function EgtInitScene(ByVal hWnd As IntPtr, ByVal nDriver As Integ 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, - Optional ByVal bRedraw As Boolean = True) As Boolean +Public Shared Function EgtSetBackground(ByRef colTop As Color3d, ByRef colBottom As Color3d, Optional ByVal bRedraw As Boolean = True) As Boolean End Function -Public Shared Function EgtSetMarkAttribs(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Boolean +Public Shared Function EgtSetMarkAttribs(ByRef colMark As Color3d) As Boolean End Function -Public Shared Function EgtSetGeoLineAttribs(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Boolean +Public Shared Function EgtSetGeoLineAttribs(ByRef colGl As Color3d) As Boolean End Function -Public Shared Function EgtSetWinRectAttribs(ByVal bOutline As Boolean, ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer, ByVal nAlpha As Integer) As Boolean +Public Shared Function EgtSetWinRectAttribs(ByVal bOutline As Boolean, ByRef colWr As Color3d) As Boolean +End Function + + +Public Shared Function EgtSetGridShow(ByVal bShowGrid As Boolean, ByVal bShowFrame As Boolean) As Boolean +End Function + + +Private Shared Function EgtSetGridFrame(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean +End Function +Public Shared Function EgtSetGridFrame(ByRef frRef As Frame3d) As Boolean + Return EgtSetGridFrame(frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) +End Function + + +Public Shared Function EgtSetGridGeo(ByVal dSnapStep As Double, ByVal nMinLineSstep As Integer, ByVal nMajLineSstep As Integer, ByVal nExtSstep As Integer) As Boolean +End Function + + +Public Shared Function EgtSetGridColor(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean +End Function + + +Private Shared Function EgtGetGridFrame(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean +End Function +Public Shared Function EgtGetGridFrame(ByRef frRef As Frame3d) As Boolean + Dim PtOrig As Point3d + Dim VtDirX, VtDirY, VtDirZ As Vector3d + If Not EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) Then + Return False + Else + Return frRef.Setup(PtOrig, VtDirX, VtDirY, VtDirZ) + End If +End Function + +Public Shared Function EgtGetGridVersZ() As Vector3d + Dim PtOrig As Point3d + Dim VtDirX, VtDirY, VtDirZ As Vector3d + EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) + Return VtDirZ End Function @@ -971,13 +1190,18 @@ Public Shared Function EgtUnselectableClearAll() As Boolean End Function -Public Shared Function EgtGetSelectedSnapPoint(ByVal nSnap As Integer, +Private Shared Function EgtGetGraphicSnapPoint(ByVal nSnap As Integer, ByVal nWinX As Integer, ByVal nWinY As Integer, ByVal nSelW As Integer, ByVal nSelH As Integer, ByRef ptP As Point3d) As Boolean End Function +Public Shared Function EgtGetGraphicSnapPoint(ByVal nSnap As Integer, + ByVal PtWin As Point, ByVal nSelW As Integer, ByVal nSelH As Integer, + ByRef ptP As Point3d) As Boolean + Return EgtGetGraphicSnapPoint(nSnap, PtWin.X, PtWin.Y, nSelW, nSelH, ptP) +End Function -Public Shared Function EgtSetShowMode(ByVal nShowMode As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean +Public Shared Function EgtSetShowMode(ByVal nShowMode As SM, Optional ByVal bRedraw As Boolean = True) As Boolean End Function @@ -993,7 +1217,7 @@ Public Shared Function EgtGetShowCurveDirection() As Boolean End Function -Public Shared Function EgtZoom(ByVal nZoom As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean +Public Shared Function EgtZoom(ByVal nZoom As ZM, Optional ByVal bRedraw As Boolean = True) As Boolean End Function @@ -1030,7 +1254,7 @@ Public Shared Function EgtZoomWin(ByVal Prev As Point, ByVal Curr As Point, Opti End Function -Public Shared Function EgtSetView(ByVal nView As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean +Public Shared Function EgtSetView(ByVal nView As VT, Optional ByVal bRedraw As Boolean = True) As Boolean End Function @@ -1101,80 +1325,108 @@ End Function Public Const EPS_SMALL As Double = 0.001 Public Const EPS_ZERO As Double = 0.0000001 'Costanti : TIPO DI FILE -Public Const FT_NULL As Integer = 0 -Public Const FT_NGE As Integer = 1 -Public Const FT_NFE As Integer = 2 -Public Const FT_DXF As Integer = 11 -Public Const FT_STL As Integer = 12 -Public Const FT_CNC As Integer = 13 -Public Const FT_TSC As Integer = 101 -Public Const FT_LUA As Integer = 102 +Public Enum FT As Integer + NULL = 0 + NGE = 1 + NFE = 2 + DXF = 11 + STL = 12 + CNC = 13 + TSC = 101 + LUA = 102 +End Enum 'Costanti : FORMATO FILE NGE -Public Const NGE_TEXT As Integer = 0 -Public Const NGE_BIN As Integer = 1 -Public Const NGE_CMPTEXT As Integer = 2 +Public Enum NGE As Integer + TEXT = 0 + BIN = 1 + CMPTEXT = 2 +End Enum 'Costanti : ID GEOMDB -Public Const GDB_ID_ROOT As Integer = 0 -Public Const GDB_ID_NULL As Integer = -1 -Public Const GDB_ID_SEL As Integer = -2 +Public Enum GDB_ID As Integer + ROOT = 0 + NULL = -1 + SEL = -2 +End Enum 'Costanti : TIPO OGGETTI -Public Const TY_NONE As Integer = 0 -Public Const TY_GROUP As Integer = 2 -Public Const TY_GEO_VECTOR As Integer = 128 -Public Const TY_GEO_POINT As Integer = 129 -Public Const TY_GEO_FRAME As Integer = 130 -Public Const TY_CRV_LINE As Integer = 256 -Public Const TY_CRV_ARC As Integer = 257 -Public Const TY_CRV_BEZ As Integer = 258 -Public Const TY_CRV_COMPO As Integer = 259 -Public Const TY_SRF_MESH As Integer = 512 -Public Const TY_EXT_TEXT As Integer = 1024 +Public Enum TY As Integer + NONE = 0 + GROUP = 2 + GEO_VECTOR = 128 + GEO_POINT = 129 + GEO_FRAME = 130 + CRV_LINE = 256 + CRV_ARC = 257 + CRV_BEZ = 258 + CRV_COMPO = 259 + SRF_MESH = 512 + EXT_TEXT = 1024 +End Enum 'Costanti : POSIZIONE DI COPIA DI UN OGGETTO -Public Const GDB_BEFORE As Integer = -1 -Public Const GDB_SON As Integer = 0 -Public Const GDB_AFTER As Integer = 1 +Public Enum GDB_POS As Integer + BEFORE = -1 + SON = 0 + AFTER = 1 +End Enum 'Costanti : LIVELLO DI UN OGGETTO -Public Const GDB_LV_USER As Integer = 1 -Public Const GDB_LV_SYSTEM As Integer = 2 -Public Const GDB_LV_TEMP As Integer = 3 +Public Enum GDB_LV As Integer + USER = 1 + SYSTEM = 2 + TEMP = 3 +End Enum 'Costanti : MODO DI UN OGGETTO -Public Const GDB_MD_STD As Integer = 1 -Public Const GDB_MD_LOCKED As Integer = 2 -Public Const GDB_MD_HIDDEN As Integer = 3 +Public Enum GDB_MD As Integer + STD = 1 + LOCKED = 2 + HIDDEN = 3 +End Enum 'Costanti : STATO DI UN OGGETTO -Public Const GDB_ST_OFF As Integer = 0 -Public Const GDB_ST_ON As Integer = 1 -Public Const GDB_ST_SEL As Integer = 2 +Public Enum GDB_ST As Integer + OFF = 0 + ON_ = 1 + SEL = 2 +End Enum 'Costanti : TIPO VISUALIZZAZIONE -Public Const SM_WIREFRAME As Integer = 0 -Public Const SM_HIDDENLINE As Integer = 1 -Public Const SM_SHADING As Integer = 2 +Public Enum SM As Integer + WIREFRAME = 0 + HIDDENLINE = 1 + SHADING = 2 +End Enum 'Costanti : TIPO ZOOM -Public Const ZM_ALL As Integer = 1 -Public Const ZM_IN As Integer = 2 -Public Const ZM_OUT As Integer = 3 +Public Enum ZM As Integer + ALL = 1 + IN_ = 2 + OUT = 3 +End Enum '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 +Public Enum VT As Integer + NONE = 0 + TOP = 1 + FRONT = 2 + RIGHT = 3 + BACK = 4 + LEFT = 5 + BOTTOM = 6 + ISO_SW = 7 + ISO_SE = 8 + ISO_NE = 9 + ISO_NW = 10 +End Enum 'Costanti : TIPO SNAP POINT -Public Const SP_END As Integer = 0 -Public Const SP_MID As Integer = 1 -Public Const SP_CENTER As Integer = 2 -Public Const SP_NEAR As Integer = 3 +Public Enum SP As Integer + PT_SKETCH = 0 + PT_GRID = 1 + PT_END = 2 + PT_MID = 3 + CENTER = 4 + PT_NEAR = 5 +End Enum 'Costanti : flag per BBOX -Public Const BBF_STANDARD As Integer = 0 -Public Const BBF_ONLY_VISIBLE As Integer = 1 -Public Const BBF_IGNORE_TEXT As Integer = 2 -Public Const BBF_IGNORE_DIM As Integer = 3 -Public Const BBF_EXACT As Integer = 4 +Public Enum BBF As Integer + STANDARD = 0 + ONLY_VISIBLE = 1 + IGNORE_TEXT = 2 + IGNORE_DIM = 3 + EXACT = 4 +End Enum End Class diff --git a/Form1.Designer.vb b/Form1.Designer.vb index 65df7df..2336654 100644 --- a/Form1.Designer.vb +++ b/Form1.Designer.vb @@ -25,7 +25,6 @@ Partial Class Form1 Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() - Me.Scene1 = New TestEIn.Scene() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.ToolStripStatusOnL = New System.Windows.Forms.ToolStripStatusLabel() Me.ToolStripStatusOutput = New System.Windows.Forms.ToolStripStatusLabel() @@ -68,16 +67,38 @@ Partial Class Form1 Me.tboxCmd = New System.Windows.Forms.TextBox() Me.TreeView1 = New System.Windows.Forms.TreeView() Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components) + Me.Panel1 = New System.Windows.Forms.Panel() + Me.txtColor = New System.Windows.Forms.TextBox() + Me.btnColor = New System.Windows.Forms.Button() + Me.btnNewLayer = New System.Windows.Forms.Button() + Me.txtPartLay = New System.Windows.Forms.TextBox() + Me.btnNewPart = New System.Windows.Forms.Button() Me.TabControl2 = New System.Windows.Forms.TabControl() Me.TabDraw = New System.Windows.Forms.TabPage() - Me.TabTest = New System.Windows.Forms.TabPage() - Me.btnMove = New System.Windows.Forms.Button() - Me.btnRotM90 = New System.Windows.Forms.Button() - Me.btnRotP90 = New System.Windows.Forms.Button() + Me.btnArc3P = New System.Windows.Forms.Button() + Me.btnArcCSE = New System.Windows.Forms.Button() + Me.btnPoint = New System.Windows.Forms.Button() + Me.btnLine2P = New System.Windows.Forms.Button() + Me.TabConstruct = New System.Windows.Forms.TabPage() + Me.btnPlane = New System.Windows.Forms.Button() + Me.TabEdit = New System.Windows.Forms.TabPage() + Me.btnDelete = New System.Windows.Forms.Button() + Me.TabTransform = New System.Windows.Forms.TabPage() Me.btnMirror = New System.Windows.Forms.Button() + Me.btnCopy = New System.Windows.Forms.Button() + Me.btnRotate = New System.Windows.Forms.Button() + Me.btnMove = New System.Windows.Forms.Button() + Me.TabTest = New System.Windows.Forms.TabPage() + Me.XbtnRotM90 = New System.Windows.Forms.Button() + Me.XbtnRotP90 = New System.Windows.Forms.Button() + Me.XbtnMirror = New System.Windows.Forms.Button() Me.OpenFileDialog = New System.Windows.Forms.OpenFileDialog() Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog() Me.btnGetDist = New System.Windows.Forms.CheckBox() + Me.ObjTreeTimer = New System.Windows.Forms.Timer(Me.components) + Me.ColorDialog1 = New System.Windows.Forms.ColorDialog() + Me.Scene1 = New TestEIn.Scene() + Me.btnInvertCurve = New System.Windows.Forms.Button() Me.TableLayoutPanel1.SuspendLayout() Me.StatusStrip1.SuspendLayout() Me.TabControl1.SuspendLayout() @@ -88,7 +109,12 @@ Partial Class Form1 CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit() Me.TableLayoutPanel3.SuspendLayout() + Me.Panel1.SuspendLayout() Me.TabControl2.SuspendLayout() + Me.TabDraw.SuspendLayout() + Me.TabConstruct.SuspendLayout() + Me.TabEdit.SuspendLayout() + Me.TabTransform.SuspendLayout() Me.TabTest.SuspendLayout() Me.SuspendLayout() ' @@ -111,19 +137,9 @@ Partial Class Form1 Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 80.0!)) 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(1056, 473) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(1056, 533) Me.TableLayoutPanel1.TabIndex = 0 ' - 'Scene1 - ' - Me.Scene1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.Scene1.Cursor = System.Windows.Forms.Cursors.Default - Me.Scene1.Dock = System.Windows.Forms.DockStyle.Fill - Me.Scene1.Location = New System.Drawing.Point(92, 83) - Me.Scene1.Name = "Scene1" - Me.Scene1.Size = New System.Drawing.Size(755, 365) - Me.Scene1.TabIndex = 1 - ' 'StatusStrip1 ' Me.StatusStrip1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ @@ -131,7 +147,7 @@ Partial Class Form1 Me.TableLayoutPanel1.SetColumnSpan(Me.StatusStrip1, 3) Me.StatusStrip1.Dock = System.Windows.Forms.DockStyle.None Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusOnL, Me.ToolStripStatusOutput, Me.ToolStripStatusCursorPos, Me.ToolStripStatusOnR}) - Me.StatusStrip1.Location = New System.Drawing.Point(0, 451) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 511) Me.StatusStrip1.MaximumSize = New System.Drawing.Size(0, 22) Me.StatusStrip1.MinimumSize = New System.Drawing.Size(0, 22) Me.StatusStrip1.Name = "StatusStrip1" @@ -724,33 +740,37 @@ Partial Class Form1 ' Me.TableLayoutPanel3.ColumnCount = 1 Me.TableLayoutPanel3.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) - Me.TableLayoutPanel3.Controls.Add(Me.tBoxInfo, 0, 1) - Me.TableLayoutPanel3.Controls.Add(Me.tboxCmd, 0, 2) - Me.TableLayoutPanel3.Controls.Add(Me.TreeView1, 0, 0) + Me.TableLayoutPanel3.Controls.Add(Me.tBoxInfo, 0, 2) + Me.TableLayoutPanel3.Controls.Add(Me.tboxCmd, 0, 3) + Me.TableLayoutPanel3.Controls.Add(Me.TreeView1, 0, 1) + Me.TableLayoutPanel3.Controls.Add(Me.Panel1, 0, 0) Me.TableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill Me.TableLayoutPanel3.Location = New System.Drawing.Point(853, 83) Me.TableLayoutPanel3.Name = "TableLayoutPanel3" - Me.TableLayoutPanel3.RowCount = 3 + Me.TableLayoutPanel3.RowCount = 4 + Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50.0!)) Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 60.0!)) Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40.0!)) Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 80.0!)) - Me.TableLayoutPanel3.Size = New System.Drawing.Size(200, 365) + Me.TableLayoutPanel3.Size = New System.Drawing.Size(200, 425) Me.TableLayoutPanel3.TabIndex = 9 ' 'tBoxInfo ' + Me.tBoxInfo.BackColor = System.Drawing.SystemColors.ControlLightLight Me.tBoxInfo.Dock = System.Windows.Forms.DockStyle.Fill - Me.tBoxInfo.Location = New System.Drawing.Point(3, 174) + Me.tBoxInfo.Location = New System.Drawing.Point(3, 230) Me.tBoxInfo.Multiline = True Me.tBoxInfo.Name = "tBoxInfo" + Me.tBoxInfo.ReadOnly = True Me.tBoxInfo.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.tBoxInfo.Size = New System.Drawing.Size(194, 108) + Me.tBoxInfo.Size = New System.Drawing.Size(194, 112) Me.tBoxInfo.TabIndex = 24 ' 'tboxCmd ' Me.tboxCmd.Dock = System.Windows.Forms.DockStyle.Fill - Me.tboxCmd.Location = New System.Drawing.Point(3, 288) + Me.tboxCmd.Location = New System.Drawing.Point(3, 348) Me.tboxCmd.Multiline = True Me.tboxCmd.Name = "tboxCmd" Me.tboxCmd.ScrollBars = System.Windows.Forms.ScrollBars.Vertical @@ -764,10 +784,10 @@ Partial Class Form1 Me.TreeView1.HideSelection = False Me.TreeView1.ImageIndex = 0 Me.TreeView1.ImageList = Me.ImageList1 - Me.TreeView1.Location = New System.Drawing.Point(3, 3) + Me.TreeView1.Location = New System.Drawing.Point(3, 53) Me.TreeView1.Name = "TreeView1" Me.TreeView1.SelectedImageIndex = 0 - Me.TreeView1.Size = New System.Drawing.Size(194, 165) + Me.TreeView1.Size = New System.Drawing.Size(194, 171) Me.TreeView1.TabIndex = 0 ' 'ImageList1 @@ -777,20 +797,87 @@ Partial Class Form1 Me.ImageList1.Images.SetKeyName(0, "Maters.ico") Me.ImageList1.Images.SetKeyName(1, "NoGeo.ico") Me.ImageList1.Images.SetKeyName(2, "Group.ico") - Me.ImageList1.Images.SetKeyName(3, "Vector.ico") - Me.ImageList1.Images.SetKeyName(4, "Point.ico") - Me.ImageList1.Images.SetKeyName(5, "Frame.ico") - Me.ImageList1.Images.SetKeyName(6, "Line.ico") - Me.ImageList1.Images.SetKeyName(7, "Arc.ico") - Me.ImageList1.Images.SetKeyName(8, "CBezier.ico") - Me.ImageList1.Images.SetKeyName(9, "CCompo.ico") - Me.ImageList1.Images.SetKeyName(10, "STriMesh.ico") - Me.ImageList1.Images.SetKeyName(11, "text.ico") + Me.ImageList1.Images.SetKeyName(3, "Part.ico") + Me.ImageList1.Images.SetKeyName(4, "Layer.ico") + Me.ImageList1.Images.SetKeyName(5, "Vector.ico") + Me.ImageList1.Images.SetKeyName(6, "Point.ico") + Me.ImageList1.Images.SetKeyName(7, "Frame.ico") + Me.ImageList1.Images.SetKeyName(8, "Line.ico") + Me.ImageList1.Images.SetKeyName(9, "Arc.ico") + Me.ImageList1.Images.SetKeyName(10, "CBezier.ico") + Me.ImageList1.Images.SetKeyName(11, "CCompo.ico") + Me.ImageList1.Images.SetKeyName(12, "STriMesh.ico") + Me.ImageList1.Images.SetKeyName(13, "text.ico") + ' + 'Panel1 + ' + Me.Panel1.AutoSize = True + Me.Panel1.Controls.Add(Me.txtColor) + Me.Panel1.Controls.Add(Me.btnColor) + Me.Panel1.Controls.Add(Me.btnNewLayer) + Me.Panel1.Controls.Add(Me.txtPartLay) + Me.Panel1.Controls.Add(Me.btnNewPart) + Me.Panel1.Location = New System.Drawing.Point(0, 0) + Me.Panel1.Margin = New System.Windows.Forms.Padding(0) + Me.Panel1.Name = "Panel1" + Me.Panel1.Size = New System.Drawing.Size(200, 50) + Me.Panel1.TabIndex = 25 + ' + 'txtColor + ' + Me.txtColor.BackColor = System.Drawing.SystemColors.ControlLightLight + Me.txtColor.Location = New System.Drawing.Point(171, 0) + Me.txtColor.Name = "txtColor" + Me.txtColor.ReadOnly = True + Me.txtColor.Size = New System.Drawing.Size(26, 20) + Me.txtColor.TabIndex = 1 + ' + 'btnColor + ' + Me.btnColor.Location = New System.Drawing.Point(146, 23) + Me.btnColor.Name = "btnColor" + Me.btnColor.Size = New System.Drawing.Size(51, 24) + Me.btnColor.TabIndex = 28 + Me.btnColor.Text = "Color" + Me.btnColor.UseVisualStyleBackColor = True + ' + 'btnNewLayer + ' + Me.btnNewLayer.Location = New System.Drawing.Point(73, 23) + Me.btnNewLayer.Margin = New System.Windows.Forms.Padding(2) + Me.btnNewLayer.Name = "btnNewLayer" + Me.btnNewLayer.Size = New System.Drawing.Size(70, 24) + Me.btnNewLayer.TabIndex = 27 + Me.btnNewLayer.Text = "New Layer" + Me.btnNewLayer.UseVisualStyleBackColor = True + ' + 'txtPartLay + ' + Me.txtPartLay.BackColor = System.Drawing.SystemColors.ControlLightLight + Me.txtPartLay.Location = New System.Drawing.Point(0, 0) + Me.txtPartLay.Margin = New System.Windows.Forms.Padding(2, 0, 2, 2) + Me.txtPartLay.Name = "txtPartLay" + Me.txtPartLay.ReadOnly = True + Me.txtPartLay.Size = New System.Drawing.Size(173, 20) + Me.txtPartLay.TabIndex = 25 + ' + 'btnNewPart + ' + Me.btnNewPart.Location = New System.Drawing.Point(0, 23) + Me.btnNewPart.Margin = New System.Windows.Forms.Padding(2) + Me.btnNewPart.Name = "btnNewPart" + Me.btnNewPart.Size = New System.Drawing.Size(70, 24) + Me.btnNewPart.TabIndex = 26 + Me.btnNewPart.Text = "New Part" + Me.btnNewPart.UseVisualStyleBackColor = True ' 'TabControl2 ' Me.TabControl2.Alignment = System.Windows.Forms.TabAlignment.Left Me.TabControl2.Controls.Add(Me.TabDraw) + Me.TabControl2.Controls.Add(Me.TabConstruct) + Me.TabControl2.Controls.Add(Me.TabEdit) + Me.TabControl2.Controls.Add(Me.TabTransform) Me.TabControl2.Controls.Add(Me.TabTest) Me.TabControl2.Dock = System.Windows.Forms.DockStyle.Fill Me.TabControl2.HotTrack = True @@ -798,74 +885,158 @@ Partial Class Form1 Me.TabControl2.Multiline = True Me.TabControl2.Name = "TabControl2" Me.TabControl2.SelectedIndex = 0 - Me.TabControl2.Size = New System.Drawing.Size(83, 365) + Me.TabControl2.Size = New System.Drawing.Size(83, 425) Me.TabControl2.TabIndex = 10 ' 'TabDraw ' Me.TabDraw.BackColor = System.Drawing.SystemColors.Control + Me.TabDraw.Controls.Add(Me.btnArc3P) + Me.TabDraw.Controls.Add(Me.btnArcCSE) + Me.TabDraw.Controls.Add(Me.btnPoint) + Me.TabDraw.Controls.Add(Me.btnLine2P) Me.TabDraw.Location = New System.Drawing.Point(23, 4) Me.TabDraw.Name = "TabDraw" Me.TabDraw.Padding = New System.Windows.Forms.Padding(3) - Me.TabDraw.Size = New System.Drawing.Size(56, 357) + Me.TabDraw.Size = New System.Drawing.Size(56, 417) Me.TabDraw.TabIndex = 0 Me.TabDraw.Text = "Draw" ' - 'TabTest + 'btnArc3P ' - Me.TabTest.BackColor = System.Drawing.SystemColors.Control - Me.TabTest.Controls.Add(Me.btnMove) - Me.TabTest.Controls.Add(Me.btnRotM90) - Me.TabTest.Controls.Add(Me.btnRotP90) - Me.TabTest.Controls.Add(Me.btnMirror) - Me.TabTest.Location = New System.Drawing.Point(23, 4) - Me.TabTest.Name = "TabTest" - Me.TabTest.Padding = New System.Windows.Forms.Padding(3) - Me.TabTest.Size = New System.Drawing.Size(56, 357) - Me.TabTest.TabIndex = 1 - Me.TabTest.Text = "Test" + Me.btnArc3P.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnArc3P.FlatAppearance.BorderSize = 0 + Me.btnArc3P.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnArc3P.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnArc3P.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnArc3P.Image = Global.TestEIn.My.Resources.Resources.Arc3P + Me.btnArc3P.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnArc3P.Location = New System.Drawing.Point(0, 144) + Me.btnArc3P.Name = "btnArc3P" + Me.btnArc3P.Size = New System.Drawing.Size(56, 48) + Me.btnArc3P.TabIndex = 33 + Me.btnArc3P.Text = "Arc 3p" + Me.btnArc3P.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnArc3P.UseVisualStyleBackColor = False ' - 'btnMove + 'btnArcCSE ' - Me.btnMove.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control - Me.btnMove.FlatAppearance.BorderSize = 0 - Me.btnMove.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control - Me.btnMove.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption - Me.btnMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnMove.Location = New System.Drawing.Point(0, 144) - Me.btnMove.Name = "btnMove" - Me.btnMove.Size = New System.Drawing.Size(56, 48) - Me.btnMove.TabIndex = 29 - Me.btnMove.Text = "Move" - Me.btnMove.UseVisualStyleBackColor = False + Me.btnArcCSE.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnArcCSE.FlatAppearance.BorderSize = 0 + Me.btnArcCSE.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnArcCSE.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnArcCSE.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnArcCSE.Image = Global.TestEIn.My.Resources.Resources.ArcCSE + Me.btnArcCSE.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnArcCSE.Location = New System.Drawing.Point(0, 96) + Me.btnArcCSE.Name = "btnArcCSE" + Me.btnArcCSE.Size = New System.Drawing.Size(56, 48) + Me.btnArcCSE.TabIndex = 32 + Me.btnArcCSE.Text = "Arc cse" + Me.btnArcCSE.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnArcCSE.UseVisualStyleBackColor = False ' - 'btnRotM90 + 'btnPoint ' - Me.btnRotM90.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control - Me.btnRotM90.FlatAppearance.BorderSize = 0 - Me.btnRotM90.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control - Me.btnRotM90.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption - Me.btnRotM90.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnRotM90.Location = New System.Drawing.Point(0, 96) - Me.btnRotM90.Name = "btnRotM90" - Me.btnRotM90.Size = New System.Drawing.Size(56, 48) - Me.btnRotM90.TabIndex = 27 - Me.btnRotM90.Text = "Rot-90" - Me.btnRotM90.UseVisualStyleBackColor = False + Me.btnPoint.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnPoint.FlatAppearance.BorderSize = 0 + Me.btnPoint.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnPoint.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnPoint.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnPoint.Image = Global.TestEIn.My.Resources.Resources.Point + Me.btnPoint.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnPoint.Location = New System.Drawing.Point(0, 0) + Me.btnPoint.Name = "btnPoint" + Me.btnPoint.Size = New System.Drawing.Size(56, 48) + Me.btnPoint.TabIndex = 31 + Me.btnPoint.Text = "Point" + Me.btnPoint.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnPoint.UseVisualStyleBackColor = False ' - 'btnRotP90 + 'btnLine2P ' - Me.btnRotP90.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control - Me.btnRotP90.FlatAppearance.BorderSize = 0 - Me.btnRotP90.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control - Me.btnRotP90.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption - Me.btnRotP90.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnRotP90.Location = New System.Drawing.Point(0, 0) - Me.btnRotP90.Name = "btnRotP90" - Me.btnRotP90.Size = New System.Drawing.Size(56, 48) - Me.btnRotP90.TabIndex = 26 - Me.btnRotP90.Text = "Rot+90" - Me.btnRotP90.UseVisualStyleBackColor = False + Me.btnLine2P.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnLine2P.FlatAppearance.BorderSize = 0 + Me.btnLine2P.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnLine2P.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnLine2P.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnLine2P.Image = Global.TestEIn.My.Resources.Resources.Line2P + Me.btnLine2P.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnLine2P.Location = New System.Drawing.Point(0, 48) + Me.btnLine2P.Name = "btnLine2P" + Me.btnLine2P.Size = New System.Drawing.Size(56, 48) + Me.btnLine2P.TabIndex = 30 + Me.btnLine2P.Text = "Line 2p" + Me.btnLine2P.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnLine2P.UseVisualStyleBackColor = False + ' + 'TabConstruct + ' + Me.TabConstruct.BackColor = System.Drawing.SystemColors.Control + Me.TabConstruct.Controls.Add(Me.btnPlane) + Me.TabConstruct.Location = New System.Drawing.Point(23, 4) + Me.TabConstruct.Name = "TabConstruct" + Me.TabConstruct.Size = New System.Drawing.Size(56, 417) + Me.TabConstruct.TabIndex = 4 + Me.TabConstruct.Text = "Construct" + ' + 'btnPlane + ' + Me.btnPlane.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnPlane.FlatAppearance.BorderSize = 0 + Me.btnPlane.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnPlane.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnPlane.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnPlane.Image = Global.TestEIn.My.Resources.Resources.Plane + Me.btnPlane.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnPlane.Location = New System.Drawing.Point(0, 0) + Me.btnPlane.Name = "btnPlane" + Me.btnPlane.Size = New System.Drawing.Size(56, 48) + Me.btnPlane.TabIndex = 33 + Me.btnPlane.Text = "Plane" + Me.btnPlane.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnPlane.UseVisualStyleBackColor = False + ' + 'TabEdit + ' + Me.TabEdit.BackColor = System.Drawing.SystemColors.Control + Me.TabEdit.Controls.Add(Me.btnInvertCurve) + Me.TabEdit.Controls.Add(Me.btnDelete) + Me.TabEdit.Location = New System.Drawing.Point(23, 4) + Me.TabEdit.Name = "TabEdit" + Me.TabEdit.Size = New System.Drawing.Size(56, 417) + Me.TabEdit.TabIndex = 3 + Me.TabEdit.Text = "Edit" + ' + 'btnDelete + ' + Me.btnDelete.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnDelete.FlatAppearance.BorderSize = 0 + Me.btnDelete.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnDelete.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnDelete.Image = Global.TestEIn.My.Resources.Resources.Delete + Me.btnDelete.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnDelete.Location = New System.Drawing.Point(0, 0) + Me.btnDelete.Name = "btnDelete" + Me.btnDelete.Size = New System.Drawing.Size(56, 48) + Me.btnDelete.TabIndex = 30 + Me.btnDelete.Text = "Delete" + Me.btnDelete.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnDelete.UseVisualStyleBackColor = False + ' + 'TabTransform + ' + Me.TabTransform.BackColor = System.Drawing.SystemColors.Control + Me.TabTransform.Controls.Add(Me.btnMirror) + Me.TabTransform.Controls.Add(Me.btnCopy) + Me.TabTransform.Controls.Add(Me.btnRotate) + Me.TabTransform.Controls.Add(Me.btnMove) + Me.TabTransform.Location = New System.Drawing.Point(23, 4) + Me.TabTransform.Name = "TabTransform" + Me.TabTransform.Size = New System.Drawing.Size(56, 417) + Me.TabTransform.TabIndex = 2 + Me.TabTransform.Text = "Transform" ' 'btnMirror ' @@ -874,13 +1045,122 @@ Partial Class Form1 Me.btnMirror.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control Me.btnMirror.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption Me.btnMirror.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnMirror.Location = New System.Drawing.Point(0, 48) + Me.btnMirror.Image = Global.TestEIn.My.Resources.Resources.Mirror + Me.btnMirror.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnMirror.Location = New System.Drawing.Point(0, 144) Me.btnMirror.Name = "btnMirror" Me.btnMirror.Size = New System.Drawing.Size(56, 48) - Me.btnMirror.TabIndex = 28 + Me.btnMirror.TabIndex = 32 Me.btnMirror.Text = "Mirror" + Me.btnMirror.TextAlign = System.Drawing.ContentAlignment.BottomCenter Me.btnMirror.UseVisualStyleBackColor = False ' + 'btnCopy + ' + Me.btnCopy.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnCopy.FlatAppearance.BorderSize = 0 + Me.btnCopy.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnCopy.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnCopy.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnCopy.Image = Global.TestEIn.My.Resources.Resources.Copy + Me.btnCopy.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnCopy.Location = New System.Drawing.Point(0, 48) + Me.btnCopy.Name = "btnCopy" + Me.btnCopy.Size = New System.Drawing.Size(56, 48) + Me.btnCopy.TabIndex = 31 + Me.btnCopy.Text = "Copy" + Me.btnCopy.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnCopy.UseVisualStyleBackColor = False + ' + 'btnRotate + ' + Me.btnRotate.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnRotate.FlatAppearance.BorderSize = 0 + Me.btnRotate.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnRotate.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnRotate.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnRotate.Image = Global.TestEIn.My.Resources.Resources.Rotate + Me.btnRotate.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnRotate.Location = New System.Drawing.Point(0, 96) + Me.btnRotate.Name = "btnRotate" + Me.btnRotate.Size = New System.Drawing.Size(56, 48) + Me.btnRotate.TabIndex = 30 + Me.btnRotate.Text = "Rotate" + Me.btnRotate.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnRotate.UseVisualStyleBackColor = False + ' + 'btnMove + ' + Me.btnMove.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnMove.FlatAppearance.BorderSize = 0 + Me.btnMove.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnMove.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnMove.Image = Global.TestEIn.My.Resources.Resources.Move + Me.btnMove.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnMove.Location = New System.Drawing.Point(0, 0) + Me.btnMove.Name = "btnMove" + Me.btnMove.Size = New System.Drawing.Size(56, 48) + Me.btnMove.TabIndex = 29 + Me.btnMove.Text = "Move" + Me.btnMove.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnMove.UseVisualStyleBackColor = False + ' + 'TabTest + ' + Me.TabTest.BackColor = System.Drawing.SystemColors.Control + Me.TabTest.Controls.Add(Me.XbtnRotM90) + Me.TabTest.Controls.Add(Me.XbtnRotP90) + Me.TabTest.Controls.Add(Me.XbtnMirror) + Me.TabTest.Location = New System.Drawing.Point(23, 4) + Me.TabTest.Name = "TabTest" + Me.TabTest.Padding = New System.Windows.Forms.Padding(3) + Me.TabTest.Size = New System.Drawing.Size(56, 417) + Me.TabTest.TabIndex = 1 + Me.TabTest.Text = "Test" + ' + 'XbtnRotM90 + ' + Me.XbtnRotM90.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.XbtnRotM90.FlatAppearance.BorderSize = 0 + Me.XbtnRotM90.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.XbtnRotM90.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.XbtnRotM90.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.XbtnRotM90.Location = New System.Drawing.Point(0, 96) + Me.XbtnRotM90.Name = "XbtnRotM90" + Me.XbtnRotM90.Size = New System.Drawing.Size(56, 48) + Me.XbtnRotM90.TabIndex = 27 + Me.XbtnRotM90.Text = "Rot-90" + Me.XbtnRotM90.UseVisualStyleBackColor = False + ' + 'XbtnRotP90 + ' + Me.XbtnRotP90.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.XbtnRotP90.FlatAppearance.BorderSize = 0 + Me.XbtnRotP90.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.XbtnRotP90.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.XbtnRotP90.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.XbtnRotP90.Location = New System.Drawing.Point(0, 0) + Me.XbtnRotP90.Name = "XbtnRotP90" + Me.XbtnRotP90.Size = New System.Drawing.Size(56, 48) + Me.XbtnRotP90.TabIndex = 26 + Me.XbtnRotP90.Text = "Rot+90" + Me.XbtnRotP90.UseVisualStyleBackColor = False + ' + 'XbtnMirror + ' + Me.XbtnMirror.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.XbtnMirror.FlatAppearance.BorderSize = 0 + Me.XbtnMirror.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.XbtnMirror.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.XbtnMirror.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.XbtnMirror.Location = New System.Drawing.Point(0, 48) + Me.XbtnMirror.Name = "XbtnMirror" + Me.XbtnMirror.Size = New System.Drawing.Size(56, 48) + Me.XbtnMirror.TabIndex = 28 + Me.XbtnMirror.Text = "Mirror" + Me.XbtnMirror.UseVisualStyleBackColor = False + ' 'OpenFileDialog ' Me.OpenFileDialog.DefaultExt = "Nge" @@ -900,13 +1180,44 @@ Partial Class Form1 Me.btnGetDist.Text = "Get Dist" Me.btnGetDist.UseVisualStyleBackColor = True ' + 'ObjTreeTimer + ' + Me.ObjTreeTimer.Interval = 2000 + ' + 'Scene1 + ' + Me.Scene1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.Scene1.Cursor = System.Windows.Forms.Cursors.Default + Me.Scene1.Dock = System.Windows.Forms.DockStyle.Fill + Me.Scene1.Location = New System.Drawing.Point(92, 83) + Me.Scene1.Name = "Scene1" + Me.Scene1.Size = New System.Drawing.Size(755, 425) + Me.Scene1.TabIndex = 1 + ' + 'btnInvertCurve + ' + Me.btnInvertCurve.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnInvertCurve.FlatAppearance.BorderSize = 0 + Me.btnInvertCurve.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnInvertCurve.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnInvertCurve.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnInvertCurve.Image = Global.TestEIn.My.Resources.Resources.InvertCurve + Me.btnInvertCurve.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnInvertCurve.Location = New System.Drawing.Point(0, 48) + Me.btnInvertCurve.Name = "btnInvertCurve" + Me.btnInvertCurve.Size = New System.Drawing.Size(56, 48) + Me.btnInvertCurve.TabIndex = 31 + Me.btnInvertCurve.Text = "Invert" + Me.btnInvertCurve.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnInvertCurve.UseVisualStyleBackColor = False + ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoSize = True Me.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None - Me.ClientSize = New System.Drawing.Size(1056, 473) + Me.ClientSize = New System.Drawing.Size(1056, 533) Me.Controls.Add(Me.TableLayoutPanel1) Me.Cursor = System.Windows.Forms.Cursors.Arrow Me.ForeColor = System.Drawing.SystemColors.ControlText @@ -931,7 +1242,13 @@ Partial Class Form1 CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit() Me.TableLayoutPanel3.ResumeLayout(False) Me.TableLayoutPanel3.PerformLayout() + Me.Panel1.ResumeLayout(False) + Me.Panel1.PerformLayout() Me.TabControl2.ResumeLayout(False) + Me.TabDraw.ResumeLayout(False) + Me.TabConstruct.ResumeLayout(False) + Me.TabEdit.ResumeLayout(False) + Me.TabTransform.ResumeLayout(False) Me.TabTest.ResumeLayout(False) Me.ResumeLayout(False) @@ -950,9 +1267,9 @@ End Sub Friend WithEvents ToolStripStatusOutput As System.Windows.Forms.ToolStripStatusLabel Friend WithEvents ToolStripStatusOnL As System.Windows.Forms.ToolStripStatusLabel Friend WithEvents ToolStripStatusOnR As System.Windows.Forms.ToolStripStatusLabel - Friend WithEvents btnRotM90 As System.Windows.Forms.Button - Friend WithEvents btnRotP90 As System.Windows.Forms.Button - Friend WithEvents btnMirror As System.Windows.Forms.Button + Friend WithEvents XbtnRotM90 As System.Windows.Forms.Button + Friend WithEvents XbtnRotP90 As System.Windows.Forms.Button + Friend WithEvents XbtnMirror As System.Windows.Forms.Button Friend WithEvents TableLayoutPanel3 As System.Windows.Forms.TableLayoutPanel Friend WithEvents TabControl2 As System.Windows.Forms.TabControl Friend WithEvents TabDraw As System.Windows.Forms.TabPage @@ -990,5 +1307,26 @@ End Sub Friend WithEvents btnZoomIn As System.Windows.Forms.Button Friend WithEvents btnTop As System.Windows.Forms.Button Friend WithEvents btnMove As System.Windows.Forms.Button + Friend WithEvents TabTransform As System.Windows.Forms.TabPage + Friend WithEvents TabEdit As System.Windows.Forms.TabPage + Friend WithEvents btnRotate As System.Windows.Forms.Button + Friend WithEvents btnLine2P As System.Windows.Forms.Button + Friend WithEvents btnPoint As System.Windows.Forms.Button + Friend WithEvents btnArcCSE As System.Windows.Forms.Button + Friend WithEvents ObjTreeTimer As System.Windows.Forms.Timer + Friend WithEvents btnDelete As System.Windows.Forms.Button + Friend WithEvents btnArc3P As System.Windows.Forms.Button + Friend WithEvents txtPartLay As System.Windows.Forms.TextBox + Friend WithEvents btnNewPart As System.Windows.Forms.Button + Friend WithEvents Panel1 As System.Windows.Forms.Panel + Friend WithEvents btnNewLayer As System.Windows.Forms.Button + Friend WithEvents btnColor As System.Windows.Forms.Button + Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog + Friend WithEvents txtColor As System.Windows.Forms.TextBox + Friend WithEvents TabConstruct As System.Windows.Forms.TabPage + Friend WithEvents btnCopy As System.Windows.Forms.Button + Friend WithEvents btnMirror As System.Windows.Forms.Button + Friend WithEvents btnPlane As System.Windows.Forms.Button + Friend WithEvents btnInvertCurve As System.Windows.Forms.Button End Class diff --git a/Form1.resx b/Form1.resx index a913496..0305069 100644 --- a/Form1.resx +++ b/Form1.resx @@ -159,8 +159,8 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADS - DAAAAk1TRnQBSQFMAgEBDAEAAWABBQFgAQUBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC4 + DQAAAk1TRnQBSQFMAgEBDgEAARABBwEQAQcBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAAUADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -188,33 +188,37 @@ AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw - AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD//8A/wD/AP8AXAAG/AUA - C/wqAAf8BAAC/AcAAvwHAAf8BgAC/BkAAvwDAAH8AgAB/AUAAfwBAAH8CQAD/AgAAvwaAAL8AgAB/AMA - AfwDAAH8AgAB/AkAA/wIAAL8BQAF/BAAAvwCAAH8BAAB/AEAAfwDAAH8CQAD/AgAAvwEAAf8AwAC/AoA - AvwCAAH8BAAC/AQAAfwJAAP8CAAD/AIAA/wDAAL8AwAC/AoAAvwBAAH8AQAE/AEAAvwEAAH8CAAD/AkA - BvwFAAL8AgAC/AoAAvwBAAL8BQAB/AEAAfwDAAH8CAAD/AoAA/wHAAL8AgAC/AoAAvwCAAH8BQAB/AIA - AfwCAAH8CAAD/BQAAvwCAAL8CgAC/AMAAfwDAAH8BAAB/AEAAfwIAAP8FAAC/AIAAvwKAAL8BAAC/AEA - AfwFAAL8BAAB/AMAA/wDAAH8FAAD/AgAA/wGAAL8AwAE/AQAAfwDAAP8AwAB/BUADPwIAAT8CAAL/BYA - CfyAAAH5PwAC+RQAAvwhAAr5DQAC/AQAAvwhAAr5DAAD/AQAAvwgAAL6BgAC+QwAA/wFAAL8EwAC/AkA - AvwD+gUAAfkMAAP8BgAD/BEABPwIAAL8AQAD+hAAA/wIAAL8EAAG/AcAAvwCAAP6DgAD/AkAA/wPAAb8 - BwAC/AMAA/oBAAH6CgAD/AsAA/wPAAT8CAAC/AQABPoJAAP8DAAD/BAAAvwJAAL8BQAD+ggAA/wOAAT8 - GQAC/AQABPoHAAP8EAAF/BUABvwMAAP8EwAH/BIABPwNAAL8FgAF/BMAAvyuAAP5A/oD+wP8NAAD+QP6 - A/sD/BcABPwZAAP5A/oD+wP8CQAC+QsABPwCAAL5BwAC/A0AA/kD+gP7A/wJAAL5CgAE/AEAA/kIAAP8 - DAAD+QP6A/sD/BYAAvwBAAL5AwACBAYAA/wLAAP5A/oD+wP8CQAC+QwAAvkCAAP6AgQHAAP8CgAD+QP6 - A/sD/AkAAvkLAAL5AQAE+gEAAgQIAAP8AgAC/AUAA/kD+gP7A/wKAAL5CAAD+QT6AwACBAkAA/wBAAL8 - BQAD+QP6A/sD/AsAAvkGAAL5AgAC+gUAAgQKAAX8BQAD+QP6A/sD/AcAAvkCAAL5CQAC+gIAAwcOAAT8 - BQAD+QP6A/sD/AcAAvkCAAL5CQAC+gIAAwcMAAb8BQAD+QP6A/sD/AgABPkLAAH6EQAG/AUAA/kD+gP7 - A/w0AAP5A/oD+wP8cgABQgFNAT4HAAE+AwABKAMAAUADAAFAAwABAQEAAQEGAAECFgAD/4EACv8B/gEH - AcABBwT/Af4BAwHPAecB8AEfAZ8C/wHzAbcB1wH8AX8BnwL/AfkBuwG3AfwBfwGfAQcB/wH5Ab0BdwH8 - AX8BngEDAZ8B+QG8AfcB/AF/AYwBcwGfAfkBQgF7AfwBfwHAAfkBnwH5AT4BuwH8AX8B4wH5AZ8B+QG+ - AdsB/AF/Af8B+QGfAfkB3QHrAfwBfwH/AfkBnwH5AeUB8wHcAXcC/wGPAfEB+QHDAdwBdwL/AcABAwH8 - AT8BwAEHAv8B4AEPD/8B9wb/Ac8B8wL/Ac8D/wGAAQEB/wHzAc8D/wGAAQEB/wHjAc8D/wHDAfMB/wHH - Ac8B/wH+AX8BwQH3Af8BjwHHAf8B/AE/AcgC/wEfAecB/wH4AR8BzAF/Af4BPwHjAf8B+AEfAc4BLwH8 - AX8B8QH/AfwBPwHPAQ8B+AH/AfEB/wH+AX8BzwGPAfEB/wH4AX8C/wHPAQ8B4wH/AfwBHwL/AQMB/wHH - Av8BAQL/AYcB/wHPAv8BwQL/Ac8V/wHAAQMC/wH4AR8C/wHAAQMC/wHgAWcC/wHAAQMB/gF/AdABywHn - Af8BwAEDAf4BfwGhAR0B4wH/AcABAwL/AbIBcQHxAf8BwAEDAf4BfwF5AYIB+AH/AcABAwH+AX8BcgES - AfwBZwHAAQMB/wE/AUABcgH+AScBwAEDAf8BnwEZARIB/wEHAcABAwH5AZ8BsgENAf8BhwHAAQMB+QGf - AbIBDQH+AQcBwAEDAfwBPwHbARsB/gEHAcABAwL/AucC/wHAAQMC/wH4AR8K/ws= + AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/0MAC/w1AAL8BwAC/AcA + B/wmAAH8AgAB/AUAAfwBAAH8CQAD/CgAAfwDAAH8AwAB/AIAAfwJAAP8KAAB/AQAAfwBAAH8AwAB/AkA + A/woAAH8BAAC/AQAAfwJAAP8JwAB/AEABPwBAAL8BAAB/AgAA/wnAAL8BQAB/AEAAfwDAAH8CAAD/CgA + AfwFAAH8AgAB/AIAAfwIAAP8KQAB/AMAAfwEAAH8AQAB/AgAA/wqAAL8AQAB/AUAAvwEAAH8AwAD/AMA + AfwoAAL8AwAE/AQAAfwDAAP8AwAB/CkABPwIAAv89QAC/CMABvwPAAL8BAAC/CMAB/wNAAP8BAAC/A0A + AvwZAAL8DAAD/AUAAvwNAAL8GgAC/AoAA/wGAAP8DAAC/AUABfwQAAL8CQAD/AgAAvwMAAL8BAAH/AMA + AvwKAAL8CAAD/AkAA/wLAAP8AgAD/AMAAvwDAAL8CgAC/AcAA/wLAAP8CwAG/AUAAvwCAAL8CgAC/AYA + A/wMAAP8DAAD/AcAAvwCAAL8CgAC/AUAA/wOAAT8FAAC/AIAAvwKAAL8BAAD/BAABfwSAAL8AgAC/AoA + AvwDAAP8EwAH/BIAA/wIAAP8AwAC/BYABfwTAAz8NQAJ/IAAAfk/AAL5NwAK+QIACNkKAAL8IAAK+QoA + AdkJAAP8HgAC+gYAAvkMAAHZCQAD/BAAAvwJAAL8A/oFAAH5BAAI2QIAAdkJAAP8DgAE/AgAAvwBAAP6 + CgAI2QIAAdkJAAP8AgAC/AgABvwHAAL8AgAD+goACNkCAAHZCQAD/AEAAvwIAAb8BwAC/AMAA/oBAAH6 + CAAI2QIAAdkJAAX8CQAE/AgAAvwEAAT6CQAI2QwABPwKAAL8CQAC/AUAA/oKAAjZCQAG/BUAAvwEAAT6 + CwAI2QgABvwTAAb8OwAE/D0AAvyOAAP5A/oD+wP8NAAD+QP6A/sD/BcABPwIAAmsCAAD+QP6A/sD/AkA + AvkLAAT8AgAC+QUACawBhQcAA/kD+gP7A/wJAAL5CgAE/AEAA/kGAAmsAoUGAAP5A/oD+wP8FgAC/AEA + AvkDAAIEAwAJrAOFBQAD+QP6A/sD/AkAAvkMAAL5AgAD+gIEAwAJrASFBAAD+QP6A/sD/AkAAvkLAAL5 + AQAE+gEAAgQEAAjZBYUDAAP5A/oD+wP8CgAC+QgAA/kE+gMAAgQFAAjZBYUCAAP5A/oD+wP8CwAC+QYA + AvkCAAL6BQACBAYACNkEhQIAA/kD+gP7A/wHAAL5AgAC+QkAAvoCAAMHCgAI2QOFAgAD+QP6A/sD/AcA + AvkCAAL5CQAC+gIAAwcLAAjZAoUCAAP5A/oD+wP8CAAE+QsAAfoRAAjZAYUCAAP5A/oD+wP8NAAD+QP6 + A/sD/HIAAUIBTQE+BwABPgMAASgDAAFAAwABQAMAAQEBAAEBBgABAhYAA/8BAAT/BAABwAEHAv8EAAHP + AecB8AEfBAABtwHXAfwBfwQAAbsBtwH8AX8EAAG9AXcB/AF/BAABvAH3AfwBfwQAAUIBewH8AX8EAAE+ + AbsB/AF/BAABvgHbAfwBfwQAAd0B6wH8AX8EAAHlAfMB3AF3BAAB+QHDAdwBdwQAAfwBPwHAAQcEAAT/ + BAAE/wQACv8BzwP/Af4BBwH/AfMBzwP/Af4BAwH/AeMBzwH/AZ8C/wHzAf8BxwHPAf8BnwL/AfkB/wGP + AccB/wGfAQcB/wH5Af8BHwHnAf8BngEDAZ8B+QH+AT8B4wH/AYwBcwGfAfkB/AF/AfEB/wHAAfkBnwH5 + AfgB/wHxAf8B4wH5AZ8B+QHxAf8B+AF/Af8B+QGfAfkB4wH/AfwBHwH/AfkBnwH5AccC/wEBAv8BjwHx + Ac8C/wHBAv8BwAEDBv8B4AEPD/8B9wb/Ac8B8wb/AYABAQGAAX8B5wP/AYABAQH/Ab8B4wP/AcMB8wH/ + Ad8B8QH/Af4BfwHBAfcBgAFvAfgB/wH8AT8ByAH/AcABNwH8AWcB+AEfAcwBfwHgARsB/gEnAfgBHwHO + AS8B8AENAf8BBwH8AT8BzwEPAfgBBwH/AYcB/gF/Ac8BjwH8AQMB/gEHAv8BzwEPAf4BAQH+AQcC/wED + B/8Bhwf/Ac8R/wHAAQMC/wH4AR8C/wHAAQMC/wHgAWcBgAE/AcABAwH+AX8B0AHLAYABHwHAAQMB/gF/ + AaEBHQGAAQ8BwAEDAv8BsgFxAYABBwHAAQMB/gF/AXkBggGAAQMBwAEDAf4BfwFyARIBwAEBAcABAwH/ + AT8BQAFyAeABAAHAAQMB/wGfARkBEgHwAQABwAEDAfkBnwGyAQ0B+AEAAcABAwH5AZ8BsgENAfwBAAHA + AQMB/AE/AdsBGwH+AQABwAEDAv8C5wL/AcABAwL/AfgBHwr/Cw== @@ -223,6 +227,12 @@ 165, 7 + + 508, 10 + + + 634, 10 + 34 diff --git a/Form1.vb b/Form1.vb index 6e0b87a..2dc2001 100644 --- a/Form1.vb +++ b/Form1.vb @@ -10,11 +10,12 @@ Public Class Form1 Private m_sIniFile As String = String.Empty Private m_sCurrFile As String = String.Empty - Private m_bModified As Boolean = False - Private m_nMarkObj As Integer = GDB_ID_NULL + Private m_nMarkObj As Integer = GDB_ID.NULL '-------------------------------- Form ------------------------------------------------------------ Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + ' installo aggiornamento interfaccia + AddHandler System.Windows.Forms.Application.Idle, AddressOf Application_Idle 'Title EmitTitle() 'Impostazione path Ini file @@ -32,27 +33,27 @@ Public Class Form1 GetPrivateProfileString("GeomDB", "DefaultFont", "", sDefFont, m_sIniFile) EgtSetFont(sNfeDir, sDefFont) ' imposto colore di default - Dim DefColor As New Color(0, 0, 0) + Dim DefColor As New Color3d(0, 0, 0) GetPrivateProfileColor("GeomDB", "DefaultColor", DefColor, m_sIniFile) Scene1.SetDefaultMaterial(DefColor) ' imposto colori sfondo - Dim BackTopColor As New Color(192, 192, 192) + Dim BackTopColor As New Color3d(192, 192, 192) GetPrivateProfileColor("Scene", "BackTop", BackTopColor, m_sIniFile) - Dim BackBotColor As New Color(192, 192, 192) + Dim BackBotColor As New Color3d(192, 192, 192) GetPrivateProfileColor("Scene", "BackBottom", BackBotColor, m_sIniFile) Scene1.SetViewBackground(BackTopColor, BackBotColor) ' imposto colore di evidenziazione - Dim MarkColor As New Color(255, 255, 0) + Dim MarkColor As New Color3d(255, 255, 0) GetPrivateProfileColor("Scene", "Mark", MarkColor, m_sIniFile) Scene1.SetMarkMaterial(MarkColor) ' imposto tipo e colore del rettangolo di zoom Dim bOutline As Boolean = True - Dim ZwColor As Color + Dim ZwColor As Color3d ZwColor.Setup(0, 0, 0) GetPrivateProfileZoomWin("Scene", "ZoomWin", bOutline, ZwColor, m_sIniFile) Scene1.SetZoomWinAttribs(bOutline, ZwColor) ' imposto colore della linea di distanza - Dim DstLnColor As Color + Dim DstLnColor As Color3d DstLnColor.Setup(255, 0, 0) GetPrivateProfileColor("Scene", "DistLine", DstLnColor, m_sIniFile) Scene1.SetDistLineMaterial(DstLnColor) @@ -64,11 +65,16 @@ Public Class Form1 Scene1.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits) ' inizializzo scena Scene1.Init() + ' imposto i dati della griglia + EgtSetGridShow(True, True) + EgtSetGridFrame(Frame3d.GLOB) + EgtSetGridGeo(10, 1, 10, 50) + EgtSetGridColor(New Color3d(160, 160, 160), New Color3d(160, 160, 160)) ' modo di visualizzazione - Dim nShowMode As Integer = GetPrivateProfileInt("Scene", "ShowMode", SM_SHADING, m_sIniFile) - If nShowMode = SM_WIREFRAME Then + Dim nShowMode As Integer = GetPrivateProfileInt("Scene", "ShowMode", SM.SHADING, m_sIniFile) + If nShowMode = SM.WIREFRAME Then rbtWireFrame.Checked = True - ElseIf nShowMode = SM_HIDDENLINE Then + ElseIf nShowMode = SM.HIDDENLINE Then rbtHiddenLine.Checked = True Else rbtShading.Checked = True @@ -77,7 +83,7 @@ Public Class Form1 Dim nShowCurveDir As Integer = GetPrivateProfileInt("Scene", "CurveDir", 0, m_sIniFile) chkCurveDir.Checked = (nShowCurveDir <> 0) ' ObjTree non selezionato - m_nOldIdTree = GDB_ID_NULL + m_nObjTreeOldId = GDB_ID.NULL ' aggiungo voce per about box nel menù di sistema Dim hSysMenu As IntPtr = GetSystemMenu(Handle, False) If hSysMenu <> IntPtr.Zero Then @@ -98,20 +104,27 @@ Public Class Form1 WindowState = IIf(nFlag = 1, FormWindowState.Maximized, FormWindowState.Normal) End If ' Recupero eventuali parametri da linea di comando + Dim bOpen As Boolean = False For Each s As String In My.Application.CommandLineArgs If Not String.IsNullOrWhiteSpace(s) Then Dim nFileType As Integer = EgtGetFileType(s) Select Case nFileType - Case FT_NGE, FT_NFE + Case FT.NGE, FT.NFE Scene1.OpenProject(s, False) - Case FT_DXF, FT_STL, FT_CNC + bOpen = True + Case FT.DXF, FT.STL, FT.CNC Scene1.ImportProject(s, False) - Case FT_TSC, FT_LUA + bOpen = True + Case FT.TSC, FT.LUA Scene1.Exec(s, False) + bOpen = True End Select Exit For End If Next + If Not bOpen Then + Scene1.NewProject() + End If End Sub Private Sub Form1_FormClosing(sender As System.Object, e As FormClosingEventArgs) Handles MyBase.FormClosing @@ -145,13 +158,15 @@ Public Class Form1 ToolStripStatusCursorPos.Text = sCursorPos End Sub - Private Sub OnMouseSelected(ByVal sender As Object, ByVal nId As Integer) Handles Scene1.OnMouseSelected + Private Sub OnMouseSelected(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean) Handles Scene1.OnMouseSelected If EgtIsSelectedObj(nId) Then EgtDeselectObj(nId) Else EgtSelectObj(nId) End If - EgtDraw() + If bLast Then + EgtDraw() + End If End Sub Private Sub OnMouseAnalyzed(ByVal sender As Object, ByVal nId As Integer) Handles Scene1.OnMouseAnalyzed @@ -164,9 +179,10 @@ Public Class Form1 Private Sub OnNewProject(ByVal sender As Object) Handles Scene1.OnNewProject m_sCurrFile = String.Empty - m_bModified = False + ResetModified() EmitTitle() - ClearObjTree() + ResetCurrPartLayer() + LoadObjTree() End Sub Private Sub OnOpeningProject(ByVal sender As Object) Handles Scene1.OnOpeningProject @@ -175,9 +191,10 @@ Public Class Form1 Private Sub OnOpenProject(ByVal sender As Object, ByVal sFile As String) Handles Scene1.OnOpenProject m_sCurrFile = sFile - m_bModified = False + ResetModified() EmitTitle() WritePrivateProfileString("General", "LastNgeDir", Path.GetDirectoryName(m_sCurrFile), m_sIniFile) + ResetCurrPartLayer() LoadObjTree() End Sub @@ -190,7 +207,7 @@ Public Class Form1 End Sub Private Sub OnSavedProject(ByVal sender As Object) Handles Scene1.OnSavedProject - m_bModified = False + ResetModified() ' rimarco eventuale oggetto smarcato SelectIdInObjTree(m_nMarkObj) End Sub @@ -202,8 +219,9 @@ Public Class Form1 Private Sub OnImportedProject(ByVal sender As Object, ByVal sFile As String) Handles Scene1.OnImportedProject WritePrivateProfileString("General", "LastImpDir", Path.GetDirectoryName(sFile), m_sIniFile) m_sCurrFile = sFile - m_bModified = True + SetModified() EmitTitle() + ResetCurrPartLayer() LoadObjTree() End Sub @@ -224,7 +242,7 @@ Public Class Form1 End Sub Private Sub OnExecutedScript(ByVal sender As Object) Handles Scene1.OnExecutedScript - m_bModified = True + SetModified() LoadObjTree() End Sub @@ -279,15 +297,15 @@ Public Class Form1 End Sub Private Sub rbtWireFrame_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rbtWireFrame.CheckedChanged - EgtSetShowMode(SM_WIREFRAME) + Scene1.WireFrame() End Sub Private Sub rbtHiddenLine_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rbtHiddenLine.CheckedChanged - EgtSetShowMode(SM_HIDDENLINE) + Scene1.HiddenLine() End Sub Private Sub rbtShading_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rbtShading.CheckedChanged - EgtSetShowMode(SM_SHADING) + Scene1.Shading() End Sub Private Sub chkCurveDir_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkCurveDir.CheckedChanged @@ -300,7 +318,7 @@ Public Class Form1 Scene1.SetStatusAnalyze() Else Scene1.ResetStatusAnalyze() - SelectIdInObjTree(GDB_ID_NULL) + SelectIdInObjTree(GDB_ID.NULL) End If End Sub @@ -311,41 +329,40 @@ Public Class Form1 ToolStripStatusOutput.Text = " " Else Scene1.ResetStatusGetDistance() - EgtResetGeoLine() ToolStripStatusOutput.Text = " " End If End Sub Private Sub btnZoomAll_Click(sender As System.Object, e As System.EventArgs) Handles btnZoomAll.Click - EgtZoom(ZM_ALL) + Scene1.ZoomAll() End Sub Private Sub btnZoomIn_Click(sender As System.Object, e As System.EventArgs) Handles btnZoomIn.Click - EgtZoom(ZM_IN) + Scene1.ZoomIn() End Sub Private Sub btnZoomOut_Click(sender As System.Object, e As System.EventArgs) Handles btnZoomOut.Click - EgtZoom(ZM_OUT) + Scene1.ZoomOut() End Sub Private Sub btnTop_Click(sender As System.Object, e As System.EventArgs) Handles btnTop.Click - EgtSetView(CT_TOP) + Scene1.TopView() End Sub Private Sub btnFront_Click(sender As System.Object, e As System.EventArgs) Handles btnFront.Click - EgtSetView(CT_FRONT) + Scene1.FrontView() End Sub Private Sub btnLeft_Click(sender As System.Object, e As System.EventArgs) Handles btnLeft.Click - EgtSetView(CT_LEFT) + Scene1.LeftView() End Sub Private Sub btnBack_Click(sender As System.Object, e As System.EventArgs) Handles btnBack.Click - EgtSetView(CT_BACK) + Scene1.BackView() End Sub Private Sub btnRight_Click(sender As System.Object, e As System.EventArgs) Handles btnRight.Click - EgtSetView(CT_RIGHT) + Scene1.RightView() End Sub Private Sub btnIsoSW_Click(sender As System.Object, e As System.EventArgs) Handles btnIsoSW.Click @@ -364,65 +381,66 @@ Public Class Form1 Scene1.IsoViewNW() End Sub - Private Sub btnRotP90_Click(sender As System.Object, e As System.EventArgs) Handles btnRotP90.Click - Rotate(90) + ' ----------------- Test ------------------- + Private Sub XbtnRotP90_Click(sender As System.Object, e As System.EventArgs) Handles XbtnRotP90.Click + XRotate(90) ' aggiorno visualizzazione - EgtZoom(ZM_ALL) - UpdateObjInObjTree(m_nOldIdTree) + Scene1.ZoomAll() + UpdateObjInObjTree(m_nObjTreeOldId) End Sub - Private Sub btnRotM90_Click(sender As System.Object, e As System.EventArgs) Handles btnRotM90.Click - Rotate(-90) + Private Sub XbtnRotM90_Click(sender As System.Object, e As System.EventArgs) Handles XbtnRotM90.Click + XRotate(-90) ' aggiorno visualizzazione - EgtZoom(ZM_ALL) - UpdateObjInObjTree(m_nOldIdTree) + Scene1.ZoomAll() + UpdateObjInObjTree(m_nObjTreeOldId) End Sub - Private Sub Rotate(ByVal dAngRotDeg As Double) + Private Sub XRotate(ByVal dAngRotDeg As Double) ' indice del primo gruppo sotto la radice - Dim nId As Integer = EgtGetFirstInGroup(GDB_ID_ROOT) + Dim nId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT) ' recupero il box del gruppo in globale Dim PtMinPre As New Point3d Dim PtMaxPre As New Point3d - EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT + BBF_EXACT, PtMinPre, PtMaxPre) + EgtGetBBoxGlob(nId, BBF.IGNORE_TEXT + BBF.EXACT, PtMinPre, PtMaxPre) ' ruoto attorno al punto minimo - EgtRotateGlob(nId, PtMinPre, Vector3d.Z_AX, dAngRotDeg) + EgtRotateGlob(nId, PtMinPre, EgtGetGridVersZ(), dAngRotDeg) ' calcolo nuovo box in globale Dim PtMinPost As New Point3d Dim PtMaxPost As New Point3d - EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT + BBF_EXACT, PtMinPost, PtMaxPost) + EgtGetBBoxGlob(nId, BBF.IGNORE_TEXT + BBF.EXACT, PtMinPost, PtMaxPost) ' eseguo traslazione per riavere lo stesso punto minimo Dim VtMove As Vector3d = PtMinPre - PtMinPost EgtMoveGlob(nId, VtMove) End Sub - Private Sub btnMirror_Click(sender As System.Object, e As System.EventArgs) Handles btnMirror.Click + Private Sub XbtnMirror_Click(sender As System.Object, e As System.EventArgs) Handles XbtnMirror.Click ' indice del primo gruppo sotto la radice - Dim nId As Integer = EgtGetFirstInGroup(GDB_ID_ROOT) + Dim nId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT) ' recupero il box del gruppo in globale Dim PtMin As New Point3d Dim PtMax As New Point3d - EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT + BBF_EXACT, PtMin, PtMax) + EgtGetBBoxGlob(nId, BBF.IGNORE_TEXT + BBF.EXACT, PtMin, PtMax) Dim PtCen As Point3d = Point3d.Media(PtMin, PtMax) ' mirror rispetto a Y centrato nel box EgtMirrorGlob(nId, PtCen, Vector3d.X_AX) ' sistemo gli eventuali testi - UnMirrorTexts(nId) + XUnMirrorTexts(nId) ' aggiorno visualizzazione - EgtZoom(ZM_ALL) - UpdateObjInObjTree(m_nOldIdTree) + Scene1.ZoomAll() + UpdateObjInObjTree(m_nObjTreeOldId) End Sub - Private Sub UnMirrorTexts(ByVal nGroupId As Integer) + Private Sub XUnMirrorTexts(ByVal nGroupId As Integer) Dim nId As Integer = EgtGetFirstInGroup(nGroupId) - While nId <> GDB_ID_NULL + While nId <> GDB_ID.NULL 'recupero il tipo di oggetto Dim nType As Integer = EgtGetType(nId) 'se gruppo - If nType = TY_GROUP Then - UnMirrorTexts(nId) + If nType = TY.GROUP Then + XUnMirrorTexts(nId) ' se testo - ElseIf nType = TY_EXT_TEXT Then + ElseIf nType = TY.EXT_TEXT Then EgtMirrorText(nId, True) End If ' passo al successivo @@ -430,72 +448,492 @@ Public Class Form1 End While End Sub + ' --------------------- Update UI ------------------------------- + Private Sub Application_Idle(ByVal sender As Object, ByVal e As EventArgs) + Dim bLayerOk As Boolean = (GetCurrLayer() <> GDB_ID.NULL) + Dim bSelOk As Boolean = (EgtGetFirstSelectedObj() <> GDB_ID.NULL) + ' Draw + btnPoint.Enabled = bLayerOk + btnLine2P.Enabled = bLayerOk + btnArcCSE.Enabled = bLayerOk + btnArc3P.Enabled = bLayerOk + ' Construct + btnPlane.Enabled = bLayerOk And bSelOk + ' Edit + btnDelete.Enabled = bSelOk + btnInvertCurve.Enabled = bSelOk + ' Transform + btnCopy.Enabled = bSelOk + btnMove.Enabled = bSelOk + btnRotate.Enabled = bSelOk + btnMirror.Enabled = bSelOk - Private Const EI_ST_NULL As Integer = 0 - Private Const EI_ST_MOVE1 As Integer = 1 - Private Const EI_ST_MOVE2 As Integer = 2 - Private m_nStatus As Integer = EI_ST_NULL - Private m_ptStart As Point3d - Private m_ptCurr As Point3d + End Sub - Private Sub btnMove_Click(sender As System.Object, e As System.EventArgs) Handles btnMove.Click + ' --------------------- Commands -------------------------------- + Private Enum EST As Integer + NULL = 0 + POINT + LINE2P_1 + LINE2P_2 + ARCCSE_1 + ARCCSE_2 + ARCCSE_3 + ARC3P_1 + ARC3P_2 + ARC3P_3 + MOVE_1 + MOVE_2 + COPY_1 + COPY_2 + ROTATE_1 + ROTATE_2 + ROTATE_3 + MIRROR_1 + MIRROR_2 + End Enum + Private m_nStatus As EST = EST.NULL + Private m_ptP1 As Point3d + Private m_ptP2 As Point3d + + Private Sub btnPoint_Click(sender As System.Object, e As System.EventArgs) Handles btnPoint.Click ' posso partire solo da stato libero - If m_nStatus <> EI_ST_NULL Then + If m_nStatus <> EST.NULL Then Return End If - ' verifico ci sia qualcosa di selezionato - If EgtGetFirstSelectedObj() = GDB_ID_NULL Then + ' posso partire solo se esiste un gruppo corrente + If GetCurrLayer() = GDB_ID.NULL Then Return End If - ' creo il gruppo di drag e vi copio le entità selezionate + ' non serve il gruppo di drag + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per point + m_nStatus = EST.POINT + ToolStripStatusOutput.Text = "Point : select Point" + End Sub + + Private Sub btnLine2P_Click(sender As System.Object, e As System.EventArgs) Handles btnLine2P.Click + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' posso partire solo se esiste un gruppo corrente + If GetCurrLayer() = GDB_ID.NULL Then + Return + End If + ' creo il gruppo di drag If Not Scene1.CreateDragGroup() Then Return End If + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per Line2P + m_nStatus = EST.LINE2P_1 + ToolStripStatusOutput.Text = "Line : select Start Point" + End Sub + + Private Sub btnArcCSE_Click(sender As System.Object, e As System.EventArgs) Handles btnArcCSE.Click + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' posso partire solo se esiste un gruppo corrente + If GetCurrLayer() = GDB_ID.NULL Then + Return + End If + ' creo il gruppo di drag + If Not Scene1.CreateDragGroup() Then + Return + End If + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per ArcCSE + m_nStatus = EST.ARCCSE_1 + ToolStripStatusOutput.Text = "Arc : select Center" + End Sub + + Private Sub btnArc3P_Click(sender As System.Object, e As System.EventArgs) Handles btnArc3P.Click + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' posso partire solo se esiste un gruppo corrente + If GetCurrLayer() = GDB_ID.NULL Then + Return + End If + ' creo il gruppo di drag + If Not Scene1.CreateDragGroup() Then + Return + End If + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per Arc3P + m_nStatus = EST.ARC3P_1 + ToolStripStatusOutput.Text = "Arc : select Start Point" + End Sub + + Private Sub btnPlane_Click(sender As System.Object, e As System.EventArgs) Handles btnPlane.Click + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' posso partire solo se esiste un gruppo corrente + If GetCurrLayer() = GDB_ID.NULL Then + Return + End If + ' creo la superficie + EgtCreateSurfTriMeshByContour(GetCurrLayer(), EgtGetFirstSelectedObj(), 10 * EPS_SMALL) + EgtDeselectAll() + ' reset stato scena + Scene1.ResetStatus() + ' reset stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + End Sub + + Private Sub btnDelete_Click(sender As System.Object, e As System.EventArgs) Handles btnDelete.Click + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' lancio la cancellazione + EgtErase(GDB_ID.SEL) + ' reset stato scena + Scene1.ResetStatus() + ' reset stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + End Sub + + Private Sub btnInvertCurve_Click(sender As System.Object, e As System.EventArgs) Handles btnInvertCurve.Click + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' lancio l'inversione della curva + EgtInvertCurve(EgtGetFirstSelectedObj()) + EgtDeselectAll() + ' reset stato scena + Scene1.ResetStatus() + ' reset stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + End Sub + + Private Sub btnMove_Click(sender As System.Object, e As System.EventArgs) Handles btnMove.Click + ' verifico condizioni e preparo per il drag + If Not PrepareTransform() Then + Return + End If + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per Move + m_nStatus = EST.MOVE_1 + ToolStripStatusOutput.Text = "Move : select Base Point" + End Sub + + Private Sub btnCopy_Click(sender As System.Object, e As System.EventArgs) Handles btnCopy.Click + ' verifico condizioni e preparo per il drag + If Not PrepareTransform() Then + Return + End If + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per Move + m_nStatus = EST.COPY_1 + ToolStripStatusOutput.Text = "Copy : select Base Point" + End Sub + + Private Sub btnRotate_Click(sender As System.Object, e As System.EventArgs) Handles btnRotate.Click + ' verifico condizioni e preparo per il drag + If Not PrepareTransform() Then + Return + End If + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per Rotate + m_nStatus = EST.ROTATE_1 + ToolStripStatusOutput.Text = "Rotate : select Center" + End Sub + + Private Sub btnMirror_Click(sender As System.Object, e As System.EventArgs) Handles btnMirror.Click + ' verifico condizioni e preparo per il drag + If Not PrepareTransform() Then + Return + End If + ' imposto stato di scena a selezione punto + Scene1.SetStatusSelPoint() + ' imposto stato a primo punto per Mirror + m_nStatus = EST.MIRROR_1 + ToolStripStatusOutput.Text = "Rotate : select Start Point" + End Sub + + Private Function PrepareTransform() As Boolean + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return False + End If + ' verifico ci sia qualcosa di selezionato + If EgtGetFirstSelectedObj() = GDB_ID.NULL Then + Return False + End If + ' creo il gruppo di drag e vi copio le entità selezionate + If Not Scene1.CreateDragGroup() Then + Return False + End If Dim nId As Integer = EgtGetFirstSelectedObj() - While nId <> GDB_ID_NULL + While nId <> GDB_ID.NULL If Not Scene1.AddToDragGroup(nId) Then Scene1.EraseDragGroup() - Return + Return False End If nId = EgtGetNextSelectedObj() End While - ' imposto stato di scena a selezione punto - Scene1.SetStatusSelPoint() - ' imposto stato a primo punto per move - m_nStatus = EI_ST_MOVE1 - ToolStripStatusOutput.Text = "Select Start Point" - End Sub + Return True + End Function Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d) Handles Scene1.OnMouseSelectedPoint - If m_nStatus = EI_ST_MOVE1 Then - m_ptStart = PtP - m_ptCurr = PtP - m_nStatus = EI_ST_MOVE2 - ToolStripStatusOutput.Text = "Select End Point" - ElseIf m_nStatus = EI_ST_MOVE2 Then - ' cancello gruppo di drag e linea temporanea - Scene1.EraseDragGroup() - EgtResetGeoLine(False) + ' Point + If m_nStatus = EST.POINT Then + ' creo il punto (i dati sono in globale) + EgtCreateGeoPoint(GetCurrLayer(), PtP.Loc(GetCurrLayer())) + ' reset stato scena + Scene1.ResetStatus() + ' aggiorno stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + ' Line2P + ElseIf m_nStatus = EST.LINE2P_1 Then + m_ptP1 = PtP + m_nStatus = EST.LINE2P_2 + ToolStripStatusOutput.Text = "Line : select End Point" + ElseIf m_nStatus = EST.LINE2P_2 Then + ' reset scena + Scene1.ResetStatus(False) + ' creo la linea (i punti sono in globale) + EgtCreateCurveLine(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()), PtP.Loc(GetCurrLayer())) + EgtDraw() + ' aggiorno stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + ' Arc3P + ElseIf m_nStatus = EST.ARC3P_1 Then + m_ptP1 = PtP + m_nStatus = EST.ARC3P_2 + ToolStripStatusOutput.Text = "Arc : select End Point" + ElseIf m_nStatus = EST.ARC3P_2 Then + m_ptP2 = PtP + m_nStatus = EST.ARC3P_3 + ToolStripStatusOutput.Text = "Arc : select Mid Point" + ElseIf m_nStatus = EST.ARC3P_3 Then + ' reset scena + Scene1.ResetStatus() + ' creo l'arco (i punti sono in globale) + EgtCreateCurveArc3P(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()), PtP.Loc(GetCurrLayer()), m_ptP2.Loc(GetCurrLayer())) + EgtDraw() + ' aggiorno stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + ' ArcCSE + ElseIf m_nStatus = EST.ARCCSE_1 Then + m_ptP1 = PtP + m_nStatus = EST.ARCCSE_2 + ToolStripStatusOutput.Text = "Arc : select Start Point" + ElseIf m_nStatus = EST.ARCCSE_2 Then + m_ptP2 = PtP + m_nStatus = EST.ARCCSE_3 + ToolStripStatusOutput.Text = "Arc : select End (near) Point" + ElseIf m_nStatus = EST.ARCCSE_3 Then + ' reset scena + Scene1.ResetStatus() + ' creo l'arco (i punti sono in globale) + EgtCreateCurveArcC2PN(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()), m_ptP2.Loc(GetCurrLayer()), PtP.Loc(GetCurrLayer()), EgtGetGridVersZ()) + EgtDraw() + ' aggiorno stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + ' Move + ElseIf m_nStatus = EST.MOVE_1 Then + m_ptP1 = PtP + m_nStatus = EST.MOVE_2 + ToolStripStatusOutput.Text = "Move : select Target Point" + ElseIf m_nStatus = EST.MOVE_2 Then ' eseguo movimento - Dim VtMove As Vector3d = PtP - m_ptStart - EgtMoveGlob(GDB_ID_SEL, VtMove) + EgtMoveGlob(GDB_ID.SEL, (PtP - m_ptP1)) + EgtDeselectAll() + ' reset stato scena + Scene1.ResetStatus() + ' aggiorno stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + ' Copy + ElseIf m_nStatus = EST.COPY_1 Then + m_ptP1 = PtP + m_nStatus = EST.COPY_2 + ToolStripStatusOutput.Text = "Copy : select Target Point" + ElseIf m_nStatus = EST.COPY_2 Then + ' reset scena + Scene1.ResetStatus() + ' eseguo copia e movimento + Dim nId As Integer = EgtGetFirstSelectedObj() + While nId <> GDB_ID.NULL + Dim nCopyId As Integer = EgtCopyGlob(nId, GetCurrLayer()) + EgtMoveGlob(nCopyId, (PtP - m_ptP1)) + nId = EgtGetNextSelectedObj() + End While EgtDeselectAll() EgtDraw() - ' reset stato di scena - Scene1.ResetStatusSelPoint() - ' reset stato - m_nStatus = EI_ST_NULL + ' aggiorno stato + m_nStatus = EST.NULL ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + ' Rotate + ElseIf m_nStatus = EST.ROTATE_1 Then + m_ptP1 = PtP + m_nStatus = EST.ROTATE_2 + ToolStripStatusOutput.Text = "Rotate : select Base Point" + ElseIf m_nStatus = EST.ROTATE_2 Then + m_ptP2 = PtP + m_nStatus = EST.ROTATE_3 + ToolStripStatusOutput.Text = "Rotate : select Rotation Point" + ElseIf m_nStatus = EST.ROTATE_3 Then + ' eseguo rotazione + Dim dAngRotDeg As Double = 0 + Dim bDet As Boolean = True + EgtGetVectorRotation((m_ptP2 - m_ptP1), (PtP - m_ptP1), EgtGetGridVersZ(), dAngRotDeg, bDet) + EgtRotateGlob(GDB_ID.SEL, m_ptP1, EgtGetGridVersZ(), dAngRotDeg) + EgtDeselectAll() + ' reset stato scena + Scene1.ResetStatus() + ' aggiorno stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() + ' Mirror + ElseIf m_nStatus = EST.MIRROR_1 Then + m_ptP1 = PtP + m_ptP2 = m_ptP1 + m_nStatus = EST.MIRROR_2 + ToolStripStatusOutput.Text = "Mirror : select End Point" + ElseIf m_nStatus = EST.MIRROR_2 Then + ' eseguo mirror + Dim VtNorm As Vector3d = (PtP - m_ptP1) ^ EgtGetGridVersZ() + If VtNorm.Len > EPS_SMALL Then + EgtMirrorGlob(GDB_ID.SEL, m_ptP1, VtNorm) + End If + EgtDeselectAll() + ' reset stato scena + Scene1.ResetStatus() + ' aggiorno stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + SetModified() + LoadObjTree() End If End Sub Private Sub OnMouseMoveSelPoint(ByVal sender As Object, ByVal PtP As Point3d) Handles Scene1.OnMouseMoveSelPoint - If m_nStatus = EI_ST_MOVE2 Then - Dim VtMove As Vector3d = PtP - m_ptCurr - EgtMoveGlob(Scene1.GetDragGroup(), VtMove) - EgtSetGeoLine(m_ptStart, PtP) + If m_nStatus = EST.LINE2P_2 Then + ' durante la creazione di oggetti il gruppo di Drag ha riferimento globale + Dim nId As Integer = EgtGetFirstInGroup(Scene1.GetDragGroup()) + If nId = GDB_ID.NULL Then + EgtCreateCurveLine(Scene1.GetDragGroup(), m_ptP1, PtP) + Else + EgtModifyCurveEndPoint(nId, PtP) + End If + EgtDraw() + ElseIf m_nStatus = EST.ARC3P_2 Or m_nStatus = EST.ARCCSE_2 Then + ' durante la creazione di oggetti il gruppo di Drag ha riferimento globale + Dim nId As Integer = EgtGetFirstInGroup(Scene1.GetDragGroup()) + If nId = GDB_ID.NULL Then + EgtCreateCurveLine(Scene1.GetDragGroup(), m_ptP1, PtP) + Else + EgtModifyCurveEndPoint(nId, PtP) + End If + EgtDraw() + ElseIf m_nStatus = EST.ARC3P_3 Then + ' durante la creazione di oggetti il gruppo di Drag ha riferimento globale + Dim nId As Integer = EgtGetFirstInGroup(Scene1.GetDragGroup()) + If EgtGetType(nId) <> TY.CRV_ARC Then + EgtErase(nId) + nId = GDB_ID.NULL + End If + If nId = GDB_ID.NULL Then + EgtCreateCurveArc3P(Scene1.GetDragGroup(), m_ptP1, PtP, m_ptP2) + Else + EgtModifyCurveArc3P(nId, PtP) + End If + EgtDraw() + ElseIf m_nStatus = EST.ARCCSE_3 Then + ' durante la creazione di oggetti il gruppo di Drag ha riferimento globale + Dim nId As Integer = EgtGetFirstInGroup(Scene1.GetDragGroup()) + If EgtGetType(nId) <> TY.CRV_ARC Then + EgtErase(nId) + nId = GDB_ID.NULL + End If + If nId = GDB_ID.NULL Then + Dim vtN As New Vector3d(0, 0, 1) + EgtCreateCurveArcC2PN(Scene1.GetDragGroup(), m_ptP1, m_ptP2, PtP, vtN.Glob(GetCurrLayer())) + Else + EgtModifyCurveArcC2PN(nId, PtP) + End If + EgtDraw() + ElseIf m_nStatus = EST.MOVE_2 Then + ' ripristino lo stato iniziale + EgtChangeGroupFrame(Scene1.GetDragGroup(), Frame3d.GLOB) + ' eseguo tutto il movimento + EgtMoveGlob(Scene1.GetDragGroup(), (PtP - m_ptP1)) + EgtSetGeoLine(m_ptP1, PtP) + EgtDraw() + ElseIf m_nStatus = EST.COPY_2 Then + ' ripristino lo stato iniziale + EgtChangeGroupFrame(Scene1.GetDragGroup(), Frame3d.GLOB) + ' eseguo tutto il movimento + EgtMoveGlob(Scene1.GetDragGroup(), (PtP - m_ptP1)) + EgtSetGeoLine(m_ptP1, PtP) + EgtDraw() + ElseIf m_nStatus = EST.ROTATE_3 Then + ' ripristino lo stato iniziale + EgtChangeGroupFrame(Scene1.GetDragGroup(), Frame3d.GLOB) + ' eseguo rotazione + Dim dAngRotDeg As Double = 0 + Dim bDet As Boolean = True + EgtGetVectorRotation((m_ptP2 - m_ptP1), (PtP - m_ptP1), EgtGetGridVersZ(), dAngRotDeg, bDet) + EgtRotateGlob(Scene1.GetDragGroup(), m_ptP1, EgtGetGridVersZ(), dAngRotDeg) + EgtDraw() + ElseIf m_nStatus = EST.MIRROR_2 Then + ' ripristino lo stato iniziale, tramite annullo mirror precedente + Dim VtNorm As Vector3d = (m_ptP2 - m_ptP1) ^ EgtGetGridVersZ() + If VtNorm.Len > EPS_SMALL Then + EgtMirrorGlob(Scene1.GetDragGroup(), m_ptP1, VtNorm) + End If + ' eseguo mirror + VtNorm = (PtP - m_ptP1) ^ EgtGetGridVersZ() + If VtNorm.Len > EPS_SMALL Then + EgtMirrorGlob(Scene1.GetDragGroup(), m_ptP1, VtNorm) + End If + ' salvo il punto + m_ptP2 = PtP EgtDraw() - m_ptCurr = PtP End If End Sub @@ -505,20 +943,35 @@ Public Class Form1 ' Con ESC esco dall'azione corrente If e.KeyData = Keys.Escape Then ' reset Azione corrente - Scene1.EraseDragGroup() - EgtResetGeoLine(False) - m_nStatus = EI_ST_NULL - Scene1.ResetStatusSelPoint() + m_nStatus = EST.NULL + Scene1.ResetStatus() ' reset Analisi e Distanza chkAnalyze.Checked = False chkGetDist.Checked = False ' pulisco output ToolStripStatusOutput.Text = "" - ' aggiorno disegno - EgtDraw() End If End Sub + Private Sub Scene1_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles Scene1.KeyDown + ' Con DEL eseguo cancellazione delle entità selezionate + If e.KeyData = Keys.Delete Then + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' lancio la cancellazione + If EgtGetFirstSelectedObj() <> GDB_ID.NULL Then + EgtErase(GDB_ID.SEL) + SetModified() + ' reset stato scena + Scene1.ResetStatus() + ' reset stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + End If + End If + End Sub '-------------------------------- Command Box ---------------------------------------------------- Private Sub tboxCmd_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles tboxCmd.KeyDown @@ -542,14 +995,135 @@ Public Class Form1 End If End Sub + '-------------------------------- Current Piece/Layer -------------------------------------------- + Private m_nCurrPart = GDB_ID.NULL + Private m_nCurrLayer = GDB_ID.NULL + + Private Sub btnNewPart_Click(sender As System.Object, e As System.EventArgs) Handles btnNewPart.Click + ' inserisco un nuovo gruppo (piece) sotto la radice + Dim nIdNewPart As Integer = EgtCreateGroup(GDB_ID.ROOT) + ' inserisco un nuovo gruppo (layer) sotto quello appena creato + Dim nIdNewLayer As Integer = EgtCreateGroup(nIdNewPart) + ' se ok, salvo nuova situazione + If nIdNewPart <> GDB_ID.NULL And nIdNewLayer <> GDB_ID.NULL Then + m_nCurrPart = nIdNewPart + m_nCurrLayer = nIdNewLayer + SetModified() + End If + ' aggiorno visualizzazione + EmitCurrPartLayer() + LoadObjTree() + End Sub + + Private Sub btnNewLayer_Click(sender As System.Object, e As System.EventArgs) Handles btnNewLayer.Click + ' inserisco un nuovo gruppo (layer) sotto il pezzo corrente + Dim nIdNewLayer As Integer = EgtCreateGroup(m_nCurrPart) + ' se ok, salvo nuova situazione + If nIdNewLayer <> GDB_ID.NULL Then + m_nCurrLayer = nIdNewLayer + SetModified() + End If + ' aggiorno visualizzazione + EmitCurrPartLayer() + LoadObjTree() + End Sub + + Private Sub btnColor_Click(sender As System.Object, e As System.EventArgs) Handles btnColor.Click + Dim nCurrId As Integer + If m_nCurrPart <> GDB_ID.NULL Then + nCurrId = m_nCurrPart + If m_nCurrLayer <> GDB_ID.NULL Then + nCurrId = m_nCurrLayer + End If + Else + Return + End If + Dim colObj As Color3d + EgtGetCalcColor(nCurrId, colObj) + ColorDialog1.Color = colObj.ToColor() + If ColorDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then + colObj.FromColor(ColorDialog1.Color) + EgtSetColor(nCurrId, colObj) + EmitCurrPartLayer() + SetModified() + EgtDraw() + End If + End Sub + + Private Function SetCurrPartLayer(ByVal nPart As Integer, ByVal nLayer As Integer) + ' verifico esistenza + If Not EgtExistsObj(nPart) Or EgtGetParent(nLayer) <> nPart Then + Return False + End If + ' assegno + m_nCurrPart = nPart + m_nCurrLayer = nLayer + ' aggiorno visualizzazione + EmitCurrPartLayer() + Return True + End Function + + Private Sub ResetCurrPartLayer() + ' reset + m_nCurrPart = GDB_ID.NULL + m_nCurrLayer = GDB_ID.NULL + ' cerco il primo pezzo + Dim nIdPart As Integer = EgtGetFirstGroupInGroup(GDB_ID.ROOT) + If nIdPart <> GDB_ID.NULL Then + ' assegno il pezzo corrente + m_nCurrPart = nIdPart + ' cerco il primo layer del pezzo + Dim nIdLayer As Integer = EgtGetFirstGroupInGroup(m_nCurrPart) + If nIdLayer <> GDB_ID.NULL Then + ' assegno il layer corrente + m_nCurrLayer = nIdLayer + End If + End If + ' aggiorno visualizzazione + EmitCurrPartLayer() + End Sub + + Private Function GetCurrPart() As Integer + Return m_nCurrPart + End Function + + Private Function GetCurrLayer() As Integer + Return m_nCurrLayer + End Function + + Private Sub EmitCurrPartLayer() + Dim sText As String = " " + Dim colObj As Color3d + EgtGetColor(GDB_ID.ROOT, colObj) + If m_nCurrPart <> GDB_ID.NULL Then + sText = "Part " + m_nCurrPart.ToString() + EgtGetCalcColor(m_nCurrPart, colObj) + If m_nCurrLayer <> GDB_ID.NULL And EgtExistsObj(m_nCurrLayer) Then + sText += " --> Layer " + m_nCurrLayer.ToString() + EgtGetCalcColor(m_nCurrLayer, colObj) + End If + End If + txtPartLay.Text = sText + txtColor.BackColor = colObj.ToColor() + End Sub + + '-------------------------------- Tree View ------------------------------------------------------ - Private m_nOldIdTree As Integer + Private m_nObjTreeOldId As Integer = GDB_ID.NULL + + Private Sub ObjTreeTickEvent(source As Object, e As EventArgs) Handles ObjTreeTimer.Tick + If m_nObjTreeOldId <> GDB_ID.NULL Then + EgtResetMark(m_nObjTreeOldId) + EgtDraw() + End If + ObjTreeTimer.Stop() + End Sub Private Sub LoadObjTree() ClearObjTree() TreeView1.BeginUpdate() - TreeView1.Nodes.Add(GDB_ID_NULL.ToString, "No Selection", 0, 0) - AddGroupInObjTree(GDB_ID_ROOT, TreeView1.Nodes) + 'TreeView1.Nodes.Add(GDB_ID.NULL.ToString, "No Selection", 0, 0) + AddGroupInObjTree(GDB_ID.ROOT, 0, TreeView1.Nodes) TreeView1.EndUpdate() End Sub @@ -558,21 +1132,33 @@ Public Class Form1 TreeView1.Nodes.Clear() End Sub - Private Sub AddGroupInObjTree(ByVal nGroupId As Integer, ByRef PrevNodColl As TreeNodeCollection) + Private Sub AddGroupInObjTree(ByVal nGroupId As Integer, ByVal nLev As Integer, ByRef PrevNodColl As TreeNodeCollection) Dim CurrNodColl As TreeNodeCollection - If nGroupId = GDB_ID_ROOT Then + If nGroupId = GDB_ID.ROOT Then CurrNodColl = PrevNodColl Else Dim sName As String = String.Empty Dim sText As String = String.Empty If EgtGetName(nGroupId, sName) Then - sText = sName + " (Group " + nGroupId.ToString + ")" + If nLev = 1 Then + sText = sName + " (Part " + nGroupId.ToString + ")" + ElseIf nLev = 2 Then + sText = sName + " (Layer " + nGroupId.ToString + ")" + Else + sText = sName + " (Group " + nGroupId.ToString + ")" + End If Else - sText = "Group " + nGroupId.ToString + If nLev = 1 Then + sText = "Part " + nGroupId.ToString + ElseIf nLev = 2 Then + sText = "Layer " + nGroupId.ToString + Else + sText = "Group " + nGroupId.ToString + End If End If - Dim nImage As Integer = TypeToImageInObjTree(TY_GROUP) + Dim nImage As Integer = TypeToImageInObjTree(TY.GROUP, nLev) CurrNodColl = PrevNodColl.Add(nGroupId.ToString, sText, nImage, nImage).Nodes End If @@ -583,14 +1169,14 @@ Public Class Form1 End If Dim nId As Integer = EgtGetFirstInGroup(nGroupId) - While nId <> GDB_ID_NULL + While nId <> GDB_ID.NULL 'recupero il tipo di nodo Dim nType As Integer = EgtGetType(nId) 'se gruppo - If nType = TY_GROUP Then - AddGroupInObjTree(nId, CurrNodColl) + If nType = TY.GROUP Then + AddGroupInObjTree(nId, nLev + 1, CurrNodColl) 'se oggetto geometrico - ElseIf nType >= TY_GEO_VECTOR Then + ElseIf nType >= TY.GEO_VECTOR Then Dim sTitle As String = String.Empty EgtGetTitle(nId, sTitle) Dim sName As String = String.Empty @@ -600,7 +1186,7 @@ Public Class Form1 Else sText = sTitle + " " + nId.ToString End If - Dim nImage As Integer = TypeToImageInObjTree(nType) + Dim nImage As Integer = TypeToImageInObjTree(nType, nLev) CurrNodColl.Add(nId.ToString, sText, nImage, nImage) End If 'passo al successivo @@ -608,28 +1194,34 @@ Public Class Form1 End While End Sub - Private Function TypeToImageInObjTree(ByVal nType As Integer) As Integer + Private Function TypeToImageInObjTree(ByVal nType As Integer, ByVal nLev As Integer) As Integer Select Case nType - Case TY_GROUP - Return 2 - Case TY_GEO_VECTOR - Return 3 - Case TY_GEO_POINT - Return 4 - Case TY_GEO_FRAME + Case TY.GROUP + If nLev = 1 Then + Return 3 + ElseIf nLev = 2 Then + Return 4 + Else + Return 2 + End If + Case TY.GEO_VECTOR Return 5 - Case TY_CRV_LINE + Case TY.GEO_POINT Return 6 - Case TY_CRV_ARC + Case TY.GEO_FRAME Return 7 - Case TY_CRV_BEZ + Case TY.CRV_LINE Return 8 - Case TY_CRV_COMPO + Case TY.CRV_ARC Return 9 - Case TY_SRF_MESH + Case TY.CRV_BEZ Return 10 - Case TY_EXT_TEXT + Case TY.CRV_COMPO Return 11 + Case TY.SRF_MESH + Return 12 + Case TY.EXT_TEXT + Return 13 End Select Return 1 End Function @@ -643,6 +1235,61 @@ Public Class Form1 UpdateObjInObjTree(nId) End Sub + Private Sub ObjTree_MouseUp(ByVal sender As Object, e As MouseEventArgs) Handles TreeView1.MouseUp + If m_nObjTreeOldId <> GDB_ID.NULL Then + ' evidenzio + EgtSetMark(m_nObjTreeOldId) + EgtDraw() + ' lancio timer per successiva de-evidenziazione + ObjTreeTimer.Stop() + ObjTreeTimer.Start() + End If + End Sub + + Private Sub ObjTree_MouseDoubleClick(ByVal sender As Object, e As MouseEventArgs) Handles TreeView1.MouseDoubleClick + If m_nObjTreeOldId <> GDB_ID.NULL Then + ' recupero il padre + Dim nIdParent As Integer = EgtGetParent(m_nObjTreeOldId) + If nIdParent = GDB_ID.NULL Then + Return + ' se Part + ElseIf nIdParent = GDB_ID.ROOT Then + ' cerco il primo Layer del Part + Dim nId As Integer = EgtGetFirstGroupInGroup(m_nObjTreeOldId) + SetCurrPartLayer(m_nObjTreeOldId, nId) + ' se Layer + ElseIf EgtGetParent(nIdParent) = GDB_ID.ROOT Then + SetCurrPartLayer(nIdParent, m_nObjTreeOldId) + End If + End If + End Sub + + Private Sub ObjTree_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles TreeView1.KeyDown + ' Con DEL eseguo cancellazione del pezzo o del layer selezionati + If e.KeyData = Keys.Delete Then + ' posso partire solo da stato libero + If m_nStatus <> EST.NULL Then + Return + End If + ' lancio la cancellazione + If m_nObjTreeOldId <> GDB_ID.NULL Then + EgtErase(m_nObjTreeOldId) + SetModified() + ' reset stato scena + Scene1.ResetStatus() + ' reset stato + m_nStatus = EST.NULL + ToolStripStatusOutput.Text = "" + ' aggiorno visualizzazione + If m_nObjTreeOldId = m_nCurrPart Or m_nObjTreeOldId = m_nCurrLayer Then + ResetCurrPartLayer() + End If + m_nObjTreeOldId = GDB_ID.NULL + LoadObjTree() + End If + End If + End Sub + Private Sub UpdateObjInObjTree(ByVal nId As Integer) ' ripristino eventuale vecchio oggetto selezionato RevertOldIdInObjTree() @@ -650,9 +1297,9 @@ Public Class Form1 Dim nType As Integer = EgtGetType(nId) ' stampa dei dati del nuovo oggetto Dim sDump As String = String.Empty - If nType = TY_NONE Then + If nType = TY.NONE Then tBoxInfo.Text = String.Empty - ElseIf nType = TY_GROUP Then + ElseIf nType = TY.GROUP Then If EgtGroupDump(nId, sDump) Then tBoxInfo.Text = sDump Else @@ -666,31 +1313,34 @@ Public Class Form1 End If End If ' permetto in ogni caso la visualizzazione dell'oggetto e lo evidenzio - Dim nOldMode As Integer = GDB_MD_STD + Dim nOldMode As Integer = GDB_MD.STD EgtGetMode(nId, nOldMode) - Dim nMode As Integer = IIf((nOldMode = GDB_MD_HIDDEN), GDB_MD_STD, nOldMode) + Dim nMode As Integer = IIf((nOldMode = GDB_MD.HIDDEN), GDB_MD.STD, nOldMode) EgtSetMode(nId, nMode) - Dim nOldStatus As Integer = GDB_ST_ON + Dim nOldStatus As Integer = GDB_ST.ON_ EgtGetStatus(nId, nOldStatus) - Dim nStat As Integer = IIf((nOldStatus = GDB_ST_OFF), GDB_ST_ON, nOldStatus) + Dim nStat As Integer = IIf((nOldStatus = GDB_ST.OFF), GDB_ST.ON_, nOldStatus) EgtSetStatus(nId, nStat) EgtSetMark(nId) - m_nOldIdTree = nId + m_nObjTreeOldId = nId ' imposto il ridisegno della scena - Scene1.Invalidate() + EgtDraw() + ' lancio timer per successiva de-evidenziazione + ObjTreeTimer.Stop() + ObjTreeTimer.Start() End Sub Private Function RevertOldIdInObjTree() As Integer ' salvo il vecchio Id - Dim nOldId As Integer = m_nOldIdTree + Dim nOldId As Integer = m_nObjTreeOldId ' se non nullo... - If EgtExistsObj(m_nOldIdTree) Then + If EgtExistsObj(m_nObjTreeOldId) Then ' ripristino il modo e lo stato precedente dell'oggetto e lo smarco - EgtRevertMode(m_nOldIdTree) - EgtRevertStatus(m_nOldIdTree) - EgtResetMark(m_nOldIdTree) + EgtRevertMode(m_nObjTreeOldId) + EgtRevertStatus(m_nObjTreeOldId) + EgtResetMark(m_nObjTreeOldId) ' annullo oggetto da ripristinare - m_nOldIdTree = GDB_ID_NULL + m_nObjTreeOldId = GDB_ID.NULL End If Return nOldId End Function @@ -705,7 +1355,19 @@ Public Class Form1 End If End Function - '-------------------------------- Utilities ------------------------------------------------------ + '-------------------------------- Modified Status ------------------------------------------------ + Private m_bModified As Boolean = False + + Private Sub SetModified() + m_bModified = True + EmitTitle() + End Sub + + Private Sub ResetModified() + m_bModified = False + EmitTitle() + End Sub + Private Function ManageModified() As Boolean ' se non modificato, procedo normalmente If Not m_bModified Then @@ -729,7 +1391,9 @@ Public Class Form1 End Select End Function - Private Sub EmitTitle() + + '-------------------------------- Program Title -------------------------------------------------- + Private Sub EmitTitle() ' nome file Dim sTitle As String = m_sCurrFile If String.IsNullOrEmpty(m_sCurrFile) Then @@ -740,10 +1404,9 @@ Public Class Form1 sTitle += "*" End If ' dati del prodotto - sTitle += " - EgalTech TestEGr" + sTitle += " - EgalTech TestEIn" ' emissione del titolo Me.Text = sTitle End Sub - End Class diff --git a/GenInterface.vb b/GenInterface.vb index 0cc9ee0..2aa7ceb 100644 --- a/GenInterface.vb +++ b/GenInterface.vb @@ -37,7 +37,7 @@ End Function Public Shared Function GetPrivateProfileColor( ByVal lpAppName As String, ByVal lpKeyName As String, - ByRef Col As Color, + ByRef Col As Color3d, ByVal lpFileName As String) As Boolean Dim sVal As String = String.Empty GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName) @@ -58,7 +58,7 @@ Public Shared Function GetPrivateProfileZoomWin( ByVal lpAppName As String, ByVal lpKeyName As String, ByRef bOutline As Boolean, - ByRef Col As Color, + ByRef Col As Color3d, ByVal lpFileName As String) As Boolean Dim sVal As String = String.Empty GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 42d1304..d31bb3c 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -43,5 +43,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + + diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb index afe90ec..c7d570c 100644 --- a/My Project/Resources.Designer.vb +++ b/My Project/Resources.Designer.vb @@ -80,6 +80,36 @@ Namespace My.Resources End Get End Property + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Arc3P() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Arc3P", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property ArcCSE() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("ArcCSE", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Copy() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Copy", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. ''' @@ -90,6 +120,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Delete() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Delete", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. ''' @@ -130,6 +170,26 @@ Namespace My.Resources End Get End Property + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property InvertCurve() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("InvertCurve", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Line2P() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Line2P", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. ''' @@ -220,6 +280,26 @@ Namespace My.Resources End Get End Property + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Mirror() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Mirror", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Move() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Move", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. ''' @@ -230,6 +310,26 @@ Namespace My.Resources End Get End Property + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Plane() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Plane", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Point() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Point", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. ''' @@ -260,6 +360,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Rotate() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Rotate", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. ''' diff --git a/My Project/Resources.resx b/My Project/Resources.resx index 282a99a..198f7e8 100644 --- a/My Project/Resources.resx +++ b/My Project/Resources.resx @@ -118,38 +118,101 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\New.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\GetDist.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\LookFromBACK.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Plane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Rotate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Analyze.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\LookFromISO_NE.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LookFromTOP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Copy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Line2P.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LookFromBACK.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Mirror.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\LookFromISO_SE.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RenderingWF.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ZoomAll.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Move.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ZoomIn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\LookFromRIGHT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\LookFromLEFT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\CurveDir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Point.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RenderingHL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Exec.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ZoomOut.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\New.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SaveAs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ZoomIn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ArcCSE.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LookFromLEFT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\LookFromRIGHT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Arc3P.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LookFromFRONT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ZoomAll.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RenderingSH.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -157,40 +220,10 @@ ..\Resources\LookFromISO_SW.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\RenderingSH.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LookFromISO_NE.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\SaveAs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RenderingWF.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LookFromTOP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RenderingHL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\GetDist.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\LookFromISO_NW.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\ZoomOut.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LookFromFRONT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\CurveDir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\InvertCurve.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Resources/Arc3P.png b/Resources/Arc3P.png new file mode 100644 index 0000000000000000000000000000000000000000..9779235a12726568a2d00a6f7cd7c2990eeb34f0 GIT binary patch literal 340 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_r((Aj~*bn@<`j$X?><>&kwQOI%RjXvs!~OF*HAo-U3d5r^M~9~5j>5V&(T!lkP* zENISJm7_O~K5G`_U7>QvVDY^(wGt)Mlk*w9oKEjpSST}@!P7k`aMznVx1=}{{J$JF z`LTn!Vfq&%#Se_K%541}9*>H4tY-U_T(Y*I+eM;Vi}{_Z;glQgw*N0Ve0n}9Ot^tr z;mhGE2WI4bo!whGX`8D@km@3%E|s*`h$sCZ^MWx91&=Wc4~<#Lcv9TXn40cYzPnw(Wjx7f>|qx<{P; f;_d@4IrlK03HaZT7dZ0?(6bDlu6{1-oD!M<>&kwQOI%Rf=)m2h*BBTWxjkJRLn02p4ZqFXY`|j^&T}#G zkd|y;XoAGH9d#y+8W#K+OhShyscu*_r?#$f!jY+;4jnD>XLmW$!C`B9ar4&f15LdW z&#wNcWOnc`%6fEw>D3YT?{gG17w%lmRu!;obwj!MLhUsi75+gwNB5rnxs2^fw`ZDY z1EYhh@54&ry}uQ9Xcq2q*&LgY$^UYm-%7^Rh7eZ&YX|1pn0Y#S>@{<>&kwQOIl1!@8jAEDWK3bPZ!6Kh{JEgJo%ap1U@f_s|>dM zusrVJiTM@>W>+*+X9QiGvgz!E6-^TbxHOW5-&i;aX=*z^+7)R&WzXAX^NKaPojLb3 z%I`S8m%p>4l}#mocl?3)s|(~OpIFqiTU6@*vL{M^>X~FtG4cMoD$K;&an)_h6DI#p z0^%xn*E;Cey$HV4cae< U&*oX<0`wt+r>mdKI;Vst04}b5ssI20 literal 0 HcmV?d00001 diff --git a/Resources/Delete.png b/Resources/Delete.png new file mode 100644 index 0000000000000000000000000000000000000000..f63f8c3f8b62514ca898f947952af42a3482e436 GIT binary patch literal 1063 zcmV+?1laqDP)u(#y;+48u~&41*NwQcYtMeKIvR7DdwNgQ-hWEXD-Xqy%4F zYg8Ugu_dUGG{<TGNJV>;ovqrD-hziWq2y+QibbZ;mVuTW2}GsHq6TOeOV!lbpBj zp7Y)RIp25hUx^6UGBmDn{C^4jYh5Ar)jRGp{^h?y>vR@J$NAnGgEC=Vp^_!%wAe8sVlRXjnw``JHt=RoCI`E{G<19MjeC(w zlfpl-O%`%5Wg?R~1dm!7!;-jdIivcc&k}%LyK~CdP&<%;Z+Jbv9xsF4UP3=xk+%#U zZ*j8!dkbf%DL^s#EDNg8#qQyB7q26H~>LFh2Yqb~;wv30ocNInCf(u`rgR)9)K&A8489wV}stEni62+XY zDGXhRLpadrzA6IelliD4i>?+oJ?)u{9x%>fD&B*r8|yAjx;YfNYm)HLMsESCCbUaniNvPy!o zHz4@SlzJp40y8FwqA{aENQcOrpmY0eb5S^E=y;f2cWOKp69F@b->L|TFl#rEwn;kW zi3fY5@t4;{>W&ISF&PmeiKiU2`g8d5L=ux3*m7h2*u*Zw*WOLp1BcdPePE@UNA*9j hdNElguu5R1;&-d}MDOS%aDD&)002ovPDHLkV1l7P=imSU literal 0 HcmV?d00001 diff --git a/Resources/InvertCurve.png b/Resources/InvertCurve.png new file mode 100644 index 0000000000000000000000000000000000000000..a216dfb1d154b631885de27d8582bc3f1071b258 GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_r((Aj~*bn@<`j$X?><>&kwQOIDCisOIn0xj>=Io-U3d5r^MSKgfH?K!BxOkoQB8 z@j~XP6a1^1H7cEvOe)foHXYb{_@rw?3iAV|glH~yhN!L# zj_D=3t?8;CdaRh{)v^YDSfee$Gu!%()&~uV&bWfl0#)<&tYM$?;B(ah!91}KZL?XF z9{jWwU^$y=5ubp Rx)1aogQu&X%Q~loCIFYveck{7 literal 0 HcmV?d00001 diff --git a/Resources/Line2P.png b/Resources/Line2P.png new file mode 100644 index 0000000000000000000000000000000000000000..b2666c2d4f2943fdb74e6586e8e5979e2d1f265b GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_r((Aj~*bn@<`j$X?><>&kwQOI%RZT+c-2I#B4Gr;B4q#NoHoFY+ET;Bh(Mp(vpi z+xjqqwJovxar-3)r`IZFO#!+;muLN&_iD>tF3+Ad&DUF9RXR8p^WFSx^X`Cf+0m!_ zWNhX$Bq&wBRy<%{q2d^{t0&=x+z+$YdQ9tY>KpribJ*0e#FLqWVaFxK-RC6b%&zyf zm~(GAG@C`|!BwWP4_b`g6&o8&_jnv&UMKdUX*G+@!`V#tKCE$gYrS_{|0xyY@JSi7 z_Ae+@it;v+`>@F70ptIZ9%d^i_k?QBW4avs|K_Ld^=`Wl=q*^w&f+q8#)kMmZa|+g Nc)I$ztaD0e0sv;*earv= literal 0 HcmV?d00001 diff --git a/Resources/Mirror.png b/Resources/Mirror.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd21c7fb6ffea35d722b98f6c3f5d41cf2f24e1 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_r((Aj~*bn@<`j$X?><>&kwQOP0^r%r?7*bf#>nP; zo3W>-=fC^nhM)sZApxJ?Su!O5|NrJuL-5^4(?4kZl-EAzaaTYieS^B!-Tm$_7iTuC z;!AjPx47ZO1NSbrCtn=4F`w8p$Hm>?;*laDnS(CIr#nkngnf0@4+$>5S#X7MF`q;! z!#6fh^}~*z_NtgqUQ(v2`j^Sg?bv@HNSEmdKI;Vst0A=!NG5`Po literal 0 HcmV?d00001 diff --git a/Resources/Move.png b/Resources/Move.png new file mode 100644 index 0000000000000000000000000000000000000000..e321455ef6bd5678613e56c3ec9dbf9e1f377403 GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_r*vAk26?e?EJP%ok>{%61JiDj+!+*{PZ>vRu4XYj9 znRTvqEQ?v-@$M1R;@XCp(fJGw{Z|k08{C?daM{sCQP6R&`1(})wUto=&dtAkW zVK1+x?$&!Q4+@-r3N{3Msb0YLZ;xEm>7^~EVbWVSu3}iO+Sc& zxL`InU#d&M;ekP9o>BeOIc!m8bBY?3G+FH|`j-D{c=5yT@BE9d50pNzc5S)EJZ18~ Rb-)l}@O1TaS?83{1OS2gliUCR literal 0 HcmV?d00001 diff --git a/Resources/Plane.png b/Resources/Plane.png new file mode 100644 index 0000000000000000000000000000000000000000..047ceba5d49edd461b81236dab82468502790f81 GIT binary patch literal 277 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_r((Aj~*bn@<`j$X?><>&kwQOO{_vbY)G#JD|`aPZ!6Kh{MT${{Oc>?7*bf#>lpq zPok88+j5q~+p1rZ=cFYjEqeYxU7UTD1w&q?WwY(YSyqyKL8@FQHqD93Y!I6!{FWgq z(r*fLMy91B`-NLYd-xW#KmFm{z&CAjtU#dh|I61H4Z3;t=lrirK=vN1gd^4r3>$SEH>-E> RJ_5Ry!PC{xWt~$(69CY8VZi_Z literal 0 HcmV?d00001 diff --git a/Resources/Point.png b/Resources/Point.png new file mode 100644 index 0000000000000000000000000000000000000000..e6a7749839cf954f381e8702a17165c96124f21e GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_r((Aj~*bn@<`j$X?><>&kwQOI%Qg{ignOBcM>3r;B4q#NoHsHu5$Y@UR@HUzQ+| zF4~qXD$%ApPff@%WQRvfg?C=i9{(=U)=37N)Ohrmc?=%xW|-s{Hpy58VU;4Hp V+lM<^D}gRx@O1TaS?83{1OR;cNr3<>&kwQOO)4A*t^smD93Qy)5S3);_%z+dwCBT2(Ui*9uSpf zrRK@PnjK)wWNg4xdTjxN<>U)Xmp#8|G0~CZ)8iwKH)3^M{}t`qtUsk?f^y~D2Y*Wb zeQC;@{dEBY!vVR~+ds3%)VL?K9eBK*Q6+d17n8zFCIf~|7a7kzVn}%Nxq`v7_4Cu2 zt}D2gd=|6dQ10YYk=5l?6)pRy9w6Ov-Ka$H;5o)_hszo~r2?jXhZGvLxc=9Qhg>!M z$)S?_zV=z_doi!uuClV*GEdH!e(3M6*V|v7Ud-LW>&fD?g=c@tMt=t9|B^>#IvO4{ ZuzzCrao}C?kOk;X22WQ%mvv4FO#sc?eUAVD literal 0 HcmV?d00001 diff --git a/Resources/WinSelect.cur b/Resources/WinSelect.cur new file mode 100644 index 0000000000000000000000000000000000000000..ed015fea13c96cea52efe50c67e28b33b9891255 GIT binary patch literal 326 zcmZvX!41P83`IXIQ1w#vW{x>#1DGsjlXw%lN!Y~wE>cC?`0JT3gpCbE1f&F9alsmZ z8-RuI3WWs9qrUS9?YNnhi@&E2K jOd<3?RAh7ZHevLZ0pWsoB0+Y^f3Qv*_MFA{Tzv2XL49j` literal 0 HcmV?d00001 diff --git a/Scene.Designer.vb b/Scene.Designer.vb index 28c9596..d48c6cf 100644 --- a/Scene.Designer.vb +++ b/Scene.Designer.vb @@ -24,21 +24,49 @@ Partial Class Scene Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.MenuScene = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.cmdSelectAll = New System.Windows.Forms.ToolStripMenuItem() + Me.cmdDeselectAll = New System.Windows.Forms.ToolStripMenuItem() + Me.SepSel1 = New System.Windows.Forms.ToolStripSeparator() + Me.cmdWinSelect = New System.Windows.Forms.ToolStripMenuItem() Me.cmdEndPoint = New System.Windows.Forms.ToolStripMenuItem() Me.cmdMidPoint = New System.Windows.Forms.ToolStripMenuItem() Me.cmdCenterPoint = New System.Windows.Forms.ToolStripMenuItem() Me.cmdNearPoint = New System.Windows.Forms.ToolStripMenuItem() - Me.cmdDeselectAll = New System.Windows.Forms.ToolStripMenuItem() + Me.cmdSketchPoint = New System.Windows.Forms.ToolStripMenuItem() + Me.cmdGridPoint = New System.Windows.Forms.ToolStripMenuItem() Me.MenuScene.SuspendLayout() Me.SuspendLayout() ' 'MenuScene ' - Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdDeselectAll, Me.cmdEndPoint, Me.cmdMidPoint, Me.cmdCenterPoint, Me.cmdNearPoint}) + Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectAll, Me.cmdDeselectAll, Me.SepSel1, Me.cmdWinSelect, Me.cmdSketchPoint, Me.cmdGridPoint, Me.cmdEndPoint, Me.cmdMidPoint, Me.cmdCenterPoint, Me.cmdNearPoint}) Me.MenuScene.Name = "ContextMenuStrip1" Me.MenuScene.ShowCheckMargin = True Me.MenuScene.ShowImageMargin = False - Me.MenuScene.Size = New System.Drawing.Size(153, 136) + Me.MenuScene.Size = New System.Drawing.Size(153, 230) + ' + 'cmdSelectAll + ' + Me.cmdSelectAll.Name = "cmdSelectAll" + Me.cmdSelectAll.Size = New System.Drawing.Size(152, 22) + Me.cmdSelectAll.Text = "Select All" + ' + 'cmdDeselectAll + ' + Me.cmdDeselectAll.Name = "cmdDeselectAll" + Me.cmdDeselectAll.Size = New System.Drawing.Size(152, 22) + Me.cmdDeselectAll.Text = "Deselect All" + ' + 'SepSel1 + ' + Me.SepSel1.Name = "SepSel1" + Me.SepSel1.Size = New System.Drawing.Size(149, 6) + ' + 'cmdWinSelect + ' + Me.cmdWinSelect.Name = "cmdWinSelect" + Me.cmdWinSelect.Size = New System.Drawing.Size(152, 22) + Me.cmdWinSelect.Text = "Select Window" ' 'cmdEndPoint ' @@ -50,7 +78,7 @@ Partial Class Scene ' Me.cmdMidPoint.Name = "cmdMidPoint" Me.cmdMidPoint.Size = New System.Drawing.Size(152, 22) - Me.cmdMidPoint.Text = "MidPoint" + Me.cmdMidPoint.Text = "Mid Point" ' 'cmdCenterPoint ' @@ -64,11 +92,17 @@ Partial Class Scene Me.cmdNearPoint.Size = New System.Drawing.Size(152, 22) Me.cmdNearPoint.Text = "Near Point" ' - 'cmdDeselectAll + 'cmdSketchPoint ' - Me.cmdDeselectAll.Name = "cmdDeselectAll" - Me.cmdDeselectAll.Size = New System.Drawing.Size(152, 22) - Me.cmdDeselectAll.Text = "Deselect All" + Me.cmdSketchPoint.Name = "cmdSketchPoint" + Me.cmdSketchPoint.Size = New System.Drawing.Size(152, 22) + Me.cmdSketchPoint.Text = "Sketch Point" + ' + 'cmdGridPoint + ' + Me.cmdGridPoint.Name = "cmdGridPoint" + Me.cmdGridPoint.Size = New System.Drawing.Size(152, 22) + Me.cmdGridPoint.Text = "Grid Point" ' 'Scene ' @@ -86,5 +120,10 @@ End Sub Friend WithEvents cmdCenterPoint As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmdNearPoint As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmdDeselectAll As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents cmdSelectAll As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents cmdWinSelect As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents SepSel1 As System.Windows.Forms.ToolStripSeparator + Friend WithEvents cmdSketchPoint As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents cmdGridPoint As System.Windows.Forms.ToolStripMenuItem End Class diff --git a/Scene.vb b/Scene.vb index 474a6a1..bc6c0e7 100644 --- a/Scene.vb +++ b/Scene.vb @@ -10,17 +10,18 @@ Public Class Scene '---- Members --------- Private m_nGseContext As Integer - Private m_nStatus As Integer - Private m_nOldStatus As Integer + Private m_nStatus As ST + Private m_nOldStatus As ST Private Enum ST As Integer NULL = 0 PAN = 1 ROT = 2 ZOOMWIN = 3 - ANALYZE = 4 - GETDIST = 5 - GETDIST2 = 6 - SELPOINT = 7 + WINSEL = 4 + ANALYZE = 5 + GETDIST = 6 + GETDIST2 = 7 + SELPOINT = 8 End Enum Private m_nSnapType As Integer Private m_PrevPoint As Point @@ -29,13 +30,13 @@ Public Class Scene Private m_b2Buff As Boolean Private m_nColorBits As Integer Private m_nDepthBits As Integer - Private m_BackTopColor As Color - Private m_BackBotColor As Color - Private m_DefColor As Color - Private m_MarkColor As Color + Private m_BackTopColor As Color3d + Private m_BackBotColor As Color3d + Private m_DefColor As Color3d + Private m_MarkColor As Color3d Private m_bZwOutline As Boolean - Private m_ZwColor As Color - Private m_DstLnColor As Color + Private m_ZwColor As Color3d + Private m_DstLnColor As Color3d '---- Constructor ----- @@ -50,7 +51,7 @@ Public Class Scene m_nGseContext = 0 m_nStatus = ST.NULL m_nOldStatus = ST.NULL - m_nSnapType = SP_END + m_nSnapType = SP.PT_GRID m_PrevPoint = Point.Empty m_nDriver = 3 m_b2Buff = True @@ -74,25 +75,25 @@ Public Class Scene m_nDepthBits = nDepthBits End Sub - Public Sub SetViewBackground(ByRef BackTopColor As Color, ByRef BackBotColor As Color) + Public Sub SetViewBackground(ByRef BackTopColor As Color3d, ByRef BackBotColor As Color3d) m_BackTopColor = BackTopColor m_BackBotColor = BackBotColor End Sub - Public Sub SetDefaultMaterial(ByRef DefColor As Color) + Public Sub SetDefaultMaterial(ByRef DefColor As Color3d) m_DefColor = DefColor End Sub - Public Sub SetMarkMaterial(ByRef DefColor As Color) + Public Sub SetMarkMaterial(ByRef DefColor As Color3d) m_MarkColor = DefColor End Sub - Public Sub SetZoomWinAttribs(ByVal bZwOutline As Boolean, ByRef ZwColor As Color) + Public Sub SetZoomWinAttribs(ByVal bZwOutline As Boolean, ByRef ZwColor As Color3d) m_bZwOutline = bZwOutline m_ZwColor = ZwColor End Sub - Public Sub SetDistLineMaterial(ByRef DstLnColor As Color) + Public Sub SetDistLineMaterial(ByRef DstLnColor As Color3d) m_DstLnColor = DstLnColor End Sub @@ -101,13 +102,12 @@ Public Class Scene Public Sub Init() m_nGseContext = EgtInitGeomDB() - EgtSetDefaultMaterial(m_DefColor.R, m_DefColor.G, m_DefColor.B) + EgtSetDefaultMaterial(m_DefColor) EgtInitScene(Handle, m_nDriver, m_b2Buff, m_nColorBits, m_nDepthBits) - EgtSetBackground(m_BackTopColor.R, m_BackTopColor.G, m_BackTopColor.B, - m_BackBotColor.R, m_BackBotColor.G, m_BackBotColor.B) - EgtSetMarkAttribs(m_MarkColor.R, m_MarkColor.G, m_MarkColor.B) - EgtSetWinRectAttribs(m_bZwOutline, m_ZwColor.R, m_ZwColor.G, m_ZwColor.B, m_ZwColor.A) - EgtSetGeoLineAttribs(m_DstLnColor.R, m_DstLnColor.G, m_DstLnColor.B) + EgtSetBackground(m_BackTopColor, m_BackBotColor) + EgtSetMarkAttribs(m_MarkColor) + EgtSetWinRectAttribs(m_bZwOutline, m_ZwColor) + EgtSetGeoLineAttribs(m_DstLnColor) EgtInitTscExec() End Sub @@ -155,7 +155,7 @@ Public Class Scene End Sub '---- Events ---------- - Public Event OnMouseSelected(ByVal sender As Object, ByVal nId As Integer) + Public Event OnMouseSelected(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean) Public Event OnMouseAnalyzed(ByVal sender As Object, ByVal nId As Integer) Public Event OnMouseDownScene(ByVal sender As Object) Public Event OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String) @@ -184,14 +184,22 @@ Public Class Scene Protected Overrides Sub OnMouseDown(e As System.Windows.Forms.MouseEventArgs) ' Imposto il contesto della scena come corrente EgtSetCurrentContext(m_nGseContext) + ' --- Pressione tasto sinistro --- If e.Button = Windows.Forms.MouseButtons.Left Then - If m_nStatus = ST.NULL Or m_nStatus = ST.ANALYZE Then + ' se stato WINSEL oppure NULL e premuto SHIFT allora inizio selezione a finestra + If m_nStatus = ST.WINSEL Or + (m_nStatus = ST.NULL And (Control.ModifierKeys And Keys.Shift) = Keys.Shift) Then + Cursor = New Cursor(Me.GetType(), "WinSelect.cur") + m_PrevPoint = e.Location + m_nStatus = ST.WINSEL + ' se stato NULL (selezione) o analisi + ElseIf m_nStatus = ST.NULL Or m_nStatus = ST.ANALYZE Then If m_nStatus = ST.NULL Then Cursor = New Cursor(Me.GetType(), "Select.cur") Else Cursor = New Cursor(Me.GetType(), "Analyze.cur") End If - Dim nId As Integer = GDB_ID_NULL + Dim nId As Integer = GDB_ID.NULL Dim nSel As Integer EgtSelect(e.Location, DIM_SEL, DIM_SEL, nSel) If nSel = 1 Then @@ -206,24 +214,26 @@ Public Class Scene nId = MselDlg.GetId() End If End If - If nId <> GDB_ID_NULL Then + If nId <> GDB_ID.NULL Then If m_nStatus = ST.NULL Then - RaiseEvent OnMouseSelected(Me, nId) + RaiseEvent OnMouseSelected(Me, nId, True) Else RaiseEvent OnMouseAnalyzed(Me, nId) End If End If + ' se stato misura di distanza (primo punto) ElseIf m_nStatus = ST.GETDIST Then - If EgtGetSelectedSnapPoint(m_nSnapType, e.Location.X, e.Location.Y, DIM_SEL, DIM_SEL, m_ptPrev) Then + If EgtGetGraphicSnapPoint(m_nSnapType, e.Location, DIM_SEL, DIM_SEL, m_ptPrev) Then ' salvo il punto di riferimento Dim ptWin As Point3d EgtProjectPoint(m_ptPrev, ptWin) m_PrevPoint = New Point(ptWin.x, ptWin.y) m_nStatus = ST.GETDIST2 End If + ' se stato misura di distanza (secondo punto) ElseIf m_nStatus = ST.GETDIST2 Then Dim ptSel As Point3d - If EgtGetSelectedSnapPoint(m_nSnapType, e.Location.X, e.Location.Y, DIM_SEL, DIM_SEL, ptSel) Then + If EgtGetGraphicSnapPoint(m_nSnapType, e.Location, DIM_SEL, DIM_SEL, ptSel) Then ' disegno la linea (coordinate geo globali) EgtSetGeoLine(m_ptPrev, ptSel) ' calcolo la distanza e il delta e li visualizzo @@ -245,32 +255,33 @@ Public Class Scene m_nStatus = ST.NULL m_nOldStatus = ST.NULL End If + ' se stato selezione punto ElseIf m_nStatus = ST.SELPOINT Then - If EgtGetSelectedSnapPoint(m_nSnapType, e.Location.X, e.Location.Y, DIM_SEL, DIM_SEL, m_ptPrev) Then + If EgtGetGraphicSnapPoint(m_nSnapType, e.Location, DIM_SEL, DIM_SEL, m_ptPrev) Then RaiseEvent OnMouseSelectedPoint(Me, m_ptPrev) End If End If + ' --- Pressione tasto medio (rotella) --- ElseIf e.Button = Windows.Forms.MouseButtons.Middle Then + ' se premuto SHIFT entro in zoom a finestra If (Control.ModifierKeys And Keys.Shift) = Keys.Shift Then - If m_nStatus = ST.ANALYZE Or m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Or m_nStatus = ST.SELPOINT Then - m_nOldStatus = m_nStatus - End If + SaveCurrStatus() m_nStatus = ST.ZOOMWIN Cursor = New Cursor(Me.GetType(), "ZoomWin.cur") + ' se premuto CTRL entro in rotazione vista ElseIf (Control.ModifierKeys And Keys.Control) = Keys.Control Then - If m_nStatus = ST.ANALYZE Or m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Or m_nStatus = ST.SELPOINT Then - m_nOldStatus = m_nStatus - End If + SaveCurrStatus() m_nStatus = ST.ROT Cursor = New Cursor(Me.GetType(), "Rotate.cur") + ' altrimenti entro in pan Else - If m_nStatus = ST.ANALYZE Or m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Or m_nStatus = ST.SELPOINT Then - m_nOldStatus = m_nStatus - End If + SaveCurrStatus() m_nStatus = ST.PAN Cursor = New Cursor(Me.GetType(), "Pan.cur") End If + ' salvo il punto in coordinate finestra m_PrevPoint = e.Location + ' --- Tutti gli altri casi --- Else MyBase.OnMouseDown(e) End If @@ -284,33 +295,55 @@ Public Class Scene If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(m_nGseContext) End If - ' rilascio tasto medio (rotella) - If e.Button = Windows.Forms.MouseButtons.Middle Then + ' --- Rilascio tasto sinistro --- + If e.Button = Windows.Forms.MouseButtons.Left Then + If m_nStatus = ST.WINSEL Then + EgtResetWinRect(True) + ' determino entità selezionate + Dim Center As Point + Center.X = 0.5 * (e.Location.X + m_PrevPoint.X) + Center.Y = 0.5 * (e.Location.Y + m_PrevPoint.Y) + Dim nH As Integer = Abs(e.Location.X - m_PrevPoint.X) + Dim nW As Integer = Abs(e.Location.Y - m_PrevPoint.Y) + Dim nSel As Integer + EgtSelect(Center, nH, nW, nSel) + ' notifico per ogni entità selezionata + Dim nId = EgtGetFirstObjInSelWin() + While nId <> GDB_ID.NULL + Dim nNextId = EgtGetNextObjInSelWin() + RaiseEvent OnMouseSelected(Me, nId, (nNextId = GDB_ID.NULL)) + nId = nNextId + End While + ' ritorno allo stato NULL + m_nStatus = ST.NULL + Cursor = New Cursor(Me.GetType(), "Select.cur") + End If + ' --- Rilascio tasto medio (rotella) --- + ElseIf e.Button = Windows.Forms.MouseButtons.Middle Then If m_nStatus = ST.ZOOMWIN Then EgtResetWinRect(False) EgtZoomWin(m_PrevPoint, e.Location, True) End If ' eventuale ripristino vecchio stato - If m_nOldStatus = ST.ANALYZE Then - m_nStatus = m_nOldStatus - Cursor = New Cursor(Me.GetType(), "Analyze.cur") - ElseIf m_nOldStatus = ST.GETDIST Or m_nOldStatus = ST.GETDIST2 Then - m_nStatus = m_nOldStatus - Cursor = New Cursor(Me.GetType(), "GetDist.cur") - ElseIf m_nOldStatus = ST.SELPOINT Then - m_nStatus = m_nOldStatus - Cursor = New Cursor(Me.GetType(), "Select.cur") + If RestoreStatus() Then + ' non devo fare alcunché ' reset dello stato se non NULL ElseIf m_nStatus <> ST.NULL Then m_nStatus = ST.NULL Cursor = New Cursor(Me.GetType(), "Select.cur") End If - ' rilascio tasto destro + ' --- Rilascio tasto destro --- ElseIf e.Button = Windows.Forms.MouseButtons.Right Then If m_nStatus = ST.NULL Then MenuScene.Visible = True - For Each i As ToolStripMenuItem In MenuScene.Items - If i.Name = "cmdDeselectAll" Then + For Each i As ToolStripItem In MenuScene.Items + If i.Name = "cmdSelectAll" Then + i.Visible = True + ElseIf i.Name = "cmdDeselectAll" Then + i.Visible = True + ElseIf i.Name = "sepSel1" Then + i.Visible = True + ElseIf i.Name = "cmdWinSelect" Then i.Visible = True Else i.Visible = False @@ -318,19 +351,25 @@ Public Class Scene Next ElseIf m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Or m_nStatus = ST.SELPOINT Then MenuScene.Visible = True - For Each i As ToolStripMenuItem In MenuScene.Items - If i.Name = "cmdEndPoint" Then + For Each i As ToolStripItem In MenuScene.Items + If i.Name = "cmdSketchPoint" Then i.Visible = True - i.Checked = (m_nSnapType = SP_END) + DirectCast(i, ToolStripMenuItem).Checked = (m_nSnapType = SP.PT_SKETCH) + ElseIf i.Name = "cmdGridPoint" Then + i.Visible = True + DirectCast(i, ToolStripMenuItem).Checked = (m_nSnapType = SP.PT_GRID) + ElseIf i.Name = "cmdEndPoint" Then + i.Visible = True + DirectCast(i, ToolStripMenuItem).Checked = (m_nSnapType = SP.PT_END) ElseIf i.Name = "cmdMidPoint" Then i.Visible = True - i.Checked = (m_nSnapType = SP_MID) + DirectCast(i, ToolStripMenuItem).Checked = (m_nSnapType = SP.PT_MID) ElseIf i.Name = "cmdCenterPoint" Then i.Visible = True - i.Checked = (m_nSnapType = SP_CENTER) + DirectCast(i, ToolStripMenuItem).Checked = (m_nSnapType = SP.CENTER) ElseIf i.Name = "cmdNearPoint" Then i.Visible = True - i.Checked = (m_nSnapType = SP_NEAR) + DirectCast(i, ToolStripMenuItem).Checked = (m_nSnapType = SP.PT_NEAR) Else i.Visible = False End If @@ -338,7 +377,7 @@ Public Class Scene Else MenuScene.Visible = False End If - ' tutti gli altri casi + ' --- Tutti gli altri casi --- Else MyBase.OnMouseUp(e) End If @@ -356,8 +395,16 @@ Public Class Scene End If 'Visualizzo le coordinate del mouse ShowCursorPos(e.Location) - 'In base allo stato... - If e.Button = Windows.Forms.MouseButtons.Middle Then + ' --- Premuto tasto sinistro --- + If e.Button = Windows.Forms.MouseButtons.Left Then + If m_nStatus = ST.WINSEL Then + Cursor = New Cursor(Me.GetType(), "WinSelect.cur") + EgtSetWinRect(m_PrevPoint, e.Location, True) + 'Else + ' m_nStatus = ST.NULL + End If + ' --- Premuto tasto centrale (rotella) --- + ElseIf e.Button = Windows.Forms.MouseButtons.Middle Then If m_nStatus = ST.ZOOMWIN Then Cursor = New Cursor(Me.GetType(), "ZoomWin.cur") EgtSetWinRect(m_PrevPoint, e.Location, True) @@ -372,8 +419,10 @@ Public Class Scene m_PrevPoint = e.Location Else m_nStatus = ST.NULL - Cursor = New Cursor(Me.GetType(), "Select.cur") End If + ' --- Altri casi dipendenti dallo stato --- + ElseIf m_nStatus = ST.WINSEL Then + Cursor = New Cursor(Me.GetType(), "WinSelect.cur") ElseIf m_nStatus = ST.ANALYZE Then Cursor = New Cursor(Me.GetType(), "Analyze.cur") ElseIf m_nStatus = ST.GETDIST Then @@ -386,8 +435,9 @@ Public Class Scene ElseIf m_nStatus = ST.SELPOINT Then Cursor = New Cursor(Me.GetType(), "Select.cur") Dim ptP As Point3d - EgtUnProjectPoint(e.Location, ptP) - RaiseEvent OnMouseMoveSelPoint(Me, ptP) + If EgtGetGraphicSnapPoint(SP.PT_SKETCH, e.Location, DIM_SEL, DIM_SEL, ptP) Then + RaiseEvent OnMouseMoveSelPoint(Me, ptP) + End If Else MyBase.OnMouseMove(e) End If @@ -439,17 +489,17 @@ Public Class Scene 'costruisco stringa con dati Dim sCursorPos As New System.Text.StringBuilder Select Case nDir - Case CT_TOP, CT_BOTTOM + Case VT.TOP, VT.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 + Case VT.FRONT, VT.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 + Case VT.LEFT, VT.RIGHT sCursorPos.Append("Y=") sCursorPos.Append(ptWorld.y.ToString("F4", CultureInfo.InvariantCulture)) sCursorPos.Append(" Z=") @@ -463,29 +513,112 @@ Public Class Scene Private Sub MenuScene_ItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles MenuScene.ItemClicked - If e.ClickedItem.Name = "cmdDeselectAll" Then + If e.ClickedItem.Name = "cmdSelectAll" Then + + ElseIf e.ClickedItem.Name = "cmdDeselectAll" Then EgtDeselectAll() EgtDraw() + ElseIf e.ClickedItem.Name = "cmdWinSelect" Then + m_nStatus = ST.WINSEL + ElseIf e.ClickedItem.Name = "cmdSketchPoint" Then + m_nSnapType = SP.PT_SKETCH + ElseIf e.ClickedItem.Name = "cmdGridPoint" Then + m_nSnapType = SP.PT_GRID ElseIf e.ClickedItem.Name = "cmdEndPoint" Then - m_nSnapType = SP_END + m_nSnapType = SP.PT_END ElseIf e.ClickedItem.Name = "cmdMidPoint" Then - m_nSnapType = SP_MID + m_nSnapType = SP.PT_MID ElseIf e.ClickedItem.Name = "cmdCenterPoint" Then - m_nSnapType = SP_CENTER + m_nSnapType = SP.CENTER ElseIf e.ClickedItem.Name = "cmdNearPoint" Then - m_nSnapType = SP_NEAR + m_nSnapType = SP.PT_NEAR End If End Sub + '---- Status management ------------- + Private Sub SaveCurrStatus() + If m_nStatus = ST.WINSEL Or + m_nStatus = ST.ANALYZE Or + m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Or + m_nStatus = ST.SELPOINT Then + m_nOldStatus = m_nStatus + End If + End Sub + + Private Function RestoreStatus() As Boolean + ' eventuale ripristino vecchio stato + If m_nOldStatus = ST.WINSEL Then + m_nStatus = m_nOldStatus + Cursor = New Cursor(Me.GetType(), "WinSelect.cur") + Return True + ElseIf m_nOldStatus = ST.ANALYZE Then + m_nStatus = m_nOldStatus + Cursor = New Cursor(Me.GetType(), "Analyze.cur") + Return True + ElseIf m_nOldStatus = ST.GETDIST Or m_nOldStatus = ST.GETDIST2 Then + m_nStatus = m_nOldStatus + Cursor = New Cursor(Me.GetType(), "GetDist.cur") + Return True + ElseIf m_nOldStatus = ST.SELPOINT Then + m_nStatus = m_nOldStatus + Cursor = New Cursor(Me.GetType(), "Select.cur") + Return True + End If + Return False + End Function + + Public Sub SetStatusAnalyze() + m_nStatus = ST.ANALYZE + End Sub + + Public Sub SetStatusGetDistance() + m_nStatus = ST.GETDIST + End Sub + + Public Sub SetStatusSelPoint() + m_nStatus = ST.SELPOINT + End Sub + + Public Sub ResetStatus(Optional ByVal bRedraw As Boolean = True) + ' pulisco eventuali geometrie temporanee + EraseDragGroup() + EgtResetGeoLine(False) + EgtResetWinRect(False) + ' imposto lo stato + m_nStatus = ST.NULL + m_nOldStatus = ST.NULL + ' aggiorno visualizzazione + If bRedraw Then + EgtDraw() + End If + End Sub + + Public Sub ResetStatusAnalyze() + If m_nStatus = ST.ANALYZE Then + m_nStatus = ST.NULL + m_nOldStatus = ST.NULL + End If + End Sub + + Public Sub ResetStatusGetDistance() + If m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Then + m_nStatus = ST.NULL + m_nOldStatus = ST.NULL + End If + EgtResetGeoLine() + RaiseEvent OnCloseGetDist(Me) + End Sub + '---- Drag Group ------ - Private m_nDragGroup As Integer = GDB_ID_NULL + Private m_nDragGroup As Integer = GDB_ID.NULL Public Function CreateDragGroup() As Boolean - m_nDragGroup = EgtCreateGroup(GDB_ID_ROOT) - If m_nDragGroup = GDB_ID_NULL Then + m_nDragGroup = EgtCreateGroup(GDB_ID.ROOT) + If m_nDragGroup = GDB_ID.NULL Then Return False End If - EgtSetLevel(m_nDragGroup, GDB_LV_TEMP) + EgtSetLevel(m_nDragGroup, GDB_LV.TEMP) + EgtSetMark(m_nDragGroup) EgtUnselectableAdd(m_nDragGroup) Return True End Function @@ -493,12 +626,12 @@ Public Class Scene Public Function EraseDragGroup() As Boolean EgtErase(m_nDragGroup) EgtUnselectableRemove(m_nDragGroup) - m_nDragGroup = GDB_ID_NULL + m_nDragGroup = GDB_ID.NULL Return True End Function Public Function AddToDragGroup(ByVal nId As Integer) As Boolean - Return EgtCopyGlob(nId, m_nDragGroup, GDB_SON) <> GDB_ID_NULL + Return EgtCopyGlob(nId, m_nDragGroup, GDB_POS.SON) <> GDB_ID.NULL End Function Public Function GetDragGroup() As Integer @@ -508,7 +641,7 @@ Public Class Scene '---- Main Buttons ---- Public Function NewProject() As Boolean Dim bOk As Boolean = EgtNewFile() - EgtZoom(ZM_ALL) + EgtZoom(ZM.ALL) If bOk Then RaiseEvent OnNewProject(Me) Else @@ -538,7 +671,7 @@ Public Class Scene 'Caricamento del progetto Cursor = Cursors.WaitCursor Dim bOk As Boolean = EgtOpenFile(sFile) - EgtZoom(ZM_ALL) + EgtZoom(ZM.ALL) Cursor = Cursors.Default 'Gestione risultato If bOk Then @@ -550,14 +683,14 @@ Public Class Scene End Function Public Function SaveProject(Optional ByVal sFile As String = "") As Boolean - If String.IsNullOrEmpty(sFile) Or EgtGetFileType(sFile) <> FT_NGE Then + If String.IsNullOrEmpty(sFile) Or EgtGetFileType(sFile) <> FT.NGE Then Return SaveAsProject(sFile) Else 'Prima del salvataggio RaiseEvent OnSavingProject(Me, sFile) 'Salvataggio del progetto Cursor = Cursors.WaitCursor - Dim bOk As Boolean = EgtSaveFile(sFile, NGE_CMPTEXT) + Dim bOk As Boolean = EgtSaveFile(sFile, NGE.CMPTEXT) Cursor = Cursors.Default 'Gestione risultato If bOk Then @@ -584,7 +717,7 @@ Public Class Scene RaiseEvent OnSavingProject(Me, SaveFileDialog.FileName) 'Salvataggio del progetto Cursor = Cursors.WaitCursor - Dim bOk As Boolean = EgtSaveFile(SaveFileDialog.FileName, NGE_CMPTEXT) + Dim bOk As Boolean = EgtSaveFile(SaveFileDialog.FileName, NGE.CMPTEXT) Cursor = Cursors.Default 'Gestione risultato If bOk Then @@ -614,7 +747,7 @@ Public Class Scene End If 'Riconoscimento tipo file Dim nFileType As Integer = EgtGetFileType(sFile) - If nFileType <> FT_DXF And nFileType <> FT_STL And nFileType <> FT_CNC Then + If nFileType <> FT.DXF And nFileType <> FT.STL And nFileType <> FT.CNC Then MessageBox.Show("File type unknown", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Return False End If @@ -624,14 +757,14 @@ Public Class Scene Cursor = Cursors.WaitCursor Dim bOk As Boolean = EgtNewFile() 'Importazione - If nFileType = FT_DXF Then + If nFileType = FT.DXF Then bOk = bOk And EgtImportDxf(sFile) - ElseIf nFileType = FT_STL Then + ElseIf nFileType = FT.STL Then bOk = bOk And EgtImportStl(sFile) - ElseIf nFileType = FT_CNC Then + ElseIf nFileType = FT.CNC Then bOk = bOk And EgtImportCnc(sFile) End If - EgtZoom(ZM_ALL) + EgtZoom(ZM.ALL) Cursor = Cursors.Default 'Gestione risultato If bOk Then @@ -656,7 +789,7 @@ Public Class Scene End If 'Riconoscimento tipo file Dim nFileType As Integer = EgtGetFileType(SaveFileDialog.FileName) - If nFileType <> FT_DXF And nFileType <> FT_STL Then + If nFileType <> FT.DXF And nFileType <> FT.STL Then MessageBox.Show("File type unknown", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Return False End If @@ -665,10 +798,10 @@ Public Class Scene 'Esportazione del progetto Cursor = Cursors.WaitCursor Dim bOk As Boolean = False - If nFileType = FT_DXF Then - bOk = EgtExportDxf(GDB_ID_ROOT, SaveFileDialog.FileName) - ElseIf nFileType = FT_STL Then - bOk = EgtExportStl(GDB_ID_ROOT, SaveFileDialog.FileName) + If nFileType = FT.DXF Then + bOk = EgtExportDxf(GDB_ID.ROOT, SaveFileDialog.FileName) + ElseIf nFileType = FT.STL Then + bOk = EgtExportStl(GDB_ID.ROOT, SaveFileDialog.FileName) End If Cursor = Cursors.Default 'Gestione risultato @@ -712,7 +845,7 @@ Public Class Scene Else bOk = EgtTscExecFile(sFile) End If - EgtZoom(ZM_ALL) + EgtZoom(ZM.ALL) Cursor = Cursors.Default 'Gestione risultato If bOk Then @@ -727,105 +860,67 @@ Public Class Scene Return bOk End Function - '---- Analyze Operations ------------- - Public Sub SetStatusAnalyze() - m_nStatus = ST.ANALYZE + '---- Zoom Buttons ---- + Public Sub ZoomAll() + EgtZoom(ZM.ALL) End Sub - Public Sub ResetStatusAnalyze() - If m_nStatus = ST.ANALYZE Then - m_nStatus = ST.NULL - m_nOldStatus = ST.NULL - End If + Public Sub ZoomIn() + EgtZoom(ZM.IN_) End Sub - '---- Distance Operations ------------- - Public Sub SetStatusGetDistance() - m_nStatus = ST.GETDIST + Public Sub ZoomOut() + EgtZoom(ZM.OUT) End Sub - Public Sub ResetStatusGetDistance() - If m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Then - m_nStatus = ST.NULL - m_nOldStatus = ST.NULL - End If - EgtResetGeoLine() - RaiseEvent OnCloseGetDist(Me) - End Sub - - '---- Distance Operations ------------- - Public Sub SetStatusSelPoint() - m_nStatus = ST.SELPOINT - End Sub - - Public Sub ResetStatusSelPoint() - If m_nStatus = ST.SELPOINT Then - m_nStatus = ST.NULL - m_nOldStatus = ST.NULL - End If - End Sub - - '---- Zoom Buttons ---- - Public Sub ZoomAll() - EgtZoom(ZM_ALL) - End Sub - - Public Sub ZoomIn() - EgtZoom(ZM_IN) - End Sub - - Public Sub ZoomOut() - EgtZoom(ZM_OUT) - End Sub - '---- Rendering Buttons ---- Public Sub WireFrame() - EgtSetShowMode(SM_WIREFRAME) + EgtSetShowMode(SM.WIREFRAME) End Sub Public Sub HiddenLine() - EgtSetShowMode(SM_HIDDENLINE) + EgtSetShowMode(SM.HIDDENLINE) End Sub Public Sub Shading() - EgtSetShowMode(SM_SHADING) + EgtSetShowMode(SM.SHADING) End Sub '---- LookFrom Buttons ---- Public Sub TopView() - EgtSetView(CT_TOP) - End Sub - - Public Sub IsoViewSW() - EgtSetView(CT_ISO_SW) - End Sub - - Public Sub IsoViewSE() - EgtSetView(CT_ISO_SE) - End Sub - - Public Sub IsoViewNE() - EgtSetView(CT_ISO_NE) - End Sub - - Public Sub IsoViewNW() - EgtSetView(CT_ISO_NW) + EgtSetView(VT.TOP) End Sub Public Sub FrontView() - EgtSetView(CT_FRONT) + EgtSetView(VT.FRONT) End Sub Public Sub BackView() - EgtSetView(CT_BACK) + EgtSetView(VT.BACK) End Sub Public Sub LeftView() - EgtSetView(CT_LEFT) + EgtSetView(VT.LEFT) End Sub Public Sub RightView() - EgtSetView(CT_RIGHT) + EgtSetView(VT.RIGHT) + End Sub + + Public Sub IsoViewSW() + EgtSetView(VT.ISO_SW) + End Sub + + Public Sub IsoViewSE() + EgtSetView(VT.ISO_SE) + End Sub + + Public Sub IsoViewNE() + EgtSetView(VT.ISO_NE) + End Sub + + Public Sub IsoViewNW() + EgtSetView(VT.ISO_NW) End Sub End Class \ No newline at end of file diff --git a/SelectMulti.vb b/SelectMulti.vb index 99981c2..85e23a6 100644 --- a/SelectMulti.vb +++ b/SelectMulti.vb @@ -10,7 +10,7 @@ Public Class SelectMulti ListBox1.BeginUpdate() 'Inserisco le entità nel mirino Dim nId = EgtGetFirstObjInSelWin() - While nId <> GDB_ID_NULL + While nId <> GDB_ID.NULL Dim sTitle As String = String.Empty EgtGetTitle(nId, sTitle) If EgtIsSelectedObj(nId) Then @@ -22,10 +22,10 @@ Public Class SelectMulti nId = EgtGetNextObjInSelWin() End While 'Inserisco None per non selezionare alcunchè - Dim smNone As New SelMulItem("None", GDB_ID_NULL) + Dim smNone As New SelMulItem("None", GDB_ID.NULL) ListBox1.Items.Add(smNone) ListBox1.EndUpdate() - m_nCurrEnt = GDB_ID_NULL + m_nCurrEnt = GDB_ID.NULL ListBox1.SelectedIndex = 0 End Sub diff --git a/TestEIn.vbproj b/TestEIn.vbproj index 1a81478..75473ba 100644 --- a/TestEIn.vbproj +++ b/TestEIn.vbproj @@ -336,6 +336,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\TestEIn\TestEInR32.exe