Changeset 2396


Ignore:
Timestamp:
Feb 14, 2006, 2:21:30 PM (19 years ago)
Author:
duncan
Message:

did a bit more work on changing the georef

Location:
inundation/pmesh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/pmesh/mesh.py

    r2392 r2396  
    801801        user vertex values.
    802802
     803        Not to be used with the graphical interface
     804       
    803805        Not implemented.
    804806        Don't implement now.  using the new georeferenced points class
    805         will change this
     807        will change this?
    806808        """
    807809        #to do
    808810        # find the lower left hand corner
     811        [xmin, ymin, xmax, ymax] = self.boxsize()
    809812
    810813        # set all points to that lower left hand corner.
    811814        # use change_geo_reference
    812         pass
    813 
     815        new_geo = Geo_reference(self.geo_reference.get_zone(), xmin, ymin)
     816        self.change_geo_reference(new_geo)
     817       
    814818    def change_geo_reference(self, new_geo_reference):
    815819        """
    816         """
    817         # chang egeoreference of;
    818         #self.userVertices
    819         #self.holes
    820         #self.regions
    821         pass
     820        Change from one geo_reference to another.
     821        Not to be used with the graphical interface
     822        """
     823        # FIXME
     824        # change georeference of;
     825        #self.userVertices = self.geo_reference.change_points_geo_ref( \
     826        #self.userVertices)
     827        #self.holes = self.geo_reference.change_points_geo_ref(self.holes)
     828        #self.regions = self.geo_reference.change_points_geo_ref(self.regions)
     829        # The above will not work.
     830        # since userVertices (etc) is a list of point objects,
     831        #not a list of lists.
     832        # add a method to the points class to fix this up.
    822833       
    823834    def addVertsSegs(self, outlineDict):
  • inundation/pmesh/test_mesh.py

    r2346 r2396  
    18941894        m.export_mesh_file("aaat.msh")
    18951895       
     1896    def FIXMEtest_auto_set_geo_reference(self):
     1897        x=50000
     1898        y=1000
     1899        m=Mesh(geo_reference=Geo_reference(56,x,y))
     1900        polygon = [[0,0],[1,0],[1,1],[0,1]]
     1901       
     1902        m.add_region_from_polygon(polygon,
     1903                               {'tagin':[0,1],'bom':[2]},
     1904                                  max_triangle_area=10)
     1905        m.auto_set_geo_reference()
     1906       
    18961907       
    18971908def list_comp(A,B):
Note: See TracChangeset for help on using the changeset viewer.