int main( int , char *[] )
{
using SurfacePointer = SurfaceType::Pointer;
using SurfacePointType = SurfaceType::SurfacePointType;
using CovariantVectorType = SurfaceType::CovariantVectorType;
SurfacePointer surface = SurfaceType::New();
SurfaceType::SurfacePointListType list;
for( unsigned int i=0; i<3; i++)
{
SurfacePointType p;
pnt[0] = i;
pnt[1] = i+1;
pnt[2] = i+2;
p.SetPositionInObjectSpace(pnt);
p.SetColor(1,0,0,1);
CovariantVectorType normal;
for(unsigned int j=0;j<3;j++)
{
normal[j]=j;
}
p.SetNormalInObjectSpace(normal);
list.push_back(p);
}
surface->GetProperty().SetName("Surface1");
surface->SetId(1);
surface->SetPoints(list);
surface->Update();
SurfaceType::SurfacePointListType pointList = surface->GetPoints();
std::cout << "Number of points representing the surface: ";
std::cout << pointList.size() << std::endl;
SurfaceType::SurfacePointListType::const_iterator it
= surface->GetPoints().begin();
while(it != surface->GetPoints().end())
{
std::cout << "Position = " << (*it).GetPositionInObjectSpace()
<< std::endl;
std::cout << "Normal = " << (*it).GetNormalInObjectSpace() << std::endl;
std::cout << "Color = " << (*it).GetColor() << std::endl;
std::cout << std::endl;
it++;
}
return EXIT_SUCCESS;
}