Пример #1
0
    def __init__(self, *args, **kwds):
        ToolPanel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolRaiseLow')

        self.__set_properties()
        self._do_layout()
        self._bind_events()
Пример #2
0
 def __init__(self, *args, **kwds):
     ToolPanel.__init__(self, *args, **kwds)
     self.tool = trn.get_terrain_tool('toolNoise')
     
     self.__set_properties()
     self._do_layout()
     self._bind_events()
Пример #3
0
 def __init__(self, *args, **kwds):
     ToolPanel.__init__(self, *args, **kwds)
     self.tool = trn.get_terrain_tool('toolFlatten')
     
     # controls
     # Needed to set the slider range here because using the
     # __update_slider_range doesn't update the slider range if called
     # during dialog contruction.
     outdoor = app.get_outdoor()
     if outdoor is None:
         min_value = 0.0
         max_value = 100.0
     else:
         min_value = outdoor.getminheight()
         max_value = outdoor.getmaxheight()
     value = (max_value - min_value) / 2
     self.slider_height = floatslider.FloatSlider(
         self, -1, "Height", value, min_value, max_value, precision=10.0
         )
     self.checkbox_adaptive = wx.CheckBox(self, -1, "")
     self.slider_adaptive = floatslider.FloatSlider(
         self, -1, "Adaptive", 0.5, 0.0, 1.0, precision=1000.0
         )
     
     self.__set_properties()
     self.__do_layout()
     self._bind_events()
Пример #4
0
    def __init__(self, *args, **kwds):
        ToolPanel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolFlatten')

        # controls
        # Needed to set the slider range here because using the
        # __update_slider_range doesn't update the slider range if called
        # during dialog contruction.
        outdoor = app.get_outdoor()
        if outdoor is None:
            min_value = 0.0
            max_value = 100.0
        else:
            min_value = outdoor.getminheight()
            max_value = outdoor.getmaxheight()
        value = (max_value - min_value) / 2
        self.slider_height = floatslider.FloatSlider(self,
                                                     -1,
                                                     "Height",
                                                     value,
                                                     min_value,
                                                     max_value,
                                                     precision=10.0)
        self.checkbox_adaptive = wx.CheckBox(self, -1, "")
        self.slider_adaptive = floatslider.FloatSlider(self,
                                                       -1,
                                                       "Adaptive",
                                                       0.5,
                                                       0.0,
                                                       1.0,
                                                       precision=1000.0)

        self.__set_properties()
        self.__do_layout()
        self._bind_events()
Пример #5
0
    def __init__(self, *args, **kwds):
        ToolPanel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolPaint')

        self.slider_blend = floatslider.FloatSlider(self,
                                                    -1,
                                                    "Blend",
                                                    0.5,
                                                    0.0,
                                                    1.0,
                                                    precision=1000.0)
        self.staticbox_filter = wx.StaticBox(self, -1, "Filter")
        self.checkbox_slope = wx.CheckBox(self, -1, "Filter by slope")
        self.slider_min_slope = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Min. slope",
                                                        15.0,
                                                        0.0,
                                                        90.0,
                                                        precision=10.0)
        self.slider_max_slope = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Max. slope",
                                                        45.0,
                                                        0.0,
                                                        90.0,
                                                        precision=10.0)
        self.staticline_filter = wx.StaticLine(self, -1)
        self.checkbox_height = wx.CheckBox(self, -1, "Filter by height")
        # Needed to set the height sliders range here because using the
        # __update_sliders_height doesn't update the height sliders range if
        # called during dialog contruction.
        outdoor = app.get_outdoor()
        if outdoor is None:
            min_value = 0.0
            max_value = 100.0
        else:
            min_value = outdoor.getminheight()
            max_value = outdoor.getmaxheight()
        value = 0.8 * min_value + 0.2 * max_value
        self.slider_min_height = floatslider.FloatSlider(self,
                                                         -1,
                                                         "Min. height",
                                                         value,
                                                         min_value,
                                                         max_value,
                                                         precision=10.0)
        value = 0.2 * min_value + 0.8 * max_value
        self.slider_max_height = floatslider.FloatSlider(self,
                                                         -1,
                                                         "Max. height",
                                                         value,
                                                         min_value,
                                                         max_value,
                                                         precision=10.0)

        self.__set_properties()
        self._do_layout()
        self._bind_events()
Пример #6
0
 def on_select_material(self, event):
     if self.material_selected != event.GetEventObject():
         if self.material_selected is not None:
             self.material_selected.deselect()
         self.material_selected = event.GetEventObject()
         material_id = self.__get_id_for_selected_material()
         tool = trn.get_terrain_tool('toolGrass')
         tool.setgrassid( material_id )
         self.__update_buttons()
Пример #7
0
 def on_select_material(self, event):
     if self.material_selected != event.GetEventObject():
         if self.material_selected is not None:
             self.material_selected.deselect()
         self.material_selected = event.GetEventObject()
         material_id = self.__get_id_for_selected_material()
         tool = trn.get_terrain_tool('toolGrass')
         tool.setgrassid(material_id)
         self.__update_buttons()
Пример #8
0
 def __init__(self, *args, **kwds):
     wx.Panel.__init__(self, *args, **kwds)
     self.tool = trn.get_terrain_tool('toolGrass')
     
     self.slider_alpha = floatslider.FloatSlider(
         self, -1, "Alpha", 1.0, 0.0, 1.0, precision=100.0
         )
     
     self._do_layout()
     self._bind_events()
Пример #9
0
 def __init__(self, *args, **kwds):
     ToolPanel.__init__(self, *args, **kwds)
     self.tool = trn.get_terrain_tool('toolSlope')
     
     self.slider_slope = floatslider.FloatSlider(
         self, -1, "Slope", 45.0, 0.0, 90.0, precision=10.0
         )
     
     self.__set_properties()
     self.__do_layout()
     self._bind_events()
Пример #10
0
    def __init__(self, *args, **kwds):
        wx.Panel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolGrass')

        self.slider_alpha = floatslider.FloatSlider(self,
                                                    -1,
                                                    "Alpha",
                                                    1.0,
                                                    0.0,
                                                    1.0,
                                                    precision=100.0)

        self._do_layout()
        self._bind_events()
Пример #11
0
    def __init__(self, *args, **kwds):
        ToolPanel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolSlope')

        self.slider_slope = floatslider.FloatSlider(self,
                                                    -1,
                                                    "Slope",
                                                    45.0,
                                                    0.0,
                                                    90.0,
                                                    precision=10.0)

        self.__set_properties()
        self.__do_layout()
        self._bind_events()
Пример #12
0
 def __init__(self, *args, **kwds):
     ToolPanel.__init__(self, *args, **kwds)
     self.tool = trn.get_terrain_tool('toolPaint')
     
     self.slider_blend = floatslider.FloatSlider(
         self, -1, "Blend", 0.5, 0.0, 1.0, precision=1000.0
         )
     self.staticbox_filter = wx.StaticBox(self, -1, "Filter")
     self.checkbox_slope = wx.CheckBox(self, -1, "Filter by slope")
     self.slider_min_slope = floatslider.FloatSlider(
         self, -1, "Min. slope", 15.0, 0.0, 90.0, precision=10.0
         )
     self.slider_max_slope = floatslider.FloatSlider(
         self, -1, "Max. slope", 45.0, 0.0, 90.0, precision=10.0
         )
     self.staticline_filter = wx.StaticLine(self, -1)
     self.checkbox_height = wx.CheckBox(self, -1, "Filter by height")
     # Needed to set the height sliders range here because using the
     # __update_sliders_height doesn't update the height sliders range if
     # called during dialog contruction.
     outdoor = app.get_outdoor()
     if outdoor is None:
         min_value = 0.0
         max_value = 100.0
     else:
         min_value = outdoor.getminheight()
         max_value = outdoor.getmaxheight()
     value = 0.8 * min_value + 0.2 * max_value
     self.slider_min_height = floatslider.FloatSlider(
         self, -1, "Min. height", value, min_value, max_value, precision=10.0
         )
     value = 0.2 * min_value + 0.8 * max_value
     self.slider_max_height = floatslider.FloatSlider(
         self, -1, "Max. height", value, min_value, max_value, precision=10.0
         )
     
     self.__set_properties()
     self._do_layout()
     self._bind_events()
Пример #13
0
 def __init__(self, *args, **kwds):
     wx.Panel.__init__(self, *args, **kwds)
     self.tool = trn.get_terrain_tool('toolHole')
Пример #14
0
 def __init__(self, *args, **kwds):
     wx.Panel.__init__(self, *args, **kwds)
     self.tool = trn.get_terrain_tool('toolHole')