MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / initialize_attributes

Method initialize_attributes

src/MeshFactory.cpp:154–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void MeshFactory::initialize_attributes(MeshParser::Ptr parser) {
155 Mesh::AttributesPtr attributes = m_mesh->get_attributes();
156
157 MeshParser::AttrNames attr_names = parser->get_attribute_names();
158 for (MeshParser::AttrNames::const_iterator itr = attr_names.begin();
159 itr != attr_names.end(); itr++) {
160 const std::string& name = *itr;
161 size_t attr_size = parser->get_attribute_size(name);
162 VectorF attr_data(attr_size);
163 parser->export_attribute(name, attr_data.data());
164
165 attributes->add_empty_attribute(name);
166 attributes->set_attribute(name, attr_data);
167 }
168}
169
170void MeshFactory::compute_and_drop_zero_dim() {
171 const size_t num_vertices = m_mesh->get_num_vertices();

Callers

nothing calls this directly

Calls 8

get_attributesMethod · 0.80
get_attribute_namesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
get_attribute_sizeMethod · 0.45
export_attributeMethod · 0.45
add_empty_attributeMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected