Пример #1
0
 def __set_properties(self):
     data = {
         'density': app.get_multiplace_tool().getintensity(),
         'diameter': app.get_multiplace_tool().getdiameter(),
         'random rotation': app.get_multiplace_tool().getrandomrotation(),
         'size offset': app.get_multiplace_tool().getsizevariation()
         }
     self.restore([data])
Пример #2
0
    def restore(self, data_list):
        data = data_list[0]

        # Restore tool
        tool = app.get_multiplace_tool()
        tool.setintensity( data['density'] )
        tool.setdiameter( data['diameter'] )
        tool.setrandomrotation( data['random rotation'] )
        if data.has_key('size offset'):
            tool.setsizevariation( data['size offset'] )

        # Restore controls
        self.slider_density.set_value( tool.getintensity() )
        self.slider_diameter.set_value( tool.getdiameter() )
        self.checkbox_random_rotation.SetValue( tool.getrandomrotation() )
        self.slider_size_offset.set_value( tool.getsizevariation() * 100 )
Пример #3
0
 def on_change_size_offset(self, event):
     app.get_multiplace_tool().setsizevariation(
         self.slider_size_offset.get_value() / 100 )
Пример #4
0
 def on_toggle_random_rotation(self, event):
     app.get_multiplace_tool().setrandomrotation(
         self.checkbox_random_rotation.GetValue() )
Пример #5
0
 def on_change_diameter(self, event):
     app.get_multiplace_tool().setdiameter(
         self.slider_diameter.get_value() )
Пример #6
0
 def on_change_density(self, event):
     app.get_multiplace_tool().setintensity(
         self.slider_density.get_value() )