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 mCutplane->initializeFromPlane(plane,
194 useGravity, gravityDir,
195 useViewOffset, viewportHeight, toolViewOffset,
196 mDataManager->getClinicalApplication(),
197 useConstrainedViewOffset);
229 mCutplane->setOrientationType(orientation);
235 mCutplane->setPlaneType(plane);
241 mCutplane->setFollowType(followType);
247 mCutplane->setGravity(use, dir);
252 mCutplane->setToolViewOffset(use, viewportHeight, toolViewOffset, useConstrainedViewOffset);
258 mCutplane->setToolViewportHeight(viewportHeight);
275 void SliceProxy::changed()
282 os << indent <<
"sliceproxy" << std::endl;
283 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)
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)
void initializeFromPlane(PLANE_TYPE plane, bool useGravity, const Vector3D &gravityDir, bool useViewOffset, double viewportHeight, double toolViewOffset, bool useConstrainedViewOffset=false)
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 transformChanged(Transform3D sMr)
emitted when transform is changed.
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)
void setToolViewOffset(bool use, double viewportHeight, double toolViewOffset, bool useConstrainedViewOffset=false)
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)
Transform3D createTransformRotateZ(const double angle)
void setDefaultCenter(const Vector3D &c)
void toolTransformAndTimestamp(Transform3D prMt, double timestamp)
forwarded from tool
boost::shared_ptr< class Tool > ToolPtr