15 #include "boost/bind.hpp"
18 #include <vtkPolyDataMapper.h>
19 #include <vtkProperty.h>
20 #include <vtkRenderer.h>
21 #include <vtkSectorSource.h>
37 mDataManager(dataManager),
47 this->
getView()->getRenderer()->RemoveActor(mCircleActor);
57 mCircleSource = vtkSectorSource::New();
59 mCircleSource->SetInnerRadius(0);
60 mCircleSource->SetStartAngle(0);
61 mCircleSource->SetEndAngle(360);
62 mCircleSource->SetCircumferentialResolution(60);
64 mapper->SetInputConnection(mCircleSource->GetOutputPort());
65 mapper->ScalarVisibilityOff();
66 mCircleActor = vtkActor::New();
67 mCircleActor->SetMapper(mapper);
68 mCircleActor->GetProperty()->LightingOff();
75 if (!mSliceProxy->getTool())
80 double toolOffset = mSliceProxy->getTool()->getTooltipOffset();
81 Transform3D rMt = mDataManager->get_rMpr()*mSliceProxy->getTool()->get_prMt();
86 Vector3D position = mSliceProxy->get_sMr() * centerRef;
87 mCircleActor->SetPosition(position[0], position[1], 0);
89 const double margin = 10;
90 double offsetDistance = (
mMetric->getRefCoord() - toolOffsetPosRef).
length();
91 double distance = (
mMetric->getRefCoord() - toolPosRef).
length();
92 double radius = 0.5 * offsetDistance + margin;
93 mCircleSource->SetOuterRadius(radius);
94 mCircleSource->SetInnerRadius(radius - mOutlineWidth);
96 if (distance < mRequestedAccuracy)
98 mCircleActor->GetProperty()->SetColor(0, 1, 1);
100 else if (offsetDistance < mRequestedAccuracy && toolOffset >= 0 && distance < 4*mRequestedAccuracy)
102 mCircleActor->GetProperty()->SetColor(0, 1, 1.0 - (distance-mRequestedAccuracy)/(3*mRequestedAccuracy));
104 else if (offsetDistance < mRequestedAccuracy && toolOffset >= 0)
106 mCircleActor->GetProperty()->SetColor(0, 1, 0);
110 mCircleActor->GetProperty()->SetColor(1, 0, 0);
119 mSliceProxy = sliceProxy;
127 mOutlineWidth = width;
133 mRequestedAccuracy = accuracy;