31.05.2013 Views

2 Taglio della vegetazione - Intro Page - Università degli Studi di ...

2 Taglio della vegetazione - Intro Page - Università degli Studi di ...

2 Taglio della vegetazione - Intro Page - Università degli Studi di ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Loop While max(MatriceCampo) > 0 'Il loop viene eseguito fino a quando esistno punti<br />

del campo non controllati<br />

Copy(MatriceCampoTemp, MatriceCampo) 'Rigenera MatriceCampo<br />

Stoppati = False 'Previene lo stop <strong>della</strong> simulazione<br />

If PuntoBuono Then MsgBox("Fine simulazione " & CStr(i) & " " & CStr(j)) 'Informa<br />

<strong>della</strong> fine <strong>della</strong> simulazione solo per pnti del contorno accettabili<br />

End If<br />

Next<br />

Next<br />

MsgBox("Fine") 'Informa <strong>della</strong> fine del ciclo completo <strong>di</strong> simulazioni<br />

End Sub<br />

Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)<br />

Handles btnQuit.Click<br />

End 'Termina il programma<br />

End Sub<br />

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As<br />

System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint<br />

Campo = Me.CreateGraphics 'Crea la grafica del campo minato<br />

If CampoDefinito Then 'Aggiorna la Form solo se il Campo è stato definito<br />

Dim i, j As Integer<br />

If 5 * c > 464 Then Me.Width = 5 * c + 32 'Ri<strong>di</strong>mensiona la Form se il campo da <strong>di</strong>segnare è<br />

più grande <strong>di</strong> un certo valore<br />

Me.boxPulsanti.Location = New Point((Me.Width - Me.boxPulsanti.Width) / 2 - 4, 50 + 5 * r)<br />

'Riposiziona il box che contiene i bottoni<br />

Me.Height = 5 * r + 160 'Ri<strong>di</strong>mensiona l'altezza <strong>della</strong> form tenendo conto delle <strong>di</strong>mensioni del<br />

campo <strong>di</strong>segnato<br />

Me.btnStartSimul.Enabled = True 'Abilita il pulsante <strong>di</strong> inizio simulazione<br />

Draw(Me) 'Disegna la form<br />

End If<br />

End Sub<br />

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)<br />

Handles Button1.Click<br />

Stoppati = True 'Interrompe la simulazione<br />

End Sub<br />

End Class<br />

151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!