23#ifndef VCL_MESH_COMPONENTS_NORMAL_H
24#define VCL_MESH_COMPONENTS_NORMAL_H
26#include "bases/component.h"
28#include <vclib/concepts/mesh/components/normal.h>
29#include <vclib/space/core/point.h>
58template<Po
intConcept P,
typename ParentElemType =
void,
bool OPT = false>
61 Normal<P, ParentElemType, OPT>,
65 !std::is_same_v<ParentElemType, void>,
68 using Base = Component<
73 !std::is_same_v<ParentElemType, void>,
95 const P&
normal()
const {
return Base::data(); }
105 template<
typename Element>
106 void importFrom(
const Element& e,
bool =
true)
109 if (isNormalAvailableOn(e)) {
116 void serialize(std::ostream& os)
const {
normal().serialize(os); }
118 void deserialize(std::istream& is) {
normal().deserialize(is); }
135bool isNormalAvailableOn(
const ElementConcept
auto& element)
137 return isComponentAvailableOn<CompId::NORMAL>(element);
155template<
typename Scalar,
typename ElementType =
void,
bool OPT = false>
170template<
typename ElementType =
void,
bool OPT = false>
185template<
typename ElementType =
void,
bool OPT = false>
The Element class.
Definition element.h:57
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
The Normal class represents a N-Dimensional normal vector that will be part of an Element (e....
Definition normal.h:67
P NormalType
Expose the type of the Normal.
Definition normal.h:80
Normal()=default
Initilizes the Normal to (0, 0, 0).
const P & normal() const
Returns a const reference of the normal of the element.
Definition normal.h:95
P & normal()
Returns a reference of the normal of the element.
Definition normal.h:101
HasNormal concept is satisfied only if a Element class provides the types and member functions specif...
Definition normal.h:47