home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Selection Example"
- ClientHeight = 5835
- ClientLeft = 1140
- ClientTop = 1425
- ClientWidth = 5805
- Height = 6210
- Left = 1080
- LinkTopic = "Form1"
- ScaleHeight = 5835
- ScaleWidth = 5805
- Top = 1110
- Width = 5925
- Begin VB.TextBox Text1
- Height = 495
- Left = 0
- TabIndex = 1
- Top = 5280
- Width = 5775
- End
- Begin VB.Label Label1
- Caption = "Please select an object in the scene:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 13.5
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 0
- TabIndex = 2
- Top = 0
- Width = 5775
- End
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 4695
- Left = 0
- TabIndex = 0
- Top = 600
- Width = 5775
- _Version = 131072
- _ExtentX = 10186
- _ExtentY = 8281
- _StockProps = 0
- viewingOn = 0 'False
- urlPickEnable = 0 'False
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Dim cone As SoCone
- Dim cube As SoCube
- Dim cubeType As SoType
- Dim g_selCB As SoSelectionPathCB
- Dim g_dselCB As SoSelectionPathCB
- Private Sub Form_Initialize()
- Dim rootNode As SoSelection
- Dim tran As SoTransform
- Set g_selCB = New SoSelectionPathCB
- Set g_dselCB = New SoSelectionPathCB
- Set cone = New SoCone
- Set cube = New SoCube
- Set cubeType = cube.getClassTypeId
- Set tran = New SoTransform
- Call tran.translation.setValue(2.25, 0#, 0#)
- Set rootNode = V3Space1.getSceneRoot
-
- Call rootNode.addChild(cone)
- Call rootNode.addChild(tran)
- Call rootNode.addChild(cube)
- Call V3Space1.viewAll
-
- Call rootNode.addSelectionCallback(V3Space1.GetIDispatch(), g_selCB)
- Call rootNode.addDeselectionCallback(V3Space1.GetIDispatch(), g_dselCB)
-
- Set rootNode = Nothing
- Set cone = Nothing
- Set cube = Nothing
- Set tran = Nothing
- End Sub
- Private Sub V3Space1_DeselectionCallback(ByVal pathCB As Object, ByVal path As Object)
- Text1.Text = "Deselect"
- End Sub
- Private Sub V3Space1_SelectionCallback(ByVal pathCB As Object, ByVal path As Object)
-
- Dim pathTail
- Dim pathType As SoType
- Set pathTail = path.getTail
- Set pathType = pathTail.getClassTypeId
- Dim flag As Boolean
- flag = cubeType.equals(pathType)
- If (flag) Then
- Text1.Text = "Select Cube"
- Else
- Text1.Text = "Select Cone"
- End If
- Set pathType = Nothing
- Set pathTail = Nothing
- End Sub
-