本文整理汇总了C++中stringutil::StrStreamType::str方法的典型用法代码示例。如果您正苦于以下问题:C++ StrStreamType::str方法的具体用法?C++ StrStreamType::str怎么用?C++ StrStreamType::str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stringutil::StrStreamType
的用法示例。
在下文中一共展示了StrStreamType::str方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _compile
//-----------------------------------------------------------------------------
String Technique::_compile(bool autoManageTextureUnits)
{
StringUtil::StrStreamType errors;
mIsSupported = checkGPURules(errors);
if (mIsSupported)
{
mIsSupported = checkHardwareSupport(autoManageTextureUnits, errors);
}
// Compile for categorised illumination on demand
clearIlluminationPasses();
mIlluminationPassesCompilationPhase = IPS_NOT_COMPILED;
return errors.str();
}
示例2:
SimpleRenderable::SimpleRenderable()
{
m_matWorldTransform = Matrix4::IDENTITY;
m_strMatName = "BaseWhite";
m_pMaterial = MaterialManager::getSingleton().getByName("BaseWhite");
m_pParentSceneManager = NULL;
mParentNode = NULL;
m_pCamera = NULL;
// Generate name
StringUtil::StrStreamType name;
name << _TO_CHAR("SimpleRenderable") << ms_uGenNameCount++;
mName = name.str();
}
示例3: toString
//-----------------------------------------------------------------------
String ParticleScriptSerializer::toString(vector<Real> vector, bool applySqrt)
{
StringUtil::StrStreamType stream;
if (!vector.empty())
{
for (size_t i = 0; i < vector.size(); ++i)
{
if (applySqrt)
{
stream << Math::Sqrt(vector[i]) << " ";
}
else
{
stream << vector[i] << " ";
}
}
}
return stream.str();
}
示例4: createFragmentProgram
//---------------------------------------------------------------------
HighLevelGpuProgramPtr
TerrainMaterialGeneratorC::SM2Profile::ShaderHelper::generateFragmentProgram(
const SM2Profile* prof, const Terrain* terrain, TechniqueType tt)
{
HighLevelGpuProgramPtr ret = createFragmentProgram(prof, terrain, tt);
StringUtil::StrStreamType sourceStr;
generateFragmentProgramSource(prof, terrain, tt, sourceStr);
ret->setSource(sourceStr.str());
ret->load();
defaultFpParams(prof, terrain, tt, ret);
#if 1
LogManager::getSingleton().stream(LML_TRIVIAL) << "*** Terrain Fragment Program: "
<< ret->getName() << " ***\n" << ret->getSource() << "\n*** ***";
#endif
return ret;
}
示例5: createSceneManager
//-----------------------------------------------------------------------
SceneManager* SceneManagerEnumerator::createSceneManager(
SceneTypeMask typeMask, const String& instanceName)
{
if (mInstances.find(instanceName) != mInstances.end())
{
OGRE_EXCEPT(Exception::ERR_DUPLICATE_ITEM,
"SceneManager instance called '" + instanceName + "' already exists",
"SceneManagerEnumerator::createSceneManager");
}
SceneManager* inst = 0;
String name = instanceName;
if (name.empty())
{
// generate a name
StringUtil::StrStreamType s;
s << "SceneManagerInstance" << ++mInstanceCreateCount;
name = s.str();
}
// Iterate backwards to find the matching factory registered last
for(Factories::reverse_iterator i = mFactories.rbegin(); i != mFactories.rend(); ++i)
{
if ((*i)->getMetaData().sceneTypeMask & typeMask)
{
inst = (*i)->createInstance(name);
break;
}
}
// use default factory if none
if (!inst)
inst = mDefaultFactory.createInstance(name);
/// assign rs if already configured
if (mCurrentRenderSystem)
inst->_setDestinationRenderSystem(mCurrentRenderSystem);
mInstances[inst->getName()] = inst;
return inst;
}
示例6: ParseAnimationRotationInterpolationMode
Animation::RotationInterpolationMode OgreMaxUtilities::ParseAnimationRotationInterpolationMode(const String& mode)
{
String modeLower = mode;
StringUtil::toLowerCase(modeLower);
if (modeLower == "linear")
return Animation::RIM_LINEAR;
else if (modeLower == "spherical")
return Animation::RIM_SPHERICAL;
StringUtil::StrStreamType errorMessage;
errorMessage << "Invalid animation rotation interpolation mode specified: " << mode;
OGRE_EXCEPT
(
Exception::ERR_INVALIDPARAMS,
errorMessage.str(),
"OgreMaxUtilities::ParseAnimationRotationInterpolationMode"
);
}
示例7: ParseUpAxis
UpAxis OgreMaxUtilities::ParseUpAxis(const String& upAxis)
{
String upAxisLower = upAxis;
StringUtil::toLowerCase(upAxisLower);
if (upAxisLower == "y")
return UP_AXIS_Y;
else if (upAxisLower == "z")
return UP_AXIS_Z;
StringUtil::StrStreamType errorMessage;
errorMessage << "Invalid up axis specified: " << upAxis;
OGRE_EXCEPT
(
Exception::ERR_INVALIDPARAMS,
errorMessage.str(),
"OgreMaxUtilities::ParseUpAxis"
);
}
示例8: _readPageStream
//---------------------------------------------------------------------
StreamSerialiser* PageManager::_readPageStream(PageID pageID, PagedWorldSection* section)
{
StreamSerialiser* ser = 0;
if (mPageProvider)
ser = mPageProvider->readPageStream(pageID, section);
if (!ser)
{
// use default implementation
StringUtil::StrStreamType nameStr;
nameStr << section->getWorld()->getName() << "_" << section->getName()
<< "_" << pageID << ".page";
DataStreamPtr stream = ResourceGroupManager::getSingleton().openResource(nameStr.str());
ser = OGRE_NEW StreamSerialiser(stream);
}
return ser;
}
示例9: ParseBillboardRotationType
BillboardRotationType OgreMaxUtilities::ParseBillboardRotationType(const String& rotationType)
{
String rotationTypeLower = rotationType;
StringUtil::toLowerCase(rotationTypeLower);
if (rotationTypeLower == "vertex")
return BBR_VERTEX;
else if (rotationTypeLower == "texcoord")
return BBR_TEXCOORD;
StringUtil::StrStreamType errorMessage;
errorMessage << "Invalid billboard rotation type specified: " << rotationType;
OGRE_EXCEPT
(
Exception::ERR_INVALIDPARAMS,
errorMessage.str(),
"OgreMaxUtilities::ParseBillboardRotationType"
);
}
示例10: ParseProjectionType
ProjectionType OgreMaxUtilities::ParseProjectionType(const String& type)
{
String typeLower = type;
StringUtil::toLowerCase(typeLower);
if (typeLower == "perspective")
return PT_PERSPECTIVE;
else if (typeLower == "orthographic")
return PT_ORTHOGRAPHIC;
StringUtil::StrStreamType errorMessage;
errorMessage << "Invalid projection type specified: " << type;
OGRE_EXCEPT
(
Exception::ERR_INVALIDPARAMS,
errorMessage.str(),
"OgreMaxUtilities::ParseProjectionType"
);
}
示例11: compile
//-----------------------------------------------------------------------
void Material::compile(bool autoManageTextureUnits)
{
// Compile each technique, then add it to the list of supported techniques
mSupportedTechniques.clear();
clearBestTechniqueList();
mUnsupportedReasons.clear();
Techniques::iterator i, iend;
iend = mTechniques.end();
size_t techNo = 0;
for (i = mTechniques.begin(); i != iend; ++i, ++techNo)
{
String compileMessages = (*i)->_compile(autoManageTextureUnits);
if ( (*i)->isSupported() )
{
insertSupportedTechnique(*i);
}
else
{
// Log informational
StringUtil::StrStreamType str;
str << "Material " << mName << " Technique " << techNo;
if (!(*i)->getName().empty())
str << "(" << (*i)->getName() << ")";
str << " is not supported. " << compileMessages;
LogManager::getSingleton().logMessage(str.str(), LML_TRIVIAL);
mUnsupportedReasons += compileMessages;
}
}
mCompilationRequired = false;
// Did we find any?
if (mSupportedTechniques.empty())
{
LogManager::getSingleton().stream()
<< "WARNING: material " << mName << " has no supportable "
<< "Techniques and will be blank. Explanation: \n" << mUnsupportedReasons;
}
}
示例12: EXCEPTION
const String& Exception::getFullDescription(void) const
{
if (fullDesc.empty())
{
StringUtil::StrStreamType desc; //字符串流
desc << "SAPPHIRE EXCEPTION(" << number << ":" << typeName << "): "
<< description
<< " in " << source;
if (line > 0)
{
desc << " at " << file << " (line " << line << ")";
}
fullDesc = desc.str();
}
return fullDesc;
}
示例13: toString
//-----------------------------------------------------------------------
String StringConverter::toString(const Matrix4& val)
{
StringUtil::StrStreamType stream;
stream << val[0][0] << " "
<< val[0][1] << " "
<< val[0][2] << " "
<< val[0][3] << " "
<< val[1][0] << " "
<< val[1][1] << " "
<< val[1][2] << " "
<< val[1][3] << " "
<< val[2][0] << " "
<< val[2][1] << " "
<< val[2][2] << " "
<< val[2][3] << " "
<< val[3][0] << " "
<< val[3][1] << " "
<< val[3][2] << " "
<< val[3][3];
return stream.str();
}
示例14: getWorldMaterialInstance
//------------------------------------------------------
Ogre::MaterialPtr MaterialService::getWorldMaterialInstance(unsigned int idx, int tag) {
if (tag < 0) {
MaterialPtr mat = getWorldMaterialTemplate(idx);
return mat;
} else {
MaterialPtr tmat = getWorldMaterialTemplate(idx);
MaterialPtr imat;
// have to look for it and clone
WorldMaterialInstanceMap::iterator it = mWorldMaterials.find(idx);
if (it == mWorldMaterials.end()) {
// no slot for the idx. have to clone
std::pair<WorldMaterialInstanceMap::iterator, bool> res = mWorldMaterials.insert(make_pair(idx,
SlotMaterialMap()));
it = res.first;
}
// now search
SlotMaterialMap::iterator sit = it->second.find(tag);
if (sit == it->second.end()) {
StringUtil::StrStreamType tmp;
tmp << "Shader" << idx << "#" << tag;
imat = tmat->clone(tmp.str());
prepareMaterialInstance(imat, idx, tag);
it->second.insert(make_pair(tag, imat));
} else {
imat = sit->second;
}
return imat;
}
}
示例15: setAnimatedTextureName
//-----------------------------------------------------------------------
void TextureUnitState::setAnimatedTextureName( const String& name, unsigned int numFrames, Real duration)
{
setContentType(CONTENT_NAMED);
mTextureLoadFailed = false;
String ext;
String baseName;
size_t pos = name.find_last_of(".");
baseName = name.substr(0, pos);
ext = name.substr(pos);
mFrames.resize(numFrames);
// resize pointers, but don't populate until needed
mFramePtrs.resize(numFrames);
mAnimDuration = duration;
mCurrentFrame = 0;
mCubic = false;
for (unsigned int i = 0; i < mFrames.size(); ++i)
{
StringUtil::StrStreamType str;
str << baseName << "_" << i << ext;
mFrames[i] = str.str();
mFramePtrs[i].setNull();
}
// Load immediately if Material loaded
if (isLoaded())
{
_load();
}
// Tell parent to recalculate hash
if( Pass::getHashFunction() == Pass::getBuiltinHashFunction( Pass::MIN_TEXTURE_CHANGE ) )
{
mParent->_dirtyHash();
}
}