23#ifndef VCL_MESH_COMPONENTS_NORMAL_H
24#define VCL_MESH_COMPONENTS_NORMAL_H
26#include "base/component.h"
27#include "base/predicates.h"
29#include <vclib/space/core.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);
133concept HasNormal = TTB::IsDerivedFromSpecializationOfV<T, Normal>;
151template<Po
intConcept P,
typename ParentElemType,
bool OPT>
152template<
typename Element>
153void Normal<P, ParentElemType, OPT>::importFrom(
const Element& e,
bool)
155 using ScalarType = NormalType::ScalarType;
157 if (isNormalAvailableOn(e)) {
158 normal() = e.normal().template cast<ScalarType>();
176bool isNormalAvailableOn(
const auto& element)
196template<
typename Scalar,
typename ElementType =
void,
bool OPT = false>
211template<
typename ElementType =
void,
bool OPT = false>
226template<
typename ElementType =
void,
bool OPT = false>
A class representing a box in N-dimensional space.
Definition box.h:46
void deserialize(std::istream &is)
Deserializes the box from the given input stream.
Definition box.h:476
void serialize(std::ostream &os) const
Serializes the box to the given output stream.
Definition box.h:466
The Element class.
Definition element.h:75
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
A concept that checks whether a type T (that should be a Element) has the Normal component (inherits ...
Definition normal.h:133
A concept that checks whether a type T (that should be a Element) has the Normal component (inherits ...
Definition normal.h:146
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:74