ComparePolygons example
Example for ComparePolygons method
Dim hMain As Integer
Dim hSec As Integer
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
cAvax1.StartAvax()
hMain = CAvax1.Add_ShapeRectangle(0, 0, 10, 10, Nothing, 1, 0, 1, 1, "", 0, 0, -1, -1, -1, -1)
hSec = CAvax1.Add_ShapeRectangle(5, 5, 4, 4, Nothing, 1, 0, 1, 2, "", 0, 0, -1, -1, -1, -1)
End Sub
Private Sub Form1_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
cAvax1.EndAvax()
End Sub
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
Dim sMsg As String
Dim iAns As Avax.AvaxPolygonsComp
Dim Answer As Boolean
If cAvax1.ComparePolygons(hMain, hSec, iAns) = True Then
Select Case iAns
Case Avax.AvaxPolygonsComp.Cross_p
sMsg = "The yellow rectangle crosses the red one"
Case Avax.AvaxPolygonsComp.ExtContact_p
sMsg = "The yellow rectangle is in external contact with the red one"
Case Avax.AvaxPolygonsComp.In_p
sMsg = "The yellow rectangle is inside the red one"
Case Avax.AvaxPolygonsComp.Out_p
sMsg = "The yellow rectangle is outside the red one"
End Select
MsgBox(sMsg, MsgBoxStyle.Information, "Compare polygons")
End If
End Sub