📄 form1.frm
字号:
VERSION 5.00
Object = "{257830F1-B11E-4360-A3B9-E2E9D72A50E3}#3.2#0"; "SuperMap.ocx"
Object = "{48E26958-8493-4227-B03C-CADC6672F47D}#3.2#0"; "Super3D.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "Super3D演示"
ClientHeight = 6420
ClientLeft = 1185
ClientTop = 675
ClientWidth = 10200
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 428
ScaleMode = 3 'Pixel
ScaleWidth = 680
Begin VB.Timer Timer3
Left = 8760
Top = 6960
End
Begin VB.CommandButton cmdRotate
Caption = "旋转"
Height = 450
Left = 30
Style = 1 'Graphical
TabIndex = 20
Top = 1698
Width = 870
End
Begin VB.CommandButton Command8
Caption = "放大"
Height = 450
Left = 30
TabIndex = 19
Top = 606
Width = 870
End
Begin VB.CommandButton Command7
Caption = "缩小"
Height = 450
Left = 30
TabIndex = 18
Top = 1152
Width = 870
End
Begin VB.CommandButton cmdMouse
Caption = "Command7"
Height = 450
Left = 30
TabIndex = 16
Top = 5010
Width = 870
End
Begin VB.Timer Timer2
Left = 8640
Top = 6240
End
Begin VB.CommandButton Command6
Caption = "水淹"
Height = 450
Left = 30
Style = 1 'Graphical
TabIndex = 15
Top = 3885
Width = 870
End
Begin VB.CommandButton Command5
Caption = "退出"
Height = 450
Left = 9000
TabIndex = 14
Top = 5775
Width = 870
End
Begin VB.CommandButton Command2
Caption = "背景贴图"
Height = 450
Left = 30
TabIndex = 13
Top = 2790
Width = 870
End
Begin MSComDlg.CommonDialog Dlg
Left = 9000
Top = 6240
_ExtentX = 688
_ExtentY = 688
_Version = 393216
End
Begin VB.Timer Timer1
Left = 8640
Top = 6600
End
Begin VB.CommandButton Rolld
Caption = "低"
Height = 372
Left = 8400
TabIndex = 12
Top = 1200
Width = 372
End
Begin VB.CommandButton Roll
Caption = "抬"
Height = 372
Left = 8400
TabIndex = 11
Top = 120
Width = 372
End
Begin VB.CommandButton Down
Caption = "下"
Height = 372
Left = 9720
TabIndex = 10
Top = 1200
Width = 372
End
Begin VB.CommandButton Up
Caption = "上"
Height = 372
Left = 9720
TabIndex = 9
Top = 120
Width = 372
End
Begin VB.CommandButton Path
Caption = "录制"
Height = 492
Left = 8880
Style = 1 'Graphical
TabIndex = 8
Top = 600
Width = 612
End
Begin VB.CommandButton Left
Appearance = 0 'Flat
Caption = "左"
Height = 492
Left = 8400
TabIndex = 7
Top = 600
Width = 492
End
Begin VB.CommandButton Right
Appearance = 0 'Flat
Caption = "右"
Height = 492
Left = 9480
TabIndex = 6
Top = 600
Width = 492
End
Begin VB.CommandButton Backward
Appearance = 0 'Flat
Caption = "后"
Height = 492
Left = 8880
TabIndex = 5
Top = 1080
Width = 612
End
Begin VB.CommandButton Forward
Appearance = 0 'Flat
Caption = "前"
Height = 492
Left = 8880
TabIndex = 4
Top = 120
Width = 612
End
Begin VB.CommandButton Command4
Caption = "输出"
Height = 450
Left = 30
TabIndex = 3
Top = 3336
Width = 870
End
Begin VB.CommandButton Command3
Caption = "背景色"
Height = 450
Left = 30
TabIndex = 2
Top = 2244
Width = 870
End
Begin Super3DLib.Super3D Super3D1
Height = 5955
Left = 1080
TabIndex = 1
Top = 240
Width = 6975
_Version = 196610
_ExtentX = 12303
_ExtentY = 10504
_StockProps = 128
AltitudeField = ""
Texture = ""
ScaleZ = 1
End
Begin SuperMapLib.SuperWorkspace SuperWorkspace1
Left = 9240
Top = 6600
_Version = 196610
_ExtentX = 847
_ExtentY = 847
_StockProps = 0
End
Begin VB.CommandButton Command1
Caption = "连接"
Height = 450
Left = 30
Picture = "Form1.frx":0000
TabIndex = 0
Top = 60
Width = 870
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "窗口操作:"
Height = 195
Left = 60
TabIndex = 17
Top = 4635
Width = 900
End
Begin VB.Shape Shape2
Height = 1452
Left = 8400
Top = 120
Width = 1692
End
Begin VB.Shape Shape1
Height = 6210
Left = 960
Top = 120
Width = 7215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'=====================================SuperMap Objects示范工程说明=======================================
'
'功能简介:示范SuperMap Objects中三维的基本操作:三维的放大、缩小、平移、旋转、淹没、查询、有方向的运动等
'所用控件:Supermap控件,SuperWorkspace控件和Super3D控件
'所用数据:当前目录下的data\dem.sdb和dem.sdd两个文件
'操作说明:
' 1、点击"连接",打开三维图像
' 2、点击"放大"、"缩小",三维图像会缩放指定的比例(本例中,指定放大为1.20倍,缩小为0.8倍)
' 3、点击"平移状态",在三维窗口中按下鼠标左键,拖动,能够平移图像
' 4、点击"查询状态",能够查询鼠标点击处图像的高程
' 5、点击"旋转",图像会自动旋转,此时按下"结束",可以随时中止旋转
' 6、点击"水淹",可以进行三维图像被水淹没的模拟
' 7、点击"复位",可以把三维图像恢复为初始时的状态
' 8、点击右上侧的"前"、"后"等按钮,三维图像则做相应的移动
'
'===================================SuperMap Objects示范工程说明结束=====================================
Dim ViewPoint As soPoint3D
Dim ViewHeading As Single
Dim ViewRoll As Single
Dim PFlag As Integer
Const PI = 3.1415926
Const Step = 300
Dim FlyPathViewPoint(1 To 100) As New soPoint3D
Dim FlyPathViewHeading(1 To 100) As Single
Dim FlyPathViewRoll(1 To 100) As Single
Dim FlyPathCount As Integer
Dim TimerFlyPosition As Integer
Dim cmd1Flag As Boolean
Dim MouseFlag As Integer
Dim WaterHeight As Single
Dim XStart As Single, YStart As Single
Dim mouseDown As Boolean
Dim dTwipsX As Integer, dTwipsY As Integer 'twips per pixel on screen
Private Sub Backward_Click()
Dim R1 As Single
Set ViewPoint = Super3D1.FlightControl.ViewPoint
R1 = Super3D1.FlightControl.Heading * PI / 180#
ViewPoint.y = Super3D1.FlightControl.ViewPoint.y + Step * Cos(R1)
ViewPoint.x = Super3D1.FlightControl.ViewPoint.x + Step * Sin(R1)
Super3D1.Fly ViewPoint, 0, Super3D1.FlightControl.Roll, 0, Super3D1.FlightControl.Heading
If PFlag = 2 Then
FlyPathCount = FlyPathCount + 1
If FlyPathCount > 100 Then
FlyPathCount = 1
End If
Set FlyPathViewPoint(FlyPathCount) = Super3D1.FlightControl.ViewPoint
FlyPathViewRoll(FlyPathCount) = Super3D1.FlightControl.Roll
FlyPathViewHeading(FlyPathCount) = Super3D1.FlightControl.Heading
End If
End Sub
Private Sub cmdMouse_Click()
MouseFlag = MouseFlag + 1
If MouseFlag > 3 Then
MouseFlag = 1
End If
If MouseFlag = 1 Then
cmdMouse.Caption = "平移状态"
ElseIf MouseFlag = 2 Then
cmdMouse.Caption = "缩放状态"
ElseIf MouseFlag = 3 Then
cmdMouse.Caption = "查询状态"
End If
End Sub
Private Sub cmdRotate_Click()
If cmdRotate.Caption = "旋转" Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -