本文整理汇总了C++中GeometryUnrecPtr::getFieldDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryUnrecPtr::getFieldDescription方法的具体用法?C++ GeometryUnrecPtr::getFieldDescription怎么用?C++ GeometryUnrecPtr::getFieldDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryUnrecPtr
的用法示例。
在下文中一共展示了GeometryUnrecPtr::getFieldDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
OSBGeometryElement::readV100(void)
{
OSG_OSB_LOG(("OSBGeometryElement::readV100:\n"));
OSBRootElement *root = editRoot();
BinaryReadHandler *rh = editRoot()->getReadHandler();
OSBGeometryHelper gh;
GeometryUnrecPtr geo = Geometry::create();
setContainer(geo);
// The "properties" mfield can be thought of the unification of the
// "positions", "normals", etc sfields of the 1.x Geometry.
// For the conversion the PtrFieldInfo structure for the "properties"
// mfield is filled with the corresponding ids of the sfields from the
// file. The remapping after postRead will fill in the right pointers.
FieldDescriptionBase *propFieldDesc =
geo->getFieldDescription("properties");
UInt32 propFieldId = propFieldDesc->getFieldId();
root->editPtrFieldList().push_back(PtrFieldInfo(geo, propFieldId));
PtrFieldInfo &propFieldPFI = root->editPtrFieldList().back();
propFieldPFI.editIdStore().resize(Geometry::MaxAttribs);
while(true)
{
std::string fieldName;
std::string fieldTypeName;
UInt32 fieldSize;
PtrFieldListIt ptrFieldIt;
if(!readFieldHeader("", fieldName, fieldTypeName, fieldSize))
{
OSG_OSB_LOG(("OSBGeometryElement::readV100: "
"Reading stopped at field: [%s].\n", fieldName.c_str()));
break;
}
if(fieldName == "indexMapping")
{
// read into temporary field
MField<UInt16> indexMappingField;
indexMappingField.copyFromBin(*rh);
// copy to member for use in postRead
indexMappingField.getValues().swap(_indexMapping);
}
else if(fieldName == "indices")
{
// read container id of indices property
// postRead will handle the conversion of multi indices
rh->getValue(_indicesId);
}
else if(fieldName == "positions")
{
UInt32 positionsId;
rh->getValue(positionsId);
propFieldPFI.editIdStore()[Geometry::PositionsIndex] = positionsId;
}
else if(fieldName == "normals")
{
UInt32 normalsId;
rh->getValue(normalsId);
propFieldPFI.editIdStore()[Geometry::NormalsIndex] = normalsId;
}
else if(fieldName == "colors")
{
UInt32 colorsId;
rh->getValue(colorsId);
propFieldPFI.editIdStore()[Geometry::ColorsIndex] = colorsId;
}
else if(fieldName == "secondaryColors")
{
UInt32 secondaryColorsId;
rh->getValue(secondaryColorsId);
propFieldPFI.editIdStore()[Geometry::SecondaryColorsIndex] =
secondaryColorsId;
}
else if(fieldName == "texCoords")
{
UInt32 texCoordsId;
rh->getValue(texCoordsId);
propFieldPFI.editIdStore()[Geometry::TexCoordsIndex] =
texCoordsId;
}
else if(fieldName == "texCoords1")
{
UInt32 texCoordsId1;
rh->getValue(texCoordsId1);
propFieldPFI.editIdStore()[Geometry::TexCoords1Index] =
texCoordsId1;
}
else if(fieldName == "texCoords2")
{
UInt32 texCoordsId2;
rh->getValue(texCoordsId2);
propFieldPFI.editIdStore()[Geometry::TexCoords2Index] =
//.........这里部分代码省略.........