9#ifndef IGL_MSH_LOADER_H
10#define IGL_MSH_LOADER_H
31 return this->tag==a.
tag &&
36 return (this->tag*100+this->el_type) <
96 return m_node_fields_components[c];
107 return m_element_fields_components[c];
111 return (std::find(std::begin(m_node_fields_names),
112 std::end(m_node_fields_names),
113 fieldname) != std::end(m_node_fields_names) );
117 return (std::find(std::begin(m_element_fields_names),
118 std::end(m_element_fields_names),
119 fieldname) != std::end(m_node_fields_names) );
132 return m_structure_index;
138 return m_structure_length;
152 void parse_nodes(std::ifstream& fin);
153 void parse_elements(std::ifstream& fin);
154 void parse_node_field(std::ifstream& fin);
155 void parse_element_field(std::ifstream& fin);
156 void parse_unknown_field(std::ifstream& fin,
157 const std::string& fieldname);
188#ifndef IGL_STATIC_LIBRARY
189# include "MshLoader.cpp"
Class for loading information from .msh file depends only on c++stl library.
Definition MshLoader.h:23
MshLoader(const std::string &filename)
Load a .msh file from a given path.
const IntVector & get_node_fields_components() const
Definition MshLoader.h:92
const IndexVector & get_elements_nodes_idx() const
Definition MshLoader.h:85
bool is_node_field(const std::string &fieldname) const
Definition MshLoader.h:110
const IntVector & get_elements_types() const
Definition MshLoader.h:76
const StructIndex & get_structure_index() const
Definition MshLoader.h:130
std::vector< int > IntVector
Definition MshLoader.h:44
const FloatVector & get_nodes() const
Definition MshLoader.h:70
const FloatField & get_element_fields() const
Definition MshLoader.h:100
bool is_element_map_identity() const
bool is_element_field(const std::string &fieldname) const
Definition MshLoader.h:116
std::vector< int > IndexVector
Definition MshLoader.h:43
const IndexVector & get_elements() const
Definition MshLoader.h:73
const IntVector & get_elements_ids() const
Definition MshLoader.h:82
std::vector< FloatVector > FloatField
Definition MshLoader.h:46
std::vector< msh_struct > StructVector
Definition MshLoader.h:50
const StructVector & get_structures() const
get list of structures
Definition MshLoader.h:142
static int num_nodes_per_elem_type(int elem_type)
std::vector< std::string > FieldNames
Definition MshLoader.h:48
const FloatField & get_node_fields() const
Definition MshLoader.h:88
double Float
Definition MshLoader.h:41
std::vector< Float > FloatVector
Definition MshLoader.h:45
const FieldNames & get_node_fields_names() const
Definition MshLoader.h:90
int get_node_field_components(size_t c) const
Definition MshLoader.h:94
@ ELEMENT_PYRAMID
Definition MshLoader.h:54
@ ELEMENT_TET_2ND_ORDER
Definition MshLoader.h:57
@ ELEMENT_LINE_2ND_ORDER
Definition MshLoader.h:56
@ ELEMENT_PRISM_2ND_ORDER
Definition MshLoader.h:58
@ ELEMENT_PRISM
Definition MshLoader.h:53
@ ELEMENT_HEX
Definition MshLoader.h:53
@ ELEMENT_TRI_2ND_ORDER
Definition MshLoader.h:56
@ ELEMENT_TET
Definition MshLoader.h:53
@ ELEMENT_LINE
Definition MshLoader.h:52
@ ELEMENT_PYRAMID_2ND_ORDER
Definition MshLoader.h:59
@ ELEMENT_HEX_2ND_ORDER
Definition MshLoader.h:58
@ ELEMENT_POINT
Definition MshLoader.h:61
@ ELEMENT_TRI
Definition MshLoader.h:52
@ ELEMENT_QUAD_2ND_ORDER
Definition MshLoader.h:57
@ ELEMENT_QUAD
Definition MshLoader.h:52
int get_element_field_components(size_t c) const
Definition MshLoader.h:106
void index_structures(int tag_column)
const StructIndex & get_structure_length() const
Definition MshLoader.h:136
std::multimap< msh_struct, int > StructIndex
Definition MshLoader.h:49
const IntVector & get_element_fields_components() const
Definition MshLoader.h:104
const IntField & get_elements_tags() const
Definition MshLoader.h:80
const FieldNames & get_element_fields_names() const
Definition MshLoader.h:102
const IntVector & get_elements_lengths() const
Definition MshLoader.h:78
std::vector< IntVector > IntField
Definition MshLoader.h:47
Definition MshLoader.h:26
msh_struct(int _tag=0, int _type=0)
Definition MshLoader.h:28
int tag
Definition MshLoader.h:27
int el_type
Definition MshLoader.h:27
bool operator<(const msh_struct &a) const
Definition MshLoader.h:35
bool operator==(const msh_struct &a) const
Definition MshLoader.h:30