Visual Computing Library
|
The WedgeTexCoords class is a container of texture coordinates associated to the wedges of a Face element. More...
#include <vclib/mesh/components/wedge_tex_coords.h>
Public Types | |
using | WedgeTexCoordType = vcl::TexCoord< Scalar > |
Expose the type of the Texture Coordinate. | |
using | WedgeTexCoordsIterator = Vector< vcl::TexCoord< Scalar >, N >::Iterator |
using | ConstWedgeTexCoordsIterator = Vector< vcl::TexCoord< Scalar >, N >::ConstIterator |
Public Member Functions | |
WedgeTexCoords ()=default | |
Empty constructor. | |
vcl::TexCoord< Scalar > & | wedgeTexCoord (uint i) |
Returns a reference to the i-th wedge texcoord of the element. | |
const vcl::TexCoord< Scalar > & | wedgeTexCoord (uint i) const |
Returns a const reference to the i-th wedge texcoord of the element. | |
vcl::TexCoord< Scalar > & | wedgeTexCoordMod (int i) |
Returns a reference to the i-th wedge texcoord of the element but using as index the module between i and the number of vertices of the element. You can use this function if you need to get the "next wedge
texcoord after position k", without check if it is less than the number of vertices. Works also for negative numbers: | |
const vcl::TexCoord< Scalar > & | wedgeTexCoordMod (int i) const |
Same of wedgeTexCoordMod(int) but returns a const reference. | |
void | setWedgeTexCoord (uint i, const vcl::TexCoord< Scalar > &t) |
Sets the i-th wedge texcoord of the element. | |
template<Range Rng> requires InputRange<Rng, vcl::TexCoord<Scalar>> | |
void | setWedgeTexCoords (Rng &&r) |
Sets all the wedge texcoords of the element. | |
ushort & | textureIndex () |
Returns a reference to the texture index used to identify the texture on which the wedge texture coordinates are mapped. | |
ushort | textureIndex () const |
Returns the texture index used to identify the texture on which the wedge texture coordinates are mapped. | |
WedgeTexCoordsIterator | wedgeTexCoordBegin () |
Returns an iterator to the first wedge texcoord in the container of this component. | |
WedgeTexCoordsIterator | wedgeTexCoordEnd () |
Returns an iterator to the end of the container of this component. | |
ConstWedgeTexCoordsIterator | wedgeTexCoordBegin () const |
Returns a const iterator to the first wedge texcoord in the container of this component. | |
ConstWedgeTexCoordsIterator | wedgeTexCoordEnd () const |
Returns a const iterator to the end of the container of this component. | |
View< WedgeTexCoordsIterator > | wedgeTexCoords () |
Returns a lightweight view object that stores the begin and end iterators of the container of wedge texcoords of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops: | |
View< ConstWedgeTexCoordsIterator > | wedgeTexCoords () const |
Returns a lightweight const view object that stores the begin and end iterators of the container of wedge texcoords of the element. The view object exposes the iterators trough the begin() and end() member functions, and therefore the returned object can be used in range-based for loops: | |
void | __wedgeTexCoords () const |
Static Public Attributes | |
static const int | WEDGE_TEX_COORD_NUMBER = N |
![]() | |
static const bool | TIED_TO_VERTEX_NUMBER = TTVN |
Boolean that tells if this component stores a container having its size tied to the number of the vertices of the Element. | |
static const int | SIZE = N |
Protected Types | |
using | WedgeTexCoordScalarType = Scalar |
![]() | |
using | Iterator = Vector< T, N >::Iterator |
using | ConstIterator = Vector< T, N >::ConstIterator |
Protected Member Functions | |
template<typename Element > | |
void | importFrom (const Element &e, bool=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
void | resize (uint n) |
void | pushBack (const vcl::TexCoord< Scalar > &t=vcl::TexCoord< Scalar >()) |
void | insert (uint i, const vcl::TexCoord< Scalar > &t=vcl::TexCoord< Scalar >()) |
void | erase (uint i) |
void | clear () |
![]() | |
void | init () |
Vector< T, N > & | container () |
const Vector< T, N > & | container () const |
template<typename AdDt = AdditionalData> requires (HAS_ADDITIONAL_DATA) | |
AdDt & | additionalData () |
template<typename AdDt = AdditionalData> requires (HAS_ADDITIONAL_DATA) | |
const AdDt & | additionalData () const |
Private Types | |
using | Base = ContainerComponent< WedgeTexCoords< Scalar, N, ParentElemType, OPT >, CompId::WEDGE_TEX_COORDS, vcl::TexCoord< Scalar >, N, ushort, ParentElemType, !std::is_same_v< ParentElemType, void >, OPT, true > |
Private Member Functions | |
template<typename Element > | |
void | importWedgeTexCoordsFrom (const Element &e) |
Vector< vcl::TexCoord< Scalar >, N > & | texCoords () |
const Vector< vcl::TexCoord< Scalar >, N > & | texCoords () const |
The WedgeTexCoords class is a container of texture coordinates associated to the wedges of a Face element.
The component is composed of a static or dynamic size container, depending on the value of the template argument N (a negative value indicates a dynamic size), plus a texture index that represents the index of the texture used by all the texture coordinates stored in the container.
The member functions of this class will be available in the instance of any Element that will contain this component, altough it is usually used (and it makes sense only) on the Face element.
For example, if you have a Face Element f
that has the WedgeTexCoords component, you'll be able to access to this component member functions from f
:
Scalar | The Scalar type used for the texture coordinates. |
N | The size of the container, that will represent the number of storable wedge texcoords. If N is negative, the container will be dynamic. In any case, N must be the same of the Vertex Number of the Element that will contain this component. |
ParentElemType | This 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. |
OPT | If true, the component will be optional. This argument is considered only if the component is stored vertically. |
|
default |
Empty constructor.
If the Wedge TexCoords container size is static, initializes all the Wedge TexCoords to with the vcl::TexCoord empty constructor, otherwise the container will be empty.
|
inline |
Sets the i-th wedge texcoord of the element.
[in] | i | the position in the container on which set the wedge texcoord; the value must be between 0 and the number of vertices of the element. |
[in] | t | the new wedge texcoord. |
|
inline |
Sets all the wedge texcoords of the element.
If the size of the container is static, the size of the input range must be the same one of the container.
Rng | The type of the range of wedge texcoords to set. The value type of the range must be convertible to a vcl::TexCoord<Scalar>. |
[in] | r | range of texcoords to set. |
|
inline |
Returns a reference to the texture index used to identify the texture on which the wedge texture coordinates are mapped.
|
inline |
Returns the texture index used to identify the texture on which the wedge texture coordinates are mapped.
|
inline |
Returns a reference to the i-th wedge texcoord of the element.
You can use this function to set the i-th texcoord of the element:
[in] | i | the index of the wedge texcoord to return. The value must be between 0 and the number of vertices of the element. |
|
inline |
Returns a const reference to the i-th wedge texcoord of the element.
[in] | i | the index of the wedge texcoord to return. The value must be between 0 and the number of vertices of the element. |
|
inline |
Returns an iterator to the first wedge texcoord in the container of this component.
|
inline |
Returns a const iterator to the first wedge texcoord in the container of this component.
|
inline |
Returns an iterator to the end of the container of this component.
|
inline |
Returns a const iterator to the end of the container of this component.
|
inline |
Returns a reference to the i-th wedge texcoord of the element but using as index the module between i and the number of vertices of the element. You can use this function if you need to get the "next wedge texcoord after position k", without check if it is less than the number of vertices. Works also for negative numbers:
[in] | i | the position of the required wedge texcoord in the container, w.r.t. the position 0; value is modularized on vertexNumber(). |
|
inline |
Same of wedgeTexCoordMod(int) but returns a const reference.
[in] | i | the position of the required wedge texcoord in the container, w.r.t. the position 0; value is modularized on vertexNumber(). |
|
inline |
Returns a lightweight view object that stores the begin and end iterators of the container of wedge texcoords of the element. The view object exposes the iterators trough the begin()
and end()
member functions, and therefore the returned object can be used in range-based for loops:
|
inline |
Returns a lightweight const view object that stores the begin and end iterators of the container of wedge texcoords of the element. The view object exposes the iterators trough the begin()
and end()
member functions, and therefore the returned object can be used in range-based for loops: