DGtal 2.1.0
Loading...
Searching...
No Matches
DGtal::drawutils Namespace Reference

Functions

template<size_t I>
std::vector< std::array< size_t, I > > makeIndices (size_t N)
 Create a list of indices for a vertex array with independent elements.
 
template<typename T >
std::array< T, 8 > getCubeVertices (T center, double size)
 Return the vertices of a cube.
 
template<typename T , typename U >
void insertCubeVertices (U &dest, T center, double scale)
 Insert cube vertices into an array.
 
template<typename T >
std::array< T, 4 > getAASquareVertices (T center, int orientation, double size)
 Return the vertices of an axis aligned square.
 
template<typename U , typename T >
void insertAASquare (U &dest, T center, int orientation, double size)
 Insert vertices of a square into a container.
 
template<typename T >
std::array< T, 8 > getPrism (T center, int orientation, double size1, double size2, double shift1, double shift2)
 Return the vertices of a prism.
 
template<typename T , typename U >
void insertPrism (U &dest, T center, int orientation, double size1, double size2, double shift1, double shift2)
 Insert the vertices of a prism into a container.
 
glm::vec3 toglm (const DGtal::Color &col)
 
std::vector< glm::vec3 > toglm (const std::vector< DGtal::Color > &col)
 
glm::mat4 toglm (const Eigen::Affine3d &transform)
 

Function Documentation

◆ getAASquareVertices()

template<typename T >
std::array< T, 4 > DGtal::drawutils::getAASquareVertices ( center,
int  orientation,
double  size 
)

Return the vertices of an axis aligned square.

Template Parameters
TThe type of vertex
Parameters
centerThe center of the quad
orientation0 means normal in x direction, 1 in y-direction, 2 in z-direction
sizeThe size of the square
See also
DGtal::drawutils::insertAASquare

◆ getCubeVertices()

template<typename T >
std::array< T, 8 > DGtal::drawutils::getCubeVertices ( center,
double  size 
)

Return the vertices of a cube.

Template Parameters
TThe type of vertex
Parameters
centerThe center of the cube
sizeThe size of the cube
See also
DGtal::drawutils::insertCubeVertices

◆ getPrism()

template<typename T >
std::array< T, 8 > DGtal::drawutils::getPrism ( center,
int  orientation,
double  size1,
double  size2,
double  shift1,
double  shift2 
)

Return the vertices of a prism.

Here, a prism is meant to display a signed Khalimsky cell. It is draw as two square, one of which is smaller than the other, connected by 4 other rectular shapes.

Template Parameters
TThe vertex type
Parameters
centerThe center of the cell on which the prism should be drawn
orientationThe orientation of the cell (x, y, z)
size1Size of the first square
size2Size of the second square
shift1Shift (relative to center) of the first square
shift2Shift (relative to center) of the second square

◆ insertAASquare()

template<typename U , typename T >
void DGtal::drawutils::insertAASquare ( U &  dest,
center,
int  orientation,
double  size 
)

Insert vertices of a square into a container.

Template Parameters
UThe container
TThe type of vertex
Parameters
destThe container where the vertices shoudl be inserted
centerThe center of the square
orientation0 means normal in x direction, 1 in y-direction, 2 in z-direction
sizeThe size of the square
See also
DGtal::drawutils::getAASquareVertices

◆ insertCubeVertices()

template<typename T , typename U >
void DGtal::drawutils::insertCubeVertices ( U &  dest,
center,
double  scale 
)

Insert cube vertices into an array.

Template Parameters
TThe type of vertex
UThe container to insert vertices into
Parameters
destThe container where the vertices shoudl be inserted
centerThe center of the cube
scaleThe size of the cube
See also
DGtal::drawutils::getCubeVertices

◆ insertPrism()

template<typename T , typename U >
void DGtal::drawutils::insertPrism ( U &  dest,
center,
int  orientation,
double  size1,
double  size2,
double  shift1,
double  shift2 
)

Insert the vertices of a prism into a container.

See also
DGtal::drawutils::getPrism
Template Parameters
UThe container type
TThe vertex type
Parameters
destThe container where the vertices shoudl be inserted
centerThe center of the cell on which the prism should be drawn
orientationThe orientation of the cell (x, y, z)
size1Size of the first square
size2Size of the second square
shift1Shift (relative to center) of the first square
shift2Shift (relative to center) of the second square

◆ makeIndices()

template<size_t I>
std::vector< std::array< size_t, I > > DGtal::drawutils::makeIndices ( size_t  N)

Create a list of indices for a vertex array with independent elements.

Template Parameters
IThe size of individual elements
Parameters
NThe number of elements

◆ toglm() [1/3]

glm::vec3 DGtal::drawutils::toglm ( const DGtal::Color col)

◆ toglm() [2/3]

glm::mat4 DGtal::drawutils::toglm ( const Eigen::Affine3d &  transform)

◆ toglm() [3/3]

std::vector< glm::vec3 > DGtal::drawutils::toglm ( const std::vector< DGtal::Color > &  col)