本文整理汇总了C++中ViewportPtr::getMFForegrounds方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewportPtr::getMFForegrounds方法的具体用法?C++ ViewportPtr::getMFForegrounds怎么用?C++ ViewportPtr::getMFForegrounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewportPtr
的用法示例。
在下文中一共展示了ViewportPtr::getMFForegrounds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateViewport
/*! update all changed viewport field from the client port
*/
void MultiDisplayWindow::updateViewport(ViewportPtr &serverPort,
ViewportPtr &clientPort)
{
bool equal, found;
// Compare the pointers.
if(serverPort == clientPort)
return;
if(serverPort == NullFC || clientPort == NullFC)
return;
if(serverPort->getType() != serverPort->getType())
return;
const FieldContainerType &type = serverPort->getType();
UInt32 fcount = osgMin(serverPort->getType().getNumFieldDescs(),
clientPort->getType().getNumFieldDescs());
BitVector ffilter = RemoteAspect::getFieldFilter(type.getId());
for(UInt32 i = 1; i <= fcount; ++i)
{
const FieldDescription* fdesc = type.getFieldDescription(i);
// ignore attachments
if(strcmp(fdesc->getCName(), "parent") == 0 ||
strcmp(fdesc->getCName(), "camera") == 0)
continue;
BitVector mask = fdesc->getFieldMask();
// don't update filtered fields
if(ffilter & mask)
continue;
Field *dst_field = serverPort->getField(i);
Field *src_field = clientPort->getField(i);
const FieldType &dst_ftype = dst_field->getType();
const FieldType &src_ftype = src_field->getType();
if(dst_ftype != src_ftype)
continue;
equal = true;
found = false;
if(strstr(dst_ftype.getCName(), "Ptr") == NULL)
{
// This is very slow with multi fields!!!!
std::string av, bv;
dst_field->getValueByStr(av);
src_field->getValueByStr(bv);
if(av != bv)
equal = false;
}
else
{
if(dst_field->getCardinality() == FieldType::SINGLE_FIELD)
{
if((static_cast<SFFieldContainerPtr *>(dst_field)->getValue() !=
static_cast<SFFieldContainerPtr *>(src_field)->getValue()))
equal = false;
}
else if(dst_field->getCardinality() == FieldType::MULTI_FIELD)
{
UInt32 j, cn = static_cast<MFFieldContainerPtr*>(src_field)->size(),
sn = static_cast<MFFieldContainerPtr*>(src_field)->size();
if (strcmp(fdesc->getCName(), "foregrounds") == 0)
{
MFForegroundPtr sFgndBag;
MFForegroundPtr::const_iterator sFgndIt, cFgndIt;
DisplayFilterForegroundPtr filterFgnd = NullFC;
sFgndIt = serverPort->getMFForegrounds()->begin();
cFgndIt = clientPort->getMFForegrounds()->begin();
while (sFgndIt != serverPort->getMFForegrounds()->end())
{
filterFgnd = DisplayFilterForegroundPtr::dcast(*sFgndIt);
if (filterFgnd != NullFC &&
!filterFgnd->getServer().empty())
found = true; // loaded filters found
else
sFgndBag.push_back(*sFgndIt);
++sFgndIt;
}
if (sFgndBag.size() !=
clientPort->getMFForegrounds()->size())
{
equal = false;
}
else
{
sFgndIt = sFgndBag.begin();
//.........这里部分代码省略.........