# Path: lasercut/boxproperties.py
# class BoxProperties(ObjectProperties):
# 
#     _allowed = ('length', 'width', 'height', 'thickness', 'outside_measure',
#                 'length_width_priority', 'length_outside', 'width_outside',
#                 'bottom_position', 'bottom_shift', 'inner_radius',
#                 'length_shift', 'width_shift')
# 
#     LENGTH_PRIORTY = "Length"
#     WIDTH_PRIORTY = "Width"
#     CROSS_PRIORTY = "No - Cross"
#     ROUND_PRIORTY = "No - For rounding"
# 
#     BOTTOM_OUTSIDE = "Outside"
#     BOTTOM_INSIDE = "Inside"
# 
#     def __init__(self, **kwargs):
#         super(BoxProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'length'):
#             self.length = 90.
#         if not hasattr(self, 'width'):
#             self.width = 50.
#         if not hasattr(self, 'height'):
#             self.height = 30.
#         if not hasattr(self, 'thickness'):
#             self.thickness = 3.
#         if not hasattr(self, 'outside_measure'):
#             self.outside_measure = True
#         # Length/width
#         if not hasattr(self, 'length_width_priority'):
#             self.length_width_priority = self.LENGTH_PRIORTY
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'inner_radius'):
#             self.inner_radius = 0.
#         if not hasattr(self, 'length_shift'):
#             self.length_shift = 0.
#         if not hasattr(self, 'width_shift'):
#             self.width_shift = 0.
# 
# class TopBottomProperties(ObjectProperties):
#     _allowed = ('position', 'height_shis notift', 'length_outside', 'width_outside', 'top_type', 'cover_length_tolerance')
# 
#     POSITION_OUTSIDE = "Outside"
#     POSITION_INSIDE = "Inside"
#     TOP_TYPE_NORMAL = "Normal"
#     TOP_TYPE_COVER = "Openable"
# 
#     def __init__(self, **kwargs):
#         super(TopBottomProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'position'):
#             self.position = self.POSITION_OUTSIDE
#         if not hasattr(self, 'height_shift'):
#             self.height_shift = 0.
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'top_type'):
#             self.top_type = self.TOP_TYPE_NORMAL
#         if not hasattr(self, 'cover_length_tolerance'):
#             self.cover_length_tolerance = 3.


from FreeCAD import Gui
from lasercut.boxproperties import BoxProperties, TopBottomProperties
import FreeCAD
import FreeCADGui
import Part
    else:
        part_list.append({'shape': face_panel_1, 'name': "face_panel_1"})
        part_list.append({'shape': face_panel_2, 'name': "face_panel_2"})
    part_list.append({'shape': behind_panel, 'name': "behind_panel"})
    part_list.append({'shape': left_panel, 'name': "left_panel"})
    part_list.append({'shape': right_panel, 'name': "right_panel"})
    part_list.append({'shape': bottom_panel, 'name': "bottom_panel"})
    part_list.append({'shape': top_panel, 'name': "top_panel"})


def make_box_inside_measure(dimension_properties, top_properties, bottom_properties, part_list):

    thickness = dimension_properties.thickness
    height = dimension_properties.height
    shift_height = 0.
    add_outside_cover_length = 0.
    add_outside_cover_width = 0.

    if dimension_properties.length_width_priority == BoxProperties.LENGTH_PRIORTY:
        length = dimension_properties.length + 2. * thickness + 2. * dimension_properties.width_shift
        length_spacing = dimension_properties.width
        width = dimension_properties.width
        width_spacing = dimension_properties.length
        add_outside_cover_length =  2. * dimension_properties.width_shift
    elif dimension_properties.length_width_priority == BoxProperties.WIDTH_PRIORTY:
        length = dimension_properties.length
        length_spacing = dimension_properties.width
        width = dimension_properties.width + 2. * thickness + 2. * dimension_properties.length_shift
        width_spacing = dimension_properties.length
        add_outside_cover_width = 2. * dimension_properties.length_shift

# Path: lasercut/boxproperties.py
# class BoxProperties(ObjectProperties):
# 
#     _allowed = ('length', 'width', 'height', 'thickness', 'outside_measure',
#                 'length_width_priority', 'length_outside', 'width_outside',
#                 'bottom_position', 'bottom_shift', 'inner_radius',
#                 'length_shift', 'width_shift')
# 
#     LENGTH_PRIORTY = "Length"
#     WIDTH_PRIORTY = "Width"
#     CROSS_PRIORTY = "No - Cross"
#     ROUND_PRIORTY = "No - For rounding"
# 
#     BOTTOM_OUTSIDE = "Outside"
#     BOTTOM_INSIDE = "Inside"
# 
#     def __init__(self, **kwargs):
#         super(BoxProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'length'):
#             self.length = 90.
#         if not hasattr(self, 'width'):
#             self.width = 50.
#         if not hasattr(self, 'height'):
#             self.height = 30.
#         if not hasattr(self, 'thickness'):
#             self.thickness = 3.
#         if not hasattr(self, 'outside_measure'):
#             self.outside_measure = True
#         # Length/width
#         if not hasattr(self, 'length_width_priority'):
#             self.length_width_priority = self.LENGTH_PRIORTY
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'inner_radius'):
#             self.inner_radius = 0.
#         if not hasattr(self, 'length_shift'):
#             self.length_shift = 0.
#         if not hasattr(self, 'width_shift'):
#             self.width_shift = 0.
# 
# class TopBottomProperties(ObjectProperties):
#     _allowed = ('position', 'height_shis notift', 'length_outside', 'width_outside', 'top_type', 'cover_length_tolerance')
# 
#     POSITION_OUTSIDE = "Outside"
#     POSITION_INSIDE = "Inside"
#     TOP_TYPE_NORMAL = "Normal"
#     TOP_TYPE_COVER = "Openable"
# 
#     def __init__(self, **kwargs):
#         super(TopBottomProperties, self).__init__(**kwargs)
#         if not hasattr(self, 'position'):
#             self.position = self.POSITION_OUTSIDE
#         if not hasattr(self, 'height_shift'):
#             self.height_shift = 0.
#         if not hasattr(self, 'length_outside'):
#             self.length_outside = 0.
#         if not hasattr(self, 'width_outside'):
#             self.width_outside = 0.
#         if not hasattr(self, 'top_type'):
#             self.top_type = self.TOP_TYPE_NORMAL
#         if not hasattr(self, 'cover_length_tolerance'):
#             self.cover_length_tolerance = 3.


# Path: lasercut/makebox.py
from FreeCAD import Gui
from lasercut.boxproperties import BoxProperties, TopBottomProperties
import FreeCAD
import FreeCADGui
import Part

    else:
        part_list.append({'shape': face_panel_1, 'name': "face_panel_1"})
        part_list.append({'shape': face_panel_2, 'name': "face_panel_2"})
    part_list.append({'shape': behind_panel, 'name': "behind_panel"})
    part_list.append({'shape': left_panel, 'name': "left_panel"})
    part_list.append({'shape': right_panel, 'name': "right_panel"})
    part_list.append({'shape': bottom_panel, 'name': "bottom_panel"})
    part_list.append({'shape': top_panel, 'name': "top_panel"})


def make_box_inside_measure(dimension_properties, top_properties, bottom_properties, part_list):

    thickness = dimension_properties.thickness
    height = dimension_properties.height
    shift_height = 0.
    add_outside_cover_length = 0.
    add_outside_cover_width = 0.

    if dimension_properties.length_width_priority == BoxProperties.LENGTH_PRIORTY:
        length = dimension_properties.length + 2. * thickness + 2. * dimension_properties.width_shift
        length_spacing = dimension_properties.width
        width = dimension_properties.width
        width_spacing = dimension_properties.length
        add_outside_cover_length =  2. * dimension_properties.width_shift
    elif dimension_properties.length_width_priority == BoxProperties.WIDTH_PRIORTY:
        length = dimension_properties.length
        length_spacing = dimension_properties.width
        width = dimension_properties.width + 2. * thickness + 2. * dimension_properties.length_shift
        width_spacing = dimension_properties.length
        add_outside_cover_width = 2. * dimension_properties.length_shift

    elif dimension_properties.length_width_priority == BoxProperties.CROSS_PRIORTY: