codac 1.5.6
|
Multi-view item to display vector tubes or trajectories. More...
#include <codac_VIBesFigTubeVector.h>
Public Member Functions | |
Basics | |
VIBesFigTubeVector (const std::string &fig_name) | |
Creates a VIBesFigTubeVector. | |
VIBesFigTubeVector (const std::string &fig_name, int start_index, int end_index) | |
Creates a VIBesFigTubeVector. | |
VIBesFigTubeVector (const std::string &fig_name, const TubeVector *tube, const TrajectoryVector *traj=nullptr) | |
Creates a VIBesFigTube. | |
~VIBesFigTubeVector () | |
VIBesFigTubeVector destructor. | |
int | size () const |
Returns the dimension \(n\) of the objects displayed in the figure. | |
int | subfigs_number () const |
Returns number of dimensions to be displayed. | |
VIBesFigTube * | operator[] (int index) |
Returns a pointer to the ith VIBesFigTube of this figure. | |
const VIBesFigTube * | operator[] (int index) const |
Returns a const pointer to the ith VIBesFigTube of this figure. | |
void | set_properties (int x, int y, int width, int height) |
Sets the properties (coordinates and dimensions) of this figure. | |
void | show (bool detail_slices=false) |
Displays this figure with optional details. | |
void | set_cursor (double t) |
Set the position of the temporal cursor of this figure. | |
void | show_cursor (bool display=true) |
Displays the cursor on this figure. | |
Simple drawings | |
void | draw_box (const Interval &tdomain, const IntervalVector &box, const vibes::Params ¶ms) |
Draws a multi-dimensional box. | |
void | draw_box (const Interval &tdomain, const IntervalVector &box, const std::string &color="", const vibes::Params ¶ms=vibes::Params()) |
Draws a multi-dimensional box. | |
Handling tubes | |
void | add_tube (const TubeVector *tube, const std::string &name, const std::string &color_frgrnd=DEFAULT_FRGRND_COLOR, const std::string &color_bckgrnd=DEFAULT_BCKGRND_COLOR) |
Adds a tube vector object to this figure. | |
void | set_tube_name (const TubeVector *tube, const std::string &name) |
Sets a new name for a tube vector. | |
void | set_tube_derivative (const TubeVector *tube, const TubeVector *derivative) |
Links a tube vector to its derivative for display purposes. | |
void | set_tube_color (const TubeVector *tube, const std::string &color_frgrnd, const std::string &color_bckgrnd=DEFAULT_BCKGRND_COLOR) |
Sets color properties for a given tube vector. | |
void | set_tube_color (const TubeVector *tube, TubeColorType color_type, const std::string &color) |
Sets color properties for a given tube vector. | |
void | reset_tube_background (const TubeVector *tube) |
Reset the background of a given tube vector. | |
void | remove_tube (const TubeVector *tube) |
Removes a tube vector from this figure. | |
Handling trajectories | |
void | add_trajectory (const TrajectoryVector *traj, const std::string &name, const std::string &color=DEFAULT_TRAJ_COLOR) |
Adds a trajectory vector object to this figure. | |
void | set_trajectory_name (const TrajectoryVector *traj, const std::string &name) |
Sets a new name for a trajectory vector. | |
void | set_trajectory_color (const TrajectoryVector *traj, const std::string &color) |
Sets color properties for a given trajectory vector. | |
void | set_trajectory_points_size (const TrajectoryVector *traj, double points_size) |
Sets points size for a given trajectory, and activates a display mode with points instead of a line for this trajectory. | |
void | remove_trajectory (const TrajectoryVector *traj) |
Removes a trajectory vector from this figure. | |
Public Member Functions inherited from codac::Figure | |
Figure (const std::string &fig_name) | |
Creates a Figure. | |
~Figure () | |
Figure destructor. | |
int | x () const |
Returns the horizontal coordinate of this figure. | |
int | y () const |
Returns the vertical coordinate of this figure. | |
int | width () const |
Returns the width of this figure. | |
int | height () const |
Returns the height of this figure. | |
const std::string | name () const |
Returns the name of this figure. | |
const IntervalVector & | view_box () const |
Returns the real values displayed by this figure. | |
void | reset_view_box () |
Reset the view box of this figure. | |
void | set_properties (int x, int y, int width, int height) |
Sets the properties (coordinates and dimensions) of this figure. | |
Protected Member Functions | |
void | create_subfigures (int n) |
Creates the subfigures related to the dimensions that will be displayed. | |
Protected Attributes | |
int | m_n = 0 |
dimension of this figure | |
VIBesFigTube ** | m_v_figs = nullptr |
array of components (scalar figures) | |
int | m_end_index = -1 |
restriction on the dimensions that will be displayed | |
Protected Attributes inherited from codac::Figure | |
const std::string | m_name |
figure name | |
int | m_height = 300 |
figure properties | |
IntervalVector | m_view_box = IntervalVector(2, Interval::EMPTY_SET) |
view box | |
Additional Inherited Members | |
Static Protected Member Functions inherited from codac::Figure | |
static double | trunc_inf (double x) |
Returns a representable value of any double variable x | |
static const Interval | trunc_inf (const Interval &x) |
Returns a representable value of any interval \([x]\). | |
static const IntervalVector | trunc_inf (const IntervalVector &x) |
Returns a representable value of any interval vector \([\mathbf{x}]\). | |
Multi-view item to display vector tubes or trajectories.
A set of figures is linked to some tube vector or trajectory pointers, so that any update on these objects can be easily displayed on the figures.
There will be as many windows as dimensions to be represented.
codac::VIBesFigTubeVector::VIBesFigTubeVector | ( | const std::string & | fig_name | ) |
Creates a VIBesFigTubeVector.
fig_name | name of the figure as displayed in the window title |
codac::VIBesFigTubeVector::VIBesFigTubeVector | ( | const std::string & | fig_name, |
int | start_index, | ||
int | end_index ) |
Creates a VIBesFigTubeVector.
fig_name | name of the figure as displayed in the window title |
start_index | the first dimension to be displayed |
end_index | the last dimension to be displayed |
codac::VIBesFigTubeVector::VIBesFigTubeVector | ( | const std::string & | fig_name, |
const TubeVector * | tube, | ||
const TrajectoryVector * | traj = nullptr ) |
Creates a VIBesFigTube.
The dimension of the figure (number of windows) is based on the tube
parameter.
fig_name | name of the figure as displayed in the window title |
tube | a const pointer to the tube vector to be displayed |
traj | an optional const pointer to a trajectory to be displayed (nullptr by default) |
int codac::VIBesFigTubeVector::size | ( | ) | const |
Returns the dimension \(n\) of the objects displayed in the figure.
int codac::VIBesFigTubeVector::subfigs_number | ( | ) | const |
Returns number of dimensions to be displayed.
This number corresponds to the number of windows to be created.
VIBesFigTube * codac::VIBesFigTubeVector::operator[] | ( | int | index | ) |
Returns a pointer to the ith VIBesFigTube of this figure.
index | the index of this ith component |
const VIBesFigTube * codac::VIBesFigTubeVector::operator[] | ( | int | index | ) | const |
Returns a const pointer to the ith VIBesFigTube of this figure.
index | the index of this ith component |
void codac::VIBesFigTubeVector::set_properties | ( | int | x, |
int | y, | ||
int | width, | ||
int | height ) |
Sets the properties (coordinates and dimensions) of this figure.
x | horizontal coordinate (in pixels) |
y | vertical coordinate (in pixels) |
width | width value (in pixels) |
height | height value (in pixels) |
void codac::VIBesFigTubeVector::show | ( | bool | detail_slices = false | ) |
Displays this figure with optional details.
detail_slices | if true , each slice will be displayed as a box, otherwise, only polygon envelopes of the tubes will be shown (fast display) |
void codac::VIBesFigTubeVector::set_cursor | ( | double | t | ) |
Set the position of the temporal cursor of this figure.
t | position on the tdomain |
void codac::VIBesFigTubeVector::show_cursor | ( | bool | display = true | ) |
Displays the cursor on this figure.
display | parameter (true by default) |
void codac::VIBesFigTubeVector::draw_box | ( | const Interval & | tdomain, |
const IntervalVector & | box, | ||
const vibes::Params & | params ) |
Draws a multi-dimensional box.
tdomain | the tdomain related to the box |
box | the \(n\)d IntervalVector to be displayed |
params | VIBes parameters related to the box |
void codac::VIBesFigTubeVector::draw_box | ( | const Interval & | tdomain, |
const IntervalVector & | box, | ||
const std::string & | color = "", | ||
const vibes::Params & | params = vibes::Params() ) |
Draws a multi-dimensional box.
tdomain | the tdomain related to the box |
box | the \(n\)d IntervalVector to be displayed |
color | the optional color of the box (black by default) |
params | VIBes parameters related to the box (none by default) |
void codac::VIBesFigTubeVector::add_tube | ( | const TubeVector * | tube, |
const std::string & | name, | ||
const std::string & | color_frgrnd = DEFAULT_FRGRND_COLOR, | ||
const std::string & | color_bckgrnd = DEFAULT_BCKGRND_COLOR ) |
Adds a tube vector object to this figure.
tube | a const pointer to a TubeVector object to be displayed |
name | a name to identify this object |
color_frgrnd | an optional color for the current values of the tube |
color_bckgrnd | an optional color for the previous values of the tube, before any new contraction |
void codac::VIBesFigTubeVector::set_tube_name | ( | const TubeVector * | tube, |
const std::string & | name ) |
Sets a new name for a tube vector.
tube | the const pointer to the TubeVector object to be renamed |
name | a new name to identify this object |
void codac::VIBesFigTubeVector::set_tube_derivative | ( | const TubeVector * | tube, |
const TubeVector * | derivative ) |
Links a tube vector to its derivative for display purposes.
When available, a derivative tube \([\dot{\mathbf{x}}](\cdot)\) allows to draw slices of \([\mathbf{x}](\cdot)\) as polygons, thus displaying a thinner envelope of the tube \([\mathbf{x}](\cdot)\).
tube | the const pointer to the TubeVector object that will be displayed |
derivative | the const pointer its derivative set |
void codac::VIBesFigTubeVector::set_tube_color | ( | const TubeVector * | tube, |
const std::string & | color_frgrnd, | ||
const std::string & | color_bckgrnd = DEFAULT_BCKGRND_COLOR ) |
Sets color properties for a given tube vector.
tube | the const pointer to the TubeVector object for which the colors will be set |
color_frgrnd | a color for the current values of the tube |
color_bckgrnd | a color for the previous values of the tube, before any new contraction (gray by default) |
void codac::VIBesFigTubeVector::set_tube_color | ( | const TubeVector * | tube, |
TubeColorType | color_type, | ||
const std::string & | color ) |
Sets color properties for a given tube vector.
This method allows to change the display of slices, borders, gates, etc.
tube | the const pointer to the TubeVector object for which the colors will be set |
color_type | the TubeColorType key for which the value will be set |
color | the new color to be specified for the given type |
void codac::VIBesFigTubeVector::reset_tube_background | ( | const TubeVector * | tube | ) |
Reset the background of a given tube vector.
tube | the const pointer to the TubeVector object for which the background will be deleted |
void codac::VIBesFigTubeVector::remove_tube | ( | const TubeVector * | tube | ) |
Removes a tube vector from this figure.
tube | the const pointer to the TubeVector object to be removed |
void codac::VIBesFigTubeVector::add_trajectory | ( | const TrajectoryVector * | traj, |
const std::string & | name, | ||
const std::string & | color = DEFAULT_TRAJ_COLOR ) |
Adds a trajectory vector object to this figure.
traj | a const pointer to a TrajectoryVector object to be displayed |
name | a name to identify this object |
color | an optional color to draw this trajectory |
void codac::VIBesFigTubeVector::set_trajectory_name | ( | const TrajectoryVector * | traj, |
const std::string & | name ) |
Sets a new name for a trajectory vector.
traj | the const pointer to the TrajectoryVector object to be renamed |
name | a new name to identify this object |
void codac::VIBesFigTubeVector::set_trajectory_color | ( | const TrajectoryVector * | traj, |
const std::string & | color ) |
Sets color properties for a given trajectory vector.
traj | the const pointer to the TrajectoryVector object for which the color will be set |
color | a color to draw this trajectory |
void codac::VIBesFigTubeVector::set_trajectory_points_size | ( | const TrajectoryVector * | traj, |
double | points_size ) |
Sets points size for a given trajectory, and activates a display mode with points instead of a line for this trajectory.
traj | the const pointer to the TrajectoryVector object for which the points size will be set |
points_size | size of the points (if 0, the display is done with a line) |
void codac::VIBesFigTubeVector::remove_trajectory | ( | const TrajectoryVector * | traj | ) |
Removes a trajectory vector from this figure.
traj | the const pointer to the TrajectoryVector object to be removed |
|
protected |
Creates the subfigures related to the dimensions that will be displayed.
n |