diff --git a/Tests/CPP_Bindings/Source/UnitTest_Utilities.cpp b/Tests/CPP_Bindings/Source/UnitTest_Utilities.cpp index f2b9abb24..f174da7ee 100644 --- a/Tests/CPP_Bindings/Source/UnitTest_Utilities.cpp +++ b/Tests/CPP_Bindings/Source/UnitTest_Utilities.cpp @@ -273,13 +273,6 @@ namespace Lib3MF void CompareVolumeData(Lib3MF::PModel modelA, Lib3MF::PVolumeData A, Lib3MF::PModel modelB, Lib3MF::PVolumeData B) { - ASSERT_EQ(A->GetBoundary() == nullptr, B->GetBoundary() == nullptr); - if(A->GetBoundary()) - { - CompareFunctionReferences(modelA, A->GetBoundary(), modelB, - B->GetBoundary()); - } - ASSERT_EQ(A->GetColor() == nullptr, B->GetColor() == nullptr); if(A->GetColor()) { diff --git a/Tests/CPP_Bindings/Source/Volumetric.cpp b/Tests/CPP_Bindings/Source/Volumetric.cpp index 1d4902ed9..0ed7a7d7e 100644 --- a/Tests/CPP_Bindings/Source/Volumetric.cpp +++ b/Tests/CPP_Bindings/Source/Volumetric.cpp @@ -387,8 +387,10 @@ namespace Lib3MF newFunction->AddLink(subNodeOutputResult, output); auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); - auto theBoundary = volumeData->CreateNewBoundary(newFunction.get()); + // auto volumeData = theMesh->VolumeData(); + // auto theBoundary = volumeData->CreateNewBoundary(newFunction.get()); + auto theBoundary = model->AddBoundaryShape(); + theBoundary->SetMesh(theMesh); // Write to file writer3MF->WriteToFile(Volumetric::OutFolder + @@ -473,8 +475,8 @@ namespace Lib3MF output->SetReference("distance_2.result"); auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); - auto theBoundary = volumeData->CreateNewBoundary(newFunction.get()); + auto theBoundary = model->AddBoundaryShape(); + theBoundary->SetMesh(theMesh); theBoundary->SetFallBackValue(-1.2345); // Write to file @@ -501,7 +503,7 @@ namespace Lib3MF meshesFromWrittenFile->GetCurrentMeshObject(); // Check the fallback value - auto volumeDataFromWrittenFile = meshFromWrittenFile->VolumeData(); + auto volumeDataFromWrittenFile = meshFromWrittenFile->GetVolumeData(); auto boundaryFromWrittenFile = volumeDataFromWrittenFile->GetBoundary(); EXPECT_EQ(boundaryFromWrittenFile->GetFallBackValue(), -1.2345); @@ -515,8 +517,8 @@ namespace Lib3MF PImplicitFunction newFunction = helper::createGyroidFunction(*model); auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); - auto theBoundary = volumeData->CreateNewBoundary(newFunction.get()); + auto theBoundary = model->AddBoundaryShape(); + theBoundary->SetMesh(theMesh); // write to file writer3MF->WriteToFile(Volumetric::OutFolder + "ImplicitGyroid.3mf"); @@ -595,8 +597,9 @@ namespace Lib3MF output->SetReference("subtraction.result"); auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); - auto theBoundary = volumeData->CreateNewBoundary(newFunction.get()); + auto theBoundary = model->AddBoundaryShape(); + theBoundary->SetMesh(theMesh); + theBoundary->SetMinFeatureSize(0.1); theBoundary->SetChannelName("shape"); @@ -737,8 +740,8 @@ namespace Lib3MF // Add a boundary to the volume data auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); - auto theBoundary = volumeData->CreateNewBoundary(newFunction.get()); + auto theBoundary = model->AddBoundaryShape(); + theBoundary->SetMesh(theMesh); theBoundary->SetMinFeatureSize(0.1); theBoundary->SetChannelName("shape"); @@ -844,8 +847,9 @@ namespace Lib3MF implicitFunction->AddLinkByNames("functionCall.color", "outputs.color"); auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); + auto volumeData = model->AddVolumeData(); auto theColor = volumeData->CreateNewColor(implicitFunction.get()); + theMesh->SetVolumeData(volumeData); // Set transformation auto transformation = @@ -910,10 +914,14 @@ namespace Lib3MF // add volume data auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); + auto volumeData = model->AddVolumeData(); + // Add boundary - auto boundary = volumeData->CreateNewBoundary(funcFromImage3d.get()); + auto boundary = model->AddBoundaryShape(); + boundary->SetMesh(theMesh); + boundary->SetFunction(funcFromImage3d.get()); + boundary->SetTransform( helper::ComputeTransformFromMeshCoordinatesToUVW(theMesh)); boundary->SetChannelName("red"); @@ -989,7 +997,8 @@ namespace Lib3MF // add volume data auto theMesh = GetMesh(); - auto volumeData = theMesh->VolumeData(); + auto volumeData = model->AddVolumeData(); + theMesh->SetVolumeData(volumeData); // Add property auto property =