16 #include <vtkCamera.h> 17 #include <vtkRenderer.h> 18 #include "boost/bind.hpp" 29 PlaneMetricRep::PlaneMetricRep()
32 mViewportListener->setCallback(boost::bind(&PlaneMetricRep::rescale,
this));
37 mGraphicalPoint.reset();
43 mViewportListener->startListen(view->getRenderer());
49 mViewportListener->stopListen();
69 mRect->setLine(
true, 1);
75 mGraphicalPoint->setColor(
mMetric->getColor());
76 mNormal->setColor(
mMetric->getColor());
77 mRect->setColor(
mMetric->getColor());
88 void PlaneMetricRep::rescale()
95 Vector3D p0_r = planeMetric->getRefCoord();
96 Vector3D n_r = planeMetric->getRefNormal();
98 double size = mViewportListener->getVpnZoom(p0_r);
101 mGraphicalPoint->setValue(p0_r);
102 mGraphicalPoint->setRadius(sphereSize);
104 mNormal->setValue(p0_r, n_r, sphereSize * 8);
106 this->drawRectangleForPlane(p0_r, n_r, size);
111 void PlaneMetricRep::drawRectangleForPlane(
Vector3D p0_r,
Vector3D n_r,
double size)
127 double bb_size = 0.10/size;
130 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.