23#ifndef VCL_MESH_COMPONENTS_PRINCIPAL_CURVATURE_H
24#define VCL_MESH_COMPONENTS_PRINCIPAL_CURVATURE_H
26#include "base/component.h"
27#include "base/predicates.h"
29#include <vclib/space/core.h>
62template<
typename Scalar,
typename ParentElemType =
void,
bool OPT = false>
65 PrincipalCurvature<Scalar, ParentElemType, OPT>,
66 CompId::PRINCIPAL_CURVATURE,
67 vcl::PrincipalCurvature<Scalar>,
69 !std::is_same_v<ParentElemType, void>,
72 using Base = Component<
74 CompId::PRINCIPAL_CURVATURE,
77 !std::is_same_v<ParentElemType, void>,
113 template<
typename Element>
114 void importFrom(
const Element& e,
bool =
true);
116 void serialize(std::ostream&
os)
const
146 TTB::IsDerivedFromSpecializationOfV<T, PrincipalCurvature>;
165template<
typename Scalar,
typename ParentElemType,
bool OPT>
166template<
typename Element>
167void PrincipalCurvature<Scalar, ParentElemType, OPT>::importFrom(
172 if (isPrincipalCurvatureAvailableOn(e)) {
173 principalCurvature() =
174 e.principalCurvature().template cast<Scalar>();
193bool isPrincipalCurvatureAvailableOn(
const auto& element)
212template<
typename ElementType =
void,
bool OPT = false>
227template<
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 PrincipalCurvature class represents a component that stores the principal curvature directions an...
Definition principal_curvature.h:71
const PrincipalCurvatureType & principalCurvature() const
Returns a const reference of the principal curvature of the element.
Definition principal_curvature.h:100
PrincipalCurvature()=default
Initilizes the PrincipalCurvature values to 0.
PrincipalCurvatureType & principalCurvature()
Returns a reference of the principal curvature of the element.
Definition principal_curvature.h:109
A concept that checks whether a type T (that should be a Element) has the PrincipalCurvature componen...
Definition principal_curvature.h:159
A concept that checks whether a type T (that should be a Element) has the PrincipalCurvature componen...
Definition principal_curvature.h:145
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:74