# Path: FlatCAMTool.py
# class FlatCAMTool(QtGui.QWidget):
# 
#     toolName = "FlatCAM Generic Tool"
# 
#     def __init__(self, app, parent=None):
#         """
# 
#         :param app: The application this tool will run in.
#         :type app: App
#         :param parent: Qt Parent
#         :return: FlatCAMTool
#         """
#         QtGui.QWidget.__init__(self, parent)
# 
#         # self.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum)
# 
#         self.layout = QtGui.QVBoxLayout()
#         self.setLayout(self.layout)
# 
#         self.app = app
# 
#         self.menuAction = None
# 
#     def install(self):
#         self.menuAction = self.app.ui.menutool.addAction(self.toolName)
#         self.menuAction.triggered.connect(self.run)
# 
#     def run(self):
#         # Remove anything else in the GUI
#         self.app.ui.tool_scroll_area.takeWidget()
# 
#         # Put ourself in the GUI
#         self.app.ui.tool_scroll_area.setWidget(self)
# 
#         # Switch notebook to tool page
#         self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab)
# 
#         self.show()
# 
# Path: ObjectUI.py
# class ObjectUI(QtGui.QWidget):
# class CNCObjectUI(ObjectUI):
# class GeometryObjectUI(ObjectUI):
# class ExcellonObjectUI(ObjectUI):
# class GerberObjectUI(ObjectUI):
#     def __init__(self, icon_file='share/flatcam_icon32.png', title='FlatCAM Object', parent=None):
#     def __init__(self, parent=None):
#     def __init__(self, parent=None):
#     def __init__(self, parent=None):
#     def __init__(self, parent=None):


from PyQt4 import QtGui, QtCore, Qt
from camlib import *
from FlatCAMTool import FlatCAMTool
from ObjectUI import LengthEntry
from shapely.geometry import Polygon, LineString, Point, LinearRing
from shapely.geometry import MultiPoint, MultiPolygon
from shapely.geometry import box as shply_box
from shapely.ops import cascaded_union, unary_union
from shapely.wkt import loads as sloads
from shapely.wkt import dumps as sdumps
from shapely.geometry.base import BaseGeometry
from numpy import arctan2, Inf, array, sqrt, pi, ceil, sin, cos, sign, dot
from numpy.linalg import solve
from rtree import index as rtindex
from vispy.scene.visuals import Markers
import FlatCAMApp
import shapely.affinity as affinity



#from mpl_toolkits.axes_grid.anchored_artists import AnchoredDrawingArea



class BufferSelectionTool(FlatCAMTool):
    """
    Simple input for buffer distance.
    """

    toolName = "Buffer Selection"

    def __init__(self, app, fcdraw):

# Path: FlatCAMTool.py
# class FlatCAMTool(QtGui.QWidget):
# 
#     toolName = "FlatCAM Generic Tool"
# 
#     def __init__(self, app, parent=None):
#         """
# 
#         :param app: The application this tool will run in.
#         :type app: App
#         :param parent: Qt Parent
#         :return: FlatCAMTool
#         """
#         QtGui.QWidget.__init__(self, parent)
# 
#         # self.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum)
# 
#         self.layout = QtGui.QVBoxLayout()
#         self.setLayout(self.layout)
# 
#         self.app = app
# 
#         self.menuAction = None
# 
#     def install(self):
#         self.menuAction = self.app.ui.menutool.addAction(self.toolName)
#         self.menuAction.triggered.connect(self.run)
# 
#     def run(self):
#         # Remove anything else in the GUI
#         self.app.ui.tool_scroll_area.takeWidget()
# 
#         # Put ourself in the GUI
#         self.app.ui.tool_scroll_area.setWidget(self)
# 
#         # Switch notebook to tool page
#         self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab)
# 
#         self.show()
# 
# Path: ObjectUI.py
# class ObjectUI(QtGui.QWidget):
# class CNCObjectUI(ObjectUI):
# class GeometryObjectUI(ObjectUI):
# class ExcellonObjectUI(ObjectUI):
# class GerberObjectUI(ObjectUI):
#     def __init__(self, icon_file='share/flatcam_icon32.png', title='FlatCAM Object', parent=None):
#     def __init__(self, parent=None):
#     def __init__(self, parent=None):
#     def __init__(self, parent=None):
#     def __init__(self, parent=None):


# Path: FlatCAMDraw.py
from PyQt4 import QtGui, QtCore, Qt
from camlib import *
from FlatCAMTool import FlatCAMTool
from ObjectUI import LengthEntry
from shapely.geometry import Polygon, LineString, Point, LinearRing
from shapely.geometry import MultiPoint, MultiPolygon
from shapely.geometry import box as shply_box
from shapely.ops import cascaded_union, unary_union
from shapely.wkt import loads as sloads
from shapely.wkt import dumps as sdumps
from shapely.geometry.base import BaseGeometry
from numpy import arctan2, Inf, array, sqrt, pi, ceil, sin, cos, sign, dot
from numpy.linalg import solve
from rtree import index as rtindex
from vispy.scene.visuals import Markers
import FlatCAMApp
import shapely.affinity as affinity




#from mpl_toolkits.axes_grid.anchored_artists import AnchoredDrawingArea



class BufferSelectionTool(FlatCAMTool):
    """
    Simple input for buffer distance.
    """

    toolName = "Buffer Selection"

    def __init__(self, app, fcdraw):

        FlatCAMTool.__init__(self, app)