# Path: panel/roundedbox.py
# class DimensionRoundedBoxParam(ParamWidget):
# class BottomRoundedBoxParam(ParamWidget):
# class TopBoxRoundedParam(ParamWidget):
#     def __init__(self, properties = None):
#     def update_information(self):
#     def __init__(self, properties = None):
#     def __init__(self, properties = None):
# 
# Path: lasercut/makeroundedbox.py
# def make_rounded_box(dimension_properties, top_properties, bottom_properties):
# def create_contours(radius, nb_face, side_length, thickness):
# def chunkIt(seq, num):
# def create_sides(polygon_segment, height, nb_cut):
# def create_shape(p1, p2, p3, p4):
# def retrieve_segments_arc(polygon_segment):
# def get_contours_with_arc(edge, arcs_segment_list):
# def create_plane_part(dimension_properties, plane_properties):


from FreeCAD import Gui
from panel.roundedbox import RoundedBoxProperties, TopBottomRoundedProperties, DimensionRoundedBoxParam, BottomRoundedBoxParam, TopBoxRoundedParam
from lasercut import makeroundedbox
from PySide import QtCore, QtGui
import FreeCAD
import FreeCADGui
import Part
import os
import math
import Draft
import copy

# *   License along with this library; if not, write to the Free Software   *
# *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,            *
# *   MA  02110-1301  USA                                                   *
# *                                                                         *
# ***************************************************************************



__dir__ = os.path.dirname(__file__)
iconPath = os.path.join(__dir__, 'icons')


class GroupRoundedBox:
    def __init__(self, obj):
        obj.addProperty("App::PropertyPythonObject", "box_properties").box_properties = RoundedBoxProperties()
        obj.addProperty("App::PropertyPythonObject", "top_properties").top_properties = TopBottomRoundedProperties()
        obj.addProperty("App::PropertyPythonObject", "bottom_properties").bottom_properties = TopBottomRoundedProperties()
        obj.addProperty('App::PropertyPythonObject', 'need_recompute').need_recompute = False
        obj.addProperty('App::PropertyLinkList', 'parts').parts= []
        obj.Proxy = self

    def onChanged(self, fp, prop):
        if prop == "need_recompute":
            self.execute(fp)

    def execute(self, fp):
        if fp.need_recompute:
            fp.need_recompute = False

            document = fp.Document

# Path: panel/roundedbox.py
# class DimensionRoundedBoxParam(ParamWidget):
# class BottomRoundedBoxParam(ParamWidget):
# class TopBoxRoundedParam(ParamWidget):
#     def __init__(self, properties = None):
#     def update_information(self):
#     def __init__(self, properties = None):
#     def __init__(self, properties = None):
# 
# Path: lasercut/makeroundedbox.py
# def make_rounded_box(dimension_properties, top_properties, bottom_properties):
# def create_contours(radius, nb_face, side_length, thickness):
# def chunkIt(seq, num):
# def create_sides(polygon_segment, height, nb_cut):
# def create_shape(p1, p2, p3, p4):
# def retrieve_segments_arc(polygon_segment):
# def get_contours_with_arc(edge, arcs_segment_list):
# def create_plane_part(dimension_properties, plane_properties):


# Path: MakeRoundedBoxPanel.py
from FreeCAD import Gui
from panel.roundedbox import RoundedBoxProperties, TopBottomRoundedProperties, DimensionRoundedBoxParam, BottomRoundedBoxParam, TopBoxRoundedParam
from lasercut import makeroundedbox
from PySide import QtCore, QtGui
import FreeCAD
import FreeCADGui
import Part
import os
import math
import Draft
import copy

# *   License along with this library; if not, write to the Free Software   *
# *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,            *
# *   MA  02110-1301  USA                                                   *
# *                                                                         *
# ***************************************************************************



__dir__ = os.path.dirname(__file__)
iconPath = os.path.join(__dir__, 'icons')


class GroupRoundedBox:
    def __init__(self, obj):
        obj.addProperty("App::PropertyPythonObject", "box_properties").box_properties = RoundedBoxProperties()
        obj.addProperty("App::PropertyPythonObject", "top_properties").top_properties = TopBottomRoundedProperties()
        obj.addProperty("App::PropertyPythonObject", "bottom_properties").bottom_properties = TopBottomRoundedProperties()
        obj.addProperty('App::PropertyPythonObject', 'need_recompute').need_recompute = False
        obj.addProperty('App::PropertyLinkList', 'parts').parts= []
        obj.Proxy = self

    def onChanged(self, fp, prop):
        if prop == "need_recompute":
            self.execute(fp)

    def execute(self, fp):
        if fp.need_recompute:
            fp.need_recompute = False

            document = fp.Document

            computed_parts = makeroundedbox.make_rounded_box(fp.box_properties, fp.top_properties, fp.bottom_properties)
