25 namespace VolumeVisualization {
35 const std::string&
tag) {
37 auto identity = std::make_shared<Transform3D>(Transform3D::Identity());
39 std::stringstream cStream;
41 double halfPhiSector =
M_PI / 4.;
46 auto write = [&](
const std::string& path,
bool clear =
true) ->
void {
47 std::string wpath = path + tag;
49 helper.
write(cStream);
59 auto box = std::make_shared<CuboidVolumeBounds>(4., 3., 6.);
60 auto cuboid = std::make_shared<AbstractVolume>(
identity,
box);
62 triangulate, boxColor);
63 write(
"Volumes_CuboidVolume");
69 double cylinderInnerR = 1.;
70 double cylinderOuterR = 5.;
71 double cylinderHalfZ = 10.;
74 std::make_shared<CylinderVolumeBounds>(0., cylinderOuterR, cylinderHalfZ);
75 auto cylinder = std::make_shared<AbstractVolume>(
identity, fullCylinder);
77 72, triangulate, cylinderColor);
78 write(
"Volumes_CylinderVolumeFull");
80 auto tubeCylinder = std::make_shared<CylinderVolumeBounds>(
81 cylinderInnerR, cylinderOuterR, cylinderHalfZ);
82 cylinder = std::make_shared<AbstractVolume>(
identity, tubeCylinder);
84 72, triangulate, cylinderColor);
85 write(
"Volumes_CylinderVolumeTube");
87 tubeCylinder = std::make_shared<CylinderVolumeBounds>(
88 cylinderInnerR, cylinderOuterR, cylinderHalfZ, halfPhiSector);
89 cylinder = std::make_shared<AbstractVolume>(
identity, tubeCylinder);
91 72, triangulate, cylinderColor);
92 write(
"Volumes_CylinderVolumeTubeSector");
97 std::array<Vector3D, 8> vertices;
98 vertices = {{{0, 0, 0},
106 auto genericCuboid = std::make_shared<GenericCuboidVolumeBounds>(vertices);
107 auto generic = std::make_shared<AbstractVolume>(
identity, genericCuboid);
109 triangulate, genericColor);
110 write(
"Volumes_GenericCuboidVolume");
115 auto trapezoid = std::make_shared<TrapezoidVolumeBounds>(2., 4., 5., 6.);
116 auto trapezoidVolume = std::make_shared<AbstractVolume>(
identity, trapezoid);
118 Transform3D::Identity(), 72, triangulate,
120 write(
"Volumes_TrapezoidVolume");
122 return cStream.str();