コード例 #1
0
 def openDXF(self, fileName):
     d = self.getView().getDrawing()
     for et in dxfreader.getEtt(fileName):
         if et["0"] == "LINE":
             x0 = float(et["10"])
             y0 = float(et["20"])
             p0 = pyHPoint(x0, y0)
             x1 = float(et["11"])
             y1 = float(et["21"])
             p1 = pyHPoint(x1, y1)
             l = pyHPolylineFigure()
             l.addPoint(p0)
             l.addPoint(p1)
             d.addFigure(l)
         if et["0"] == "CIRCLE":
             x0 = float(et["10"])
             y0 = float(et["20"])
             r = float(et["40"])
             c = pyHEllipseFigure(x0 - r, y0 - r, 2 * r, 2 * r)
             d.addFigure(c)
         if et["0"] == "POINT":
             x0 = float(et["10"])
             y0 = float(et["20"])
             r = 2
             c = pyHEllipseFigure(x0 - r, y0 - r, 2 * r, 2 * r)
             d.addFigure(c)
         if et["0"] == "ARC":
             x0 = float(et["10"])
             y0 = float(et["20"])
             r = float(et["40"])
             ans = float(et["50"])
             ane = float(et["51"])
             c = pyHArcFigure(x0 - r, y0 - r, 2 * r, 2 * r, ans, ane)
             d.addFigure(c)
         if et["0"] == "LWPOLYLINE":
             xs = et["10"]
             ys = et["20"]
             c = pyHPolylineFigure()
             for i, x in enumerate(xs):
                 p = pyHPoint(float(x), float(ys[i]))
                 c.addPoint(p)
             d.addFigure(c)
         if et["0"] == "SPLINE":
             xs = et["10"]
             ys = et["20"]
             c = pyHSplineFigure()
             for i, x in enumerate(xs):
                 p = pyHPoint(float(x), float(ys[i]))
                 c.addPoint(p)
             d.addFigure(c)
     self.fillTree()
コード例 #2
0
 def openDXF(self,fileName):
     d=self.getView().getDrawing()
     for et in dxfreader.getEtt(fileName):
         if et["0"]=="LINE":
             x0=float(et["10"])
             y0=float(et["20"])
             p0=pyHPoint(x0,y0)
             x1=float(et["11"])
             y1=float(et["21"])
             p1=pyHPoint(x1,y1)
             l=pyHPolylineFigure()
             l.addPoint(p0)
             l.addPoint(p1)
             d.addFigure(l)
         if et["0"]=="CIRCLE":
             x0=float(et["10"])
             y0=float(et["20"])
             r =float(et["40"])
             c=pyHEllipseFigure(x0-r,y0-r,2*r,2*r)
             d.addFigure(c)
         if et["0"]=="POINT":
             x0=float(et["10"])
             y0=float(et["20"])
             r =2
             c=pyHEllipseFigure(x0-r,y0-r,2*r,2*r)
             d.addFigure(c)
         if et["0"]=="ARC":
             x0=float(et["10"])
             y0=float(et["20"])
             r =float(et["40"])
             ans=float(et["50"])
             ane=float(et["51"])
             c=pyHArcFigure(x0-r,y0-r,2*r,2*r,ans,ane)
             d.addFigure(c)
         if et["0"]=="LWPOLYLINE":
             xs=et["10"]
             ys=et["20"]
             c=pyHPolylineFigure()
             for i,x in enumerate(xs):
                 p=pyHPoint(float(x),float(ys[i]))
                 c.addPoint(p)
             d.addFigure(c)
         if et["0"]=="SPLINE":
             xs=et["10"]
             ys=et["20"]
             c=pyHSplineFigure()
             for i,x in enumerate(xs):
                 p=pyHPoint(float(x),float(ys[i]))
                 c.addPoint(p)
             d.addFigure(c)
     self.fillTree()
コード例 #3
0
 def __init__(self,v):
     '''
     Constructor
     '''
     self.view=v
     self.f=pyHSplineFigure()
コード例 #4
0
 def __init__(self, v):
     '''
     Constructor
     '''
     self.view = v
     self.f = pyHSplineFigure()