MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / fromSceneStepFile

Function fromSceneStepFile

source/MRIOExtras/MRStep.cpp:1010–1038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1008};
1009
1010Expected<std::shared_ptr<Object>> fromSceneStepFile( const std::filesystem::path& path, const MeshLoadSettings& settings, const StepLoadSettings& stepSettings )
1011{
1012 return fromSceneStepFileImpl( [&] ( STEPControl_Reader& reader )
1013 {
1014 return readFromFile( reader, path )
1015#if !STEP_READER_FIXED
1016 .and_then( [&] { return repairStepFile( reader ); } )
1017#endif
1018 ;
1019 }, settings, stepSettings )
1020#ifndef MRIOEXTRAS_OPENCASCADE_USE_XDE
1021 .and_then( [&] ( std::shared_ptr<Object> result ) -> Expected<std::shared_ptr<Object>>
1022 {
1023 result->setName( utf8string( path.stem() ) );
1024
1025 auto counter = 0;
1026 for ( auto& objMesh : getAllObjectsInTree<ObjectMesh>( result.get() ) )
1027 objMesh->setName( fmt::format( "Solid{}", ++counter ) );
1028
1029 auto sceneObj = std::make_shared<Object>();
1030 sceneObj->setName( "Root" );
1031 sceneObj->select( true );
1032 sceneObj->addChild( std::move( result ) );
1033
1034 return sceneObj;
1035 } )
1036#endif
1037 ;
1038}
1039
1040Expected<std::shared_ptr<Object>> fromSceneStepFile( std::istream& in, const MeshLoadSettings& settings, const StepLoadSettings& stepSettings )
1041{

Callers 1

loadSceneFromStpFunction · 0.85

Calls 8

fromSceneStepFileImplFunction · 0.85
readFromFileFunction · 0.85
repairStepFileFunction · 0.85
utf8stringFunction · 0.85
addChildMethod · 0.80
readFromStreamFunction · 0.70
getMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected