Exemplo n.º 1
0
def green_bezier():
    return create_new_object(
        name='VerdBez',
        coordinates='50,250,0;70,260,0;90,350,0;120,200,0',
        line_color=[0.1, 0.8, 0],
        is_bezier=True,
        is_bspline=False)
Exemplo n.º 2
0
def green_square():
    return create_new_object(
        name='VerdQuad',
        coordinates='600,100,-50;700,100,-40;700,200,-50;600,200,-40',
        line_color=[0.1, 0.8, 0],
        is_bezier=False,
        is_bspline=False
    )
Exemplo n.º 3
0
def yellow_plane():
    return create_new_object(
        name='AmrPlane',
        coordinates='60,100,0;160,100,0;160,300,0;60,300,0',
        line_color=[0.9, 0.9, 0.007],
        is_bezier=False,
        is_bspline=False
    )
Exemplo n.º 4
0
def blue_bspline():
    return create_new_object(
        name='Az',
        coordinates='0,100,100;50,300,250;180,300,45;250,0,12;350,200,78;450,100,90;500,400,100',
        line_color=[0.3, 0.4, 0.6],
        is_bezier=False,
        is_bspline=True
    )
Exemplo n.º 5
0
def red_triangle():
    return create_new_object(
        name='VermTri',
        coordinates='400,150,-50;450,320,-40;500,300,-50',
        line_color=[0.7, 0.2, 0],
        is_bezier=False,
        is_bspline=False
    )
Exemplo n.º 6
0
def yellow_line():
    return create_new_object(
        name='AmrLine',
        coordinates='300,250,200;450,500,300',
        line_color=[0.9, 0.9, 0.007],
        is_bezier=False,
        is_bspline=False
    )
Exemplo n.º 7
0
def red_cube():
    return create_new_object(
        name='VermCube',
        coordinates='50,50,-50;150,50,-50;150,150,-50;50,150,-50;50,50,-30;150,50,-30;150,150,-30;50,150,-30',
        line_color=[0.7, 0.2, 0],
        is_bezier=False,
        is_bspline=False,
        is_3d=True
    )
    def cofirm_new_obj(self, btn) -> None:
        newObj_coordinates_raw = gtkBuilder.get_object(
            'object_coordinates_entry').get_text()
        newObj_name = gtkBuilder.get_object('newObj_name_entry').get_text()

        if newObj_name in objectManager.display_file:
            show_error("Nome já definido, escolha outro nome.", dialog)
        else:
            newObj = None

            line_color_str = gtkBuilder.get_object(
                'combo_box_color_selected').get_active_text()

            rgb = [0, 0, 0]
            if (line_color_str == "Vermelho"):
                rgb = [0.7, 0.2, 0]
            elif (line_color_str == "Verde"):
                rgb = [0.1, 0.8, 0]
            elif (line_color_str == "Azul"):
                rgb = [0.3, 0.4, 0.6]
            elif (line_color_str == "Amarelo"):
                rgb = [0.9, 0.9, 0.007]

            tipo_object = gtkBuilder.get_object(
                'combo_box_tipo_selected').get_active_text()
            is_bezier = False
            is_bspline = False
            if tipo_object == 'Curva Bezier':
                is_bezier = True
            elif tipo_object == 'Curva BSpline':
                is_bspline = True

            try:
                newObj = objectManager.create_new_object(
                    newObj_name, newObj_coordinates_raw, rgb, is_bezier,
                    is_bspline, '3D' in newObj_name)
            except ValueError as e:
                return show_error(str(e), dialog)

            object_list.append_text(newObj.name + " (" + newObj.type + ")")
            object_list.show_all()
            drawn_object(newObj)

            dialog.destroy()