I am working on an existing code adding some features. A class arc exists with start_point, end_point, and center_point. This is how start point is obtained for example:
/** returns start turn point */
const Formulas::LLPoint& get_start_turn_point() const
{
return start_point;
}
And its longitude is logged like this:
act_msg.startLongitude = flyBy.get_start_turn_point().longitude;
DEBUG_LOG1 (LVL1, "Testing, start longitude of turn:");
DEBUG_LOG1 (LVL1, flyBy.get_start_turn_point().longitude);
This logs the longitude perfectly fine. Now I want to add to the class a vector of points. That will require some basic trigonometry but the problem for me is working with vectors in C++ (this is my first experience coding in this language). I tried with just two points for testing:
/** returns list of points */
std::vector<Formulas::LLPoint>& get_arc_points()
{
arc_points.push_back(start_point);
arc_points.push_back(end_point);
return arc_points;
}
I want to log the same longitude as before, but this is not working:
DEBUG_LOG1 (LVL1, "Testing, same number from vector:");
DEBUG_LOG1 (LVL1, flyBy.get_arc_points()[0].longitude);
It is not even compiling, with the following error:
error: passing ‘const FVIS::ArcDataSegment’ as ‘this’ argument discards qualifiers [-fpermissive] DEBUG_LOG1 (LVL1, flyBy.get_arc_points()[0].longitude);
Where is the problem? Any help is appreciated, thank you.