| 247 | } |
| 248 | |
| 249 | void GcodeToolsLibrary::addNewToolFromFile_() |
| 250 | { |
| 251 | const auto folderPath = getFolder_(); |
| 252 | if ( folderPath.empty() ) |
| 253 | return; |
| 254 | |
| 255 | auto path = openFileDialog( { .filters = MeshLoad::getFilters() } ); |
| 256 | if ( path.empty() ) |
| 257 | return; |
| 258 | |
| 259 | auto loadRes = MeshLoad::fromAnySupportedFormat( path ); |
| 260 | if ( !loadRes ) |
| 261 | return; |
| 262 | |
| 263 | toolMesh_ = std::make_shared<ObjectMesh>(); |
| 264 | toolMesh_->setName( utf8string( path.filename().stem() ) ); |
| 265 | toolMesh_->setMesh( std::make_shared<Mesh>( *loadRes ) ); |
| 266 | (void)MeshSave::toMrmesh( *loadRes, folderPath / ( toolMesh_->name() + ".mrmesh" ) ); //TODO: process potential error |
| 267 | endMillTool_.reset(); |
| 268 | selectedFileName_ = toolMesh_->name(); |
| 269 | } |
| 270 | |
| 271 | void GcodeToolsLibrary::addNewToolFromMesh_( const std::shared_ptr<ObjectMesh>& objMesh ) |
| 272 | { |
nothing calls this directly
no test coverage detected