| 331 | } |
| 332 | |
| 333 | void test_attribute( const geode::LightRegularGrid3D& grid ) |
| 334 | { |
| 335 | auto attribute = |
| 336 | grid.cell_attribute_manager() |
| 337 | .find_or_create_attribute< geode::VariableAttribute, double >( |
| 338 | "toto", -1 ); |
| 339 | attribute->set_value( 10, 10 ); |
| 340 | geode::OpenGeodeMeshException::test( |
| 341 | attribute->value( 0 ) == -1, "Wrong attribute value" ); |
| 342 | geode::OpenGeodeMeshException::test( |
| 343 | attribute->value( 10 ) == 10, "Wrong attribute value" ); |
| 344 | geode::OpenGeodeMeshException::test( |
| 345 | attribute->value( grid.nb_cells() - 1 ) == -1, |
| 346 | "Wrong attribute value" ); |
| 347 | } |
| 348 | |
| 349 | void test_io( |
| 350 | const geode::LightRegularGrid3D& grid, const std::string& filename ) |