int
main(int, char *[])
{
using CellTraits = MeshType::CellTraits;
using CellType = MeshType::CellType;
using CellAutoPointer = CellType::CellAutoPointer;
MeshType::CoordRepType testPointCoords[4][3] = {
{ 0, 0, 0 }, { 9, 0, 0 }, { 9, 9, 0 }, { 0, 0, 9 }
};
MeshType::PointIdentifier tetraPoints[4] = { 0, 1, 2, 4 };
int i;
for (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;
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;
}