Changeset 2295


Ignore:
Timestamp:
Jan 27, 2006, 9:50:59 AM (19 years ago)
Author:
duncan
Message:

adding an actual test to test_mesh_interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pmesh/test_mesh_interface.py

    r2282 r2295  
    4343                                     10000000,
    4444                                     interior_regions=interior_regions,
    45                                      poly_geo_reference=geo_ref_poly)
     45                                     poly_geo_reference=geo_ref_poly,
     46                                     mesh_geo_reference=mesh_geo)
    4647
    4748        # Test the mesh instance
     
    6465                        'FAILED!')
    6566
     67        # Assuming the order of the region points is known.
     68        # (This isn't true, if you consider create_mesh_from_regions
     69        # a black box)
     70        poly_point = m.getRegions()[0]
     71       
     72        #print "poly_point", poly_point
     73        #print "polygon_absolute",polygon_absolute
     74         
     75        # poly_point values are relative to the mesh geo-ref
     76        # make them absolute
     77        self.failUnless(inside_polygon([poly_point.x+x,poly_point.y+y],
     78                                       polygon_absolute, closed = False),
     79                        'FAILED!')
     80       
     81        # Assuming the order of the region points is known.
     82        # (This isn't true, if you consider create_mesh_from_regions
     83        # a black box)
     84        poly_point = m.getRegions()[1]
     85       
     86        #print "poly_point", poly_point
     87        #print "polygon_absolute",polygon_absolute
     88         
     89        # poly_point values are relative to the mesh geo-ref
     90        # make them absolute
     91        self.failUnless(inside_polygon([poly_point.x+x,poly_point.y+y],
     92                                       inner1_polygon_absolute,
     93                                       closed = False),
     94                        'FAILED!')
     95       
     96        # Assuming the order of the region points is known.
     97        # (This isn't true, if you consider create_mesh_from_regions
     98        # a black box)
     99        poly_point = m.getRegions()[2]
     100       
     101        #print "poly_point", poly_point
     102        #print "polygon_absolute",polygon_absolute
     103         
     104        # poly_point values are relative to the mesh geo-ref
     105        # make them absolute
     106        self.failUnless(inside_polygon([poly_point.x+x,poly_point.y+y],
     107                                       inner2_polygon_absolute,
     108                                       closed = False),
     109                        'FAILED!')
    66110#-------------------------------------------------------------
    67111if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.