int main( int , char *[] )
{
typedef LineType::Pointer LinePointer;
LinePointer Line = LineType::New();
LineType::PointListType list;
for(unsigned int i=0; i<3; i++)
{
LinePointType p;
p.SetPosition(i,i+1,i+2);
p.SetColor(1,0,0,1);
VectorType normal1;
VectorType normal2;
for(unsigned int j=0;j<3;j++)
{
normal1[j]=j;
normal2[j]=j*2;
}
p.SetNormal(normal1,0);
p.SetNormal(normal2,1);
list.push_back(p);
}
Line->GetProperty()->SetName("Line1");
Line->SetId(1);
Line->SetPoints(list);
LineType::PointListType pointList = Line->GetPoints();
std::cout << "Number of points representing the line: ";
std::cout << pointList.size() << std::endl;
LineType::PointListType::const_iterator it = Line->GetPoints().begin();
while(it != Line->GetPoints().end())
{
std::cout << "Position = " << (*it).GetPosition() << std::endl;
std::cout << "Color = " << (*it).GetColor() << std::endl;
std::cout << "First normal = " << (*it).GetNormal(0) << std::endl;
std::cout << "Second normal = " << (*it).GetNormal(1) << std::endl;
std::cout << std::endl;
it++;
}
return 0;
}