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