本文整理汇总了C++中POVMS_List::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ POVMS_List::Append方法的具体用法?C++ POVMS_List::Append怎么用?C++ POVMS_List::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POVMS_List
的用法示例。
在下文中一共展示了POVMS_List::Append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendFindFile
void RenderBackend::SendFindFile(POVMSContext ctx, SceneId sid, POVMSAddress addr, const vector<POVMSUCS2String>& filenames, POVMSUCS2String& filename)
{
POVMS_Message msg(kPOVObjectClass_FileData, kPOVMsgClass_FileAccess, kPOVMsgIdent_FindFile);
POVMS_Message result(kPOVObjectClass_FileData, kPOVMsgClass_FileAccess, kPOVMsgIdent_FindFile);
POVMS_List files;
for(vector<POVMSUCS2String>::const_iterator i(filenames.begin()); i != filenames.end(); i++)
{
POVMS_Attribute attr(i->c_str());
files.Append(attr);
}
msg.Set(kPOVAttrib_ReadFile, files);
msg.SetInt(kPOVAttrib_SceneId, sid);
msg.SetDestinationAddress(addr);
POVMS_SendMessage(ctx, msg, &result, kPOVMSSendMode_WaitReply);
filename = result.TryGetUCS2String(kPOVAttrib_ReadFile, "");
}
示例2: SetOptions
//.........这里部分代码省略.........
// driven and doesn't have an explicit function for adding library paths per se.
//
// we use the Path equivalence operator rather than a string compare since
// using Path should handle platform-specific issues like case-sensitivity (or,
// rather, lack thereof). note that at the time of writing, the Path class did
// not yet implement case-insensitive comparisions.
//
// NB while it would of course be more efficient to sort the list so searches are
// faster, we'd have to make a copy of it to do that, as we can't change the order
// of existing entries (that would change the include path search order). it's not
// common to have a lot of include paths, so we just use linear searches.
for (int i = 1; i <= pathlist.GetListSize(); i++)
{
POVMS_Attribute lp;
pathlist.GetNth(i, lp);
Path path(lp.GetUCS2String());
if (find(libpaths.begin(), libpaths.end(), path) == libpaths.end())
libpaths.push_back(path);
}
}
if (opts.m_LibraryPaths.empty() == false)
{
for (vector<UCS2String>::const_iterator i = opts.m_LibraryPaths.begin(); i != opts.m_LibraryPaths.end(); i++)
{
Path path(*i);
if (find(libpaths.begin(), libpaths.end(), path) == libpaths.end())
libpaths.push_back(path);
}
}
if (libpaths.empty() == false)
{
POVMS_List pathlist;
for (list<Path>::iterator i = libpaths.begin(); i != libpaths.end(); i++)
{
POVMS_Attribute attr((*i)().c_str());
pathlist.Append(attr);
}
ropts.Set (kPOVAttrib_LibraryPath, pathlist) ;
}
if (ropts.TryGetBool(kPOVAttrib_RealTimeRaytracing, false) == true)
ropts.SetBool(kPOVAttrib_OutputToFile, false);
m_OutputToFileSet = ropts.TryGetBool(kPOVAttrib_OutputToFile, true);
// this is a bit messy: Grayscale_Output or OutputAlpha may be specified
// in an INI file or elsewhere prior to the output file type being set.
// so we can't check to see if it is supported with that file type
// until all options have been parsed.
if (m_OutputToFileSet)
{
int oft = ropts.TryGetInt(kPOVAttrib_OutputFileType, DEFAULT_OUTPUT_FORMAT);
bool has16BitGrayscale = false;
bool hasAlpha = false;
for (int i = 0; FileTypeTable[i].internalId != 0; i ++)
{
if (oft == FileTypeTable[i].internalId)
{
has16BitGrayscale = FileTypeTable[i].has16BitGrayscale;
hasAlpha = FileTypeTable[i].hasAlpha;
break;
}
}
if (ropts.TryGetBool(kPOVAttrib_GrayscaleOutput, false) && !has16BitGrayscale)
{
AppendStatusMessage ("Grayscale output not currently supported with selected output file type.");
AppendErrorMessage ("Grayscale output not currently supported with selected output file type.") ;
return (m_LastError = vfeUnsupportedOptionCombination);
}
if (ropts.TryGetBool(kPOVAttrib_OutputAlpha, false) && !hasAlpha)
{
AppendWarningMessage ("Warning: Alpha channel output currently not (or not officially) supported with selected output file type.") ;
}
}
if (ropts.TryGetInt(kPOVAttrib_RenderBlockSize, 32) < 4)
return (m_LastError = vfeRenderBlockSizeTooSmall);
if ((ropts.TryGetInt(kPOVAttrib_DisplayGammaType, DEFAULT_DISPLAY_GAMMA_TYPE) == kPOVList_GammaType_PowerLaw) &&
(ropts.TryGetFloat(kPOVAttrib_DisplayGamma, DEFAULT_DISPLAY_GAMMA) < 0.001f))
return (m_LastError = vfeDisplayGammaTooSmall);
if ((ropts.TryGetInt(kPOVAttrib_FileGammaType, DEFAULT_FILE_GAMMA_TYPE) == kPOVList_GammaType_PowerLaw) &&
(ropts.TryGetFloat(kPOVAttrib_FileGamma, DEFAULT_FILE_GAMMA) < 0.001f))
return (m_LastError = vfeFileGammaTooSmall);
n = sizeof (str) ;
if ((err = POVMSUtil_GetUCS2String (&obj, kPOVAttrib_CreateIni, str, &n)) == kNoErr && str [0] != 0)
if ((err = options.WriteFile (UCS2toASCIIString(str).c_str(), &obj)) != kNoErr)
return (m_LastError = vfeFailedToWriteINI);
opts.m_Options = ropts;
m_RenderOptions = opts ;
m_OptionsSet = true;
return (m_LastError = vfeNoError) ;
}