65 std::vector<Vector3D> RegionOfInterest::transform(
const std::vector<Vector3D>& points,
Transform3D M)
const 67 std::vector<Vector3D> retval;
68 for (
unsigned i=0; i<points.size(); ++i)
69 retval.push_back(M.coord(points[i]));
73 DoubleBoundingBox3D RegionOfInterest::generateROIFromPointsAndMargin(
const std::vector<Vector3D>& points,
double margin)
const 79 Vector3D vmargin(margin,margin, margin);
92 DataMetric(uid, name, dataManager, spaceProvider)
94 mUseActiveTooltip =
false;
109 return this->boundingBox().center();
122 for (
unsigned i=0; i<mContainedData.size(); ++i)
125 adder.
addTextToElement(
"useActiveTooltip", QString::number(mUseActiveTooltip));
140 this->onContentChanged();
150 mContainedData = val;
151 this->onContentChanged();
156 mUseActiveTooltip = val;
158 this->onContentChanged();
164 this->onContentChanged();
169 mMaxBoundsData = val;
170 this->onContentChanged();
173 void RegionOfInterestMetric::onContentChanged()
175 for (
unsigned i=0; i<mListeners.size(); ++i)
177 disconnect(mListeners[i].
get(), &
SpaceListener::changed,
this, &RegionOfInterestMetric::onContentTransformsChanged);
182 for (
unsigned i=0; i<mContainedData.size(); ++i)
186 this->onContentTransformsChanged();
192 listener->setSpace(space);
193 connect(listener.get(), &
SpaceListener::changed,
this, &RegionOfInterestMetric::onContentTransformsChanged);
194 mListeners.push_back(listener);
197 void RegionOfInterestMetric::onContentTransformsChanged()
199 emit transformChanged();
204 return this->getROI().getBox(this->get_rMd().inv());
216 *begin = M.coord(*begin);
225 if (mUseActiveTooltip)
227 retval.
mPoints.push_back(this->getToolTip_r());
230 std::map<QString, DataPtr> alldata = mDataManager->getDatas();
231 for (std::map<QString, DataPtr>::const_iterator i=alldata.begin(); i!=alldata.end(); ++i)
233 if (boost::dynamic_pointer_cast<RegionOfInterestMetric>(i->second))
236 if (mContainedData.contains(i->first))
238 std::vector<Vector3D> c = i->second->getPointCloud();
240 std::copy(c.begin(), c.end(), back_inserter(retval.
mPoints));
243 if (mMaxBoundsData == i->first)
245 std::vector<Vector3D> c = i->second->getPointCloud();
254 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.