当前位置: 首页>>代码示例>>C++>>正文


C++ ToolPtr::getProbe方法代码示例

本文整理汇总了C++中ToolPtr::getProbe方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolPtr::getProbe方法的具体用法?C++ ToolPtr::getProbe怎么用?C++ ToolPtr::getProbe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ToolPtr的用法示例。


在下文中一共展示了ToolPtr::getProbe方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateStatus

/** extract information from the IGTLinkUSStatusMessage
 *  and store locally. Also reset the old local info with
 *  information from the probe in toolmanager.
 */
void VideoConnection::updateStatus(ProbeDefinitionPtr msg)
{
	ToolPtr tool = mBackend->tracking()->getFirstProbe();
	if (!tool || !tool->getProbe())
	{
		//Don't throw away the ProbeDefinition. Save it until it can be used
		if (mUnusedProbeDefinitionVector.empty())
			connect(mBackend->tracking().get(), &TrackingService::stateChanged, this, &VideoConnection::useUnusedProbeDefinitionSlot);
		mUnusedProbeDefinitionVector.push_back(msg);
		return;
	}
	ProbePtr probe = tool->getProbe();

	// start with getting a valid data object from the probe, in order to keep
	// existing values (such as temporal calibration).
	// Note that the 'active' data is get while the 'uid' data is set.
	ProbeDefinition data = probe->getProbeDefinition();

	data.setUid(msg->getUid());
	data.setType(msg->getType());
	data.setSector(msg->getDepthStart(), msg->getDepthEnd(), msg->getWidth());
	data.setOrigin_p(msg->getOrigin_p());
	data.setSize(msg->getSize());
	data.setSpacing(msg->getSpacing());
	data.setClipRect_p(msg->getClipRect_p());
	data.setUseDigitalVideo(true);

	probe->setProbeDefinition(data);
	probe->setActiveStream(msg->getUid());
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:34,代码来源:cxVideoConnection.cpp

示例2: resetProbe

void VideoConnection::resetProbe()
{
	ToolPtr tool = mBackend->tracking()->getFirstProbe();
	if (!tool || !tool->getProbe())
		return;
	ProbePtr probe = tool->getProbe();
	if (probe)
	{
		ProbeDefinition data = probe->getProbeDefinition();
		data.setUseDigitalVideo(false);
		probe->setProbeDefinition(data);
	}
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:13,代码来源:cxVideoConnection.cpp

示例3: getGuessForActiveVideoSource

VideoSourcePtr VideoImplService::getGuessForActiveVideoSource(VideoSourcePtr old)
{

    if(old && old->getUid().contains("playback"))
        return old;

    QStringList nameFilters;
    nameFilters << "TissueAngio.fts" << "TissueFlow.fts" << "ScanConverted.fts";
    // ask for playback stream:
    foreach(USAcquisitionVideoPlaybackPtr uSAcquisitionVideoPlayback,mUSAcquisitionVideoPlaybacks)
    {
        if (uSAcquisitionVideoPlayback->isActive() && nameFilters.contains(uSAcquisitionVideoPlayback->getType()) )
            return uSAcquisitionVideoPlayback->getVideoSource();
     }

    // ask for playback stream:
    foreach(USAcquisitionVideoPlaybackPtr uSAcquisitionVideoPlayback,mUSAcquisitionVideoPlaybacks)
    {
        if (uSAcquisitionVideoPlayback->isActive())
            return uSAcquisitionVideoPlayback->getVideoSource();
    }

    // ask for active stream in first probe:
    ToolPtr tool = mBackend->tracking()->getFirstProbe();
    if (tool && tool->getProbe() && tool->getProbe()->getRTSource())
    {
        // keep existing if present
        if (old)
        {
            if (tool->getProbe()->getAvailableVideoSources().count(old->getUid()))
                    return old;
        }

        return tool->getProbe()->getRTSource();
    }

    std::vector<VideoSourcePtr> allSources = this->getVideoSources();
    // keep existing if present
    if (old)
    {
        if (std::count(allSources.begin(), allSources.end(), old))
                return old;
    }
    // ask for anything
    if (!allSources.empty())
        return allSources.front();

    // give up: return empty
    return mEmptyVideoSource;
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:50,代码来源:cxVideoImplService.cpp

示例4: connectVideoToProbe

/** Imbue probe with all stream and probe info from grabber.
 *
 * Call when active probe is changed or when streaming config is changed (new streams, new probeDefinition)
 *
 * Find the active probe, then insert all current streams into that probe.
 *
 */
void VideoConnection::connectVideoToProbe()
{
	ToolPtr tool = mBackend->tracking()->getFirstProbe();
	if (!tool)
		return;

	ProbePtr probe = tool->getProbe();
	if (!probe)
		return;

	for (unsigned i=0; i<mSources.size(); ++i)
		probe->setRTSource(mSources[i]);
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:20,代码来源:cxVideoConnection.cpp

示例5: onDisconnected

void VideoConnection::onDisconnected()
{
	mClient = NULL;
	mThread = NULL; // because this method listens to thread::finished

	this->resetProbe();

	this->stopAllSources();

	for (unsigned i=0; i<mSources.size(); ++i)
		mSources[i]->setInput(ImagePtr());

	ToolPtr tool = mBackend->tracking()->getFirstProbe();
	if (tool && tool->getProbe())
		this->removeSourceFromProbe(tool);

	mSources.clear();
	mStreamerInterface.reset();

	emit connected(false);
	emit videoSourcesChanged();
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:22,代码来源:cxVideoConnection.cpp

示例6: removeSourceFromProbe

void VideoConnection::removeSourceFromProbe(ToolPtr tool)
{
	ProbePtr probe = tool->getProbe();
	for (unsigned i=0; i<mSources.size(); ++i)
		probe->removeRTSource(mSources[i]);
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:6,代码来源:cxVideoConnection.cpp


注:本文中的ToolPtr::getProbe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。