MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / to_vtk_attribute

Method to_vtk_attribute

splashsurf_lib/src/mesh.rs:1408–1419  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1406 #[cfg(feature = "vtk_extras")]
1407 #[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
1408 fn to_vtk_attribute(&self) -> Attribute {
1409 match &self.data {
1410 OwnedAttributeData::ScalarU64(u64_vec) => {
1411 Attribute::scalars(&self.name, 1).with_data(u64_vec.clone().into_owned())
1412 }
1413 OwnedAttributeData::ScalarReal(real_vec) => {
1414 Attribute::scalars(&self.name, 1).with_data(real_vec.clone().into_owned())
1415 }
1416 OwnedAttributeData::Vector3Real(vec3r_vec) => Attribute::scalars(&self.name, 3)
1417 .with_data(vec3r_vec.iter().flatten().copied().collect::<Vec<R>>()),
1418 }
1419 }
1420}
1421
1422impl<'a, R: Real> AttributeData<'a, R> {

Callers 1

unstructured_gridMethod · 0.80

Calls 2

cloneMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected