# 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


def make_tabs_joins(parts, tabs):
    parts_element = []
    for part in parts:
        mat_element = helper.MaterialElement(part)
        parts_element.append(mat_element)

    removeParts = {}
    #test to improve speed
    for tab in tabs:
        keyid = str(tab.group_id)
        if keyid not in removeParts:
            removeParts[keyid] = []
        removeParts[keyid].append(tab.freecad_object.Name)

    for tab in tabs:
        tab_part = None
        other_parts = []
        keyid = str(tab.group_id)
        for part in parts_element:
            if part.get_name() == tab.freecad_object.Name:
                tab_part = part
#            else:
            elif part.get_name() not in removeParts[keyid]:
                other_parts.append(part)
        if tab.tab_type == TabProperties.TYPE_TAB:
            make_tab_join(tab, tab_part, other_parts)
        elif tab.tab_type == TabProperties.TYPE_T_SLOT:
            make_tslot_tab_join(tab, tab_part, other_parts)

# 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



def make_tabs_joins(parts, tabs):
    parts_element = []
    for part in parts:
        mat_element = helper.MaterialElement(part)
        parts_element.append(mat_element)

    removeParts = {}
    #test to improve speed
    for tab in tabs:
        keyid = str(tab.group_id)
        if keyid not in removeParts:
            removeParts[keyid] = []
        removeParts[keyid].append(tab.freecad_object.Name)

    for tab in tabs:
        tab_part = None
        other_parts = []
        keyid = str(tab.group_id)
        for part in parts_element:
            if part.get_name() == tab.freecad_object.Name:
                tab_part = part
#            else:
            elif part.get_name() not in removeParts[keyid]:
                other_parts.append(part)
        if tab.tab_type == TabProperties.TYPE_TAB:
            make_tab_join(tab, tab_part, other_parts)
        elif tab.tab_type == TabProperties.TYPE_T_SLOT:
            make_tslot_tab_join(tab, tab_part, other_parts)

        elif tab.tab_type == TabProperties.TYPE_CONTINUOUS: