int
main(int, char *[])
{
unsigned int i;
using TubePointType = TubeType::TubePointType;
using CovariantVectorType = TubePointType::CovariantVectorType;
TubeType::TubePointListType list;
for (i = 0; i < 5; ++i)
{
TubePointType p;
pnt[0] = i;
pnt[1] = i + 1;
pnt[2] = i + 2;
p.SetPositionInObjectSpace(pnt);
p.SetRadiusInObjectSpace(1);
CovariantVectorType normal1;
CovariantVectorType normal2;
for (unsigned int j = 0; j < 3; ++j)
{
normal1[j] = j;
normal2[j] = j * 2;
}
p.SetNormal1InObjectSpace(normal1);
p.SetNormal2InObjectSpace(normal2);
p.SetColor(1, 0, 0, 1);
list.push_back(p);
}
tube->GetProperty().SetName("Tube1");
tube->SetId(1);
tube->SetPoints(list);
tube->Update();
TubeType::TubePointListType pointList = tube->GetPoints();
std::cout << "Number of points representing the tube: ";
std::cout << pointList.
size() << std::endl;
tube->ComputeTangentsAndNormals();
TubeType::TubePointListType::const_iterator it = tube->GetPoints().begin();
i = 0;
while (it != tube->GetPoints().end())
{
std::cout << std::endl;
std::cout << "Point #" << i << std::endl;
std::cout << "Position: " << (*it).GetPositionInObjectSpace()
<< std::endl;
std::cout << "Radius: " << (*it).GetRadiusInObjectSpace() << std::endl;
std::cout << "Tangent: " << (*it).GetTangentInObjectSpace() << std::endl;
std::cout << "First Normal: " << (*it).GetNormal1InObjectSpace()
<< std::endl;
std::cout << "Second Normal: " << (*it).GetNormal2InObjectSpace()
<< std::endl;
std::cout << "Color = " << (*it).GetColor() << std::endl;
it++;
i++;
}
return EXIT_SUCCESS;
}