Visual Computing Library
Loading...
Searching...
No Matches
vcl::comp::TexCoord< Scalar, ParentElemType, OPT > Class Template Reference

The TexCoord class represents a component that stores a texture coordinate. More...

#include <vclib/mesh/components/tex_coord.h>

Inheritance diagram for vcl::comp::TexCoord< Scalar, ParentElemType, OPT >:

Public Types

using TexCoordType = vcl::TexCoordIndexed< Scalar >
 Expose the type of the TexCoord.
 

Public Member Functions

 TexCoord ()=default
 Initilizes the Texture Coordinate to (0, 0).
 
const TexCoordTypetexCoord () const
 Returns a const reference of the tex coord of the element.
 
TexCoordTypetexCoord ()
 Returns a reference of the tex coord of the element.
 

Protected Member Functions

template<typename Element >
void importFrom (const Element &e, bool=true)
 
void serialize (std::ostream &os) const
 
void deserialize (std::istream &is)
 

Private Types

using Base = Component< TexCoord< Scalar, ParentElemType, OPT >, CompId::TEX_COORD, vcl::TexCoordIndexed< Scalar >, ParentElemType, !std::is_same_v< ParentElemType, void >, OPT >
 

Detailed Description

template<typename Scalar, typename ParentElemType = void, bool OPT = false>
class vcl::comp::TexCoord< Scalar, ParentElemType, OPT >

The TexCoord class represents a component that stores a texture coordinate.

It exposes a vcl::TexCoordIndexed object, that stores a texture coordinate and an id of the texture to use.

For example, if you have a Vertex Element v with the TexCoord component, you'll be able to access to this component member functions from v:

auto texcoord = v.texCoord();
Template Parameters
ScalarThe scalar type of the texture coordinate values.
ParentElemTypeThis template argument must be void if the component needs to be stored horizontally, or the type of the parent element that will contain this component if the component needs to be stored vertically.
OPTIf true, the component will be optional. This argument is considered only if the component is stored vertically.

Member Function Documentation

◆ texCoord() [1/2]

template<typename Scalar , typename ParentElemType = void, bool OPT = false>
TexCoordType & vcl::comp::TexCoord< Scalar, ParentElemType, OPT >::texCoord ( )
inline

Returns a reference of the tex coord of the element.

Returns
a reference of the tex coord of the element.

◆ texCoord() [2/2]

template<typename Scalar , typename ParentElemType = void, bool OPT = false>
const TexCoordType & vcl::comp::TexCoord< Scalar, ParentElemType, OPT >::texCoord ( ) const
inline

Returns a const reference of the tex coord of the element.

Returns
a const reference of the tex coord of the element.

The documentation for this class was generated from the following file: