GLVis
v4.2
Accurate and flexible finite element visualization
|
#include <gltf.hpp>
Classes | |
struct | accessor_id |
struct | buffer_id |
struct | buffer_view_id |
struct | image_id |
struct | material_id |
struct | mesh_id |
struct | node_id |
struct | node_type |
struct | pbr_matallic_roughness |
struct | sampler_id |
struct | struct_accessor |
struct | struct_attributes |
struct | struct_buffer |
struct | struct_buffer_view |
struct | struct_image |
struct | struct_material |
struct | struct_mesh |
struct | struct_node |
struct | struct_pbrMetallicRoughness |
struct | struct_primitive |
struct | struct_sampler |
struct | struct_texture |
struct | struct_texture_info |
struct | texture_id |
Public Member Functions | |
glTF_Builder (const std::string &filePrefix) | |
buffer_id | addBuffer (const std::string &bufferName) |
buffer_view_id | addBufferView (buffer_id buffer, const void *data, size_t byteLength, size_t byteStride, size_t byteAlign, target_type target) |
void | appendToBufferView (buffer_view_id bufferView, const void *data, size_t byteLength) |
accessor_id | addAccessor (buffer_view_id bufferView, size_t byteOffset, component_type componentType, size_t count, tensor_type tensorType) |
accessor_id | addAccessorVec2f (buffer_view_id bufferView, size_t byteOffset, size_t count, vec2f min, vec2f max) |
accessor_id | addAccessorVec3f (buffer_view_id bufferView, size_t byteOffset, size_t count, vec3f min, vec3f max) |
image_id | addImage (const std::string &imageName, int width, int height, const color4f *pixels) |
sampler_id | addSampler (mag_filter magFilter=mag_filter::NEAREST, min_filter minFilter=min_filter::NEAREST, wrap_type wrapS=wrap_type::CLAMP_TO_EDGE, wrap_type wrapT=wrap_type::CLAMP_TO_EDGE) |
texture_id | addTexture (sampler_id sampler, image_id source) |
material_id | addMaterial (const std::string &materialName, const pbr_matallic_roughness &pbrMetallicRoughness, bool doubleSided=false) |
mesh_id | addMesh (const std::string &meshName) |
void | addMeshTriangles (mesh_id mesh, accessor_id vertexPositions, accessor_id vertexNormals, accessor_id vertexTexCoords0, accessor_id vertexIndices, material_id material) |
void | addMeshLines (mesh_id mesh, accessor_id vertexPositions, accessor_id vertexTexcoords0, accessor_id vertexColors0, material_id material) |
node_id | addNode (const std::string &nodeName) |
void | addNodeMesh (node_id node, mesh_id mesh) |
void | addNodeScale (node_id node, vec3f scale) |
void | addNodeTranslation (node_id node, vec3f translation) |
void | getMaterialPBRMR (material_id material, pbr_matallic_roughness &pbr_mr_copy) |
int | writeFile () |
Static Public Attributes | |
static constexpr unsigned | INVALID_ID = std::numeric_limits<unsigned>::max() |
static const char * | tensorTypes [] |
Protected Types | |
typedef node_type< bool > | node_bool |
typedef node_type< unsigned > | node_unsigned |
typedef node_type< float > | node_float |
typedef node_type< std::string > | node_string |
typedef node_type< vec3f > | node_vec3f |
typedef node_type< color4f > | node_color4f |
typedef node_type< vecnf > | node_vecnf |
Static Protected Member Functions | |
static const char * | sep (size_t i) |
template<typename T > | |
static void | print_node (std::ostream &out, int &pfx_counter, const std::string &pfx, const node_type< T > &n) |
static void | print (std::ostream &out, const bool &v) |
static void | print (std::ostream &out, const unsigned &v) |
static void | print (std::ostream &out, const float &v) |
static void | print (std::ostream &out, const std::string &v) |
template<typename T , size_t s> | |
static void | print (std::ostream &out, const std::array< T, s > &v) |
template<typename T > | |
static void | print (std::ostream &out, const std::vector< T > &v) |
static void | print (std::ostream &out, const struct_attributes &a) |
static void | print (std::ostream &out, const struct_texture_info &ti) |
static void | print (std::ostream &out, const struct_pbrMetallicRoughness &pbr) |
Protected Attributes | |
const std::string | file_prefix |
std::vector< struct_buffer > | buffers |
std::vector< struct_buffer_view > | buffer_views |
std::vector< struct_accessor > | accessors |
std::vector< struct_image > | images |
std::vector< struct_sampler > | samplers |
std::vector< struct_texture > | textures |
std::vector< struct_material > | materials |
std::vector< struct_mesh > | meshes |
std::vector< struct_node > | nodes |
typedef std::array<float,4> glTF_Builder::color4f |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
typedef std::array<float,2> glTF_Builder::vec2f |
typedef std::array<float,3> glTF_Builder::vec3f |
typedef std::vector<float> glTF_Builder::vecnf |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
inline |
glTF_Builder::accessor_id glTF_Builder::addAccessor | ( | buffer_view_id | bufferView, |
size_t | byteOffset, | ||
component_type | componentType, | ||
size_t | count, | ||
tensor_type | tensorType | ||
) |
glTF_Builder::accessor_id glTF_Builder::addAccessorVec2f | ( | buffer_view_id | bufferView, |
size_t | byteOffset, | ||
size_t | count, | ||
vec2f | min, | ||
vec2f | max | ||
) |
glTF_Builder::accessor_id glTF_Builder::addAccessorVec3f | ( | buffer_view_id | bufferView, |
size_t | byteOffset, | ||
size_t | count, | ||
vec3f | min, | ||
vec3f | max | ||
) |
glTF_Builder::buffer_id glTF_Builder::addBuffer | ( | const std::string & | bufferName | ) |
glTF_Builder::buffer_view_id glTF_Builder::addBufferView | ( | buffer_id | buffer, |
const void * | data, | ||
size_t | byteLength, | ||
size_t | byteStride, | ||
size_t | byteAlign, | ||
target_type | target | ||
) |
glTF_Builder::image_id glTF_Builder::addImage | ( | const std::string & | imageName, |
int | width, | ||
int | height, | ||
const color4f * | pixels | ||
) |
glTF_Builder::material_id glTF_Builder::addMaterial | ( | const std::string & | materialName, |
const pbr_matallic_roughness & | pbrMetallicRoughness, | ||
bool | doubleSided = false |
||
) |
glTF_Builder::mesh_id glTF_Builder::addMesh | ( | const std::string & | meshName | ) |
void glTF_Builder::addMeshLines | ( | mesh_id | mesh, |
accessor_id | vertexPositions, | ||
accessor_id | vertexTexcoords0, | ||
accessor_id | vertexColors0, | ||
material_id | material | ||
) |
void glTF_Builder::addMeshTriangles | ( | mesh_id | mesh, |
accessor_id | vertexPositions, | ||
accessor_id | vertexNormals, | ||
accessor_id | vertexTexCoords0, | ||
accessor_id | vertexIndices, | ||
material_id | material | ||
) |
glTF_Builder::node_id glTF_Builder::addNode | ( | const std::string & | nodeName | ) |
glTF_Builder::sampler_id glTF_Builder::addSampler | ( | mag_filter | magFilter = mag_filter::NEAREST , |
min_filter | minFilter = min_filter::NEAREST , |
||
wrap_type | wrapS = wrap_type::CLAMP_TO_EDGE , |
||
wrap_type | wrapT = wrap_type::CLAMP_TO_EDGE |
||
) |
glTF_Builder::texture_id glTF_Builder::addTexture | ( | sampler_id | sampler, |
image_id | source | ||
) |
void glTF_Builder::appendToBufferView | ( | buffer_view_id | bufferView, |
const void * | data, | ||
size_t | byteLength | ||
) |
void glTF_Builder::getMaterialPBRMR | ( | material_id | material, |
pbr_matallic_roughness & | pbr_mr_copy | ||
) |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestaticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |