# Path: lasercut/helper.py
# class ObjectProperties(object):
# class Segment:
# class MaterialElement:
#     def __init__(self, **kwargs):
#     def __init__(self, first=FreeCAD.Vector(0, 0, 0), second=FreeCAD.Vector(0, 0, 0)):
#     def a(self):
#     def b(self):
#     def clone_a(self):
#     def clone_b(self):
#     def vector(self):
#     def length(self):
#     def mid_point(self):
#     def get_angle(self, segment):
#     def add(self, vector):
#     def rotate_z(self, angle):
#     def __repr__(self):
# def rotate_vector_z(vector, angle):
# def get_screw_nut_spec(metric_diameter, metric_length):
# def transform_part(tab_to_add, face):
# def check_intersect(tab_to_add, face, part_interactor_properties):
# def transform(part, referentiel_face, transform_matrix=None, y_invert = False):
# def get_matrix_transform(face):
# def get_local_axis(face):
# def get_local_axis_normalized(face):
# def compare_freecad_vector(vector1, vector2, epsilon=10e-6):
# def compare_value(value1, value2, epsilon=10e-6):
# def compare_freecad_vector_direction(vector1, vector2, epsilon=10e-6):
# def sort_quad_vertex(list_edges, reverse):
# def biggest_area_faces(freecad_shape):
# def smallest_area_faces(freecad_shape):
# def sort_area_shape_faces(shape):
# def sort_area_shape_list(faces_list):
# def sort_area_face_common(faces, test_function=compare_freecad_vector_direction):
# def check_limit_z(tab_face, width, pos_y, material_face, material_plane):
# def check_limit_y(tab_face, height, pos_y, width, material_plane):
# def check_limit_y_on_for_tab(tab_face, height, pos_y, width, thickness, material_face):
# def tab_join_create_hole_on_plane(tab_face, width, pos_y, material_face, material_plane, dog_bone=False):
# def make_dog_bone_on_limits_on_yz(shape, length,
#                                   y_min_z_min=True, y_max_z_min=True, y_min_z_max=True, y_max_z_max=True):
# def make_dog_bone_on_xy(pos_x, pos_y, height, radius):
# def make_dog_bone_on_yz(pos_y, pos_z, height, radius):
# def make_dog_bone_on_limits_on_xy(shape, length, x_min_only=False):
# def assemble_list_element(el_list):
# def assemble_list_element_fast(el_list):
#     def __init__(self, properties):
#     def reset_add_remove(self):
#     def get_name(self):
#     def get_new_name(self):
#     def get_shape(self, fast_assemble=False):


from PySide import QtCore, QtGui
from lasercut import helper
import FreeCAD
# *                                                                         *
# ***************************************************************************


class WidgetValue(helper.ObjectProperties):

    _allowed = ('widget', 'show_name', 'name', 'type', 'interval_value', 'decimals', 'step',
                'parent_name', 'parent_value', 'widget_title')

    def __init__(self, **kwargs):
        super(WidgetValue, self).__init__(**kwargs)


class ParamWidget(object):

    def __init__(self, object_property):
        self.object_property = object_property
        self.widget_list = []
        self.form = None
        return

    def get_grid(self):
        row_index = 0
        widgets_grid = QtGui.QGridLayout(self.form)
        for widget in self.widget_list:
            self.create_item(widget, widgets_grid, row_index)
            row_index += 1
        self.listchangeIndex(0)
        return widgets_grid


# Path: lasercut/helper.py
# class ObjectProperties(object):
# class Segment:
# class MaterialElement:
#     def __init__(self, **kwargs):
#     def __init__(self, first=FreeCAD.Vector(0, 0, 0), second=FreeCAD.Vector(0, 0, 0)):
#     def a(self):
#     def b(self):
#     def clone_a(self):
#     def clone_b(self):
#     def vector(self):
#     def length(self):
#     def mid_point(self):
#     def get_angle(self, segment):
#     def add(self, vector):
#     def rotate_z(self, angle):
#     def __repr__(self):
# def rotate_vector_z(vector, angle):
# def get_screw_nut_spec(metric_diameter, metric_length):
# def transform_part(tab_to_add, face):
# def check_intersect(tab_to_add, face, part_interactor_properties):
# def transform(part, referentiel_face, transform_matrix=None, y_invert = False):
# def get_matrix_transform(face):
# def get_local_axis(face):
# def get_local_axis_normalized(face):
# def compare_freecad_vector(vector1, vector2, epsilon=10e-6):
# def compare_value(value1, value2, epsilon=10e-6):
# def compare_freecad_vector_direction(vector1, vector2, epsilon=10e-6):
# def sort_quad_vertex(list_edges, reverse):
# def biggest_area_faces(freecad_shape):
# def smallest_area_faces(freecad_shape):
# def sort_area_shape_faces(shape):
# def sort_area_shape_list(faces_list):
# def sort_area_face_common(faces, test_function=compare_freecad_vector_direction):
# def check_limit_z(tab_face, width, pos_y, material_face, material_plane):
# def check_limit_y(tab_face, height, pos_y, width, material_plane):
# def check_limit_y_on_for_tab(tab_face, height, pos_y, width, thickness, material_face):
# def tab_join_create_hole_on_plane(tab_face, width, pos_y, material_face, material_plane, dog_bone=False):
# def make_dog_bone_on_limits_on_yz(shape, length,
#                                   y_min_z_min=True, y_max_z_min=True, y_min_z_max=True, y_max_z_max=True):
# def make_dog_bone_on_xy(pos_x, pos_y, height, radius):
# def make_dog_bone_on_yz(pos_y, pos_z, height, radius):
# def make_dog_bone_on_limits_on_xy(shape, length, x_min_only=False):
# def assemble_list_element(el_list):
# def assemble_list_element_fast(el_list):
#     def __init__(self, properties):
#     def reset_add_remove(self):
#     def get_name(self):
#     def get_new_name(self):
#     def get_shape(self, fast_assemble=False):


# Path: panel/toolwidget.py
from PySide import QtCore, QtGui
from lasercut import helper
import FreeCAD

# *                                                                         *
# ***************************************************************************


class WidgetValue(helper.ObjectProperties):

    _allowed = ('widget', 'show_name', 'name', 'type', 'interval_value', 'decimals', 'step',
                'parent_name', 'parent_value', 'widget_title')

    def __init__(self, **kwargs):
        super(WidgetValue, self).__init__(**kwargs)


class ParamWidget(object):

    def __init__(self, object_property):
        self.object_property = object_property
        self.widget_list = []
        self.form = None
        return

    def get_grid(self):
        row_index = 0
        widgets_grid = QtGui.QGridLayout(self.form)
        for widget in self.widget_list:
            self.create_item(widget, widgets_grid, row_index)
            row_index += 1
        self.listchangeIndex(0)
        return widgets_grid


    def create_item(self, widget_config, grid, row_index):