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);
71 DataMetric(uid, name, dataManager, spaceProvider)
73 mUseActiveTooltip =
false;
88 return this->boundingBox().center();
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)
165 this->onContentTransformsChanged();
171 listener->setSpace(space);
172 connect(listener.get(), &
SpaceListener::changed,
this, &RegionOfInterestMetric::onContentTransformsChanged);
173 mListeners.push_back(listener);
176 void RegionOfInterestMetric::onContentTransformsChanged()
178 emit transformChanged();
183 return this->getROI().getBox(this->get_rMd().inv());
195 *begin = M.coord(*begin);
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 boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
void setMargin(double val)
virtual void parseXml(QDomNode &dataNode)
Use a XML node to load data.
Vector3D topRight() const
virtual QString getAsSingleLineString() const
void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
QStringList parseTextFromDuplicateElements(QString name)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
void setMaxBoundsData(QString val)
Vector3D bottomLeft() const
virtual Vector3D getRefCoord() const
static CoordinateSystem reference()
DoubleBoundingBox3D getBox(Transform3D qMd=Transform3D::Identity())
virtual QString getValueAsString() const
void setUseActiveTooltip(bool val)
static DoubleBoundingBox3D fromCloud(std::vector< Vector3D > cloud)
virtual void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
void parseXml(QDomNode &dataNode)
Use a XML node to load data.
static DoubleBoundingBox3D zero()
static RegionOfInterestMetricPtr create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider)
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
QDomElement addTextToElement(QString name, QString text)
virtual DoubleBoundingBox3D boundingBox() const
Identification of a Coordinate system.
void setDataList(QStringList val)
csTOOL_OFFSET
the tool space t with a virtual offset added along the z axis. (to)
boost::shared_ptr< class RegionOfInterestMetric > RegionOfInterestMetricPtr
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
std::vector< Vector3D > mPoints
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
RegionOfInterest getROI() const
virtual bool isValid() const
QString parseTextFromElement(QString name)
virtual ~RegionOfInterestMetric()
DoubleBoundingBox3D intersection(DoubleBoundingBox3D a, DoubleBoundingBox3D b)
boost::shared_ptr< class SpaceListener > SpaceListenerPtr
Base class for all Data Metrics.
void transform_coord_range(ITER begin, ITER end, Transform3D M)
std::vector< Vector3D > mMaxBoundsPoints
Namespace for all CustusX production code.