home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "03_03 Naming"
- ClientHeight = 5655
- ClientLeft = 915
- ClientTop = 1230
- ClientWidth = 5625
- Height = 6030
- Left = 855
- LinkTopic = "Form1"
- ScaleHeight = 5655
- ScaleWidth = 5625
- Top = 915
- Width = 5745
- Begin VB.CommandButton Command2
- Caption = "Remove Cube"
- Height = 612
- Left = 0
- TabIndex = 2
- Top = 4920
- Width = 2532
- End
- Begin VB.CommandButton Command1
- Caption = "Add Cube"
- Height = 612
- Left = 3000
- TabIndex = 1
- Top = 4920
- Width = 2532
- End
- Begin TgsVisual3SpaceLibCtl.V3Space V3Space1
- Height = 4812
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 5532
- _Version = 131072
- _ExtentX = 9758
- _ExtentY = 8488
- _StockProps = 0
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Dim cubePresent As Boolean
- Private Sub Command1_Click()
- If cubePresent Then
- Exit Sub
- Else
- cubePresent = True
- End If
- Dim sceneRoot As SoSelection
- Set sceneRoot = V3Space1.getSceneRoot
- Dim myRoot As SoSeparator
- Set myRoot = sceneRoot.getByName("Root")
- If (myRoot Is Nothing) Then
- Exit Sub
- End If
- Dim myCube As SoCube
- Set myCube = New SoCube
- Call myCube.setName("MyCube")
- Call myRoot.insertChild(myCube, 0)
- 'clean up
- Set sceneRoot = Nothing
- Set myRoot = Nothing
- Set myCube = Nothing
- End Sub
- Private Sub Command2_Click()
- If Not cubePresent Then
- Exit Sub
- Else
- cubePresent = False
- End If
- Dim sceneRoot As SoSelection
- Set sceneRoot = V3Space1.getSceneRoot
- Dim myRoot As SoSeparator
- Set myRoot = sceneRoot.getByName("Root")
- Dim myCube As SoCube
- Set myCube = myRoot.getByName("MyCube")
-
- Call myRoot.removeChildNode(myCube)
- End Sub
- Private Sub Form_Initialize()
- Call V3Space1.deleteSceneGraph
- 'Create some objects and give them names:
- Dim root As SoSeparator
- Set root = New SoSeparator
- Call root.ref
- Call root.setName("Root")
- Dim myCube As SoCube
- Set myCube = New SoCube
- Call root.addChild(myCube)
- Call myCube.setName("MyCube")
- Dim mySphere As SoSphere
- Set mySphere = New SoSphere
- Call root.addChild(mySphere)
- Call mySphere.setName("MySphere")
- Call V3Space1.setSceneRoot(root)
- Call V3Space1.viewAll
- Call V3Space1.setDecorations(False)
- cubePresent = True
- End Sub
-