WithinDistanceRefine.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2004 CSIRO ICT Centre
00003  *
00004  * $Id: WithinDistanceRefine.cpp 587 2004-12-03 15:06:33Z nch $
00005  */
00006 
00007 #include <iostream>
00008 #include "String.h"
00009 
00010 #include "WithinDistanceRefine.h"
00011 #include "Object.h"
00012 #include "ObjectPairConsumer.h"
00013 
00014 
00015 String WithinDistanceRefine::s_name("Within Distance Refine");
00016 
00017 
00018 WithinDistanceRefine::WithinDistanceRefine(double maxD,
00019                                            ObjectPairConsumer * mPPCons,
00020                                            ObjectPairConsumer * uPPCons)
00021     : Refine(mPPCons, uPPCons),
00022       maxDistance(maxD)
00023 {}
00024 
00025 WithinDistanceRefine::~WithinDistanceRefine()
00026 {}
00027 
00028 bool WithinDistanceRefine::refine(Object const * red,
00029                                   Object const * blue)
00030 {
00031   bool result = false;
00032 
00033   if (red->gcDistance(*blue) <= maxDistance)
00034   {
00035     result = reportMatch(red, blue);
00036   }
00037   else
00038   {
00039     reportNoMatch(red, blue);
00040   }
00041 
00042   return result;
00043 }
00044 
Generated on Mon Oct 4 10:39:55 2010 for Matching.kdevelop by  doxygen 1.6.3