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

The Normal class represents a N-Dimensional normal vector that will be part of an Element (e.g. Vertex, Face...). More...

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

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

Public Types

using NormalType = P
 Expose the type of the Normal.
 

Public Member Functions

 Normal ()=default
 Initilizes the Normal to (0, 0, 0).
 
const P & normal () const
 Returns a const reference of the normal of the element.
 
P & normal ()
 Returns a reference of the normal of the element.
 

Protected Member Functions

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

Private Types

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

Detailed Description

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

The Normal class represents a N-Dimensional normal vector that will be part of an Element (e.g. Vertex, Face...).

Allows to get and set an object that represents a normal. The type of this object must satisfy the PointConcept.

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

auto n = v.normal();
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Template Parameters
PThe type of the normal. 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

◆ normal() [1/2]

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

Returns a reference of the normal of the element.

Returns
a reference of the normal of the element.

◆ normal() [2/2]

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

Returns a const reference of the normal of the element.

Returns
a const reference of the normal of the element.

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