37 #include <vtkCamera.h> 38 #include <vtkRenderer.h> 39 #include "boost/bind.hpp" 50 PlaneMetricRep::PlaneMetricRep()
53 mViewportListener->setCallback(boost::bind(&PlaneMetricRep::rescale,
this));
58 mGraphicalPoint.reset();
64 mViewportListener->startListen(view->getRenderer());
70 mViewportListener->stopListen();
90 mRect->setLine(
true, 1);
96 mGraphicalPoint->setColor(
mMetric->getColor());
97 mNormal->setColor(
mMetric->getColor());
98 mRect->setColor(
mMetric->getColor());
109 void PlaneMetricRep::rescale()
111 if (!mGraphicalPoint)
116 Vector3D p0_r = planeMetric->getRefCoord();
117 Vector3D n_r = planeMetric->getRefNormal();
119 double size = mViewportListener->getVpnZoom(p0_r);
122 mGraphicalPoint->setValue(p0_r);
123 mGraphicalPoint->setRadius(sphereSize);
125 mNormal->setValue(p0_r, n_r, sphereSize * 8);
127 this->drawRectangleForPlane(p0_r, n_r, size);
132 void PlaneMetricRep::drawRectangleForPlane(
Vector3D p0_r,
Vector3D n_r,
double size)
148 double bb_size = 0.10/size;
151 mRect->updatePosition(bb, rMb);
vtkRendererPtr getRenderer()
virtual void removeRepActorsFromViewRenderer(ViewPtr view)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Rep for visualizing a PlaneMetric.
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
static PlaneMetricRepPtr New(const QString &uid="")
Data class representing a plane.
Helper for rendering a point in 3D.
boost::shared_ptr< class View > ViewPtr
Listens to changes in viewport and camera matrix.
Vector3D cross(const Vector3D &a, const Vector3D &b)
compute cross product of a and b.
Helper for rendering an arrow in 3D.
virtual void onModifiedStartRender()
boost::shared_ptr< class PlaneMetric > PlaneMetricPtr
Transform3D createTransformIJC(const Vector3D &ivec, const Vector3D &jvec, const Vector3D ¢er)
virtual void addRepActorsToViewRenderer(ViewPtr view)
void addRepActorsToViewRenderer(ViewPtr view)
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.
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
void removeRepActorsFromViewRenderer(ViewPtr view)
RealScalar length() const
boost::shared_ptr< class PlaneMetricRep > PlaneMetricRepPtr
Helper for drawing a rectangle in 3D.
Namespace for all CustusX production code.