44 std::vector<Vector3D> RegionOfInterest::transform(
const std::vector<Vector3D>& points,
Transform3D M)
const
46 std::vector<Vector3D> retval;
47 for (
unsigned i=0; i<points.size(); ++i)
48 retval.push_back(M.coord(points[i]));
52 DoubleBoundingBox3D RegionOfInterest::generateROIFromPointsAndMargin(
const std::vector<Vector3D>& points,
double margin)
const
58 Vector3D vmargin(margin,margin, margin);
59 Vector3D bl = bb.bottomLeft() - vmargin;
60 Vector3D tr = bb.topRight() + vmargin;
61 bb = DoubleBoundingBox3D(bl, tr);
71 DataMetric(uid, name, dataManager, spaceProvider)
73 mUseActiveTooltip =
false;
101 for (
unsigned i=0; i<mContainedData.size(); ++i)
104 adder.
addTextToElement(
"useActiveTooltip", QString::number(mUseActiveTooltip));
119 this->onContentChanged();
129 mContainedData = val;
130 this->onContentChanged();
135 mUseActiveTooltip = val;
137 this->onContentChanged();
143 this->onContentChanged();
148 mMaxBoundsData = val;
149 this->onContentChanged();
152 void RegionOfInterestMetric::onContentChanged()
154 for (
unsigned i=0; i<mListeners.size(); ++i)
156 disconnect(mListeners[i].get(), &
SpaceListener::changed,
this, &RegionOfInterestMetric::onContentTransformsChanged);
161 for (
unsigned i=0; i<mContainedData.size(); ++i)
163 this->listenTo(CoordinateSystem(
csDATA, mContainedData[i]));
165 this->onContentTransformsChanged();
168 void RegionOfInterestMetric::listenTo(CoordinateSystem space)
171 listener->setSpace(space);
172 connect(listener.get(), &
SpaceListener::changed,
this, &RegionOfInterestMetric::onContentTransformsChanged);
173 mListeners.push_back(listener);
176 void RegionOfInterestMetric::onContentTransformsChanged()
204 if (mUseActiveTooltip)
206 retval.
mPoints.push_back(this->getToolTip_r());
209 std::map<QString, DataPtr> alldata =
mDataManager->getDatas();
210 for (std::map<QString, DataPtr>::const_iterator i=alldata.begin(); i!=alldata.end(); ++i)
212 if (boost::dynamic_pointer_cast<RegionOfInterestMetric>(i->second))
215 if (mContainedData.contains(i->first))
217 std::vector<Vector3D> c = i->second->getPointCloud();
219 std::copy(c.begin(), c.end(), back_inserter(retval.
mPoints));
222 if (mMaxBoundsData == i->first)
224 std::vector<Vector3D> c = i->second->getPointCloud();
233 Vector3D RegionOfInterestMetric::getToolTip_r()
const