int main(int, char *[])
{
PointSetType::Pointer pointSet = PointSetType::New();
PointSetType::PixelType pixel;
PointSetType::PointType point;
unsigned int pointId = 0;
const double radius = 3.0;
for(unsigned int i=0; i<360; i++)
{
point[0] = radius * vcl_sin( angle );
point[1] = radius * vcl_cos( angle );
point[2] = 1.0;
pixel.SetRed( point[0] * 2.0 );
pixel.SetGreen( point[1] * 2.0 );
pixel.SetBlue( point[2] * 2.0 );
pointSet->SetPoint( pointId, point );
pointSet->SetPointData( pointId, pixel );
pointId++;
}
typedef PointSetType::PointsContainer::ConstIterator PointIterator;
PointIterator pointIterator = pointSet->GetPoints()->Begin();
PointIterator pointEnd = pointSet->GetPoints()->End();
while( pointIterator != pointEnd )
{
point = pointIterator.Value();
std::cout << point << std::endl;
++pointIterator;
}
typedef PointSetType::PointDataContainer::ConstIterator PointDataIterator;
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
PointDataIterator pixelEnd = pointSet->GetPointData()->End();
while( pixelIterator != pixelEnd )
{
pixel = pixelIterator.Value();
std::cout << pixel << std::endl;
++pixelIterator;
}
return 0;
}