Visual Computing Library
devel
|
The Position class represents a N-Dimensional point that will be part of an Element (e.g. Vertex...). More...
#include <vclib/mesh/components/position.h>
Public Types | |
using | PositionType = P |
Expose the type of the Position. | |
Public Member Functions | |
P & | position () |
Returns a reference of the position of the element. | |
const P & | position () const |
Returns a const reference of the position of the element. | |
Position ()=default | |
Initilizes the Position to (0, 0, 0). | |
Protected Member Functions | |
void | deserialize (std::istream &is) |
template<typename Element > | |
void | importFrom (const Element &v, bool=true) |
void | serialize (std::ostream &os) const |
Private Types | |
using | Base = Component< Position< P, ParentElemType, OPT >, CompId::POSITION, P, ParentElemType, !std::is_same_v< ParentElemType, void >, OPT > |
The Position class represents a N-Dimensional point that will be part of an Element (e.g. Vertex...).
Allows to get and set an object that represents a position in a space. The type of this object must satisfy the PointConcept.
For example, if you have a Vertex Element v
with the Position component, you'll be able to access to this component member functions from v
:
P | The type of the position. This template argument must be a type that satisfies the PointConcept. |
ParentElemType | This template argument must be void if the component needs to be stored horizontally, or the type of the parent element that will contain this component if the component needs to be stored vertically. |
OPT | If true, the component will be optional. This argument is considered only if the component is stored vertically. |
|
inline |
Returns a reference of the position of the element.
|
inline |
Returns a const reference of the position of the element.