17 #include <vtkVectorText.h>
18 #include <vtkFollower.h>
19 #include <vtkPolyDataMapper.h>
20 #include <vtkProperty.h>
21 #include <vtkRenderer.h>
22 #include <vtkCamera.h>
23 #include <vtkRenderWindow.h>
25 #include "vtkTextActor.h"
38 AngleMetricRep::AngleMetricRep()
52 return boost::dynamic_pointer_cast<AngleMetric>(
mMetric);
59 if (!angleMetric || !
mMetric->isValid())
66 std::vector<Vector3D> p = angleMetric->getEndpoints();
68 if (angleMetric->getUseSimpleVisualization())
79 mLine0->setColor(
mMetric->getColor());
80 mLine0->setStipple(0x0F0F);
81 mLine0->setValue(p[0], p[1]);
87 mLine1->setColor(
mMetric->getColor());
88 mLine1->setStipple(0x0F0F);
89 mLine1->setValue(p[2], p[3]);
96 mArc->setColor(
mMetric->getColor());
97 mArc->setStipple(0xF0FF);
98 Vector3D a_center = (p[1] + p[2]) / 2;
101 double d = (l0.length() + l1.length()) / 2 * 0.5;
102 Vector3D a_start = a_center + l0.normalized() * d;
103 Vector3D a_end = a_center + l1.normalized() * d;
104 mArc->setValue(a_start, a_end, a_center);