EZC3D
Public Member Functions | Protected Attributes | List of all members
ezc3d::DataNS::Points3dNS::Points Class Reference

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::Pointpoint (size_t idx) const
 Get a particular point of index idx from the 3D points data. More...
 
ezc3d::DataNS::Points3dNS::Pointpoint_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.
 

Detailed Description

Points holder for C3D data 3D points data.

Definition at line 16 of file Points.h.

Constructor & Destructor Documentation

◆ Points()

ezc3d::DataNS::Points3dNS::Points::Points ( size_t  nbPoints)

Create an empty holder for 3D points preallocating the size of it.

Parameters
nbPointsNumber of 3D points to be in the holder

Definition at line 18 of file Points.cpp.

Member Function Documentation

◆ isempty()

bool ezc3d::DataNS::Points3dNS::Points::isempty ( ) const

Return if the points are empty.

Returns
if the points are empty

Definition at line 80 of file Points.cpp.

◆ nbPoints()

size_t ezc3d::DataNS::Points3dNS::Points::nbPoints ( ) const

Get the number of points.

Returns
The number of points

Definition at line 35 of file Points.cpp.

◆ point() [1/2]

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.

Parameters
idxThe index of the point
Returns
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.

◆ point() [2/2]

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.

Parameters
pointThe point to add
idxThe 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.

◆ point_nonConst()

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.

Parameters
idxThe index of the point
Returns
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.

◆ points()

const std::vector< ezc3d::DataNS::Points3dNS::Point > & ezc3d::DataNS::Points3dNS::Points::points ( ) const

Get all the points from the 3D points data.

Returns
The points

Definition at line 75 of file Points.cpp.

◆ print()

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.

◆ write()

void ezc3d::DataNS::Points3dNS::Points::write ( std::fstream &  f) const

Write points to an opened file.

Parameters
fAlready 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.


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