HighMap library (C++)
Loading...
Searching...
No Matches
hmap::UvTile Struct Reference

Describes an Array tile's position within the normalized [0, 1]^2 UV domain and global index grid. More...

#include <uv_tile.hpp>

Collaboration diagram for hmap::UvTile:

Public Member Functions

 UvTile (const TileKey &key={}, const UvRect &uv_rect=UvRect::unit(), const glm::ivec2 &shape={0, 0}, const glm::ivec4 &halo={0, 0, 0, 0}, const glm::ivec2 &global_shape={0, 0}, const glm::ivec2 &tile_shape={0, 0}, const glm::ivec2 &tile_grid={1, 1})
 UvTile (const UvRect &uv)
UvRect core_uv_rect () const
glm::vec2 cell_uv_center (int i, int j) const
glm::vec2 cell_uv_corner (int i, int j) const
glm::vec2 cell_center (int i, int j) const
glm::vec2 cell_corner (int i, int j) const
bool contains_global (int gx, int gy) const
bool contains_global_core (int gx, int gy) const
glm::ivec2 global_offset () const
glm::ivec2 global_to_local (int gx, int gy) const
std::string info_string (int indent=0) const
bool is_valid () const
bool is_empty () const
bool is_bottom_border () const
bool is_left_border () const
bool is_right_border () const
bool is_top_border () const
std::string key_as_string () const
int linear_index () const
glm::ivec2 local_to_global (int lx, int ly) const

Static Public Member Functions

static const UvTile & unit ()
static const UvTile & dummy ()

Public Attributes

TileKey key
 Tile grid coordinates (tx, ty).
UvRect uv_rect
 UV sub-rectangle [u_min, u_max] x [v_min, v_max].
glm::ivec2 shape
 Number of cells in tile (incl. halo).
glm::ivec4 halo
 Halo cells: (left, right, bottom, top).
glm::ivec2 global_shape
 Total domain shape (nx, ny).
glm::ivec2 tile_shape
 Nominal tile shape (excluding halo).
glm::ivec2 tile_grid
 Number of tiles along (x, y).

Detailed Description

Describes an Array tile's position within the normalized [0, 1]^2 UV domain and global index grid.

Constructor & Destructor Documentation

◆ UvTile() [1/2]

hmap::UvTile::UvTile ( const TileKey & key = {},
const UvRect & uv_rect = UvRect::unit(),
const glm::ivec2 & shape = {0, 0},
const glm::ivec4 & halo = {0, 0, 0, 0},
const glm::ivec2 & global_shape = {0, 0},
const glm::ivec2 & tile_shape = {0, 0},
const glm::ivec2 & tile_grid = {1, 1} )

◆ UvTile() [2/2]

hmap::UvTile::UvTile ( const UvRect & uv)
inline

Member Function Documentation

◆ unit()

const UvTile & hmap::UvTile::unit ( )
static

◆ dummy()

const UvTile & hmap::UvTile::dummy ( )
static

◆ core_uv_rect()

UvRect hmap::UvTile::core_uv_rect ( ) const

◆ cell_uv_center()

glm::vec2 hmap::UvTile::cell_uv_center ( int i,
int j ) const
inline

◆ cell_uv_corner()

glm::vec2 hmap::UvTile::cell_uv_corner ( int i,
int j ) const
inline

◆ cell_center()

glm::vec2 hmap::UvTile::cell_center ( int i,
int j ) const

◆ cell_corner()

glm::vec2 hmap::UvTile::cell_corner ( int i,
int j ) const

◆ contains_global()

bool hmap::UvTile::contains_global ( int gx,
int gy ) const

◆ contains_global_core()

bool hmap::UvTile::contains_global_core ( int gx,
int gy ) const

◆ global_offset()

glm::ivec2 hmap::UvTile::global_offset ( ) const

◆ global_to_local()

glm::ivec2 hmap::UvTile::global_to_local ( int gx,
int gy ) const

◆ info_string()

std::string hmap::UvTile::info_string ( int indent = 0) const

◆ is_valid()

bool hmap::UvTile::is_valid ( ) const
inline

◆ is_empty()

bool hmap::UvTile::is_empty ( ) const
inline

◆ is_bottom_border()

bool hmap::UvTile::is_bottom_border ( ) const

◆ is_left_border()

bool hmap::UvTile::is_left_border ( ) const

◆ is_right_border()

bool hmap::UvTile::is_right_border ( ) const

◆ is_top_border()

bool hmap::UvTile::is_top_border ( ) const

◆ key_as_string()

std::string hmap::UvTile::key_as_string ( ) const

◆ linear_index()

int hmap::UvTile::linear_index ( ) const

◆ local_to_global()

glm::ivec2 hmap::UvTile::local_to_global ( int lx,
int ly ) const

Member Data Documentation

◆ key

TileKey hmap::UvTile::key

Tile grid coordinates (tx, ty).

◆ uv_rect

UvRect hmap::UvTile::uv_rect

UV sub-rectangle [u_min, u_max] x [v_min, v_max].

◆ shape

glm::ivec2 hmap::UvTile::shape

Number of cells in tile (incl. halo).

◆ halo

glm::ivec4 hmap::UvTile::halo

Halo cells: (left, right, bottom, top).

◆ global_shape

glm::ivec2 hmap::UvTile::global_shape

Total domain shape (nx, ny).

◆ tile_shape

glm::ivec2 hmap::UvTile::tile_shape

Nominal tile shape (excluding halo).

◆ tile_grid

glm::ivec2 hmap::UvTile::tile_grid

Number of tiles along (x, y).


The documentation for this struct was generated from the following files: