EZC3D
|
Points holder for C3D data 3D points data. More...
#include <Points.h>
Public Member Functions | |
Points () | |
Create an empty holder for 3D points. | |
Points (size_t nbPoints) | |
Create an empty holder for 3D points preallocating the size of it. More... | |
void | print () const |
Print the points. More... | |
void | write (std::fstream &f) const |
Write points to an opened file. More... | |
size_t | nbPoints () const |
Get the number of points. More... | |
const ezc3d::DataNS::Points3dNS::Point & | point (size_t idx) const |
Get a particular point of index idx from the 3D points data. More... | |
ezc3d::DataNS::Points3dNS::Point & | point_nonConst (size_t idx) |
Get a particular point of index idx from the 3D points data in order to be modified by the caller. More... | |
void | point (const ezc3d::DataNS::Points3dNS::Point &point, size_t idx=SIZE_MAX) |
Add/replace a point to the points data set. More... | |
const std::vector< ezc3d::DataNS::Points3dNS::Point > & | points () const |
Get all the points from the 3D points data. More... | |
bool | isempty () const |
Return if the points are empty. More... | |
Protected Attributes | |
std::vector< ezc3d::DataNS::Points3dNS::Point > | _points |
Holder of the 3D points. | |
ezc3d::DataNS::Points3dNS::Points::Points | ( | size_t | nbPoints | ) |
Create an empty holder for 3D points preallocating the size of it.
nbPoints | Number of 3D points to be in the holder |
Definition at line 18 of file Points.cpp.
bool ezc3d::DataNS::Points3dNS::Points::isempty | ( | ) | const |
Return if the points are empty.
Definition at line 80 of file Points.cpp.
size_t ezc3d::DataNS::Points3dNS::Points::nbPoints | ( | ) | const |
const ezc3d::DataNS::Points3dNS::Point & ezc3d::DataNS::Points3dNS::Points::point | ( | size_t | idx | ) | const |
Get a particular point of index idx from the 3D points data.
idx | The index of the point |
Throw a std::out_of_range exception if idx is larger than the number of frames
Definition at line 40 of file Points.cpp.
void ezc3d::DataNS::Points3dNS::Points::point | ( | const ezc3d::DataNS::Points3dNS::Point & | point, |
size_t | idx = SIZE_MAX |
||
) |
Add/replace a point to the points data set.
point | The point to add |
idx | The index of the point in the points data set |
Add or replace a particular point to the points data set.
If no idx is sent, then the point is appended to the points data set. If the idx correspond to a pre-existing point, it replaces it. If idx is larger than the number of points, it resize the points accordingly and add the point where it belongs but leaves the other created points empty.
Definition at line 64 of file Points.cpp.
ezc3d::DataNS::Points3dNS::Point & ezc3d::DataNS::Points3dNS::Points::point_nonConst | ( | size_t | idx | ) |
Get a particular point of index idx from the 3D points data in order to be modified by the caller.
idx | The index of the point |
Get a particular point of index idx from the 3D points data in the form of a non-const reference. The user can thereafter modify these points at will, but with the caution it requires.
Throw a std::out_of_range exception if idx is larger than the number of frames
Definition at line 52 of file Points.cpp.
const std::vector< ezc3d::DataNS::Points3dNS::Point > & ezc3d::DataNS::Points3dNS::Points::points | ( | ) | const |
Get all the points from the 3D points data.
Definition at line 75 of file Points.cpp.
void ezc3d::DataNS::Points3dNS::Points::print | ( | ) | const |
Print the points.
Print the points to the console by calling sequentially the print method for all the points
Definition at line 23 of file Points.cpp.
void ezc3d::DataNS::Points3dNS::Points::write | ( | std::fstream & | f | ) | const |
Write points to an opened file.
f | Already opened fstream file with write access |
Write all the points to a file by calling sequentially the write method of each point
Definition at line 29 of file Points.cpp.