osgDB::BEGIN_BRACKET
请问osgDB::BEGIN_BRACKET是哪个版本的osg中osgDB库中包含的? In ascii mode, such an output:os << osgDB::PROPERTY("Account") << osgDB::BEGIN_BRACKET << std::endl;
os << osgDB::PROPERTY("ID") << (int)1 << std::endl;
os << osgDB::PROPERTY("Name"); os.writeWrappedString("Wang Rui"); os << std::endl;
os << osgDB::PROPERTY("Salary") << (float)25.5 << std::endl;
os << osgDB::END_BRACKET << std::endl;
Will result in:
Account {
ID 1
Name "Wang Rui"
Salary 25.5
}
And to read the information back, just invert the operators and omit the endl symbol:
std::string name; int id; float salary;
is >> osgDB::PROPERTY("Account") >> osgDB::BEGIN_BRACKET;
is >> osgDB::PROPERTY("ID") >> id;
is >> osgDB::PROPERTY("Name"); is.readWrappedString(name);
is >> osgDB::PROPERTY("Salary") >> salary;
is >> osgDB::END_BRACKET;
起到输入输出作用? osgDB::InputStream中有具体定义,看了一下:
// Property & mask variables
ObjectProperty PROPERTY;
ObjectMark BEGIN_BRACKET;
ObjectMark END_BRACKET; 用is.BEGIN_BRACKET或者 os.BEGIN_BRACKET解决 :) osg3.2版本便编译没问题……
页:
[1]