15 #include "boost/bind.hpp"
26 ToolMetricRep::ToolMetricRep()
29 mViewportListener->setCallback(boost::bind(&ToolMetricRep::rescale,
this));
43 mViewportListener->startListen(view->getRenderer());
50 mViewportListener->stopListen();
55 return boost::dynamic_pointer_cast<ToolMetric>(
mMetric);
62 if (!metric || !metric->isValid() || !this->getView())
65 if (!mAxes || !mToolTip || !mToolOffset)
72 mAxes->setFontSize(0.04);
73 mAxes->setAxisLength(0.05);
75 mAxes->setShowAxesLabels(
false);
82 mToolTip->setValue(toolTip_r);
83 mToolTip->setColor(
mMetric->getColor());
85 mToolOffset->setValue(p0_r, toolTip_r);
86 mToolOffset->setColor(
mMetric->getColor());
88 mAxes->setTransform(metric->getRefFrame());
93 void ToolMetricRep::rescale()
98 double size = mViewportListener->getVpnZoom(this->getToolMetric()->getCoordinate());
100 mToolTip->setRadius(sphereSize);