36 #include <vtkImageData.h>
37 #include <vtkPolyData.h>
55 mShowInToolSpace =
true;
64 mShowInToolSpace = on;
69 return mPipeline->getActor();
79 return mProbeDefinition;
89 disconnect(mTool.get(), SIGNAL(toolTransformAndTimestamp(
Transform3D,
double)),
this, SLOT(receiveTransforms(
Transform3D,
double)));
90 disconnect(mTool.get(), SIGNAL(toolProbeSector()),
this, SLOT(probeSectorChanged()));
94 if (tool && tool->getProbe())
102 connect(mTool.get(), SIGNAL(toolTransformAndTimestamp(
Transform3D,
double)),
this, SLOT(receiveTransforms(
Transform3D,
double)));
103 connect(mTool.get(), SIGNAL(toolProbeSector()),
this, SLOT(probeSectorChanged()));
106 this->probeSectorChanged();
112 this->probeSectorChanged();
115 void VideoSourceGraphics::probeSectorChanged()
117 if (!mTool || !mTool->getProbe())
120 mProbeDefinition.
setData(mTool->getProbe()->getProbeDefinition());
123 mPipeline->setClip(mProbeDefinition.
getSector());
127 mPipeline->setClip(NULL);
129 this->receiveTransforms(mTool->get_prMt(), 0);
143 mPipeline->setInputVideo(NULL);
151 mPipeline->setInputVideo(mData->getVtkImageData());
157 void VideoSourceGraphics::receiveTransforms(
Transform3D prMt,
double timestamp)
159 if (!mShowInToolSpace)
164 mPipeline->setActorUserMatrix(rMu.getVtkMatrix());
167 void VideoSourceGraphics::newDataSlot()
169 if (!mData || !mData->validData())
171 mPipeline->setVisibility(
false);
178 bool visible = mData->validData();
179 if (mShowInToolSpace)
180 visible = visible && mTool && mTool->getVisible();
181 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.
cxLogicManager_EXPORT SpaceProviderPtr spaceProvider()
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)
void setTool(ToolPtr tool)
boost::shared_ptr< class Tool > ToolPtr