23#ifndef VCL_MESH_COMPONENTS_TEX_COORD_H
24#define VCL_MESH_COMPONENTS_TEX_COORD_H
26#include "base/component.h"
27#include "base/predicates.h"
29#include <vclib/space/core.h>
56template<
typename Scalar,
typename ParentElemType =
void,
bool OPT = false>
59 TexCoord<Scalar, ParentElemType, OPT>,
61 vcl::TexCoord<Scalar>,
63 !std::is_same_v<ParentElemType, void>,
66 using Base = Component<
71 !std::is_same_v<ParentElemType, void>,
103 template<
typename Element>
104 void importFrom(
const Element& e,
bool =
true);
106 void serialize(std::ostream&
os)
const {
texCoord().serialize(
os); }
108 void deserialize(std::istream& is) {
texCoord().deserialize(is); }
131concept HasTexCoord = TTB::IsDerivedFromSpecializationOfV<T, TexCoord>;
149template<
typename Scalar,
typename ParentElemType,
bool OPT>
150template<
typename Element>
151void TexCoord<Scalar, ParentElemType, OPT>::importFrom(
const Element& e,
bool)
154 if (isTexCoordAvailableOn(e)) {
155 texCoord() = e.texCoord().template cast<Scalar>();
174bool isTexCoordAvailableOn(
const auto& element)
193template<
typename ElementType =
void,
bool OPT = false>
208template<
typename ElementType =
void,
bool OPT = false>
The Element class.
Definition element.h:75
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:41
The TexCoord class represents a component that stores a texture coordinate.
Definition tex_coord.h:65
TexCoordType & texCoord()
Returns a reference of the tex coord of the element.
Definition tex_coord.h:99
const TexCoordType & texCoord() const
Returns a const reference of the tex coord of the element.
Definition tex_coord.h:93
TexCoord()=default
Initilizes the Texture Coordinate to (0, 0).
A concept that checks whether a type T (that should be a Element) has the TexCoord component (inherit...
Definition tex_coord.h:144
A concept that checks whether a type T (that should be a Element) has the TexCoord component (inherit...
Definition tex_coord.h:131
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:74