15 #include <vtkImageData.h> 16 #include <vtkPolyData.h> 31 mSpaceProvider = spaceProvider;
34 mShowInToolSpace =
true;
43 mShowInToolSpace = on;
48 return mPipeline->getActor();
58 return mProbeDefinition;
68 disconnect(mTool.get(), SIGNAL(toolTransformAndTimestamp(
Transform3D,
double)),
this, SLOT(receiveTransforms(
Transform3D,
double)));
69 disconnect(mTool.get(), SIGNAL(toolProbeSector()),
this, SLOT(probeSectorChanged()));
73 if (tool && tool->getProbe())
81 connect(mTool.get(), SIGNAL(toolTransformAndTimestamp(
Transform3D,
double)),
this, SLOT(receiveTransforms(
Transform3D,
double)));
82 connect(mTool.get(), SIGNAL(toolProbeSector()),
this, SLOT(probeSectorChanged()));
85 this->probeSectorChanged();
91 this->probeSectorChanged();
94 void VideoSourceGraphics::probeSectorChanged()
96 if (!mTool || !mTool->getProbe())
99 mProbeDefinition.
setData(mTool->getProbe()->getProbeDefinition());
102 mPipeline->setClip(mProbeDefinition.
getSector());
106 mPipeline->setClip(NULL);
108 this->receiveTransforms(mTool->get_prMt(), 0);
122 mPipeline->setInputVideo(NULL);
130 mPipeline->setInputVideo(mData->getVtkImageData());
136 void VideoSourceGraphics::receiveTransforms(
Transform3D prMt,
double timestamp)
138 if (!mShowInToolSpace)
143 mPipeline->setActorUserMatrix(rMu.getVtkMatrix());
146 void VideoSourceGraphics::newDataSlot()
148 if (!mData || !mData->validData())
150 mPipeline->setVisibility(
false);
157 bool visible = mData->validData();
158 if (mShowInToolSpace)
159 visible = visible && mTool && mTool->getVisible();
160 mPipeline->setVisibility(visible);
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
void setRealtimeStream(VideoSourcePtr data)
vtkSmartPointer< class vtkActor > vtkActorPtr
void setShowInToolSpace(bool on)
Wrap vtkActor displaying a video image, possibly clipped by a sector.
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
vtkPolyDataPtr getSector()
get a polydata representation of the us sector
VideoSourceGraphics(SpaceProviderPtr spaceProvider, bool useMaskFilter=false)
ProbeSector getProbeDefinition()
boost::shared_ptr< class VideoSource > VideoSourcePtr
Transform3D get_tMu() const
get transform from image space u to probe tool space t.
Utility functions for drawing an US Probe sector.
virtual ~VideoSourceGraphics()
void setClipToSector(bool on)
Turn sector clipping on/off. If on, only the area inside the probe sector is shown.
void newFrame()
emitted when a new frame has arrived (getVtkImageData() returns something new). info/status/name/vali...
void setData(ProbeDefinition data)
Namespace for all CustusX production code.
void setTool(ToolPtr tool)
boost::shared_ptr< class Tool > ToolPtr