2012-02-06 16:44:09 +01:00
|
|
|
/*
|
2013-05-29 18:43:35 +02:00
|
|
|
* This file is part of the Owl Positioning System (OwlPS) project.
|
|
|
|
* It is subject to the copyright notice and license terms in the
|
|
|
|
* COPYRIGHT.t2t file found in the top-level directory of this
|
|
|
|
* distribution and at
|
|
|
|
* http://code.lm7.fr/p/owlps/source/tree/master/COPYRIGHT.t2t
|
|
|
|
* No part of the OwlPS Project, including this file, may be copied,
|
|
|
|
* modified, propagated, or distributed except according to the terms
|
|
|
|
* contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
|
|
|
|
* distributed along with this file, either separately or by replacing
|
2013-06-22 23:30:17 +02:00
|
|
|
* this notice by the COPYRIGHT.t2t file's contents.
|
2012-02-06 16:44:09 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
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) ;
|
|
|
|
|
2014-05-13 23:29:08 +02:00
|
|
|
if (calibration_request)
|
2011-05-04 19:58:02 +02:00
|
|
|
coordinates = static_cast<Point3D*>(
|
|
|
|
calibration_request->get_reference_point()) ;
|
2013-06-21 23:51:24 +02:00
|
|
|
else
|
|
|
|
coordinates = request.get_real_position() ;
|
2011-05-04 19:58:02 +02:00
|
|
|
|
|
|
|
if (coordinates)
|
2011-07-24 12:32:07 +02:00
|
|
|
return Result(&request, name, *coordinates) ;
|
|
|
|
return Result(&request, name) ;
|
2010-03-03 16:15:06 +01:00
|
|
|
}
|