本文整理汇总了C++中osgdb::Output::precision方法的典型用法代码示例。如果您正苦于以下问题:C++ Output::precision方法的具体用法?C++ Output::precision怎么用?C++ Output::precision使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osgdb::Output
的用法示例。
在下文中一共展示了Output::precision方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VolumeTile_writeLocalData
bool VolumeTile_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
{
const osgVolume::VolumeTile& volumeTile = static_cast<const osgVolume::VolumeTile&>(obj);
int prec = fw.precision();
fw.precision(15);
if (volumeTile.getLocator())
{
fw.writeObject(*volumeTile.getLocator());
}
if (volumeTile.getLayer())
{
fw.writeObject(*volumeTile.getLayer());
}
if (volumeTile.getVolumeTechnique())
{
fw.writeObject(*volumeTile.getVolumeTechnique());
}
fw.precision(prec);
return true;
}
示例2: ClusterCullingCallback_writeLocalData
bool ClusterCullingCallback_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const ClusterCullingCallback* ccc = dynamic_cast<const ClusterCullingCallback*>(&obj);
if (!ccc) return false;
int prec = fw.precision();
fw.precision(15);
fw.indent() << "controlPoint " << ccc->getControlPoint() << std::endl;
fw.indent() << "normal " << ccc->getNormal() << std::endl;
fw.indent() << "radius " << ccc->getRadius() << std::endl;
fw.indent() << "deviation " << ccc->getDeviation() << std::endl;
fw.precision(prec);
return true;
}
示例3: AnimationPath_writeLocalData
bool AnimationPath_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const osg::AnimationPath* ap = dynamic_cast<const osg::AnimationPath*>(&obj);
if (!ap) return false;
fw.indent() << "LoopMode ";
switch(ap->getLoopMode())
{
case AnimationPath::SWING:
fw << "SWING" <<std::endl;
break;
case AnimationPath::LOOP:
fw << "LOOP"<<std::endl;
break;
case AnimationPath::NO_LOOPING:
fw << "NO_LOOPING"<<std::endl;
break;
}
const AnimationPath::TimeControlPointMap& tcpm = ap->getTimeControlPointMap();
fw.indent() << "ControlPoints {"<< std::endl;
fw.moveIn();
int prec = fw.precision();
fw.precision(15);
for (AnimationPath::TimeControlPointMap::const_iterator itr=tcpm.begin();
itr!=tcpm.end();
++itr)
{
fw.indent() << itr->first << " " << itr->second.getPosition() << " " << itr->second.getRotation() << " " <<itr->second.getScale() << std::endl;
}
fw.precision(prec);
fw.moveOut();
fw.indent() << "}"<< std::endl;
return true;
}
示例4: setPrecision
void setPrecision(osgDB::Output& fout, const osgDB::ReaderWriter::Options* options) const
{
if (options)
{
std::istringstream iss(options->getOptionString());
std::string opt;
while (iss >> opt)
{
if(opt=="PRECISION" || opt=="precision")
{
int prec;
iss >> prec;
fout.precision(prec);
}
if (opt=="OutputTextureFiles")
{
fout.setOutputTextureFiles(false);
}
}
}
示例5: Array_writeLocalData
bool Array_writeLocalData( const osg::Array& array, osgDB::Output& fw )
{
switch(array.getType())
{
case( osg::Array::ByteArrayType):
{
const osg::ByteArray& carray = static_cast<const osg::ByteArray&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArrayAsInts(fw,carray.begin(),carray.end());
return true;
}
break;
case( osg::Array::ShortArrayType):
{
const osg::ShortArray& carray = static_cast<const osg::ShortArray&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end());
return true;
}
break;
case( osg::Array::IntArrayType):
{
const osg::IntArray& carray = static_cast<const osg::IntArray&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end());
return true;
}
break;
case( osg::Array::UByteArrayType):
{
const osg::UByteArray& carray = static_cast<const osg::UByteArray&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArrayAsInts(fw,carray.begin(),carray.end());
return true;
}
break;
case( osg::Array::UShortArrayType):
{
const osg::UShortArray& carray = static_cast<const osg::UShortArray&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end());
return true;
}
break;
case( osg::Array::UIntArrayType):
{
const osg::UIntArray& carray = static_cast<const osg::UIntArray&>(array);
fw<<array.className()<<" "<<carray.size()<<" ";
osgDB::writeArray(fw,carray.begin(),carray.end());
return true;
}
break;
case( osg::Array::Vec4ubArrayType):
{
const osg::Vec4ubArray& carray = static_cast<const osg::Vec4ubArray&>(array);
fw<<array.className()<<" "<<carray.size()<<" ";
osgDB::writeArray(fw,carray.begin(),carray.end(),1);
return true;
}
break;
case( osg::Array::FloatArrayType):
{
const osg::FloatArray& carray = static_cast<const osg::FloatArray&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end());
return true;
}
break;
case( osg::Array::Vec2ArrayType):
{
const osg::Vec2Array& carray = static_cast<const osg::Vec2Array&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end(),1);
return true;
}
break;
case( osg::Array::Vec3ArrayType):
{
const osg::Vec3Array& carray = static_cast<const osg::Vec3Array&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end(),1);
return true;
}
break;
case( osg::Array::Vec4ArrayType):
{
const osg::Vec4Array& carray = static_cast<const osg::Vec4Array&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end(),1);
return true;
}
break;
case( osg::Array::DoubleArrayType):
{
int prec = fw.precision(15);
const osg::DoubleArray& carray = static_cast<const osg::DoubleArray&>(array);
fw<<array.className()<<" "<<carray.size()<<std::endl;
osgDB::writeArray(fw,carray.begin(),carray.end());
fw.precision(prec);
return true;
//.........这里部分代码省略.........