Skip to content

Commit

Permalink
[graphics] no axis limits option on VIBesFigMap
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRohou committed Oct 29, 2023
1 parent 690693a commit fe42c5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/robotics/graphics/codac_VIBesFigMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ namespace codac
m_draw_tubes_backgrounds = enable;
}

void VIBesFigMap::no_axis_limits()
{
_no_axis_limits = true;
}

void VIBesFigMap::show()
{
typename map<const TubeVector*,FigMapTubeParams>::const_iterator it_tubes;
Expand All @@ -61,7 +66,8 @@ namespace codac
for(it_trajs = m_map_trajs.begin(); it_trajs != m_map_trajs.end(); it_trajs++)
m_view_box |= draw_trajectory(it_trajs->first);

axis_limits(m_view_box, true, 0.02);
if(!_no_axis_limits)
axis_limits(m_view_box, true, 0.02);
}

void VIBesFigMap::show(float robot_size)
Expand Down Expand Up @@ -710,7 +716,8 @@ namespace codac
assert(pose.size() == 2 || pose.size() == 3);
float robot_size = size == -1 ? m_robot_size : size;
double robot_heading = pose.size() == 3 ? pose[2] : 0.;
axis_limits(m_view_box | pose.subvector(0,1), true);
if(!_no_axis_limits)
axis_limits(m_view_box | pose.subvector(0,1), true);
//vibes::drawTank(pose[0], pose[1], robot_heading * 180. / M_PI, robot_size, "black[yellow]", params);
vibes::drawAUV(pose[0], pose[1], robot_heading * 180. / M_PI, robot_size, "black[yellow]", params);
}
Expand Down
3 changes: 3 additions & 0 deletions src/robotics/graphics/codac_VIBesFigMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ namespace codac
*/
void enable_tubes_backgrounds(bool enable = true);

void no_axis_limits();

/**
* \brief Displays this figure
*/
Expand Down Expand Up @@ -559,6 +561,7 @@ namespace codac
bool m_draw_tubes_backgrounds = true; //!< if `true`, will highlight tubes contractions
bool m_smooth_drawing = false; //!< if `true`, a smooth rendering of tubes will be done
float m_robot_size = 5.5; //!< if `0`, no robot display
bool _no_axis_limits = false;

unsigned int m_tube_max_nb_disp_slices = TUBE_MAX_NB_DISPLAYED_SLICES; //!< limit for slices display
unsigned int m_traj_max_nb_disp_points = TRAJ_MAX_NB_DISPLAYED_POINTS; //!< limit for traj points display
Expand Down

0 comments on commit fe42c5c

Please sign in to comment.