📄 digitizetinpolygon.frm
字号:
VERSION 5.00
Begin VB.Form frmDigitizeTinPolygon
BorderStyle = 4 'Fixed ToolWindow
Caption = "Options"
ClientHeight = 1788
ClientLeft = 48
ClientTop = 288
ClientWidth = 3672
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1788
ScaleWidth = 3672
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtBufOffset
Height = 315
Left = 2520
TabIndex = 8
Text = "txtBuffOffset"
Top = 480
Width = 1095
End
Begin VB.TextBox txtZ
Height = 315
Left = 2520
TabIndex = 7
Text = "txtZ"
Top = 1200
Width = 1095
End
Begin VB.ComboBox cboSFType
Height = 315
Left = 1320
Style = 2 'Dropdown List
TabIndex = 4
Top = 120
Width = 2295
End
Begin VB.CheckBox chkConflictDetect
Caption = "Conflict detection"
Height = 195
Left = 120
TabIndex = 3
Top = 1440
Width = 1575
End
Begin VB.ComboBox cboHeightSource
Height = 315
Left = 1320
Style = 2 'Dropdown List
TabIndex = 2
Top = 840
Width = 2295
End
Begin VB.CommandButton Command1
Height = 375
Left = 3120
Picture = "DigitizeTinPolygon.frx":0000
Style = 1 'Graphical
TabIndex = 0
Top = 1320
Visible = 0 'False
Width = 375
End
Begin VB.CommandButton cmdNo
Height = 375
Left = 2760
MouseIcon = "DigitizeTinPolygon.frx":0342
Picture = "DigitizeTinPolygon.frx":0494
TabIndex = 11
Top = 1320
Visible = 0 'False
Width = 375
End
Begin VB.CommandButton cmdCross
Height = 375
Left = 2400
MouseIcon = "DigitizeTinPolygon.frx":05E6
Picture = "DigitizeTinPolygon.frx":08F0
TabIndex = 10
Top = 1320
Visible = 0 'False
Width = 375
End
Begin VB.Label labOffset
Caption = "Replace offset:"
Height = 255
Left = 1320
TabIndex = 9
Top = 495
Width = 1095
End
Begin VB.Label labHeight
Caption = "Height:"
Height = 255
Left = 1320
TabIndex = 6
Top = 1240
Width = 495
End
Begin VB.Label Label2
Caption = "SFType:"
Height = 255
Left = 120
TabIndex = 5
Top = 200
Width = 735
End
Begin VB.Label Label1
Caption = "Height source:"
Height = 255
Left = 120
TabIndex = 1
Top = 885
Width = 1095
End
End
Attribute VB_Name = "frmDigitizeTinPolygon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Copyright 1995-2004 ESRI
' All rights reserved under the copyright laws of the United States.
' You may freely redistribute and use this sample code, with or without modification.
' Disclaimer: THE SAMPLE CODE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
' WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
' FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ESRI OR
' CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
' OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
' SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
' INTERRUPTION) SUSTAINED BY YOU OR A THIRD PARTY, HOWEVER CAUSED AND ON ANY
' THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING IN ANY
' WAY OUT OF THE USE OF THIS SAMPLE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF
' SUCH DAMAGE.
' For additional information contact: Environmental Systems Research Institute, Inc.
' Attn: Contracts Dept.
' 380 New York Street
' Redlands, California, U.S.A. 92373
' Email: contracts@esri.com
Option Explicit
Public Sub Init(pTin As ITin)
Dim pEnv As IEnvelope
Set pEnv = pTin.Extent
Dim pSurf As ISurface
Set pSurf = pTin
If (pSurf.IsVoidZ(pEnv.zmin)) Then
txtZ = "0.0"
Else
Dim sZ As String
sZ = Format((pEnv.zmax + pEnv.zmin) * 0.5, "###0.00")
txtZ = sZ
End If
End Sub
Private Sub cboHeightSource_Click()
txtZ.Enabled = (cboHeightSource.ItemData(cboHeightSource.ListIndex) = 4)
labHeight.Enabled = txtZ.Enabled
End Sub
Private Sub cboSFType_Click()
' If 'Replace' is chosen we must only provide constant height options.
If (cboSFType.ItemData(cboSFType.ListIndex) = esriTinHardReplace) And _
(cboHeightSource.ListCount > 1) Then
cboHeightSource.RemoveItem 0
cboHeightSource.ListIndex = 0
Else
If (cboHeightSource.ListCount = 3) Then ' if 'Replace' was gone add it back
cboHeightSource.AddItem "variable along surface", 0
cboHeightSource.ItemData(0) = 1
End If
End If
txtBufOffset.Enabled = (cboSFType.ItemData(cboSFType.ListIndex) = esriTinHardReplace)
labOffset.Enabled = txtBufOffset.Enabled
End Sub
Private Sub Form_Load()
' TODO - add other 'Soft' SFType options
cboSFType.AddItem "Replace"
cboSFType.ItemData(0) = esriTinHardReplace
cboSFType.AddItem "Erase"
cboSFType.ItemData(1) = esriTinHardErase
cboSFType.AddItem "Clip"
cboSFType.ItemData(2) = esriTinHardClip
cboSFType.AddItem "Hard line"
cboSFType.ItemData(3) = esriTinHardLine
cboSFType.AddItem "Soft line"
cboSFType.ItemData(4) = esriTinSoftLine
cboHeightSource.AddItem "variable along surface"
cboHeightSource.ItemData(0) = 1
cboHeightSource.AddItem "max z from surface"
cboHeightSource.ItemData(1) = 2
cboHeightSource.AddItem "min z from surface"
cboHeightSource.ItemData(2) = 3
cboHeightSource.AddItem "specified"
cboHeightSource.ItemData(3) = 4
cboSFType.ListIndex = 3
cboHeightSource.ListIndex = 3
txtBufOffset = "1"
win32Util.FloatWindow Me, True
End Sub
Public Function GetSFType() As esriTinSurfaceType
GetSFType = cboSFType.ItemData(cboSFType.ListIndex)
End Function
Public Function GetHeightSource() As Long
GetHeightSource = cboHeightSource.ItemData(cboHeightSource.ListIndex)
End Function
Public Function GetHeight() As Double
GetHeight = CDbl(txtZ)
End Function
Public Function GetBufOffset() As Double
GetBufOffset = CDbl(txtBufOffset)
End Function
Public Function DetectConflicts() As Boolean
DetectConflicts = (chkConflictDetect.Value = 1)
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -