int main(int, char * [] )
{
typedef MeshType::CellTraits CellTraits;
typedef MeshType::PointType PointType;
typedef MeshType::CellType CellType;
typedef CellType::CellAutoPointer 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(
MeshType::CellsAllocatedDynamicallyCellByCell );
CellAutoPointer testCell1;
testCell1.TakeOwnership( new TetraCellType );
testCell1->SetPointIds(tetraPoints);
myMesh->SetCell(0, testCell1 );
myMeshSpatialObject->SetMesh(myMesh);
myMeshSpatialObject->GetMesh();
std::cout << "Mesh bounds : " <<
myMeshSpatialObject->GetBoundingBox()->GetBounds() << std::endl;
MeshSpatialObjectType::PointType myPhysicalPoint;
myPhysicalPoint.Fill(1);
std::cout << "Is my physical point inside? : " <<
myMeshSpatialObject->IsInside(myPhysicalPoint) << std::endl;
writer->SetInput(myMeshSpatialObject);
writer->SetFileName("myMesh.meta");
writer->Update();
reader->SetFileName("myMesh.meta");
reader->Update();
SpatialObjectToImageFilterType;
imageFilter->SetInput( reader->GetGroup() );
imageFilter->Update();
return EXIT_SUCCESS;
}