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

Method add_attribute

tools/Wires/Attributes/WireAttributes.cpp:40–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void WireAttributes::add_attribute(const WireNetwork& wire_network,
41 const std::string& name, bool vertex_wise, bool auto_compute) {
42 AttrMap::const_iterator itr = m_attr_map.find(name);
43 if (itr != m_attr_map.end()) {
44 throw_attribute_exists_error(name);
45 }
46
47 WireAttribute::Ptr attribute = WireAttribute::create(name,
48 vertex_wise ? WireAttribute::VERTEX : WireAttribute::EDGE);
49 if (auto_compute) attribute->compute(wire_network);
50
51 m_attr_map[name] = attribute;
52}
53
54void WireAttributes::set_attribute(const WireNetwork& wire_network,
55 const std::string& name, const MatrixFr& values) {

Callers 15

compute_cell_sizeMethod · 0.45
initialize_2D_gridMethod · 0.45
initialize_3D_gridMethod · 0.45
check_meshMethod · 0.45
check_meshMethod · 0.45
initializeMethod · 0.45
save_meshFunction · 0.45
save_meshMethod · 0.45
save_meshMethod · 0.45
update_meshMethod · 0.45

Calls 4

findMethod · 0.80
endMethod · 0.45
computeMethod · 0.45

Tested by 15

TEST_FFunction · 0.36
save_meshMethod · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
inflateMethod · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36