/* SFNode.C */ #include #include #include "vrml.H" #include "error.H" void SFNode::construct(const char *id, const int nr, const interfaceDeclaration *iface) { // filename of file being parsed and line at which parsing is going on // declared in yacc.y. extern char *yyfilename; extern int lineno; typeId = id; nameId = 0; nameIndex = -1; nrInterfaceDeclarations = nr; if (nr > 0) { interface = new interfaceDeclaration[nr]; for (int i=0; iinstantiate_interface(master); return instance; } #define MAXSFNODENAMELEN 1000 char* SFNode::name(char *buf) { if (!buf) { static char sbuf[MAXSFNODENAMELEN]; buf = sbuf; } ostrstream ost(buf,MAXSFNODENAMELEN); ost << typeId; if (nameId) ost << ' ' << nameId << '(' << nameIndex << ')'; if (filename && line>0) ost << '@' << filename << ':' << line; ost << '\0'; return buf; } ostream& SFNode::print(ostream& s) { s << name() << " {\n"; for (int i=0; ikind==kfield || d->kind==kexposedField) && strcmp(d->Id, fieldId) == 0) return d; } return 0; } interfaceDeclaration* SFNode::get_eventIn(char *eventInId) { int i; interfaceDeclaration *d; for (i=0, d=interface; ikind==keventIn && strcmp(d->Id, eventInId) == 0) return d; } return 0; } interfaceDeclaration* SFNode::get_eventOut(char *eventOutId) { int i; interfaceDeclaration *d; for (i=0, d=interface; ikind==keventOut && strcmp(d->Id, eventOutId) == 0) return d; } return 0; } void SFNode::render(void) { Warning("SFNode::render", "can't yet render %s nodes", typeId); }