@@ -58,7 +58,8 @@ AchievePointCalcs::AchievePointCalcs(const string &waypoint, const AircraftInten
5858
5959AchievePointCalcs::AchievePointCalcs (const string &waypoint, const AircraftIntent &intent, const VerticalPath &vpath,
6060 const vector<HorizontalPath> &htraj, const AchievePointCalcs &ownship_calcs,
61- const AircraftIntent &ownship_intent) {
61+ const AircraftIntent &ownship_intent,
62+ const std::shared_ptr<TangentPlaneSequence> &position_converter) {
6263 Clear ();
6364
6465 m_waypoint_name = waypoint;
@@ -69,16 +70,16 @@ AchievePointCalcs::AchievePointCalcs(const string &waypoint, const AircraftInten
6970 if (m_waypoint_name == " CALCULATED_TRP" ) {
7071 Waypoint traffic_reference_point;
7172 size_t waypoint_index;
72- ComputeDefaultTRP (ownship_calcs, ownship_intent, intent, m_horizontal_path, traffic_reference_point, m_waypoint_x ,
73- m_waypoint_y, waypoint_index);
73+ ComputeDefaultTRP (ownship_calcs, ownship_intent, intent, position_converter, m_horizontal_path ,
74+ traffic_reference_point, m_waypoint_x, m_waypoint_y, waypoint_index);
7475 LOG4CPLUS_DEBUG (m_logger, " Calculated TRP = (" << m_waypoint_x << " ," << m_waypoint_y << " )" );
7576 // log the geographic coordinates
7677 EarthModel::LocalPositionEnu xy;
7778 xy.x = m_waypoint_x;
7879 xy.y = m_waypoint_y;
7980 xy.z = Units::zero ();
8081 EarthModel::GeodeticPosition geo;
81- intent. GetTangentPlaneSequence ()-> convertLocalToGeodetic (xy, geo);
82+ position_converter-> ConvertLocalToGeodetic (xy, geo);
8283 LOG4CPLUS_DEBUG (m_logger, " (lat,lon) = (" << std::setprecision (10 ) << Units::DegreesAngle (geo.latitude ) << " ,"
8384 << Units::DegreesAngle (geo.longitude ) << " )" );
8485 } else {
@@ -87,8 +88,6 @@ AchievePointCalcs::AchievePointCalcs(const string &waypoint, const AircraftInten
8788 ComputeEndValues (vpath);
8889}
8990
90- AchievePointCalcs::~AchievePointCalcs () = default ;
91-
9291void AchievePointCalcs::Clear () {
9392
9493 m_waypoint_name = " " ;
@@ -107,6 +106,7 @@ void AchievePointCalcs::Clear() {
107106
108107void AchievePointCalcs::ComputeDefaultTRP (const AchievePointCalcs &ownship_calcs, const AircraftIntent &ownship_intent,
109108 const AircraftIntent &target_intent,
109+ const std::shared_ptr<TangentPlaneSequence> &position_converter,
110110 const vector<HorizontalPath> &target_horizontal_path,
111111 Waypoint &traffic_reference_point, Units::Length &waypoint_x,
112112 Units::Length &waypoint_y, size_t &waypoint_index_in_target_intent) {
@@ -154,7 +154,7 @@ void AchievePointCalcs::ComputeDefaultTRP(const AchievePointCalcs &ownship_calcs
154154 // Search horizontal path for an intersecting segment
155155 HorizontalTurnPath trp_turn;
156156 bool first (true ), crossed (false ), end_is_usable (false );
157- double x0, y0, d0;
157+ double x0{} , y0{} , d0{} ;
158158 vector<HorizontalPath>::const_iterator hpi;
159159 for (hpi = target_horizontal_path.begin (); hpi != target_horizontal_path.end (); ++hpi) {
160160 double x1 = hpi->GetXPositionMeters ();
@@ -343,7 +343,7 @@ void AchievePointCalcs::ComputeDefaultTRP(const AchievePointCalcs &ownship_calcs
343343 xy.y = waypoint_y;
344344 xy.z = Units::zero ();
345345 EarthModel::GeodeticPosition geo;
346- target_intent. GetTangentPlaneSequence ()-> convertLocalToGeodetic (xy, geo);
346+ position_converter-> ConvertLocalToGeodetic (xy, geo);
347347
348348 // populate traffic_reference_point
349349 traffic_reference_point.SetName (" CALCULATED_TRP" );
@@ -353,7 +353,7 @@ void AchievePointCalcs::ComputeDefaultTRP(const AchievePointCalcs &ownship_calcs
353353 if (trp_turn.radius > Units::zero ()) {
354354 xy.x = Units::MetersLength (trp_turn.x_position_meters );
355355 xy.y = Units::MetersLength (trp_turn.y_position_meters );
356- target_intent. GetTangentPlaneSequence ()-> convertLocalToGeodetic (xy, geo);
356+ position_converter-> ConvertLocalToGeodetic (xy, geo);
357357 traffic_reference_point.SetRfTurnCenterLatitude (geo.latitude );
358358 traffic_reference_point.SetRfTurnCenterLongitude (geo.longitude );
359359 } else {
0 commit comments