Changeset 8029


Ignore:
Timestamp:
Oct 7, 2010, 2:57:19 PM (12 years ago)
Author:
habili
Message:

modified _polygon_triangle_overlap so that it takes in any polygon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/polygon_ext.c

    r8028 r8029  
    316316
    317317int __polygon_triangle_overlap(double* polygon,
    318                                double* triangle)
     318                               double* triangle,
     319                               int polygon_number_of_vertices)
    319320{
    320321    int i, ii, j, jj;
     
    328329    p0_y = polygon[1];
    329330   
    330     for (i = 1; i < 5; i++)
     331    for (i = 1; i < polygon_number_of_vertices + 1; i++)
    331332    {
    332         ii = i%4;
     333        ii = i%polygon_number_of_vertices;
    333334       
    334335        p1_x = polygon[2*ii];
     
    679680  // Call underlying routine
    680681  res = __polygon_triangle_overlap((double*) polygon->data,
    681                              (double*) triangle -> data);                                                     
     682                             (double*) triangle -> data,
     683                 (int) polygon->dimensions[0]);                                               
    682684
    683685
Note: See TracChangeset for help on using the changeset viewer.