Beispiel #1
0
    def __init__(self, *args, **kwds):
        editorpanel.EditorPanel.__init__(self, *args, **kwds)
        self.light = None

        self.label_type = wx.StaticText(self, -1, "Light type")
        self.choice_type = choice.Choice(
            self, -1, choices=["Point", "Spot", "Directional", "Bulb"])
        self.csel_ambient = colorsel.ColorSelector(self, -1, "Ambient")
        self.csel_diffuse = colorsel.ColorSelector(self, -1, "Diffuse")
        self.csel_specular = colorsel.ColorSelector(self, -1, "Specular")
        self.staticbox_spot = wx.StaticBox(self, -1, "Spot")
        self.staticbox_static = wx.StaticBox(self, -1, "Static light")
        self.slider_spot_burn = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Spot burn",
                                                        0.5,
                                                        0.0,
                                                        1.0,
                                                        precision=1000.0)
        self.slider_lightmapambientfactor = floatslider.FloatSlider(
            self,
            -1,
            "Lightmap ambient factor",
            0.2,
            0.0,
            2.0,
            precision=1000.0)
        self.slider_lightmapdiffusefactor = floatslider.FloatSlider(
            self,
            -1,
            "Lightmap diffuse factor",
            0.2,
            0.0,
            2.0,
            precision=1000.0)
        self.slider_terrainambientfactor = floatslider.FloatSlider(
            self,
            -1,
            "Terrain ambient factor",
            1.0,
            0.0,
            2.0,
            precision=1000.0)
        self.slider_terraindiffusefactor = floatslider.FloatSlider(
            self,
            -1,
            "Terrain diffuse factor",
            1.0,
            0.0,
            2.0,
            precision=1000.0)
        self.__set_properties()
        self.__do_layout()
        self.__bind_events()
Beispiel #2
0
 def __init__(self, *args, **kwds):
     editorpanel.EditorPanel.__init__(self, *args, **kwds)
     self.fog = None
     
     self.label_type = wx.StaticText(self, -1, "Fog type")
     self.choice_type = choice.Choice(
         self, -1, choices=["None", "Linear", "Layered", "Exponential"]
         )
     self.color = colorsel.ColorSelector(self, -1, "Color")
     
     self.__set_properties()
     self.__do_layout()
     self.__bind_events()
Beispiel #3
0
    def cb_choice(self, element, facts):
        # there are really two cases here.
        # choice between values of elements,
        # and choice between elements

        tagnames = [self.tag(child) for child in element]

        if "value" in tagnames:
            for child in self.element_children(element):
                tag = self.tag(child)
                f = self.callbacks[tag]
                x = f(child, facts)

        else:
            if "schemaname" in facts:
                return

            r = []
            children = self.choice_children(self.element_children(element))

            # bloody simplified RNG
            if len(children) == 2:
                empty = [x for x in children if self.tag(x) == "empty"]
                nonempty = [x for x in children if self.tag(x) != "empty"]
                if len(empty) > 0:
                    tag = self.tag(nonempty[0])
                    if tag == "oneOrMore":
                        return self.cb_oneormore(element, facts)
                    else:
                        f = self.callbacks[tag]
                        return f(element, facts)

            for child in children:
                newfacts = {}
                tag = self.tag(child)
                f = self.callbacks[tag]
                self.append(r, f(child, newfacts))

            return choice.Choice(r, **facts)
Beispiel #4
0
 def addChoice(self, text, cb, tooltip, tooltiptext, params=[]):
     x = self.x + 10
     y = self.y + (len(self.choices) * 20) + 10
     c = choice.Choice(text, x, y, cb, params)
     self.choices.append(c)
Beispiel #5
0
import out_feature
import choice
import basic_func
import attitude

df = pd.read_csv("data.csv")

#print(df)
#print(df['gender'])
#print(df['provience'])
#print(df[df['provience'] == '广东'])
#print(df.loc[:, ['order_daily', 'order_life', 'order_play', 'order_no_out']])

dfBasicInfo = basic_info.BasicInfo(df)
dfOutFeature = out_feature.OutFeature(df)
dfChoice = choice.Choice(df)
dfTrend = attitude.Trend(df)
dfMask = attitude.Mask(df)
dfNecessity = attitude.Necessity(df)
dfEffect = attitude.Effect(df)
dfReason = attitude.Reason(df)

# basic info
'''
dfBasicInfo.getNumGender()
dfBasicInfo.getNumAge()
'''
'''
dfBasicInfo.getNumProvience()
dfBasicInfo.getIsCar()
'''