23#ifndef VCL_SPACE_CORE_TEX_COORD_H
24#define VCL_SPACE_CORE_TEX_COORD_H
49template<
typename Scalar>
58 using ScalarType = Scalar;
69 if constexpr (std::is_same<Scalar, S>::value) {
79 Scalar u()
const {
return mCoord.x(); }
81 Scalar v()
const {
return mCoord.y(); }
83 Scalar& u() {
return mCoord.x(); }
85 Scalar& v() {
return mCoord.y(); }
99 void set(Scalar u, Scalar v)
105 void serialize(std::ostream&
os)
const { mCoord.
serialize(
os); }
107 void deserialize(std::istream& is) { mCoord.
deserialize(is); }
110 Scalar& operator()(
uint i) {
return mCoord[
i]; }
112 const Scalar& operator()(
uint i)
const {
return mCoord[
i]; }
114 Scalar& operator[](
uint i) {
return mCoord[
i]; }
116 const Scalar& operator[](
uint i)
const {
return mCoord[
i]; }
142 std::remove_cvref_t<T>,
143 TexCoord<typename RemoveRef<T>::ScalarType>>;
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 TexCoord class represents a 2-dimensional texture coordinate containing two scalar values.
Definition tex_coord.h:51
A concept representing a TexCoordIndexed.
Definition tex_coord.h:141