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


C++ StrStreamType::str方法代码示例

本文整理汇总了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();

    }
开发者ID:JangoOs,项目名称:kbengine_ogre_demo,代码行数:18,代码来源:OgreTechnique.cpp

示例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();
    }
开发者ID:brock7,项目名称:TianLong,代码行数:17,代码来源:OgreSimpleRenderable.cpp

示例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();
	}
开发者ID:xubingyue,项目名称:particle_universe,代码行数:20,代码来源:ParticleUniverseScriptSerializer.cpp

示例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;
	}
开发者ID:zhouxs1023,项目名称:Editor,代码行数:20,代码来源:TerrainMaterialGeneratorC.cpp

示例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;

	}
开发者ID:Anti-Mage,项目名称:ogre,代码行数:44,代码来源:OgreSceneManagerEnumerator.cpp

示例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"
        );
}
开发者ID:Gachuk,项目名称:Hardwar,代码行数:20,代码来源:OgreMaxUtilities.cpp

示例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"
        );
}
开发者ID:Gachuk,项目名称:Hardwar,代码行数:20,代码来源:OgreMaxUtilities.cpp

示例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;

}
开发者ID:gorkinovich,项目名称:DefendersOfMankind,代码行数:21,代码来源:OgrePageManager.cpp

示例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"
        );
}
开发者ID:Gachuk,项目名称:Hardwar,代码行数:20,代码来源:OgreMaxUtilities.cpp

示例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"
        );
}
开发者ID:Gachuk,项目名称:Hardwar,代码行数:20,代码来源:OgreMaxUtilities.cpp

示例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;
        }
    }
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:42,代码来源:OgreMaterial.cpp

示例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;
	}
开发者ID:zxycode007,项目名称:Sapphire,代码行数:21,代码来源:SapphireException.cpp

示例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();
}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:22,代码来源:OgreStringConverter.cpp

示例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;
		}
	}
开发者ID:Painpillow,项目名称:openDarkEngine,代码行数:41,代码来源:MaterialService.cpp

示例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();
		}

    }
开发者ID:Anti-Mage,项目名称:ogre,代码行数:40,代码来源:OgreTextureUnitState.cpp


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