# Path: Interface/Entity/point.py
# class Point(BaseEntity):
#     """
#         this class define the arcQT object 
#     """
#     def __init__(self, entity):
#         super(Point, self).__init__(entity)
#         self.xc,self.yc = self.geoItem.getCoords()
#         self.yc = (-1.0 * self.yc)
#         return
# 
#     def drawShape(self, painterPath):    
#         """
#             overloading of the shape method 
#         """
#         painterPath.addRect (QtCore.QRectF(self.xc - 2,self.yc - 2 , 4, 4))   
#         
#     def drawGeometry(self, painter, option, widget):
#         """
#             overloading of the paint method
#         """
#         # Create Arc/Circle
#         p = QtCore.QPoint(self.xc, self.yc)
#         painter.drawRect(self.boundingRect())  # self.xc-2,self.yc-2 ,4 ,4) with coordinates seems better
#         painter.drawPoint(p)
# 
# Path: Interface/Entity/arc.py
# class Arc(BaseEntity):
#     """
#         this class define the arcQT object 
#     """
#     def __init__(self, entity):
#         super(Arc, self).__init__(entity)
#         geoEnt=self.geoItem  # get the geometry from kernel
#         self.startPoint, p2=geoEnt.getEndpoints()     
#         self.xc, self.yc=geoEnt.center.getCoords()
#         startAngle=geoEnt.startAngle
#         self.sa=startAngle
#         spanAngle=geoEnt.endAngle
#         self.yc=(-1.0*self.yc)- geoEnt.radius
#         self.xc=self.xc-geoEnt.radius
#         self.h=geoEnt.radius*2
#         # By default, the span angle is 5760 (360 * 16, a full circle).
#         # From pythoncad the angle are in radiant ..
#         startAngle=(startAngle*180/math.pi)*16
#         spanAngle=(spanAngle*180/math.pi)*16
#         spanAngle=spanAngle
#         self.startAngle=startAngle
#         self.spanAngle=spanAngle
#         return
#     
#     def arcRect(self):    
#         return QtCore.QRectF(self.xc,
#                              self.yc,
#                              self.h,
#                              self.h)
# 
#     
#     def drawShape(self, painterPath):    
#         """
#             extending of the shape method 
#         """
#         x, y=self.startPoint.getCoords()
#         painterPath.moveTo(x, y*-1.0)
#         painterPath.arcTo(self.arcRect(),self.startAngle/16.0,self.spanAngle/16.0) 
#         return
#     
#     def drawGeometry(self, painter, option, widget):
#         """
#             extending of the paint method
#         """
#         #Create Arc/Circle
#         
#         painter.drawArc(self.arcRect(),self.startAngle,  self.spanAngle)
# 
# Path: Interface/Entity/polyline.py
# class Polyline(BaseEntity):
#     """
#         this class define the polyline object 
#     """
#     def __init__(self, entity):
#         super(Polyline, self).__init__(entity)
#         self.qtPoints=self.getQtPointF()
#         return
#         
#     def getQtPointF(self):
#         qtPoints=[]
#         geoPolyline=self.geoItem
#         for p in geoPolyline.points():
#             x, y=p.getCoords()
#             qtPointf=QtCore.QPointF(x, y*-1.0 )
#             qtPoints.append(qtPointf)
#         return qtPoints
# 
#     def drawShape(self, painterPath):    
#         """
#             overloading of the shape method 
#         """
#         painterPath.moveTo(self.qtPoints[0])
#         for i in range(1,len(self.qtPoints)):
#             painterPath.lineTo(self.qtPoints[i])    
#     
#     def drawGeometry(self, painter, option, widget):
#         """
#             overloading of the paint method
#         """
#         #Create poliline Object
#         pol=QtGui.QPolygonF(self.qtPoints)
#         painter.drawPolyline(pol)
#         #painter.drawRect(self.boundingRect())
# 
# Path: Interface/Command/distance2point.py
# class Distance2Point(BaseCommand):
#     """
#         This class rappresent the distance 2 point command
#     """
#     def __init__(self, document, iDocument):
#         BaseCommand.__init__(self, document)
#         self.iDocuemnt=iDocument
#         self.exception=[ExcPoint, ExcPoint]
#         self.defaultValue=[None, None]
#         self.message=["Give Me the first Point", 
#                         "Give Me the second Point"]
#         
#     def applyCommand(self):
#         if len(self.value)<1:
#             raise PyCadWrongImputData("Wrong number of imput parameter")
#         leng=self.value[0].dist(self.value[1])
#         msg="Lenght, "+ str(leng)
#         self.iDocuemnt.popUpInfo(msg)


from Interface.Entity.point import Point
from Interface.Entity.segment import Segment
from Interface.Entity.arc import Arc
from Interface.Entity.text import Text
from Interface.Entity.ellipse import Ellipse
from Interface.Entity.polyline import Polyline
from PyQt5 import QtCore
from Interface.Command.distance2point import Distance2Point
#
# PythonCAD is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PythonCAD; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# This  module PROVIDE ALL GLOBAL VARIABLE NEEDE TO THE SCENE
#



SCENE_SUPPORTED_TYPE = ["SEGMENT",
                      "POINT", 
                        "ARC",
                        "TEXT", 
                        "ELLIPSE", 
                        "POLYLINE"]

SCANE_OBJECT_TYPE = dict(zip(SCENE_SUPPORTED_TYPE, 
                       (
                        Segment, 
                        Point, 
                        Arc, 
                        Text, 
                        Ellipse, 

# Path: Interface/Entity/point.py
# class Point(BaseEntity):
#     """
#         this class define the arcQT object 
#     """
#     def __init__(self, entity):
#         super(Point, self).__init__(entity)
#         self.xc,self.yc = self.geoItem.getCoords()
#         self.yc = (-1.0 * self.yc)
#         return
# 
#     def drawShape(self, painterPath):    
#         """
#             overloading of the shape method 
#         """
#         painterPath.addRect (QtCore.QRectF(self.xc - 2,self.yc - 2 , 4, 4))   
#         
#     def drawGeometry(self, painter, option, widget):
#         """
#             overloading of the paint method
#         """
#         # Create Arc/Circle
#         p = QtCore.QPoint(self.xc, self.yc)
#         painter.drawRect(self.boundingRect())  # self.xc-2,self.yc-2 ,4 ,4) with coordinates seems better
#         painter.drawPoint(p)
# 
# Path: Interface/Entity/arc.py
# class Arc(BaseEntity):
#     """
#         this class define the arcQT object 
#     """
#     def __init__(self, entity):
#         super(Arc, self).__init__(entity)
#         geoEnt=self.geoItem  # get the geometry from kernel
#         self.startPoint, p2=geoEnt.getEndpoints()     
#         self.xc, self.yc=geoEnt.center.getCoords()
#         startAngle=geoEnt.startAngle
#         self.sa=startAngle
#         spanAngle=geoEnt.endAngle
#         self.yc=(-1.0*self.yc)- geoEnt.radius
#         self.xc=self.xc-geoEnt.radius
#         self.h=geoEnt.radius*2
#         # By default, the span angle is 5760 (360 * 16, a full circle).
#         # From pythoncad the angle are in radiant ..
#         startAngle=(startAngle*180/math.pi)*16
#         spanAngle=(spanAngle*180/math.pi)*16
#         spanAngle=spanAngle
#         self.startAngle=startAngle
#         self.spanAngle=spanAngle
#         return
#     
#     def arcRect(self):    
#         return QtCore.QRectF(self.xc,
#                              self.yc,
#                              self.h,
#                              self.h)
# 
#     
#     def drawShape(self, painterPath):    
#         """
#             extending of the shape method 
#         """
#         x, y=self.startPoint.getCoords()
#         painterPath.moveTo(x, y*-1.0)
#         painterPath.arcTo(self.arcRect(),self.startAngle/16.0,self.spanAngle/16.0) 
#         return
#     
#     def drawGeometry(self, painter, option, widget):
#         """
#             extending of the paint method
#         """
#         #Create Arc/Circle
#         
#         painter.drawArc(self.arcRect(),self.startAngle,  self.spanAngle)
# 
# Path: Interface/Entity/polyline.py
# class Polyline(BaseEntity):
#     """
#         this class define the polyline object 
#     """
#     def __init__(self, entity):
#         super(Polyline, self).__init__(entity)
#         self.qtPoints=self.getQtPointF()
#         return
#         
#     def getQtPointF(self):
#         qtPoints=[]
#         geoPolyline=self.geoItem
#         for p in geoPolyline.points():
#             x, y=p.getCoords()
#             qtPointf=QtCore.QPointF(x, y*-1.0 )
#             qtPoints.append(qtPointf)
#         return qtPoints
# 
#     def drawShape(self, painterPath):    
#         """
#             overloading of the shape method 
#         """
#         painterPath.moveTo(self.qtPoints[0])
#         for i in range(1,len(self.qtPoints)):
#             painterPath.lineTo(self.qtPoints[i])    
#     
#     def drawGeometry(self, painter, option, widget):
#         """
#             overloading of the paint method
#         """
#         #Create poliline Object
#         pol=QtGui.QPolygonF(self.qtPoints)
#         painter.drawPolyline(pol)
#         #painter.drawRect(self.boundingRect())
# 
# Path: Interface/Command/distance2point.py
# class Distance2Point(BaseCommand):
#     """
#         This class rappresent the distance 2 point command
#     """
#     def __init__(self, document, iDocument):
#         BaseCommand.__init__(self, document)
#         self.iDocuemnt=iDocument
#         self.exception=[ExcPoint, ExcPoint]
#         self.defaultValue=[None, None]
#         self.message=["Give Me the first Point", 
#                         "Give Me the second Point"]
#         
#     def applyCommand(self):
#         if len(self.value)<1:
#             raise PyCadWrongImputData("Wrong number of imput parameter")
#         leng=self.value[0].dist(self.value[1])
#         msg="Lenght, "+ str(leng)
#         self.iDocuemnt.popUpInfo(msg)


# Path: Interface/cadinitsetting.py
from Interface.Entity.point import Point
from Interface.Entity.segment import Segment
from Interface.Entity.arc import Arc
from Interface.Entity.text import Text
from Interface.Entity.ellipse import Ellipse
from Interface.Entity.polyline import Polyline
from PyQt5 import QtCore
from Interface.Command.distance2point import Distance2Point

#
# PythonCAD is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PythonCAD; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# This  module PROVIDE ALL GLOBAL VARIABLE NEEDE TO THE SCENE
#



SCENE_SUPPORTED_TYPE = ["SEGMENT",
                      "POINT", 
                        "ARC",
                        "TEXT", 
                        "ELLIPSE", 
                        "POLYLINE"]

SCANE_OBJECT_TYPE = dict(zip(SCENE_SUPPORTED_TYPE, 
                       (
                        Segment, 
                        Point, 
                        Arc, 
                        Text, 
                        Ellipse, 

                        Polyline