本文整理汇总了C++中osgdb::Input类的典型用法代码示例。如果您正苦于以下问题:C++ Input类的具体用法?C++ Input怎么用?C++ Input使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Input类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnimationPathCallback_readLocalData
bool AnimationPathCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
osg::AnimationPathCallback *apc = dynamic_cast<osg::AnimationPathCallback*>(&obj);
if (!apc) return false;
bool iteratorAdvanced = false;
if (fr.matchSequence("pivotPoint %f %f %f"))
{
osg::Vec3 pivot;
fr[1].getFloat(pivot[0]);
fr[2].getFloat(pivot[1]);
fr[3].getFloat(pivot[2]);
apc->setPivotPoint(pivot);
fr += 4;
iteratorAdvanced = true;
}
if (fr.matchSequence("timeOffset %f"))
{
fr[1].getFloat(apc->_timeOffset);
fr+=2;
iteratorAdvanced = true;
}
else if(fr.matchSequence("timeMultiplier %f"))
{
fr[1].getFloat(apc->_timeMultiplier);
fr+=2;
iteratorAdvanced = true;
}
static osg::ref_ptr<osg::AnimationPath> s_path = new osg::AnimationPath;
ref_ptr<osg::Object> object = fr.readObjectOfType(*s_path);
if (object.valid())
{
osg::AnimationPath* animpath = dynamic_cast<osg::AnimationPath*>(object.get());
if (animpath) apc->setAnimationPath(animpath);
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
示例2: Layer_readLocalData
bool Layer_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgVolume::Layer& layer = static_cast<osgVolume::Layer&>(obj);
bool itrAdvanced = false;
osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<osgVolume::Locator>());
osgVolume::Locator* locator = dynamic_cast<osgVolume::Locator*>(readObject.get());
if (locator) layer.setLocator(locator);
return itrAdvanced;
}
示例3: Locator_readLocalData
bool Locator_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgVolume::Locator& locator = static_cast<osgVolume::Locator&>(obj);
bool itrAdvanced = false;
if (fr.matchSequence("Transform {"))
{
int tansform_entry = fr[0].getNoNestedBrackets();
fr += 2;
int row=0;
int col=0;
double v;
osg::Matrixd matrix;
while (!fr.eof() && fr[0].getNoNestedBrackets()>tansform_entry)
{
if (fr[0].getFloat(v))
{
matrix(row,col)=v;
++col;
if (col>=4)
{
col = 0;
++row;
}
++fr;
}
else fr.advanceOverCurrentFieldOrBlock();
}
locator.setTransform(matrix);
++fr;
itrAdvanced = true;
}
return itrAdvanced;
}
示例4: OQN_readLocalData
bool OQN_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
osg::OcclusionQueryNode &oqn = static_cast<osg::OcclusionQueryNode&>(obj);
bool advanced(false);
int param;
if (fr[0].matchWord("QueriesEnabled"))
{
bool enable(fr[1].getStr() == std::string("TRUE"));
oqn.setQueriesEnabled(enable);
fr += 2;
advanced = true;
}
if (fr.matchSequence("VisibilityThreshold %i"))
{
fr[1].getInt(param);
oqn.setVisibilityThreshold(param);
fr += 2;
advanced = true;
}
if (fr.matchSequence("QueryFrameCount %i"))
{
fr[1].getInt(param);
oqn.setQueryFrameCount(param);
fr += 2;
advanced = true;
}
if (fr[0].matchWord("DebugDisplay"))
{
bool enable(fr[1].getStr() == std::string("TRUE"));
oqn.setDebugDisplay(enable);
fr += 2;
advanced = true;
}
return advanced;
}
示例5: DatabaseBuilder_readLocalData
bool DatabaseBuilder_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
vpb::DatabaseBuilder& db = static_cast<vpb::DatabaseBuilder&>(obj);
bool itrAdvanced = false;
osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<BuildOptions>());
if (readObject.valid())
{
db.setBuildOptions(dynamic_cast<BuildOptions*>(readObject.get()));
}
return itrAdvanced;
}
示例6: ModularProgram_readLocalData
bool ModularProgram_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
osgParticle::ModularProgram &myobj = static_cast<osgParticle::ModularProgram &>(obj);
bool itAdvanced = false;
osgParticle::Operator *op = static_cast<osgParticle::Operator *>(fr.readObjectOfType(osgDB::type_wrapper<osgParticle::Operator>()));
if (op) {
myobj.addOperator(op);
itAdvanced = true;
}
return itAdvanced;
}
示例7: TransferFunctionProperty_readLocalData
bool TransferFunctionProperty_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgVolume::TransferFunctionProperty& tfp = static_cast<osgVolume::TransferFunctionProperty&>(obj);
bool itrAdvanced = false;
osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<osg::TransferFunction>());
if (readObject.valid()) itrAdvanced = true;
osg::TransferFunction* tf = dynamic_cast<osg::TransferFunction*>(readObject.get());
if (tf) tfp.setTransferFunction(tf);
return itrAdvanced;
}
示例8: readMatrix
static bool readMatrix(osg::Matrix &matrix, osgDB::Input &fr, const char *keyword)
{
bool iteratorAdvanced = false;
if (fr[0].matchWord(keyword) && fr[1].isOpenBracket())
{
int entry = fr[0].getNoNestedBrackets();
fr += 2;
int row = 0;
int col = 0;
double v;
while (!fr.eof() && fr[0].getNoNestedBrackets() > entry)
{
if (fr[0].getFloat(v))
{
matrix(row, col) = v;
++col;
if (col >= 4)
{
col = 0;
++row;
}
++fr;
}
else
fr.advanceOverCurrentFieldOrBlock();
}
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
示例9: SwitchProperty_readLocalData
bool SwitchProperty_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgVolume::SwitchProperty& sp = static_cast<osgVolume::SwitchProperty&>(obj);
bool itrAdvanced = false;
int value=0;
if (fr.read("activeProperty",value))
{
itrAdvanced = true;
sp.setActiveProperty(value);
}
return itrAdvanced;
}
示例10: ObjectRecordData_readLocalData
bool ObjectRecordData_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
bool iteratorAdvanced = false;
osgSim::ObjectRecordData &ord = static_cast<osgSim::ObjectRecordData&>(obj);
if (fr.matchSequence("flags %i"))
{
unsigned int flags;
fr[1].getUInt( flags );
ord._flags = flags;
fr += 2;
iteratorAdvanced = true;
}
if (fr.matchSequence("relativePriority %i"))
{
int relativePriority;
fr[1].getInt( relativePriority );
ord._relativePriority = (short) relativePriority;
fr += 2;
iteratorAdvanced = true;
}
if (fr.matchSequence("transparency %i"))
{
int transparency;
fr[1].getInt( transparency );
ord._transparency = (unsigned short) transparency;
fr += 2;
iteratorAdvanced = true;
}
if (fr.matchSequence("effectID1 %i"))
{
int effectID1;
fr[1].getInt( effectID1 );
ord._effectID1 = (short) effectID1;
fr += 2;
iteratorAdvanced = true;
}
if (fr.matchSequence("effectID2 %i"))
{
int effectID2;
fr[1].getInt( effectID2 );
ord._effectID2 = (short) effectID2;
fr += 2;
iteratorAdvanced = true;
}
if (fr.matchSequence("significance %i"))
{
int significance;
fr[1].getInt( significance );
ord._significance = (short) significance;
fr += 2;
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
示例11: HeightFieldLayer_readLocalData
bool HeightFieldLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgTerrain::HeightFieldLayer& layer = static_cast<osgTerrain::HeightFieldLayer&>(obj);
bool itrAdvanced = false;
if (fr.matchSequence("file %w") || fr.matchSequence("file %s"))
{
std::string setname;
std::string filename;
osgTerrain::extractSetNameAndFileName(fr[1].getStr(),setname, filename);
if (!filename.empty())
{
osg::ref_ptr<osg::HeightField> hf = osgDB::readHeightFieldFile(filename);
if (hf.valid())
{
layer.setName(setname);
layer.setFileName(filename);
layer.setHeightField(hf.get());
}
}
fr += 2;
itrAdvanced = true;
}
osg::ref_ptr<osg::Object> readObject = fr.readObjectOfType(osgDB::type_wrapper<osg::HeightField>());
if (readObject.valid()) itrAdvanced = true;
osg::HeightField* hf = dynamic_cast<osg::HeightField*>(readObject.get());
if (hf)
{
layer.setHeightField(hf);
}
return itrAdvanced;
}
示例12: ShadowedScene_readLocalData
bool ShadowedScene_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgShadow::ShadowedScene& ss = static_cast<osgShadow::ShadowedScene&>(obj);
bool iteratorAdvanced = false;
osg::ref_ptr<osg::Object> object=0;
while((object=fr.readObject())!=0)
{
osgShadow::ShadowTechnique* st = dynamic_cast<osgShadow::ShadowTechnique*>(object.get());
if (st) ss.setShadowTechnique(st);
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
示例13: ScalarProperty_readLocalData
bool ScalarProperty_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgVolume::ScalarProperty& sp = static_cast<osgVolume::ScalarProperty&>(obj);
bool itrAdvanced = false;
float value=0;
if (fr.read("value",value))
{
itrAdvanced = true;
sp.setValue(value);
}
return itrAdvanced;
}
示例14: NodeCallback_readLocalData
bool NodeCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
NodeCallback& nc = dynamic_cast<NodeCallback&>(obj);
if (!(&nc)) return false;
bool itrAdvanced = false;
static osg::ref_ptr<NodeCallback> s_nc = new NodeCallback;
osg::ref_ptr<osg::Object> object = fr.readObjectOfType(*s_nc);
if (object.valid())
{
NodeCallback* ncc = dynamic_cast<NodeCallback*>(object.get());
if (ncc) nc.setNestedCallback(ncc);
itrAdvanced = true;
}
return itrAdvanced;
}
示例15: SwitchLayer_readLocalData
bool SwitchLayer_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
osgTerrain::SwitchLayer &layer = static_cast<osgTerrain::SwitchLayer&>(obj);
bool itrAdvanced = false;
int i;
if (fr.read("ActiveLayer", i))
{
layer.setActiveLayer(i);
itrAdvanced = true;
}
;
return itrAdvanced;
}