int
main(int, char *[])
{
using VesselTubePointType = VesselTubeType::TubePointType;
using PointType = VesselTubeType::PointType;
auto vesselTube = VesselTubeType::New();
VesselTubeType::TubePointListType list;
for (unsigned int i = 0; i < 5; ++i)
{
VesselTubePointType p;
PointType pnt;
pnt[0] = i;
pnt[1] = i + 1;
pnt[2] = i + 2;
p.SetPositionInObjectSpace(pnt);
p.SetRadiusInObjectSpace(1);
p.SetAlpha1(i);
p.SetAlpha2(i + 1);
p.SetAlpha3(i + 2);
p.SetMedialness(i);
p.SetRidgeness(i);
p.SetBranchness(i);
p.SetColor(1, 0, 0, 1);
list.push_back(p);
}
vesselTube->GetProperty().SetName("VesselTube");
vesselTube->SetId(1);
vesselTube->SetPoints(list);
vesselTube->Update();
const VesselTubeType::TubePointListType pointList = vesselTube->GetPoints();
std::cout << "Number of points representing the blood vessel: ";
std::cout << pointList.size() << std::endl;
{
unsigned int i = 0;
for (auto & currentPoint : vesselTube->GetPoints())
{
std::cout << std::endl;
std::cout << "Point #" << i << std::endl;
std::cout << "Position: " << currentPoint.GetPositionInObjectSpace()
<< std::endl;
std::cout << "Radius: " << currentPoint.GetRadiusInObjectSpace()
<< std::endl;
std::cout << "Medialness: " << currentPoint.GetMedialness()
<< std::endl;
std::cout << "Ridgeness: " << currentPoint.GetRidgeness() << std::endl;
std::cout << "Branchness: " << currentPoint.GetBranchness()
<< std::endl;
std::cout << "Alpha1: " << currentPoint.GetAlpha1() << std::endl;
std::cout << "Alpha2: " << currentPoint.GetAlpha2() << std::endl;
std::cout << "Alpha3: " << currentPoint.GetAlpha3() << std::endl;
std::cout << "Color = " << currentPoint.GetColor() << std::endl;
++i;
}
}
return EXIT_SUCCESS;
}
Representation of a tube based on the spatial object classes.