cgv
Loading...
Searching...
No Matches
cgv::media::mesh::simple_mesh< T > Class Template Reference

the simple_mesh class is templated over the coordinate type that defaults to float More...

#include <simple_mesh.h>

Inheritance diagram for cgv::media::mesh::simple_mesh< T >:
cgv::media::mesh::simple_mesh_base cgv::media::colored_model

Public Types

using numeric_type = T
typedef simple_mesh< T > mesh_type
 type of axis aligned 3d box
typedef cgv::media::axis_aligned_box< T, 3 > box_type
 type of axis aligned 3d box
typedef cgv::math::fvec< T, 2 > vec2_type
 type of 2d vector
typedef cgv::math::fvec< T, 3 > vec3_type
 type of 3d vector
typedef cgv::math::fmat< T, 3, 3 > mat3_type
 linear transformation
Public Types inherited from cgv::media::mesh::simple_mesh_base
enum class  attribute_type {
  begin =0 , position =0 , texcoords =1 , normal =2 ,
  tangent =3 , color =4 , end =5
}
 different mesh attributes More...
enum  AttributeFlags {
  AF_position = 1 , AF_texcoords = 2 , AF_normal = 4 , AF_tangent = 8 ,
  AF_color = 16
}
typedef cgv::type::uint32_type idx_type
 define index type
typedef cgv::math::fvec< idx_type, 2 > idx2_type
 define index pair type
typedef cgv::math::fvec< idx_type, 3 > idx3_type
 define index triple type
typedef cgv::math::fvec< idx_type, 4 > idx4_type
 define index quadruple type
typedef illum::textured_surface_material mat_type
 define material type

Public Member Functions

 simple_mesh (const simple_mesh< T > &sm)
 copy constructor
 simple_mesh (simple_mesh< T > &&sm)
 move constructor
 simple_mesh (const std::string &conway_notation="")
 assignment operator
simple_mesh< T > & operator= (const simple_mesh< T > &sm)
 assignment operator
simple_mesh< T > & operator= (simple_mesh< T > &&sm)
 move assignment operator
uint32_t get_coord_size () const
 return the size of one coordinate in bytes
void clear ()
 clear simple mesh
idx_type new_position (const vec3_type &p)
 add a new position and return position index
idx_type get_nr_positions () const
 access to positions
vec3_type & position (idx_type pi)
const vec3_type & position (idx_type pi) const
const std::vector< vec3_type > & get_positions () const
std::vector< vec3_type > & ref_positions ()
idx_type new_normal (const vec3_type &n)
 add a new normal and return normal index
bool has_normals () const
 access to normals
idx_type get_nr_normals () const
vec3_type & normal (idx_type ni)
const vec3_type & normal (idx_type ni) const
const std::vector< vec3_type > & get_normals () const
idx_type new_tangent (const vec3_type &tc)
 add a new tangent and return tangent index
bool has_tangents () const
 access to tangents
idx_type get_nr_tangents () const
vec3_type & tangent (idx_type ti)
const vec3_type & tangent (idx_type ti) const
idx_type new_tex_coord (const vec2_type &tc)
 add a new texture coordinate and return texture coordinate index
bool has_tex_coords () const
 access to texture coordinates
idx_type get_nr_tex_coords () const
vec2_type & tex_coord (idx_type ti)
const vec2_type & tex_coord (idx_type ti) const
bool compute_face_normal (idx_type fi, vec3_type &nml, bool normalize=true) const
 compute the normal nml of a face and return whether this was possible
vec3_type compute_face_center (idx_type fi) const
 compute face center
void compute_face_normals (bool construct_normal_indices=true)
 compute per face normals (ensure that per corner normal indices are set correspondingly)
void compute_face_tangents (bool construct_tangent_indices=true)
 compute per face tangents (ensure that per corner tangent indices are set correspondingly)
void ambo ()
 Conway ambo operator.
void truncate (T lambda=0.33333f)
 Conway truncate operator.
void snub (T lambda=0.33333f)
 Conway snub operator.
void dual ()
 Conway dual operator.
void gyro (T lambda=0.3333f)
 Conway gyro operator.
void join ()
 Conway join operator.
void ortho ()
 Conway ortho operator.
void construct_conway_polyhedron (const std::string &conway_notation)
 construct new mesh according to Conway polyhedron notation: [a|t|s|d|g|j|o]*[T|C|O|D|I] which is evaluated from right to left and last capital letter is Platonic solid and lowercase letters are Conway operations
box_type compute_box () const
 compute the axis aligned bounding box
void compute_vertex_normals (bool use_parallel_implementation=true)
 compute vertex normals by averaging triangle normals
void construct (const obj_loader_generic< T > &loader, bool copy_grp_info, bool copy_material_info)
 construct from obj loader
bool read (const std::string &file_name)
 read simple mesh from file (currently only obj and stl are supported)
bool write (const std::string &file_name) const
 write simple mesh to file (currently only obj is supported)
unsigned extract_vertex_attribute_buffer (const std::vector< idx4_type > &unique_quadruples, bool include_tex_coords, bool include_normals, bool include_tangents, std::vector< T > &attrib_buffer, bool *include_colors_ptr=0, int *num_floats_in_vertex=nullptr) const
 Extract vertex attribute array and element array buffers for triangulation and edges in wireframe.
void transform (const mat3_type &linear_transformation, const vec3_type &translation)
 apply transformation to mesh
void transform (const mat3_type &linear_transform, const vec3_type &translation, const mat3_type &inverse_linear_transform)
 apply transformation to mesh with given inverse linear transformation
Public Member Functions inherited from cgv::media::mesh::simple_mesh_base
 simple_mesh_base ()
 default constructor
 simple_mesh_base (const simple_mesh_base &smb)
 copy constructor
 simple_mesh_base (simple_mesh_base &&smb)
 move constructor
simple_mesh_base & operator= (const simple_mesh_base &smb)
 assignment operator
simple_mesh_base & operator= (simple_mesh_base &&smb)
 move assignment operator
idx_type start_face ()
 Create a new empty face to which new corners are added.
idx_type new_corner (idx_type position_index, idx_type normal_index=-1, idx_type tex_coord_index=-1)
 Create a new corner with the given attributes.
idx_type c2p (idx_type ci) const
 return position index of corner
idx_type c2n (idx_type ci) const
 return normal index of corner
bool has_normal_indices () const
 return whether normal indices are stored
idx_type c2t (idx_type ci) const
 return texture index of corner
bool has_tex_coord_indices () const
 return whether texture coordinate indices are stored
idx_type get_nr_faces () const
 return the number of faces
idx_type get_nr_corners () const
 return the number of corners
idx_type begin_corner (idx_type fi) const
 Retrieve the vertex index of the first corner of a face.
idx_type end_corner (idx_type fi) const
 Retrieve index of the vertex which follows the end corner of a face.
idx_type face_degree (idx_type fi) const
 return number of edges/corners of face with index fi
size_t get_nr_materials () const
 return number of materials in mesh
idx_type new_material ()
 add a new material and return its index
const mat_type & get_material (size_t i) const
 return const reference to i-th material
mat_type & ref_material (size_t i)
 return reference to i-th material
const idx_type & material_index (idx_type fi) const
 return material index of given face
idx_type & material_index (idx_type fi)
 return reference to material index of given face
size_t get_nr_groups () const
 return number of face groups
const std::string & group_name (size_t i) const
 return the name of the i-th face group
std::string & group_name (size_t i)
 set a new group name
idx_type new_group (const std::string &name)
 add a new group and return its index
const idx_type & group_index (idx_type fi) const
 return group index of given face
idx_type & group_index (idx_type fi)
 return reference to group index of given face
void revert_face_orientation ()
 revert face orientation
void sort_faces (std::vector< idx_type > &perm, bool by_group=true, bool by_material=true) const
 Calculate a permutation of face indices which sorts them by group and/or material.
void merge_indices (std::vector< idx_type > &vertex_indices, std::vector< idx4_type > &unique_tuples, bool *include_tex_coords_ptr=0, bool *include_normals_ptr=0, bool *include_tangents_ptr=0) const
 Transforms n individual vertex attribute indices into one list of unique index n-tuples.
void extract_triangle_element_buffer (const std::vector< idx_type > &vertex_indices, std::vector< idx_type > &triangle_element_buffer, const std::vector< idx_type > *face_permutation_ptr=0, std::vector< idx3_type > *material_group_start_ptr=0) const
 Extract element array buffers for triangulation.
void extract_wireframe_element_buffer (const std::vector< idx_type > &vertex_indices, std::vector< idx_type > &edge_element_buffer) const
 Extract element array buffers for edges in wireframe.
idx_type extract_vertex_attribute_buffer_base (const std::vector< idx4_type > &unique_quadruples, AttributeFlags &flags, std::vector< uint8_t > &attrib_buffer) const
 extract vertex attribute buffer for the given flags and return size of vertex in bytes
void extract_triangle_indices (std::vector< idx3_type > &position_indices, std::vector< idx3_type > *tex_coord_indices=nullptr, std::vector< idx3_type > *normal_indices=nullptr, std::vector< idx3_type > *tangent_indices=nullptr) const
 Extract index lists of triangle positions and optional attributes.
idx_type compute_inv (std::vector< idx_type > &inv, bool link_non_manifold_edges=false, std::vector< idx_type > *p2c_ptr=0, std::vector< idx_type > *next_ptr=0, std::vector< idx_type > *prev_ptr=0, std::vector< idx_type > *unmatched=0, std::vector< idx_type > *non_manifold=0, std::vector< idx_type > *unmatched_elements=0, std::vector< idx_type > *non_manifold_elements=0) const
 Do inverse matching of half-edges.
idx_type compute_c2e (const std::vector< idx_type > &inv, std::vector< idx_type > &c2e, std::vector< idx_type > *e2c_ptr=0) const
 given the inv corners compute vector storing per corner the edge index and optionally per edge one corner index and return edge count (implementation assumes closed manifold connectivity)
void compute_c2f (std::vector< idx_type > &c2f) const
 compute index vector with per corner its face index
Public Member Functions inherited from cgv::media::colored_model
 colored_model ()
 construct colored model
 colored_model (const colored_model &cm)
 copy constructur
 colored_model (colored_model &&cm)
 move constructur
colored_model & operator= (const colored_model &cm)
 assignment operator
colored_model & operator= (colored_model &&cm)
 move assignment operator
virtual ~colored_model ()
 destruct colored model
bool has_colors () const
 check whether colors have been allocated
void set_color (size_t i, const void *col_ptr)
 set i-th color to color of type stored in storage
void set_color (size_t i, const rgb &col)
 set i-th color from color of type rgb
void set_color (size_t i, const rgb8 &col)
 set i-th color from color of type rgba
void set_color (size_t i, const rgba &col)
 set i-th color from color of type rgb8
void set_color (size_t i, const rgba8 &col)
 set i-th color from color of type rgba8
void put_color (size_t i, void *col_ptr) const
 set color of type stored in storage to i-th color
void put_color (size_t i, rgb &col) const
 set color of type rgb to i-th color
void put_color (size_t i, rgba &col) const
 set color of type rgba to i-th color
void put_color (size_t i, rgb8 &col) const
 set color of type rgb8 to i-th color
void put_color (size_t i, rgba8 &col) const
 set color of type rgba8 to i-th color
size_t get_nr_colors () const
 return number of allocated colors
void resize_colors (size_t nr_colors)
 resize the color storage to given number of colors
size_t get_color_size () const
 return the size of one allocated color in byte
ColorType get_color_storage_type () const
 return storage type of colors, if no colors are allocated CT_RGBA8 is returned
const void * get_color_data_ptr () const
const void * get_color_data_vector_ptr () const
void * ref_color_data_ptr ()
void * ref_color_data_vector_ptr ()
void ensure_colors (ColorType _color_type, size_t nr_colors=-1)
 ensure that colors are allocated and of given storage type
void destruct_colors ()
 destruct color storage

Protected Member Functions

bool has_attribute (attribute_type attr) const
const uint8_t * get_attribute_ptr (attribute_type attr, idx_type ai=0) const
size_t get_attribute_size (attribute_type attr) const
size_t get_attribute_offset (attribute_type attr) const
vec3_type compute_normal (const vec3_type &p0, const vec3_type &p1, const vec3_type &p2)

Protected Attributes

std::vector< vec3_type > positions
std::vector< vec3_type > normals
std::vector< vec3_type > tangents
std::vector< vec2_type > tex_coords
Protected Attributes inherited from cgv::media::mesh::simple_mesh_base
std::vector< idx_type > position_indices
std::vector< idx_type > tex_coord_indices
std::vector< idx_type > normal_indices
std::vector< idx_type > tangent_indices
std::vector< idx_type > faces
std::vector< idx_type > group_indices
std::vector< std::string > group_names
std::vector< idx_type > material_indices
std::vector< mat_type > materials
Protected Attributes inherited from cgv::media::colored_model
abst_color_storage * color_storage_ptr
 pointer to color storage

Friends

class simple_mesh_obj_reader< T >

Additional Inherited Members

Static Public Member Functions inherited from cgv::media::mesh::simple_mesh_base
static std::string get_attribute_name (attribute_type attr)
static AttributeFlags get_attribute_flag (attribute_type attr)

Detailed Description

template<typename T = float>
class cgv::media::mesh::simple_mesh< T >

the simple_mesh class is templated over the coordinate type that defaults to float

Definition at line 260 of file simple_mesh.h.

Member Typedef Documentation

◆ box_type

template<typename T = float>
typedef cgv::media::axis_aligned_box<T, 3> cgv::media::mesh::simple_mesh< T >::box_type

type of axis aligned 3d box

Definition at line 268 of file simple_mesh.h.

◆ mat3_type

template<typename T = float>
typedef cgv::math::fmat<T, 3, 3> cgv::media::mesh::simple_mesh< T >::mat3_type

linear transformation

Definition at line 274 of file simple_mesh.h.

◆ mesh_type

template<typename T = float>
typedef simple_mesh<T> cgv::media::mesh::simple_mesh< T >::mesh_type

type of axis aligned 3d box

Definition at line 266 of file simple_mesh.h.

◆ numeric_type

template<typename T = float>
using cgv::media::mesh::simple_mesh< T >::numeric_type = T

Definition at line 263 of file simple_mesh.h.

◆ vec2_type

template<typename T = float>
typedef cgv::math::fvec<T, 2> cgv::media::mesh::simple_mesh< T >::vec2_type

type of 2d vector

Definition at line 270 of file simple_mesh.h.

◆ vec3_type

template<typename T = float>
typedef cgv::math::fvec<T, 3> cgv::media::mesh::simple_mesh< T >::vec3_type

type of 3d vector

Definition at line 272 of file simple_mesh.h.

Constructor & Destructor Documentation

◆ simple_mesh() [1/3]

template<typename T>
cgv::media::mesh::simple_mesh< T >::simple_mesh ( const simple_mesh< T > & sm)

copy constructor

Definition at line 566 of file simple_mesh.cxx.

References simple_mesh(), and cgv::media::mesh::simple_mesh_base::simple_mesh_base().

Referenced by operator=(), operator=(), simple_mesh(), and simple_mesh().

◆ simple_mesh() [2/3]

template<typename T>
cgv::media::mesh::simple_mesh< T >::simple_mesh ( simple_mesh< T > && sm)

move constructor

Definition at line 573 of file simple_mesh.cxx.

References simple_mesh(), and cgv::media::mesh::simple_mesh_base::simple_mesh_base().

◆ simple_mesh() [3/3]

template<typename T>
cgv::media::mesh::simple_mesh< T >::simple_mesh ( const std::string & conway_notation = "")

assignment operator

Definition at line 1031 of file simple_mesh.cxx.

References construct_conway_polyhedron().

Member Function Documentation

◆ ambo()

◆ clear()

template<typename T>
void cgv::media::mesh::simple_mesh< T >::clear ( )

clear simple mesh

Definition at line 605 of file simple_mesh.cxx.

References cgv::media::colored_model::destruct_colors().

Referenced by cgv::render::extract_mesh().

◆ compute_box()

template<typename T>
simple_mesh< T >::box_type cgv::media::mesh::simple_mesh< T >::compute_box ( ) const

compute the axis aligned bounding box

Definition at line 813 of file simple_mesh.cxx.

References cgv::media::axis_aligned_box< T, N >::add_point().

◆ compute_face_center()

◆ compute_face_normal()

template<typename T>
bool cgv::media::mesh::simple_mesh< T >::compute_face_normal ( idx_type fi,
vec3_type & nml,
bool normalize = true ) const

compute the normal nml of a face and return whether this was possible

Definition at line 933 of file simple_mesh.cxx.

References cgv::media::mesh::simple_mesh_base::begin_corner(), cgv::media::mesh::simple_mesh_base::end_corner(), and cgv::math::fvec< T, N >::length().

Referenced by compute_face_normals(), and compute_vertex_normals().

◆ compute_face_normals()

template<typename T>
void cgv::media::mesh::simple_mesh< T >::compute_face_normals ( bool construct_normal_indices = true)

compute per face normals (ensure that per corner normal indices are set correspondingly)

Definition at line 957 of file simple_mesh.cxx.

References cgv::media::mesh::simple_mesh_base::begin_corner(), compute_face_normal(), cgv::media::mesh::simple_mesh_base::end_corner(), cgv::media::mesh::simple_mesh_base::get_nr_faces(), and new_normal().

Referenced by ambo(), dual(), gyro(), join(), snub(), and truncate().

◆ compute_face_tangents()

◆ compute_normal()

template<typename T>
simple_mesh< T >::vec3_type cgv::media::mesh::simple_mesh< T >::compute_normal ( const vec3_type & p0,
const vec3_type & p1,
const vec3_type & p2 )
protected

Definition at line 974 of file simple_mesh.cxx.

◆ compute_vertex_normals()

template<typename T>
void cgv::media::mesh::simple_mesh< T >::compute_vertex_normals ( bool use_parallel_implementation = true)

◆ construct()

◆ construct_conway_polyhedron()

template<typename T>
void cgv::media::mesh::simple_mesh< T >::construct_conway_polyhedron ( const std::string & conway_notation)

construct new mesh according to Conway polyhedron notation: [a|t|s|d|g|j|o]*[T|C|O|D|I] which is evaluated from right to left and last capital letter is Platonic solid and lowercase letters are Conway operations

Definition at line 1281 of file simple_mesh.cxx.

References ambo(), dual(), gyro(), join(), cgv::media::mesh::simple_mesh_base::new_corner(), new_normal(), new_position(), ortho(), snub(), cgv::media::mesh::simple_mesh_base::start_face(), and truncate().

Referenced by simple_mesh().

◆ dual()

◆ extract_vertex_attribute_buffer()

template<typename T>
unsigned cgv::media::mesh::simple_mesh< T >::extract_vertex_attribute_buffer ( const std::vector< idx4_type > & unique_quadruples,
bool include_tex_coords,
bool include_normals,
bool include_tangents,
std::vector< T > & attrib_buffer,
bool * include_colors_ptr = 0,
int * num_floats_in_vertex = nullptr ) const

Extract vertex attribute array and element array buffers for triangulation and edges in wireframe.

Parameters
unique_quadruplesA list of unique n-tuples where each entry is an index into attribute vectors of simple_mesh.
include_tex_coordsTrue if texture coordinates should be written into the vertex buffer, false otherwise.
include_normalsTrue if normals should be written into the vertex buffer, false otherwise.
include_tangentsTrue if tangents should be written into the vertex buffer, false otherwise.
attrib_bufferwill contain the vertex attribute data in interleaved form.
include_colors_ptrIf nullptr then the vertex buffer won't contain colors, otherwise it will be set to true if the mesh even contains colors or false if not.
num_floats_in_vertexIf not nullptr will be set to the number of floats which make up one vertex with all its attributes.
Returns
The size of one color in bytes.

Definition at line 855 of file simple_mesh.cxx.

References cgv::media::colored_model::get_color_size(), cgv::media::colored_model::get_nr_colors(), cgv::media::colored_model::has_colors(), and cgv::media::colored_model::put_color().

◆ get_attribute_offset()

template<typename T = float>
size_t cgv::media::mesh::simple_mesh< T >::get_attribute_offset ( attribute_type attr) const
inlineprotectedvirtual

Implements cgv::media::mesh::simple_mesh_base.

Definition at line 314 of file simple_mesh.h.

◆ get_attribute_ptr()

template<typename T = float>
const uint8_t * cgv::media::mesh::simple_mesh< T >::get_attribute_ptr ( attribute_type attr,
idx_type ai = 0 ) const
inlineprotectedvirtual

Implements cgv::media::mesh::simple_mesh_base.

Definition at line 292 of file simple_mesh.h.

◆ get_attribute_size()

template<typename T = float>
size_t cgv::media::mesh::simple_mesh< T >::get_attribute_size ( attribute_type attr) const
inlineprotectedvirtual

Implements cgv::media::mesh::simple_mesh_base.

Definition at line 303 of file simple_mesh.h.

◆ get_coord_size()

template<typename T = float>
uint32_t cgv::media::mesh::simple_mesh< T >::get_coord_size ( ) const
inlinevirtual

return the size of one coordinate in bytes

Implements cgv::media::mesh::simple_mesh_base.

Definition at line 334 of file simple_mesh.h.

◆ get_normals()

template<typename T = float>
const std::vector< vec3_type > & cgv::media::mesh::simple_mesh< T >::get_normals ( ) const
inline

Definition at line 354 of file simple_mesh.h.

◆ get_nr_normals()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::get_nr_normals ( ) const
inline

Definition at line 351 of file simple_mesh.h.

◆ get_nr_positions()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::get_nr_positions ( ) const
inlinevirtual

access to positions

Implements cgv::media::mesh::simple_mesh_base.

Definition at line 341 of file simple_mesh.h.

Referenced by ambo(), dual(), cgv::render::extract_mesh(), gyro(), join(), snub(), and truncate().

◆ get_nr_tangents()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::get_nr_tangents ( ) const
inline

Definition at line 360 of file simple_mesh.h.

◆ get_nr_tex_coords()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::get_nr_tex_coords ( ) const
inline

Definition at line 368 of file simple_mesh.h.

◆ get_positions()

template<typename T = float>
const std::vector< vec3_type > & cgv::media::mesh::simple_mesh< T >::get_positions ( ) const
inline

Definition at line 344 of file simple_mesh.h.

◆ gyro()

◆ has_attribute()

template<typename T = float>
bool cgv::media::mesh::simple_mesh< T >::has_attribute ( attribute_type attr) const
inlineprotectedvirtual

Implements cgv::media::mesh::simple_mesh_base.

Definition at line 281 of file simple_mesh.h.

◆ has_normals()

template<typename T = float>
bool cgv::media::mesh::simple_mesh< T >::has_normals ( ) const
inline

access to normals

Definition at line 350 of file simple_mesh.h.

Referenced by compute_vertex_normals(), cgv::render::mesh_render_info::construct(), and read().

◆ has_tangents()

template<typename T = float>
bool cgv::media::mesh::simple_mesh< T >::has_tangents ( ) const
inline

access to tangents

Definition at line 359 of file simple_mesh.h.

Referenced by cgv::render::mesh_render_info::construct().

◆ has_tex_coords()

template<typename T = float>
bool cgv::media::mesh::simple_mesh< T >::has_tex_coords ( ) const
inline

access to texture coordinates

Definition at line 367 of file simple_mesh.h.

Referenced by compute_face_tangents(), and cgv::render::mesh_render_info::construct().

◆ join()

◆ new_normal()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::new_normal ( const vec3_type & n)
inline

add a new normal and return normal index

Definition at line 348 of file simple_mesh.h.

Referenced by compute_face_normals(), construct(), construct_conway_polyhedron(), cgv::render::extract_mesh(), and read().

◆ new_position()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::new_position ( const vec3_type & p)
inline

add a new position and return position index

Definition at line 339 of file simple_mesh.h.

Referenced by ambo(), construct(), construct_conway_polyhedron(), dual(), cgv::render::extract_mesh(), gyro(), join(), read(), snub(), and truncate().

◆ new_tangent()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::new_tangent ( const vec3_type & tc)
inline

add a new tangent and return tangent index

Definition at line 357 of file simple_mesh.h.

Referenced by compute_face_tangents().

◆ new_tex_coord()

template<typename T = float>
idx_type cgv::media::mesh::simple_mesh< T >::new_tex_coord ( const vec2_type & tc)
inline

add a new texture coordinate and return texture coordinate index

Definition at line 365 of file simple_mesh.h.

Referenced by construct(), and cgv::render::extract_mesh().

◆ normal() [1/2]

template<typename T = float>
vec3_type & cgv::media::mesh::simple_mesh< T >::normal ( idx_type ni)
inline

Definition at line 352 of file simple_mesh.h.

◆ normal() [2/2]

template<typename T = float>
const vec3_type & cgv::media::mesh::simple_mesh< T >::normal ( idx_type ni) const
inline

Definition at line 353 of file simple_mesh.h.

◆ operator=() [1/2]

template<typename T>
simple_mesh< T > & cgv::media::mesh::simple_mesh< T >::operator= ( const simple_mesh< T > & sm)

assignment operator

Definition at line 581 of file simple_mesh.cxx.

References cgv::media::mesh::simple_mesh_base::operator=(), and simple_mesh().

◆ operator=() [2/2]

template<typename T>
simple_mesh< T > & cgv::media::mesh::simple_mesh< T >::operator= ( simple_mesh< T > && sm)

move assignment operator

Definition at line 593 of file simple_mesh.cxx.

References cgv::media::mesh::simple_mesh_base::operator=(), and simple_mesh().

◆ ortho()

template<typename T>
void cgv::media::mesh::simple_mesh< T >::ortho ( )

Conway ortho operator.

Definition at line 1276 of file simple_mesh.cxx.

References join().

Referenced by construct_conway_polyhedron().

◆ position() [1/2]

template<typename T = float>
vec3_type & cgv::media::mesh::simple_mesh< T >::position ( idx_type pi)
inline

Definition at line 342 of file simple_mesh.h.

◆ position() [2/2]

template<typename T = float>
const vec3_type & cgv::media::mesh::simple_mesh< T >::position ( idx_type pi) const
inline

Definition at line 343 of file simple_mesh.h.

◆ read()

template<typename T>
bool cgv::media::mesh::simple_mesh< T >::read ( const std::string & file_name)

◆ ref_positions()

template<typename T = float>
std::vector< vec3_type > & cgv::media::mesh::simple_mesh< T >::ref_positions ( )
inline

Definition at line 345 of file simple_mesh.h.

◆ snub()

◆ tangent() [1/2]

template<typename T = float>
vec3_type & cgv::media::mesh::simple_mesh< T >::tangent ( idx_type ti)
inline

Definition at line 361 of file simple_mesh.h.

◆ tangent() [2/2]

template<typename T = float>
const vec3_type & cgv::media::mesh::simple_mesh< T >::tangent ( idx_type ti) const
inline

Definition at line 362 of file simple_mesh.h.

◆ tex_coord() [1/2]

template<typename T = float>
vec2_type & cgv::media::mesh::simple_mesh< T >::tex_coord ( idx_type ti)
inline

Definition at line 369 of file simple_mesh.h.

◆ tex_coord() [2/2]

template<typename T = float>
const vec2_type & cgv::media::mesh::simple_mesh< T >::tex_coord ( idx_type ti) const
inline

Definition at line 370 of file simple_mesh.h.

◆ transform() [1/2]

template<typename T>
void cgv::media::mesh::simple_mesh< T >::transform ( const mat3_type & linear_transform,
const vec3_type & translation,
const mat3_type & inverse_linear_transform )

apply transformation to mesh with given inverse linear transformation

Definition at line 912 of file simple_mesh.cxx.

◆ transform() [2/2]

template<typename T>
void cgv::media::mesh::simple_mesh< T >::transform ( const mat3_type & linear_transformation,
const vec3_type & translation )

apply transformation to mesh

Definition at line 907 of file simple_mesh.cxx.

References transform().

Referenced by transform().

◆ truncate()

◆ write()

template<typename T>
bool cgv::media::mesh::simple_mesh< T >::write ( const std::string & file_name) const

write simple mesh to file (currently only obj is supported)

Definition at line 779 of file simple_mesh.cxx.

References cgv::media::mesh::simple_mesh_base::begin_corner(), and cgv::media::mesh::simple_mesh_base::end_corner().

◆ simple_mesh_obj_reader< T >

template<typename T = float>
friend class simple_mesh_obj_reader< T >
friend

Definition at line 274 of file simple_mesh.h.

Member Data Documentation

◆ normals

template<typename T = float>
std::vector<vec3_type> cgv::media::mesh::simple_mesh< T >::normals
protected

Definition at line 278 of file simple_mesh.h.

◆ positions

template<typename T = float>
std::vector<vec3_type> cgv::media::mesh::simple_mesh< T >::positions
protected

Definition at line 277 of file simple_mesh.h.

◆ tangents

template<typename T = float>
std::vector<vec3_type> cgv::media::mesh::simple_mesh< T >::tangents
protected

Definition at line 279 of file simple_mesh.h.

◆ tex_coords

template<typename T = float>
std::vector<vec2_type> cgv::media::mesh::simple_mesh< T >::tex_coords
protected

Definition at line 280 of file simple_mesh.h.


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