File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 4141 .def( pybind11::init< Point< dimension >, \
4242 std::array< index_t , dimension >, \
4343 std::array< Vector< dimension >, dimension > >() ) \
44+ .def( " vertex_attribute_manager" , \
45+ &Grid##dimension##D::grid_vertex_attribute_manager, \
46+ pybind11::return_value_policy::reference ) \
4447 .def( " native_extension" , \
4548 &LightRegularGrid##dimension##D::native_extension )
4649
Original file line number Diff line number Diff line change @@ -249,6 +249,14 @@ def test_attribute( grid ):
249249 raise ValueError ( "[Test] Wrong attribute value" )
250250 if attribute .value ( grid .nb_cells () - 1 ) != - 1 :
251251 raise ValueError ( "[Test] Wrong attribute value" )
252+ attribute = grid .vertex_attribute_manager ().find_or_create_attribute_variable_double ( "toto_vertex" , 1 )
253+ attribute .set_value ( 10 , 10 )
254+ if attribute .value ( 0 ) != 1 :
255+ raise ValueError ( "[Test] Wrong attribute value" )
256+ if attribute .value ( 10 ) != 10 :
257+ raise ValueError ( "[Test] Wrong attribute value" )
258+ if attribute .value ( grid .nb_cells () - 1 ) != 1 :
259+ raise ValueError ( "[Test] Wrong attribute value" )
252260
253261def test_io (grid , filename ):
254262 mesh .save_light_regular_grid3D (grid , filename )
Original file line number Diff line number Diff line change @@ -79,10 +79,11 @@ namespace geode
7979 std::dynamic_pointer_cast< ReadOnlyAttribute< T > >(
8080 find_attribute_base ( name ) );
8181 OPENGEODE_EXCEPTION ( attribute.get (),
82- " [AttributeManager::find_attribute] You have to create an "
83- " attribute before using it. "
84- " See find_or_create_attribute method and "
85- " derived classes of ReadOnlyAttribute." );
82+ " [AttributeManager::find_attribute] Could not find attribute '" ,
83+ name,
84+ " '. You have to create an attribute before using it. See "
85+ " find_or_create_attribute method and derived classes of "
86+ " ReadOnlyAttribute." );
8687 return attribute;
8788 }
8889
You can’t perform that action at this time.
0 commit comments