codac
Protected Member Functions | Protected Attributes | List of all members
codac::VIBesFigTubeVector Class Reference

Multi-view item to display vector tubes or trajectories. More...

#include <codac_VIBesFigTubeVector.h>

Inheritance diagram for codac::VIBesFigTubeVector:
Inheritance graph
[legend]
Collaboration diagram for codac::VIBesFigTubeVector:
Collaboration graph
[legend]

Public Member Functions

Basics
 VIBesFigTubeVector (const std::string &fig_name)
 Creates a VIBesFigTubeVector. More...
 
 VIBesFigTubeVector (const std::string &fig_name, int start_index, int end_index)
 Creates a VIBesFigTubeVector. More...
 
 VIBesFigTubeVector (const std::string &fig_name, const TubeVector *tube, const TrajectoryVector *traj=nullptr)
 Creates a VIBesFigTube. More...
 
 ~VIBesFigTubeVector ()
 VIBesFigTubeVector destructor.
 
int size () const
 Returns the dimension \(n\) of the objects displayed in the figure. More...
 
int subfigs_number () const
 Returns number of dimensions to be displayed. More...
 
VIBesFigTubeoperator[] (int index)
 Returns a pointer to the ith VIBesFigTube of this figure. More...
 
const VIBesFigTubeoperator[] (int index) const
 Returns a const pointer to the ith VIBesFigTube of this figure. More...
 
void set_properties (int x, int y, int width, int height)
 Sets the properties (coordinates and dimensions) of this figure. More...
 
void show (bool detail_slices=false)
 Displays this figure with optional details. More...
 
void set_cursor (double t)
 Set the position of the temporal cursor of this figure. More...
 
void show_cursor (bool display=true)
 Displays the cursor on this figure. More...
 
Simple drawings
void draw_box (const Interval &tdomain, const IntervalVector &box, const vibes::Params &params)
 Draws a multi-dimensional box. More...
 
void draw_box (const Interval &tdomain, const IntervalVector &box, const std::string &color="", const vibes::Params &params=vibes::Params())
 Draws a multi-dimensional box. More...
 
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. More...
 
void set_tube_name (const TubeVector *tube, const std::string &name)
 Sets a new name for a tube vector. More...
 
void set_tube_derivative (const TubeVector *tube, const TubeVector *derivative)
 Links a tube vector to its derivative for display purposes. More...
 
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. More...
 
void set_tube_color (const TubeVector *tube, TubeColorType color_type, const std::string &color)
 Sets color properties for a given tube vector. More...
 
void reset_tube_background (const TubeVector *tube)
 Reset the background of a given tube vector. More...
 
void remove_tube (const TubeVector *tube)
 Removes a tube vector from this figure. More...
 
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. More...
 
void set_trajectory_name (const TrajectoryVector *traj, const std::string &name)
 Sets a new name for a trajectory vector. More...
 
void set_trajectory_color (const TrajectoryVector *traj, const std::string &color)
 Sets color properties for a given trajectory vector. More...
 
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. More...
 
void remove_trajectory (const TrajectoryVector *traj)
 Removes a trajectory vector from this figure. More...
 
- Public Member Functions inherited from codac::Figure
 Figure (const std::string &fig_name)
 Creates a Figure. More...
 
 ~Figure ()
 Figure destructor.
 
int x () const
 Returns the horizontal coordinate of this figure. More...
 
int y () const
 Returns the vertical coordinate of this figure. More...
 
int width () const
 Returns the width of this figure. More...
 
int height () const
 Returns the height of this figure. More...
 
const std::string name () const
 Returns the name of this figure. More...
 
const IntervalVector & view_box () const
 Returns the real values displayed by this figure. More...
 
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. More...
 

Protected Member Functions

void create_subfigures (int n)
 Creates the subfigures related to the dimensions that will be displayed. More...
 

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 More...
 
static const Interval trunc_inf (const Interval &x)
 Returns a representable value of any interval \([x]\). More...
 
static const IntervalVector trunc_inf (const IntervalVector &x)
 Returns a representable value of any interval vector \([\mathbf{x}]\). More...
 

Detailed Description

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.

Todo:
test this class

Constructor & Destructor Documentation

◆ VIBesFigTubeVector() [1/3]

codac::VIBesFigTubeVector::VIBesFigTubeVector ( const std::string &  fig_name)

Creates a VIBesFigTubeVector.

Parameters
fig_namename of the figure as displayed in the window title

◆ VIBesFigTubeVector() [2/3]

codac::VIBesFigTubeVector::VIBesFigTubeVector ( const std::string &  fig_name,
int  start_index,
int  end_index 
)

Creates a VIBesFigTubeVector.

Parameters
fig_namename of the figure as displayed in the window title
start_indexthe first dimension to be displayed
end_indexthe last dimension to be displayed

◆ VIBesFigTubeVector() [3/3]

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.

Parameters
fig_namename of the figure as displayed in the window title
tubea const pointer to the tube vector to be displayed
trajan optional const pointer to a trajectory to be displayed (nullptr by default)

Member Function Documentation

◆ size()

int codac::VIBesFigTubeVector::size ( ) const

Returns the dimension \(n\) of the objects displayed in the figure.

Note
Some dimensions may not be displayed (see the subfigs_number method)
Returns
n

◆ subfigs_number()

int codac::VIBesFigTubeVector::subfigs_number ( ) const

Returns number of dimensions to be displayed.

This number corresponds to the number of windows to be created.

Returns
the number of subfigures

◆ operator[]() [1/2]

VIBesFigTube* codac::VIBesFigTubeVector::operator[] ( int  index)

Returns a pointer to the ith VIBesFigTube of this figure.

Parameters
indexthe index of this ith component
Returns
a pointer to the ith component

◆ operator[]() [2/2]

const VIBesFigTube* codac::VIBesFigTubeVector::operator[] ( int  index) const

Returns a const pointer to the ith VIBesFigTube of this figure.

Parameters
indexthe index of this ith component
Returns
a const pointer to the ith component

◆ set_properties()

void codac::VIBesFigTubeVector::set_properties ( int  x,
int  y,
int  width,
int  height 
)

Sets the properties (coordinates and dimensions) of this figure.

Parameters
xhorizontal coordinate (in pixels)
yvertical coordinate (in pixels)
widthwidth value (in pixels)
heightheight value (in pixels)

◆ show()

void codac::VIBesFigTubeVector::show ( bool  detail_slices = false)

Displays this figure with optional details.

Parameters
detail_slicesif true, each slice will be displayed as a box, otherwise, only polygon envelopes of the tubes will be shown (fast display)

◆ set_cursor()

void codac::VIBesFigTubeVector::set_cursor ( double  t)

Set the position of the temporal cursor of this figure.

Parameters
tposition on the tdomain

◆ show_cursor()

void codac::VIBesFigTubeVector::show_cursor ( bool  display = true)

Displays the cursor on this figure.

Parameters
displayparameter (true by default)

◆ draw_box() [1/2]

void codac::VIBesFigTubeVector::draw_box ( const Interval &  tdomain,
const IntervalVector &  box,
const vibes::Params &  params 
)

Draws a multi-dimensional box.

Parameters
tdomainthe tdomain related to the box
boxthe \(n\)d IntervalVector to be displayed
paramsVIBes parameters related to the box

◆ draw_box() [2/2]

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.

Parameters
tdomainthe tdomain related to the box
boxthe \(n\)d IntervalVector to be displayed
colorthe optional color of the box (black by default)
paramsVIBes parameters related to the box (none by default)

◆ add_tube()

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.

Parameters
tubea const pointer to a TubeVector object to be displayed
namea name to identify this object
color_frgrndan optional color for the current values of the tube
color_bckgrndan optional color for the previous values of the tube, before any new contraction

◆ set_tube_name()

void codac::VIBesFigTubeVector::set_tube_name ( const TubeVector tube,
const std::string &  name 
)

Sets a new name for a tube vector.

Parameters
tubethe const pointer to the TubeVector object to be renamed
namea new name to identify this object

◆ set_tube_derivative()

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)\).

Parameters
tubethe const pointer to the TubeVector object that will be displayed
derivativethe const pointer its derivative set

◆ set_tube_color() [1/2]

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.

Parameters
tubethe const pointer to the TubeVector object for which the colors will be set
color_frgrnda color for the current values of the tube
color_bckgrnda color for the previous values of the tube, before any new contraction (gray by default)

◆ set_tube_color() [2/2]

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.

Parameters
tubethe const pointer to the TubeVector object for which the colors will be set
color_typethe TubeColorType key for which the value will be set
colorthe new color to be specified for the given type

◆ reset_tube_background()

void codac::VIBesFigTubeVector::reset_tube_background ( const TubeVector tube)

Reset the background of a given tube vector.

Todo:
automatically clear the figure (for now, the pointer is only deleted)
Parameters
tubethe const pointer to the TubeVector object for which the background will be deleted

◆ remove_tube()

void codac::VIBesFigTubeVector::remove_tube ( const TubeVector tube)

Removes a tube vector from this figure.

Todo:
automatically clear the figure (for now, the tube is only removed from the list of objects to be shown afterwards)
Note
the object will not be deleted
Parameters
tubethe const pointer to the TubeVector object to be removed

◆ add_trajectory()

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.

Parameters
traja const pointer to a TrajectoryVector object to be displayed
namea name to identify this object
coloran optional color to draw this trajectory

◆ set_trajectory_name()

void codac::VIBesFigTubeVector::set_trajectory_name ( const TrajectoryVector traj,
const std::string &  name 
)

Sets a new name for a trajectory vector.

Parameters
trajthe const pointer to the TrajectoryVector object to be renamed
namea new name to identify this object

◆ set_trajectory_color()

void codac::VIBesFigTubeVector::set_trajectory_color ( const TrajectoryVector traj,
const std::string &  color 
)

Sets color properties for a given trajectory vector.

Parameters
trajthe const pointer to the TrajectoryVector object for which the color will be set
colora color to draw this trajectory

◆ set_trajectory_points_size()

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.

Parameters
trajthe const pointer to the TrajectoryVector object for which the points size will be set
points_sizesize of the points (if 0, the display is done with a line)

◆ remove_trajectory()

void codac::VIBesFigTubeVector::remove_trajectory ( const TrajectoryVector traj)

Removes a trajectory vector from this figure.

Todo:
automatically clear the figure (for now, the trajectory is only removed from the list of objects to be shown afterwards)
Note
the object will not be deleted
Parameters
trajthe const pointer to the TrajectoryVector object to be removed

◆ create_subfigures()

void codac::VIBesFigTubeVector::create_subfigures ( int  n)
protected

Creates the subfigures related to the dimensions that will be displayed.

Parameters
n

The documentation for this class was generated from the following file: