int main( int , char *[] )
{
unsigned int i;
typedef TubeType::Pointer TubePointer;
typedef TubePointType::CovariantVectorType
VectorType;
TubePointer tube = TubeType::New();
TubeType::PointListType list;
for (i=0; i<5; ++i)
{
TubePointType p;
p.SetPosition(i,i+1,i+2);
p.SetRadius(1);
VectorType normal1;
VectorType normal2;
for (unsigned int j=0; j<3; ++j)
{
normal1[j]=j;
normal2[j]=j*2;
}
p.SetNormal1(normal1);
p.SetNormal2(normal2);
p.SetColor(1,0,0,1);
list.push_back(p);
}
tube->GetProperty()->SetName("Tube1");
tube->SetId(1);
tube->SetPoints(list);
TubeType::PointListType pointList = tube->GetPoints();
std::cout << "Number of points representing the tube: ";
std::cout << pointList.size() << std::endl;
tube->ComputeTangentAndNormals();
TubeType::PointListType::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).GetPosition() << std::endl;
std::cout << "Radius: " << (*it).GetRadius() << std::endl;
std::cout << "Tangent: " << (*it).GetTangent() << std::endl;
std::cout << "First Normal: " << (*it).GetNormal1() << std::endl;
std::cout << "Second Normal: " << (*it).GetNormal2() << std::endl;
std::cout << "Color = " << (*it).GetColor() << std::endl;
it++;
i++;
}
return EXIT_SUCCESS;
}