Exemplo n.º 1
0
 /** Dumps the ranges of a region to the console in a human-readable format */
 inline static void print_ranges(const Region<int> &reg){
     int cnt(1);
     if(reg.IsUniverse())
         Console::Write("\nUniverse Set\n");
     else if(reg.IsEmpty())
         Console::Write("\nEmpty Set\n");
     else{
         G_FOREACH_CONST(const Range<int> &r, reg.Ranges()){
             Console::WriteLine();
             Console::Write(String::Format("Range %d:", cnt));
             if(r.HasLowerBound())
                 Console::Write(String::Format("    %sLB: %2d",
                                               r.LowerBound().ValueIncludedInBound() ? "+" : " ",
                                               r.LowerBound().Value()));
             if(r.HasUpperBound())
                 Console::Write(String::Format("    %sUB: %2d",
                                               r.UpperBound().ValueIncludedInBound() ? "+" : " ",
                                               r.UpperBound().Value()));
             ++cnt;
         }
         Console::WriteLine();
     }
     Console::WriteLine();
 }
Exemplo n.º 2
0
bool Robot::intersects( const Region& aRegion) const
{
	Region region = getRegion();
	region.Intersect( aRegion);
	return !region.IsEmpty();
}