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>
57template<
typename Scalar,
typename ParentElemType =
void,
bool OPT = false>
60 TexCoord<Scalar, ParentElemType, OPT>,
62 vcl::TexCoordIndexed<Scalar>,
64 !std::is_same_v<ParentElemType, void>,
67 using Base = Component<
72 !std::is_same_v<ParentElemType, void>,
104 template<
typename Element>
105 void importFrom(
const Element& e,
bool =
true);
132concept HasTexCoord = TTB::IsDerivedFromSpecializationOfV<T, TexCoord>;
150template<
typename Scalar,
typename ParentElemType,
bool OPT>
151template<
typename Element>
152void TexCoord<Scalar, ParentElemType, OPT>::importFrom(
const Element& e,
bool)
155 if (isTexCoordAvailableOn(e)) {
156 texCoord() = e.texCoord().template cast<Scalar>();
175bool isTexCoordAvailableOn(
const auto& element)
194template<
typename ElementType =
void,
bool OPT = false>
209template<
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 TexCoord class represents a component that stores a texture coordinate.
Definition tex_coord.h:66
TexCoordType & texCoord()
Returns a reference of the tex coord of the element.
Definition tex_coord.h:100
const TexCoordType & texCoord() const
Returns a const reference of the tex coord of the element.
Definition tex_coord.h:94
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:145
A concept that checks whether a type T (that should be a Element) has the TexCoord component (inherit...
Definition tex_coord.h:132
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:74