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

Method add_property

src/IO/PLYParser.cpp:148–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void PLYParser::add_property(const std::string& elem_name,
149 const std::string& prop_name, size_t size) {
150 if (elem_name == "vertex") {
151 m_num_vertices = size;
152 } else if (elem_name == "face") {
153 m_num_faces = size;
154 } else if (elem_name == "voxel") {
155 m_num_voxels = size;
156 }
157
158 std::string attr_name = form_attribute_name(elem_name, prop_name);
159 AttributeMap::const_iterator itr = m_attributes.find(attr_name);
160 if (itr == m_attributes.end()) {
161 m_attributes[attr_name] = std::vector<Float>();
162 } else {
163 std::stringstream err_msg;
164 err_msg << "Duplicated property name: " << prop_name << std::endl;
165 err_msg << "PyMesh requires unique custom property names";
166 throw IOError(err_msg.str());
167 }
168}
169
170void PLYParser::add_property_value(const std::string& elem_name,
171 const std::string& prop_name, Float value) {

Callers 1

parse_plyFunction · 0.80

Calls 5

form_attribute_nameFunction · 0.85
IOErrorClass · 0.85
findMethod · 0.80
endMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected