本文整理汇总了C++中osgdb::Output::wrapString方法的典型用法代码示例。如果您正苦于以下问题:C++ Output::wrapString方法的具体用法?C++ Output::wrapString怎么用?C++ Output::wrapString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osgdb::Output
的用法示例。
在下文中一共展示了Output::wrapString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: osgWidget_Box_writeData
bool osgWidget_Box_writeData(const osg::Object& obj, osgDB::Output& fw) {
const osgWidget::Box& model = static_cast<const osgWidget::Box&>(obj);
fw.indent() << fw.wrapString("Box stuff...") << std::endl;
return true;
}
示例2: ParticleEffect_writeLocalData
bool ParticleEffect_writeLocalData(const osg::Object& object, osgDB::Output& fw)
{
const osgParticle::ParticleEffect& effect = static_cast<const osgParticle::ParticleEffect&>(object);
fw.indent()<<"textFileName "<<fw.wrapString(effect.getTextureFileName())<<std::endl;
fw.indent()<<"position "<<effect.getPosition()<<std::endl;
fw.indent()<<"scale "<<effect.getScale()<<std::endl;
fw.indent()<<"intensity "<<effect.getIntensity()<<std::endl;
fw.indent()<<"startTime "<<effect.getStartTime()<<std::endl;
fw.indent()<<"emitterDuration "<<effect.getEmitterDuration()<<std::endl;
fw.indent()<<"particleDuration "<<effect.getParticleDuration()<<std::endl;
osgParticle::rangef rf = effect.getDefaultParticleTemplate().getSizeRange();
fw.indent() << "particleSizeRange " << rf.minimum << " " << rf.maximum << std::endl;
rf = effect.getDefaultParticleTemplate().getAlphaRange();
fw.indent() << "particleAlphaRange " << rf.minimum << " " << rf.maximum << std::endl;
osgParticle::rangev4 rv4 = effect.getDefaultParticleTemplate().getColorRange();
fw.indent() << "particleColorRange ";
fw << rv4.minimum.x() << " " << rv4.minimum.y() << " " << rv4.minimum.z() << " " << rv4.minimum.w() << " ";
fw << rv4.maximum.x() << " " << rv4.maximum.y() << " " << rv4.maximum.z() << " " << rv4.maximum.w() << std::endl;
fw.indent()<<"wind "<<effect.getWind()<<std::endl;
fw.indent()<<"useLocalParticleSystem ";
if (effect.getUseLocalParticleSystem()) fw<<"TRUE"<<std::endl;
else
{
fw<<"FALSE"<<std::endl;
fw.writeObject(*effect.getParticleSystem());
}
return true;
}
示例3: osgWidget_WindowManager_writeData
bool osgWidget_WindowManager_writeData(const osg::Object& /*obj*/, osgDB::Output& fw)
{
// const osgWidget::WindowManager& model = static_cast<const osgWidget::WindowManager&>(obj);
fw.indent() << fw.wrapString("WindowManager stuff...") << std::endl;
return true;
}
示例4: osgWidget_EmbeddedWindow_writeData
bool osgWidget_EmbeddedWindow_writeData(const osg::Object& /*obj*/, osgDB::Output& fw)
{
// const osgWidget::Window::EmbeddedWindow& model = static_cast<const osgWidget::Window::EmbeddedWindow&>(obj);
fw.indent() << fw.wrapString("EmbeddedWindow stuff...") << std::endl;
return true;
}
示例5: ImageLayer_writeLocalData
bool ImageLayer_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
{
const osgTerrain::ImageLayer& layer = static_cast<const osgTerrain::ImageLayer&>(obj);
std::string fileName = layer.getFileName();
if (fw.getOutputTextureFiles())
{
if (fileName.empty())
{
fileName = fw.getTextureFileNameForOutput();
}
osgDB::writeImageFile(*layer.getImage(), fileName);
}
if (!fileName.empty())
{
fw.indent()<<"file "<< fw.wrapString(fileName) << std::endl;
}
return true;
}
示例6: TextBase_writeLocalData
//.........这里部分代码省略.........
// alignment
fw.indent() << "alignment ";
switch(text.getAlignment())
{
case osgText::Text::LEFT_TOP: fw << "LEFT_TOP" << std::endl; break;
case osgText::Text::LEFT_CENTER : fw << "LEFT_CENTER" << std::endl; break;
case osgText::Text::LEFT_BOTTOM : fw << "LEFT_BOTTOM" << std::endl; break;
case osgText::Text::CENTER_TOP: fw << "CENTER_TOP" << std::endl; break;
case osgText::Text::CENTER_CENTER: fw << "CENTER_CENTER" << std::endl; break;
case osgText::Text::CENTER_BOTTOM: fw << "CENTER_BOTTOM" << std::endl; break;
case osgText::Text::RIGHT_TOP: fw << "RIGHT_TOP" << std::endl; break;
case osgText::Text::RIGHT_CENTER: fw << "RIGHT_CENTER" << std::endl; break;
case osgText::Text::RIGHT_BOTTOM: fw << "RIGHT_BOTTOM" << std::endl; break;
case osgText::Text::LEFT_BASE_LINE: fw << "LEFT_BASE_LINE" << std::endl; break;
case osgText::Text::CENTER_BASE_LINE:fw << "CENTER_BASE_LINE" << std::endl; break;
case osgText::Text::RIGHT_BASE_LINE: fw << "RIGHT_BASE_LINE" << std::endl; break;
case osgText::Text::LEFT_BOTTOM_BASE_LINE: fw << "LEFT_BOTTOM_BASE_LINE" << std::endl; break;
case osgText::Text::CENTER_BOTTOM_BASE_LINE:fw << "CENTER_BOTTOM_BASE_LINE" << std::endl; break;
case osgText::Text::RIGHT_BOTTOM_BASE_LINE: fw << "RIGHT_BOTTOM_BASE_LINE" << std::endl; break;
};
if (!text.getRotation().zeroRotation())
{
fw.indent() << "rotation " << text.getRotation() << std::endl;
}
if (text.getAutoRotateToScreen())
{
fw.indent() << "autoRotateToScreen TRUE"<< std::endl;
}
// layout
fw.indent() << "layout ";
switch(text.getLayout())
{
case osgText::Text::LEFT_TO_RIGHT: fw << "LEFT_TO_RIGHT" << std::endl; break;
case osgText::Text::RIGHT_TO_LEFT: fw << "RIGHT_TO_LEFT" << std::endl; break;
case osgText::Text::VERTICAL: fw << "VERTICAL" << std::endl; break;
};
// position
osg::Vec3 p = text.getPosition();
fw.indent() << "position " << p.x() << " " << p.y() << " " << p.z() << std::endl;
// color
// osg::Vec4 c = text.getColor();
// fw.indent() << "color " << c.x() << " " << c.y() << " " << c.z() << " " << c.w() << std::endl;
// draw mode
fw.indent() << "drawMode " << text.getDrawMode() << std::endl;
// bounding box margin
fw.indent() << "BoundingBoxMargin " << text.getBoundingBoxMargin() << std::endl;
// bounding box color
osg::Vec4 bbc = text.getBoundingBoxColor();
fw.indent() << "BoundingBoxColor " << bbc.x() << " " << bbc.y() << " " << bbc.z() << " " << bbc.w() << std::endl;
// text
const osgText::String& textstring = text.getText();
bool isACString = true;
osgText::String::const_iterator itr;
for(itr=textstring.begin();
itr!=textstring.end() && isACString;
++itr)
{
if (*itr==0 || *itr>256) isACString=false;
}
if (isACString)
{
std::string str;
for(itr=textstring.begin();
itr!=textstring.end();
++itr)
{
str += (char)(*itr);
}
//std::copy(textstring.begin(),textstring.end(),std::back_inserter(str));
fw.indent() << "text " << fw.wrapString(str) << std::endl;
}
else
{
// do it the hardway...output each character as an int
fw.indent() << "text "<<textstring.size()<<std::endl;;
osgDB::writeArray(fw,textstring.begin(),textstring.end());
}
return true;
}