'Calculate the weight of the filament given the length, diameter and
density of the filament. Set the \'Weight\' field to this value.'

def calculateWeight(self, event):

    length = getFloat(self, self.length_dialog.field.GetValue())
    diameter = getFloat(self, self.diameter_dialog.field.GetValue())
    density = getFloat(self, self.density_dialog.field.GetValue())
    if (length and diameter and density):
        pi = 3.14159265359
        mass = ((((length * pi) * (diameter ** 2)) * density) / 4000000.0)
        self.weight_dialog.field.ChangeValue(('%.2f' % mass))
        self.statusbar.SetStatusText('')
    else:
        self.weight_dialog.field.ChangeValue('---')
