scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
|
Specialization class of size_3d<T> that allows to store and calculate size in 3D, with width, height and depth as float types. Initialization string example: "1 * 2 * 4". More...
#include <size_3d.hpp>
Public Member Functions | |
size_3d () | |
Default constructor. Initializes width, height and depth to 0. | |
size_3d (const size_3d< float > &x) | |
Copy constructor. The width, height and depth are copied from the size_3d<float> x. | |
size_3d (size_3d< float > &&x) | |
Move constructor. The width, height and depth are moved from the size_3d<float> x. | |
size_3d (const float &new_width, const float &new_height, const float &new_depth) | |
Constructor. width is new_width, height is new_height and depth is new_depth. | |
size_3d (const string &new_width, const string &new_height, const string &new_depth) | |
Constructor. width is new_width, height is new_height and depth is new_depth, they are initialized by string. | |
size_3d (const string &init_size_3d) | |
Constructor. The member-variables are initialized by the initialization string init_size_3d specialized for float. | |
size_3d< float > & | operator= (const size_3d< float > &x) |
Copy assignment. The width, height and depth are copied from the size_3d<float> x. | |
size_3d< float > & | operator= (size_3d< float > &&x) |
Move assignment. The width, height and depth are moved from the size_3d<float> x. | |
size_3d< float > & | operator= (const string &init_size_3d) |
Assignment. The member-variables are initialized by the initialization string init_size_3d specialized for float. | |
size_3d< float > | operator+ (const size_3d< float > &x) const |
Creates a new size_3d<float> by the addition of two size_3d<float> classes. The width, height and depth are the result of the addition of the two width, height and depth of the size_3d<float> classes, respectively. | |
size_3d< float > | operator- (const size_3d< float > &x) const |
Creates a new size_3d<float> by the difference of two size_3d<float> classes. The width, height and depth are the result of the difference of the width, height and depth of the size_3d<float> classes, respectively. | |
void | operator+= (const size_3d< float > &x) |
Sums the width of size_3d<float> x to the width, sums the height of size_3d<float> x to the height and sums the depth of size_3d<float> x to the depth. | |
void | operator-= (const size_3d< float > &x) |
Substracts the width of size_3d<float> x to the width, substracts the height of size_3d<float> x to the height and substracts the depth of size_3d<float> x to the depth. | |
float | get_volume () const |
Calculates the volume as the multiplication of the width, height and depth. | |
string | display () const |
Returns a string representation of size_3d<float>, with his width, height and depth. | |
Public Attributes | |
float | width |
Width, stored as a float. The advantage related to size_3d<float> over size_3d<T> is that it sizes less, the disadvantage is the lack of dimensions. | |
float | height |
Height, stored as a float. The advantage related to size_3d<float> over size_3d<T> is that it sizes less, the disadvantage is the lack of dimensions. | |
float | depth |
Depth, stored as a float. The advantage related to size_3d<float> over size_3d<T> is that it sizes less, the disadvantage is the lack of dimensions. | |
Private Member Functions | |
void | initialize_from_string (const string &init_size_3d) |
Internal function. Initializes the member-variables with an initialization string of size_3d<float>. | |
Specialization class of size_3d<T> that allows to store and calculate size in 3D, with width, height and depth as float types. Initialization string example: "1 * 2 * 4".
Definition at line 123 of file size_3d.hpp.
|
inline |
Default constructor. Initializes width, height and depth to 0.
Definition at line 126 of file size_3d.hpp.
|
inline |
Copy constructor. The width, height and depth are copied from the size_3d<float> x.
Definition at line 129 of file size_3d.hpp.
|
inline |
Move constructor. The width, height and depth are moved from the size_3d<float> x.
Definition at line 132 of file size_3d.hpp.
|
inlineexplicit |
Constructor. width is new_width, height is new_height and depth is new_depth.
Definition at line 135 of file size_3d.hpp.
|
inlineexplicit |
Constructor. width is new_width, height is new_height and depth is new_depth, they are initialized by string.
Definition at line 138 of file size_3d.hpp.
|
inlineexplicit |
Constructor. The member-variables are initialized by the initialization string init_size_3d specialized for float.
Definition at line 141 of file size_3d.hpp.
|
inline |
Returns a string representation of size_3d<float>, with his width, height and depth.
Definition at line 197 of file size_3d.hpp.
|
inline |
Calculates the volume as the multiplication of the width, height and depth.
Definition at line 192 of file size_3d.hpp.
|
inlineprivate |
Internal function. Initializes the member-variables with an initialization string of size_3d<float>.
Definition at line 209 of file size_3d.hpp.
Creates a new size_3d<float> by the addition of two size_3d<float> classes. The width, height and depth are the result of the addition of the two width, height and depth of the size_3d<float> classes, respectively.
Definition at line 168 of file size_3d.hpp.
Sums the width of size_3d<float> x to the width, sums the height of size_3d<float> x to the height and sums the depth of size_3d<float> x to the depth.
Definition at line 178 of file size_3d.hpp.
Creates a new size_3d<float> by the difference of two size_3d<float> classes. The width, height and depth are the result of the difference of the width, height and depth of the size_3d<float> classes, respectively.
Definition at line 173 of file size_3d.hpp.
Substracts the width of size_3d<float> x to the width, substracts the height of size_3d<float> x to the height and substracts the depth of size_3d<float> x to the depth.
Definition at line 185 of file size_3d.hpp.
Copy assignment. The width, height and depth are copied from the size_3d<float> x.
Definition at line 146 of file size_3d.hpp.
Assignment. The member-variables are initialized by the initialization string init_size_3d specialized for float.
Definition at line 162 of file size_3d.hpp.
Move assignment. The width, height and depth are moved from the size_3d<float> x.
Definition at line 154 of file size_3d.hpp.
float scifir::size_3d< float >::depth |
Depth, stored as a float. The advantage related to size_3d<float> over size_3d<T> is that it sizes less, the disadvantage is the lack of dimensions.
Definition at line 206 of file size_3d.hpp.
float scifir::size_3d< float >::height |
Height, stored as a float. The advantage related to size_3d<float> over size_3d<T> is that it sizes less, the disadvantage is the lack of dimensions.
Definition at line 205 of file size_3d.hpp.
float scifir::size_3d< float >::width |
Width, stored as a float. The advantage related to size_3d<float> over size_3d<T> is that it sizes less, the disadvantage is the lack of dimensions.
Definition at line 204 of file size_3d.hpp.