def __init__(self, *args, **kwargs): self.first_point = FirstPoint() self.second_point = SecondPoint() self.control = Control() Figure.__init__(self, self.first_point) self.center = QPoint() self.ctrl = QPoint() if 'center' in kwargs: self.center = kwargs['center'] if 'ctrl' in kwargs: self.ctrl = kwargs['ctrl'] if 'figure' in kwargs: self.center = QPoint(kwargs['figure']['center']['x'], kwargs['figure']['center']['y']) self.ctrl = QPoint(kwargs['figure']['ctrl']['x'], kwargs['figure']['ctrl']['y']) self.state = self.control if len(args) == 2: self.center = args[0] self.ctrl = args[1] if len(args) == 4: self.center = QPoint(args[0], args[1]) self.ctrl = QPoint(args[2], args[3])
def __init__(self, *args, **kwargs): self.first_point = FirstPoint() self.second_point = SecondPoint() self.control = Control() self.p1 = QPoint() self.p2 = QPoint() Figure.__init__(self, self.first_point) if 'x1' in kwargs and 'y1' in kwargs: self.p1 = QPoint(kwargs['x1'], kwargs['y1']) if 'x2' in kwargs and 'y2' in kwargs: self.p2 = QPoint(kwargs['x2'], kwargs['y2']) if 'p1' in kwargs: self.p1 = kwargs['p1'] if 'p2' in kwargs: self.p2 = kwargs['p2'] if len(args) == 2: self.p1 = args[0] self.p2 = args[1] if len(args) == 4: self.p1 = QPoint(args[0], args[1]) self.p2 = QPoint(args[2], args[3]) if 'figure' in kwargs: self.p1 = QPoint(kwargs['figure']['x1'], kwargs['figure']['y1']) self.p2 = QPoint(kwargs['figure']['x2'], kwargs['figure']['y2']) self.state = self.control
def __init__(self, *args, **kwargs): self.first_point = FirstPoint() self.second_point = SecondPoint() self.control = Control() self.p1 = QPoint() self.p2 = QPoint() Figure.__init__(self, self.first_point) if 'x1' in kwargs and 'y1' in kwargs: self.p1 = QPoint(kwargs['x1'], kwargs['y1']) if 'x2' in kwargs and 'y2' in kwargs: self.p2 = QPoint(kwargs['x2'], kwargs['y2']) if 'p1' in kwargs: self.p1 = kwargs['p1'] if 'p2' in kwargs: self.p2 = kwargs['p2'] if len(args) == 2: self.p1 = args[0] self.p2 = args[1] if len(args) == 4: self.p1 = QPoint(args[0], args[1]) self.p2 = QPoint(args[2], args[3]) if 'figure' in kwargs: self.p1 = QPoint(kwargs['figure']['x1'], kwargs['figure']['y1']) self.p2 = QPoint(kwargs['figure']['x2'], kwargs['figure']['y2']) self.state = self.control
def __init__(self, *args, **kwargs): self.first_point = FirstPoint() self.second_point = SecondPoint() self.control = Control() Figure.__init__(self, self.first_point) self.center = QPoint() self.ctrl = QPoint() if 'center' in kwargs: self.center = kwargs['center'] if 'ctrl' in kwargs: self.ctrl = kwargs['ctrl'] if 'figure' in kwargs: self.center = QPoint(kwargs['figure']['center']['x'], kwargs['figure']['center']['y']) self.ctrl = QPoint(kwargs['figure']['ctrl']['x'], kwargs['figure']['ctrl']['y']) self.state = self.control if len(args) == 2: self.center = args[0] self.ctrl = args[1] if len(args) == 4: self.center = QPoint(args[0], args[1]) self.ctrl = QPoint(args[2], args[3])
def __init__(self, *args, **kwargs): self.add_point = AddPoint() self.control = Control() Figure.__init__(self, self.add_point) self.decomposer = BayazitDecomposer() self.polygon = [] self.convex_polygons = [] if 'figure' in kwargs: self.polygon = [dict2qpoint(p) for p in kwargs['figure']['editor']] self.decompose() self.state = self.control if len(args) > 0: self.polygon = args