int
main(int, char *[])
{
using CellTraits = MeshType::CellTraits;
using CellType = MeshType::CellType;
using CellAutoPointer = CellType::CellAutoPointer;
constexpr MeshType::CoordinateType testPointCoords[4][3] = {
{ 0, 0, 0 }, { 9, 0, 0 }, { 9, 9, 0 }, { 0, 0, 9 }
};
MeshType::PointIdentifier tetraPoints[4] = { 0, 1, 2, 4 };
for (int i = 0; i < 4; ++i)
{
myMesh->SetPoint(i,
PointType(testPointCoords[i]));
}
myMesh->SetCellsAllocationMethod(
CellsAllocatedDynamicallyCellByCell);
CellAutoPointer testCell1;
testCell1.TakeOwnership(new TetraCellType);
testCell1->SetPointIds(tetraPoints);
myMesh->SetCell(0, testCell1);
myMeshSpatialObject->SetMesh(myMesh);
myMeshSpatialObject->Update();
myMeshSpatialObject->GetMesh();
std::cout
<< "Mesh bounds : "
<< myMeshSpatialObject->GetMyBoundingBoxInWorldSpace()->GetBounds()
<< std::endl;
auto myPhysicalPoint = itk::MakeFilled<MeshSpatialObjectType::PointType>(1);
std::cout << "Is my physical point inside? : "
<< myMeshSpatialObject->IsInsideInWorldSpace(myPhysicalPoint)
<< std::endl;
writer->SetInput(myMeshSpatialObject);
writer->SetFileName("myMesh.meta");
writer->Update();
reader->SetFileName("myMesh.meta");
reader->Update();
using SpatialObjectToImageFilterType =
imageFilter->SetInput(reader->GetGroup());
imageFilter->Update();
return EXIT_SUCCESS;
}