MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / add_block_collection

Function add_block_collection

tests/model/test-brep.cpp:317–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317geode::uuid add_block_collection(
318 const geode::BRep& model, geode::BRepBuilder& builder )
319{
320 geode::uuid block_uuid;
321 block_uuid = builder.add_block_collection();
322 builder.set_block_collection_name( block_uuid, "block_collection1" );
323 const auto& temp_collection =
324 model.block_collection( builder.add_block_collection() );
325 builder.remove_block_collection( temp_collection );
326 const auto message = absl::StrCat( "BRep should have 1 block collections" );
327 geode::OpenGeodeModelException::test(
328 model.nb_block_collections() == 1, message );
329 geode::OpenGeodeModelException::test(
330 geode::detail::count_range_elements( model.block_collections() ) == 1,
331 message );
332 geode::OpenGeodeModelException::test(
333 model.block_collection( block_uuid ).name() == "block_collection1",
334 "Wrong BlockCollection name" );
335 geode::OpenGeodeModelException::test(
336 model.nb_active_block_collections() == 1, message );
337 builder.set_block_collection_active( block_uuid, false );
338 geode::OpenGeodeModelException::test(
339 model.nb_active_block_collections() == 0,
340 "BRep should have 0 active block collection" );
341 geode::OpenGeodeModelException::test( model.nb_block_collections() == 1,
342 "BRep should still have 1 block collection" );
343 return block_uuid;
344}
345
346void add_corner_line_boundary_relation( const geode::BRep& model,
347 geode::BRepBuilder& builder,

Callers 1

testFunction · 0.70

Calls 10

count_range_elementsFunction · 0.85
add_block_collectionMethod · 0.80
nb_block_collectionsMethod · 0.80
block_collectionsMethod · 0.80
nameMethod · 0.80
testFunction · 0.70

Tested by

no test coverage detected