Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::comp::Position< P, ParentElemType, OPT > Class Template Reference

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>

Inheritance diagram for vcl::comp::Position< P, ParentElemType, OPT >:

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 >
 

Detailed Description

template<PointConcept P, typename ParentElemType = void, bool OPT = false>
class vcl::comp::Position< P, ParentElemType, 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:

auto pos = v.position();
A class representing a box in N-dimensional space.
Definition box.h:46
Template Parameters
PThe type of the position. This template argument must be a type that satisfies the PointConcept.
ParentElemTypeThis 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.
OPTIf true, the component will be optional. This argument is considered only if the component is stored vertically.

Member Function Documentation

◆ position() [1/2]

template<PointConcept P, typename ParentElemType = void, bool OPT = false>
P & vcl::comp::Position< P, ParentElemType, OPT >::position ( )
inline

Returns a reference of the position of the element.

Returns
a reference of the position of the element.

◆ position() [2/2]

template<PointConcept P, typename ParentElemType = void, bool OPT = false>
const P & vcl::comp::Position< P, ParentElemType, OPT >::position ( ) const
inline

Returns a const reference of the position of the element.

Returns
a const reference of the position of the element.

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