54 mDataManager = dataManager;
55 mAlwaysUseDefaultCenter =
false;
56 mUseTooltipOffset =
true;
57 connect(mDataManager.get(), SIGNAL(centerChanged()),
this, SLOT(centerChangedSlot()) ) ;
58 connect(mDataManager.get(), SIGNAL(clinicalApplicationChanged()),
this, SLOT(clinicalApplicationChangedSlot()));
60 mDefaultCenter = mDataManager->getCenter();
61 this->centerChangedSlot();
70 void SliceProxy::initCutplane()
72 mCutplane->setFixedCenter(mDefaultCenter);
73 mCutplane->setToolPosition(getSyntheticToolPos(mDefaultCenter));
81 disconnect(mTool.get(), SIGNAL(
toolVisible(
bool)),
this, SLOT(toolVisibleSlot(
bool)));
82 disconnect(mTool.get(), SIGNAL(tooltipOffset(
double)),
this, SLOT(tooltipOffsetSlot(
double)));
83 disconnect(mTool.get(), SIGNAL(toolProbeSector()),
this, SLOT(changed()));
91 connect(mTool.get(), SIGNAL(
toolVisible(
bool)),
this, SLOT(toolVisibleSlot(
bool)));
92 connect(mTool.get(), SIGNAL(tooltipOffset(
double)),
this, SLOT(tooltipOffsetSlot(
double)));
93 connect(mTool.get(), SIGNAL(toolProbeSector()),
this, SLOT(changed()));
96 toolTransformAndTimestampSlot(mTool->get_prMt(), 0);
97 tooltipOffsetSlot(mTool->getTooltipOffset());
100 this->centerChangedSlot();
104 void SliceProxy::toolTransformAndTimestampSlot(
Transform3D prMt,
double timestamp)
113 mCutplane->setToolPosition(rMt);
119 void SliceProxy::tooltipOffsetSlot(
double val)
121 if (mUseTooltipOffset)
123 mCutplane->setToolOffset(val);
132 tooltipOffsetSlot(0);
134 mUseTooltipOffset = use;
137 tooltipOffsetSlot(mTool->getTooltipOffset());
141 void SliceProxy::toolVisibleSlot(
bool visible)
158 this->centerChangedSlot();
163 mAlwaysUseDefaultCenter = on;
164 this->centerChangedSlot();
167 void SliceProxy::centerChangedSlot()
169 if (mAlwaysUseDefaultCenter)
171 mCutplane->setFixedCenter(mDefaultCenter);
175 Vector3D c = mDataManager->getCenter();
176 mCutplane->setFixedCenter(c);
183 void SliceProxy::clinicalApplicationChangedSlot()
185 mCutplane->setClinicalApplication(mDataManager->getClinicalApplication());
193 Vector3D gravityDir = -mDataManager->getOperatingTable().getVectorUp();
200 mCutplane->initializeFromPlane(plane,
201 useGravity, gravityDir,
202 useViewOffset, viewportHeight, toolViewOffset,
203 mDataManager->getClinicalApplication());
221 mCutplane->setOrientationType(orientation);
227 mCutplane->setPlaneType(plane);
233 mCutplane->setFollowType(followType);
239 mCutplane->setGravity(use, dir);
244 mCutplane->setToolViewOffset(use, viewportHeight, toolViewOffset);
250 mCutplane->setToolViewportHeight(viewportHeight);
267 void SliceProxy::changed()
270 if (
similar(plane, mLastEmittedSlicePlane))
272 mLastEmittedSlicePlane = plane;
278 os << indent <<
"sliceproxy" << std::endl;
279 os << indent <<
"sMr: " << std::endl;
void setTool(ToolPtr tool)
Vector3D j
defines the second axis of the plane. unit vector
Provides a slice matrix based on definition and tool.
Transform3D createTransformRotateY(const double angle)
static SliceProxyPtr create(PatientModelServicePtr dataManager)
void setToolViewOffset(bool use, double viewportHeight, double toolViewOffset)
A 2D slice plane in 3D. i,j are perpendicular unit vectors.
void setToolViewportHeight(double viewportHeight)
virtual void printSelf(std::ostream &os, Indent indent)
void setPlane(PLANE_TYPE plane)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
void setComputer(const SliceComputer &val)
void setAlwaysUseDefaultCenter(bool on)
void setGravity(bool use, const Vector3D &dir)
SliceComputer getComputer() const
void setUseTooltipOffset(bool)
Enable or disable usage of the tools tool tip offset for this slice proxy.
void toolVisible(bool visible)
forwarding of visible in tool
Transform3D createTransformIJC(const Vector3D &ivec, const Vector3D &jvec, const Vector3D ¢er)
Vector3D c
defines the center of the plane
void initializeFromPlane(PLANE_TYPE plane, bool useGravity, bool useViewOffset, double viewportHeight, double toolViewOffset)
void transformChanged(Transform3D sMr)
emitted when transform is changed.
ptTOOLSIDEPLANE
z-rotated 90* relative to anyplane like side plane, but always kept oriented like the plane defined b...
virtual Transform3D get_sMr()
get slice transform, i.e. the matrix sMr transforming a point p in ref to slice space.
void setFollowType(FOLLOW_TYPE followType)
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Formatting class for debug printing of the ssc library.
Transform3D createTransformTranslate(const Vector3D &translation)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Vector3D i
defines the first axis of the plane. unit vector
Calculates a slice plane given a definition.
void setOrientation(ORIENTATION_TYPE orientation)
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
Transform3D createTransformRotateZ(const double angle)
void setDefaultCenter(const Vector3D &c)
void toolTransformAndTimestamp(Transform3D prMt, double timestamp)
forwarded from tool
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr