codac 1.5.6
Loading...
Searching...
No Matches
codac::VIBesFigTubeVector Class Reference

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

#include <codac_VIBesFigTubeVector.h>

Inheritance diagram for codac::VIBesFigTubeVector:
Collaboration diagram for codac::VIBesFigTubeVector:

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.
 
VIBesFigTubeoperator[] (int index)
 Returns a pointer to the ith VIBesFigTube of this figure.
 
const VIBesFigTubeoperator[] (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 &params)
 Draws a multi-dimensional box.
 
void draw_box (const Interval &tdomain, const IntervalVector &box, const std::string &color="", const vibes::Params &params=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}]\).
 

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: