15 #include "vrmlParser.h" 32 get_value(
const char *field_name)
const {
33 Fields::const_iterator fi;
34 for (fi = _fields.begin(); fi != _fields.end(); ++fi) {
35 if (strcmp((*fi)._type->name, field_name) == 0) {
36 return ((*fi)._value);
42 if (field !=
nullptr) {
46 std::cerr <<
"No such field defined for type " << _type->getName() <<
": " 47 << field_name <<
"\n";
55 output(std::ostream &out,
int indent_level)
const {
56 out << _type->getName() <<
" {\n";
57 Fields::const_iterator fi;
58 for (fi = _fields.begin(); fi != _fields.end(); ++fi) {
59 indent(out, indent_level + 2) << (*fi)._type->name <<
" ";
60 output_value(out, (*fi)._value, (*fi)._type->type, indent_level + 2) <<
"\n";
62 indent(out, indent_level) <<
"}";
67 output(std::ostream &out,
int indent)
const {
70 output_value(out, v, SFNODE,
indent);
73 std::ostream &operator << (std::ostream &out,
const VrmlScene &scene) {
74 VrmlScene::const_iterator si;
75 for (si = scene.begin(); si != scene.end(); ++si) {
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL vector.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.