parameters: (self,filter1=None,filter2=None,bb_reject=True)
docstring: Returns an iterator over potential colliding pairs, which
          should be tested for collisions. 
  
          Usage:
              To test collisions, you call::
  
                  for i,j in worldCollider.collisionTests():
                      if i[1].collides(j[1]):
                          print "Object",i[0].getName(),"collides with",j[0].getName()
                      
          (Note that for this purpose is easier to just call :meth:`collisions`;
          however you may want to use `collisionTests` to perform other queries
          like proximity detection.)
  
          Args:
              filter1 (function, optional): has form f(object) -> bool
              filter2 (function, optional): has form f(object) -> bool
              bb_reject (bool, optional): True if we should quick reject objects
                  whose bounding boxes are not overlapping (broad phase collision
                  detection).  If false, all non-ignored collision pairs are
                  returned.
  
          See :meth:`collisions` for an explanation of how filter1 and filter2
          are interpreted
  
          Returns:
              iterator of tuple: Iterates over
              ((object1,geom1),(object2,geom2)) pairs indicating which objects
              should be tested for collision. They have type:
  
                  - object1, object2: a RobotModelLink, RigidObjectModel, or
                    TerrainModel
                  - geom1, geom2: Geometry3D corresponding to those objects.
docstring_summary: Returns an iterator over potential colliding pairs, which
          should be tested for collisions.
docstring_tokens: Returns an iterator over potential colliding pairs which should be tested for collisions .
function: def collisionTests(self,filter1=None,filter2=None,bb_reject=True):
          """Returns an iterator over potential colliding pairs, which
          should be tested for collisions. 
  
          Usage:
              To test collisions, you call::
  
                  for i,j in worldCollider.collisionTests():
                      if i[1].collides(j[1]):
                          print "Object",i[0].getName(),"collides with",j[0].getName()
                      
          (Note that for this purpose is easier to just call :meth:`collisions`;
          however you may want to use `collisionTests` to perform other queries
          like proximity detection.)
  
          Args:
              filter1 (function, optional): has form f(object) -> bool
              filter2 (function, optional): has form f(object) -> bool
              bb_reject (bool, optional): True if we should quick reject objects
                  whose bounding boxes are not overlapping (broad phase collision
                  detection).  If false, all non-ignored collision pairs are
                  returned.
  
          See :meth:`collisions` for an explanation of how filter1 and filter2
          are interpreted
  
          Returns:
              iterator of tuple: Iterates over
              ((object1,geom1),(object2,geom2)) pairs indicating which objects
              should be tested for collision. They have type:
  
                  - object1, object2: a RobotModelLink, RigidObjectModel, or
                    TerrainModel
                  - geom1, geom2: Geometry3D corresponding to those objects.
  
          """
          res = []
          if filter1 is None: #all pairs
              if bb_reject: bblist = [g[1].getBB() for g in self.geomList]
              for (i,(g,objs)) in enumerate(zip(self.geomList,self.mask)):
                  for objIndex in objs:
                      #already checked
                      if objIndex < i: continue
                      if bb_reject and not bb_intersect(bblist[i],bblist[objIndex]): continue
                      yield (g,self.geomList[objIndex])
          elif filter2 is None: #self collision with objects passing filter1
              if bb_reject:
                  #TODO: bounding box rejection, if requested
                  pass
              for (i,(g,objs)) in enumerate(zip(self.geomList,self.mask)):
                  if not filter1(g[0]): continue
                  for objIndex in objs:
                      #already checked
                      if objIndex < i: continue
                      if not filter1(self.geomList[objIndex][0]): continue
                      yield (g,self.geomList[objIndex])
          else:  #checks everything
              for (i,(g,objs)) in enumerate(zip(self.geomList,self.mask)):
                  f1 = filter1(g[0])
                  f2 = filter2(g[0])
                  for objIndex in objs:
                      #already checked
                      if self.geomList[objIndex][0]==g[0]:
                          continue
                      if f1 and filter2(self.geomList[objIndex][0]):
                          yield (g,self.geomList[objIndex])
                      elif f2 and filter1(self.geomList[objIndex][0]):
                          yield (self.geomList[objIndex],g)
function_tokens: def collisionTests ( self , filter1 = None , filter2 = None , bb_reject = True ) : res = [ ] if filter1 is None : #all pairs if bb_reject : bblist = [ g [ 1 ] . getBB ( ) for g in self . geomList ] for ( i , ( g , objs ) ) in enumerate ( zip ( self . geomList , self . mask ) ) : for objIndex in objs : #already checked if objIndex < i : continue if bb_reject and not bb_intersect ( bblist [ i ] , bblist [ objIndex ] ) : continue yield ( g , self . geomList [ objIndex ] ) elif filter2 is None : #self collision with objects passing filter1 if bb_reject : #TODO: bounding box rejection, if requested pass for ( i , ( g , objs ) ) in enumerate ( zip ( self . geomList , self . mask ) ) : if not filter1 ( g [ 0 ] ) : continue for objIndex in objs : #already checked if objIndex < i : continue if not filter1 ( self . geomList [ objIndex ] [ 0 ] ) : continue yield ( g , self . geomList [ objIndex ] ) else : #checks everything for ( i , ( g , objs ) ) in enumerate ( zip ( self . geomList , self . mask ) ) : f1 = filter1 ( g [ 0 ] ) f2 = filter2 ( g [ 0 ] ) for objIndex in objs : #already checked if self . geomList [ objIndex ] [ 0 ] == g [ 0 ] : continue if f1 and filter2 ( self . geomList [ objIndex ] [ 0 ] ) : yield ( g , self . geomList [ objIndex ] ) elif f2 and filter1 ( self . geomList [ objIndex ] [ 0 ] ) : yield ( self . geomList [ objIndex ] , g )