Ignore:
Timestamp:
Jun 24, 2010, 10:38:40 PM (15 years ago)
Author:
James Hudson
Message:

Fixed a few unit test errors.

Location:
trunk/anuga_core/source/anuga/geometry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/geometry/aabb.py

    r7861 r7872  
    1212
    1313class AABB:
    14     """Axially-aligned bounding box class.
    15        Defines a box which can check for intersections with other boxes,
    16        or if a point lies within it.
     14    """ Axially-aligned bounding box class.
     15        An axially aligned bounding box (or AABB) defines a box-shaped region
     16        of the plane which contains any other arbitrary geometry.
     17        It is useful because intersections can be tested against it very
     18        rapidly. Once all misses are trivially rejected, a more expensive
     19        collision detection can be done against the remaining geometry.
     20       
     21        This class defines a box which can check for intersections with other
     22        boxes, or points. It can also subdivide itself, returning
     23        smaller AABBs. This can be used as the basis of a recursive tree
     24        structure for optimising geometry searches.
    1725    """
    1826   
  • trunk/anuga_core/source/anuga/geometry/quad.py

    r7866 r7872  
    1717           
    1818class Cell():
    19     """class Cell
    20 
    21     One cell in the plane.
     19    """ One cell in the plane.
     20        A cell is defined by an AABB, and can have smaller AABB children.
     21        The children can be rapidly searched for intersections in log(n) time.
    2222    """
    2323 
     
    3838   
    3939    def __repr__(self):
     40        """ String representation of the quadtree. """
    4041        ret_str = '%s: leaves: %d' \
    4142               % (self.name , len(self.leaves))   
     
    8485                    #return               
    8586
    86             # option 2 - try splitting 2 ways - no diff noticed in practise
     87            # option 2 - try splitting 2 ways - no performance difference
     88            # noticed in practise between this and the above option.
    8789            if subregion1.is_trivial_in(new_region):
    8890                self.children = [Cell(subregion1, self), \
     
    160162 
    161163    def test_leaves(self, point):
    162         """ Test all leaves to see if they intersect x.
     164        """ Test all leaves on this node to see if they intersect x.
     165            Does not recurse into children.
    163166            x is a point to test
    164167            return a list of leaves that intersect x
Note: See TracChangeset for help on using the changeset viewer.