Changeset 1035
- Timestamp:
- Mar 8, 2005, 12:15:59 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/mesh.py
r1023 r1035 27 27 28 28 import load_mesh 29 from coordinate_transforms.geo_reference import Geo_reference 29 30 30 31 SET_COLOUR='red' 31 32 DEFAULT_ZONE = 56 32 33 33 34 def gradient_python(x0, y0, x1, y1, x2, y2, q0, q1, q2): … … 127 128 def __init__(self,X,Y, attributes = None): 128 129 __slots__ = ['x','y','attributes'] 130 assert (type(X) == types.FloatType) 129 131 self.x=X 130 132 self.y=Y … … 394 396 """ 395 397 Each segment is specified by listing the vertices of its endpoints 396 """397 398 The vertices are Vertex objects 399 """ 398 400 assert(vertex1 != vertex2) 399 401 self.vertices = [vertex1,vertex2 ] … … 414 416 #end.draw(canvas,scale, xoffset, yoffset ) # draw the vertices 415 417 x.append(scale*(end.x + xoffset)) 416 y.append(-1*scale*(end.y + yoffset)) # - since for a canvas - is up 417 return canvas.create_line(x[0], y[0], x[1], y[1], tags = tags,fill=colour) 418 y.append(-1*scale*(end.y + yoffset)) # - since for a canvas - is up 419 420 return canvas.create_line(x[0], y[0], x[1], y[1], 421 tags = tags,fill=colour) 418 422 def set_tag(self,tag): 419 423 self.tag = tag … … 498 502 499 503 if geo_reference is None: 500 self.geo_reference = None504 self.geo_reference = Geo_reference(DEFAULT_ZONE,0,0) 501 505 else: 502 506 self.geo_reference = geo_reference … … 1119 1123 segment list: [(point1,point2),(p3,p4),...] (Tuples of integers) 1120 1124 #segment tag list: [S1Tag, S2Tag, ...] (list of ints) 1125 1126 Assume the values are in Eastings and Northings, with no reference 1127 point 1121 1128 """ 1122 1129 … … 1124 1131 #index = 0 1125 1132 for point in outlineDict['pointlist']: 1126 v=Vertex(point[0], point[1]) 1133 1134 v=Vertex(point[0]-self.geo_reference.xllcorner, 1135 point[1]-self.geo_reference.yllcorner) 1127 1136 #v.index = index 1128 1137 #index +=1 … … 2278 2287 elif (ofile[-4:]== ".tsh" or ofile[-4:]== ".msh"): 2279 2288 dict = load_mesh.loadASCII.import_triangulation(ofile) 2280 print "********"2281 print "zq mesh.dict",dict2282 print "********"2289 #print "********" 2290 #print "zq mesh.dict",dict 2291 #print "********" 2283 2292 newmesh= Mesh() 2284 2293 newmesh.IOOutline2Mesh(dict)
Note: See TracChangeset
for help on using the changeset viewer.