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

The Coordinate class represents a N-Dimensional point that will be part of an Element (e.g. Vertex...). More...

#include <vclib/mesh/components/coordinate.h>

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

Public Types

using CoordType = P
 Expose the type of the Coordinate.
 

Public Member Functions

 Coordinate ()=default
 Initilizes the Coordinate to (0, 0, 0).
 
const P & coord () const
 Returns a const reference of the coordinate of the element.
 
P & coord ()
 Returns a reference of the coordinate of the element.
 

Protected Member Functions

template<typename Element >
void importFrom (const Element &v, bool=true)
 
void serialize (std::ostream &os) const
 
void deserialize (std::istream &is)
 

Private Types

using Base = Component< Coordinate< P, ParentElemType, OPT >, CompId::COORDINATE, P, ParentElemType, !std::is_same_v< ParentElemType, void >, OPT >
 

Detailed Description

template<PointConcept P, typename ParentElemType = void, bool OPT = false>
class vcl::comp::Coordinate< P, ParentElemType, OPT >

The Coordinate 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 coordinate. The type of this object must satisfy the PointConcept.

For example, if you have a Vertex Element v with the Coordinate component, you'll be able to access to this component member functions from v:

auto coord = v.coord();
const P & coord() const
Returns a const reference of the coordinate of the element.
Definition coordinate.h:95
Template Parameters
PThe type of the coordinate. 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

◆ coord() [1/2]

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

Returns a reference of the coordinate of the element.

Returns
a reference of the coordinate of the element.

◆ coord() [2/2]

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

Returns a const reference of the coordinate of the element.

Returns
a const reference of the coordinate of the element.

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