| 251 | #ifndef MRMESH_NO_OPENVDB |
| 252 | |
| 253 | void pythonAddVoxelsToScene( const MR::VdbVolume& model, const std::string& name ) |
| 254 | { |
| 255 | MR::CommandLoop::runCommandFromGUIThread( [&] () |
| 256 | { |
| 257 | auto newObject = std::make_shared<MR::ObjectVoxels>(); |
| 258 | newObject->construct( model ); |
| 259 | auto bins = newObject->histogram().getBins(); |
| 260 | auto minMax = newObject->histogram().getBinMinMax( bins.size() / 3 ); |
| 261 | (void)newObject->setIsoValue( minMax.first ); //TODO: process potential error |
| 262 | newObject->setName( name ); |
| 263 | MR::SceneRoot::get().addChild( newObject ); |
| 264 | } ); |
| 265 | } |
| 266 | |
| 267 | MR_ADD_PYTHON_CUSTOM_DEF( mrviewerpy, SceneVoxels, [] ( pybind11::module_& m ) |
| 268 | { |
nothing calls this directly
no test coverage detected