2012-02-06 16:44:09 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the Owl Positioning System (OwlPS).
|
|
|
|
* OwlPS is a project of the University of Franche-Comté
|
|
|
|
* (Université de Franche-Comté), France.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-03-03 16:15:06 +01:00
|
|
|
#include "realposition.hh"
|
|
|
|
#include "calibrationrequest.hh"
|
|
|
|
#include "referencepoint.hh"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Result RealPosition::compute(const Request &request)
|
|
|
|
{
|
2011-05-04 19:58:02 +02:00
|
|
|
const Point3D *coordinates = NULL ;
|
|
|
|
|
2010-03-03 16:15:06 +01:00
|
|
|
const CalibrationRequest *calibration_request =
|
|
|
|
dynamic_cast<const CalibrationRequest*>(&request) ;
|
|
|
|
|
|
|
|
if (calibration_request != NULL)
|
2011-05-04 19:58:02 +02:00
|
|
|
coordinates = static_cast<Point3D*>(
|
|
|
|
calibration_request->get_reference_point()) ;
|
|
|
|
|
|
|
|
coordinates = request.get_real_position() ;
|
|
|
|
if (coordinates)
|
2011-07-24 12:32:07 +02:00
|
|
|
return Result(&request, name, *coordinates) ;
|
2010-03-03 16:15:06 +01:00
|
|
|
|
2011-07-24 12:32:07 +02:00
|
|
|
return Result(&request, name) ;
|
2010-03-03 16:15:06 +01:00
|
|
|
}
|