# Path: panel/tab.py
# class BaseTabWidget(ParamWidget):
# class TabWidget(BaseTabWidget):
# class TSlotWidget(BaseTabWidget):
# class TabContinuousWidget(BaseTabWidget):
# class TabFlexWidget(BaseTabWidget):
# class TabLink(ParamWidget):
# class TabsList(object):
#     def __init__(self, tab_properties):
#     def get_tab_type(self):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def get_group_box(self, widget):
#     def __init__(self, faces):
#     def createWidgetFromTabProperties(self, tab_properties):
#     def append(self, face, tab_type):
#     def append_link(self, face, src_tab_name):
#     def remove(self, name):
#     def exist(self, name):
#     def get(self, name):
#     def get_linked_tabs(self, name):
#     def __iter__(self):
#     def get_tabs_properties(self):


import Part
import FreeCAD
import lasercut.flextab as flextab
import lasercut.helper as helper
from panel.tab import TabProperties
    y_plus_inside, y_minus_inside = helper.check_limit_y_on_for_tab(tab_face, material_face.thickness, pos_y, width,
                                                                    material_plane.thickness, material_face)
    # X Rien pr l'instant, mais on peut prendre en compte l'epaiseur variante de la piece opposé => length
    # Y Ajout d'un Kerf => width
    # Z Rien => height
    corrected_length = material_plane.thickness
    # corrected_width = width + materialFace.laser_beam_diameter
    corrected_height = material_face.thickness

    corrected_width = width  # - materialPlane.laser_beam_diameter
    corrected_width_center = corrected_width / 2.0
    if y_minus_inside and y_plus_inside:
        corrected_width += material_face.laser_beam_diameter
        corrected_width_center = corrected_width / 2.0
    elif y_minus_inside:
        corrected_width += material_face.laser_beam_diameter / 2.0
        corrected_width_center = (corrected_width + material_face.laser_beam_diameter / 2.0) / 2.0
    elif y_plus_inside:
        corrected_width += material_face.laser_beam_diameter / 2.0
        corrected_width_center = (corrected_width - material_face.laser_beam_diameter / 2.0) / 2.0

    #origin = FreeCAD.Vector(-corrected_length / 2.0, -corrected_width_center, -corrected_height / 2.0)
    origin = FreeCAD.Vector(0., -corrected_width_center, -corrected_height / 2.0)
    tab = Part.makeBox(corrected_length, corrected_width, corrected_height, origin)
    tab.translate(FreeCAD.Vector(0, pos_y, 0))

    hole = None
    left_hole = None
    right_hole = None


# Path: panel/tab.py
# class BaseTabWidget(ParamWidget):
# class TabWidget(BaseTabWidget):
# class TSlotWidget(BaseTabWidget):
# class TabContinuousWidget(BaseTabWidget):
# class TabFlexWidget(BaseTabWidget):
# class TabLink(ParamWidget):
# class TabsList(object):
#     def __init__(self, tab_properties):
#     def get_tab_type(self):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def __init__(self, tab_properties):
#     def get_group_box(self, widget):
#     def __init__(self, faces):
#     def createWidgetFromTabProperties(self, tab_properties):
#     def append(self, face, tab_type):
#     def append_link(self, face, src_tab_name):
#     def remove(self, name):
#     def exist(self, name):
#     def get(self, name):
#     def get_linked_tabs(self, name):
#     def __iter__(self):
#     def get_tabs_properties(self):


# Path: lasercut/join.py
import Part
import FreeCAD
import lasercut.flextab as flextab
import lasercut.helper as helper
from panel.tab import TabProperties

    y_plus_inside, y_minus_inside = helper.check_limit_y_on_for_tab(tab_face, material_face.thickness, pos_y, width,
                                                                    material_plane.thickness, material_face)
    # X Rien pr l'instant, mais on peut prendre en compte l'epaiseur variante de la piece opposé => length
    # Y Ajout d'un Kerf => width
    # Z Rien => height
    corrected_length = material_plane.thickness
    # corrected_width = width + materialFace.laser_beam_diameter
    corrected_height = material_face.thickness

    corrected_width = width  # - materialPlane.laser_beam_diameter
    corrected_width_center = corrected_width / 2.0
    if y_minus_inside and y_plus_inside:
        corrected_width += material_face.laser_beam_diameter
        corrected_width_center = corrected_width / 2.0
    elif y_minus_inside:
        corrected_width += material_face.laser_beam_diameter / 2.0
        corrected_width_center = (corrected_width + material_face.laser_beam_diameter / 2.0) / 2.0
    elif y_plus_inside:
        corrected_width += material_face.laser_beam_diameter / 2.0
        corrected_width_center = (corrected_width - material_face.laser_beam_diameter / 2.0) / 2.0

    #origin = FreeCAD.Vector(-corrected_length / 2.0, -corrected_width_center, -corrected_height / 2.0)
    origin = FreeCAD.Vector(0., -corrected_width_center, -corrected_height / 2.0)
    tab = Part.makeBox(corrected_length, corrected_width, corrected_height, origin)
    tab.translate(FreeCAD.Vector(0, pos_y, 0))

    hole = None
    left_hole = None
    right_hole = None


    if dog_bone: