24 #include <boost/version.hpp> 25 #if (BOOST_VERSION <= 103301) 26 #include <boost/filesystem/path.hpp> 27 #include <boost/filesystem/operations.hpp> 29 #include <boost/filesystem.hpp> 33 using namespace boost;
117 N_COLOR_INTERPOLATOR,
118 N_COORDINATE_INTERPOLATOR,
119 N_ORIENTATION_INTERPOLATOR,
120 N_NORMAL_INTERPOLATOR,
121 N_POSITION_INTERPOLATOR,
122 N_SCALAR_INTERPOLATOR,
329 VrmlNodePtr newInlineSource(std::string& io_filename);
383 void readSFInt32(
SFInt32& out_value);
384 void readSFFloat(
SFFloat& out_value);
385 void readSFString(
SFString& out_value);
386 void readMFInt32(
MFInt32& out_value);
387 void readMFFloat(
MFFloat& out_value);
388 void readSFColor(
SFColor& out_value);
389 void readMFColor(
MFColor& out_value);
390 void readMFString(
MFString& out_value);
391 void readSFVec2f(
SFVec2f& out_value);
392 void readMFVec2f(
MFVec2f& out_value);
393 void readSFVec3f(
SFVec3f& out_value);
394 void readMFVec3f(
MFVec3f& out_value);
397 void readSFBool(
SFBool& out_value);
398 void readSFTime(
SFTime& out_value);
399 void readMFTime(
MFTime& out_value);
403 void readSFImage(
SFImage& out_image );
414 VrmlParser::VrmlParser()
420 VrmlParser::VrmlParser(
const string&
filename)
428 void VrmlParser::init()
455 impl->protoInstanceActualNodeExtractionMode = isOn;
465 impl->load(filename);
471 filesystem::path localPath(filename);
472 localPath.normalize();
474 #if (BOOST_VERSION < 104600) 476 scanner->loadFile(localPath.file_string());
479 scanner->loadFile(localPath.string());
484 bool ok =
scanner->readString(
"#VRML V2.0");
491 scanner->setWhiteSpaceChar(
',');
492 scanner->setLineOriented(
false);
519 string nodeTypeName(
scanner->stringValue);
531 scanner->throwException(
"PROTO node cannot be defined here");
537 const string& label =
scanner->stringValue;
538 TDefNodeMap::iterator p =
defNodeMap.find(label);
543 (
string(
"A node \"") + label +
"\" specified by the USE directive does not exist");
549 if(symbol == D_ROUTE){
552 scanner->throwException(
"Illegal ROUTE (without TO)");
559 if(symbol == U_SCRIPT){
560 cerr <<
"Script is not supported. " << endl;
564 if(symbol == U_EXTERNPROTO){
565 cerr <<
"ExternProto is not supported." << endl;
571 def_name =
scanner->readStringEx(
"Illegal DEF name");
574 nodeTypeName =
scanner->stringValue;
581 (
string(
"The entity of a ") + nodeTypeName +
" node does not correctly begin with '{'");
592 (
string(
"A ") + nodeTypeName +
" node is not correctly closed with '}'");
595 if(def_name.size() > 0) {
597 node->defName = def_name;
658 case N_COORDINATE_INTERPOLATOR: node =
skipUnsupportedNode(
"CoordinateInterpolator");
break;
659 case N_ORIENTATION_INTERPOLATOR: node =
skipUnsupportedNode(
"OrientationInterpolator");
break;
670 default:
scanner->throwException
671 (
string(
"Node type \"") + nodeTypeName +
"\" is not supported");
675 if(!node->isCategoryOf(nodeCategory)){
677 (
string(
"A ") + nodeTypeName +
" node is put in a illegal place");
687 if(!
scanner->readQuotedString()){
688 if(
scanner->peekChar() ==
'}'){
691 scanner->throwException(
"Node is not closed." );
702 for(
int i=0;
i<1;
i++){
704 if(!
scanner->readQuotedString()){
705 if(
scanner->peekChar() ==
'}'){
710 scanner->throwException(
"Script is not closed." );
725 if(!
scanner->readQuotedString()){
726 if(
scanner->peekChar() ==
']' ){
732 scanner->throwException(
"EXTERNPROTO is not closed." );
752 scanner->readCharEx(
'}',
"syntax error 2");
755 for( MFString::iterator ite = inlineUrls.begin(); ite != inlineUrls.end(); ++ite ){
757 inlineNode->urls.push_back(*ite);
767 filesystem::path localPath;
773 localPath.normalize();
775 if ( ! exists(localPath) ){
777 filesystem::path parentPath(
scanner->filename );
778 #if BOOST_VERSION < 103600 779 localPath = parentPath.branch_path() / localPath;
781 localPath = parentPath.parent_path() / localPath;
783 localPath.normalize();
785 chkFile = complete( localPath ).string();
788 chkFile = io_filename;
791 if( chkFile == *cIte )
793 scanner->throwException(
"Infinity loop ! " + chkFile +
" is included ancestor list");
799 inlineParser.
load( chkFile );
800 io_filename = chkFile;
805 group->children.push_back(node);
809 if(group->children.size() == 1){
810 return group->children.front();
819 string proto_name =
scanner->readWordEx(
"illegal PROTO name");
820 scanner->readCharEx(
'[',
"syntax error 3");
824 while(!
scanner->readChar(
']')){
825 int event_type =
scanner->readSymbolEx(
"illegal field event type");
826 int field_symbol =
scanner->readSymbolEx(
"illegal field type");
827 string field_name =
scanner->readWordEx(
"syntax error 4");
835 case E_EXPOSED_FIELD:
837 switch(field_symbol){
857 default:
scanner->throwException(
"illegal field type");
864 switch(field_symbol){
885 default:
scanner->throwException(
"illegal field event type");
890 scanner->readCharEx(
'{',
"A PROTO definition has no entity");
894 int token =
scanner->readToken();
896 scanner->throwException(
"syntax error 5");
898 if(
scanner->charValue ==
'{') {
900 }
else if(
scanner->charValue ==
'}') {
909 entityScanner->setText(begin,
scanner->text - begin - 1);
910 entityScanner->setLineNumberOffset(
scanner->lineNumber);
922 TProtoMap::iterator p =
protoMap.find(proto_name);
924 scanner->throwException(
"undefined node");
931 TProtoFieldMap::iterator p = protoInstance->fields.find(
scanner->stringValue);
932 if(p == protoInstance->fields.end())
933 scanner->throwException(
"undefined field");
966 return protoInstance;
973 ProtoToEntityScannerMap::iterator p;
976 scanner->throwException(
"Undefined proto node instance");
986 node->defName = protoInstance->defName;
1004 case F_FIELD_OF_VIEW:
readSFFloat(node->fieldOfView);
break;
1007 case F_POSITION:
readSFVec3f(node->position);
break;
1008 case F_DESCRIPTION:
readSFString(node->description);
break;
1010 default:
scanner->throwException(
"Undefined field");
1026 case F_AVATAR_SIZE:
readMFFloat(node->avatarSize);
break;
1027 case F_HEADLIGHT:
readSFBool(node->headlight);
break;
1030 case F_VISIBILITY_LIMIT:
readSFFloat(node->visibilityLimit);
break;
1032 default:
scanner->throwException(
"Undefined field");
1048 case F_GROUND_ANGLE:
readMFFloat(node->groundAngle);
break;
1049 case F_GROUND_COLOR:
readMFColor(node->groundColor);
break;
1050 case F_SKY_ANGLE:
readMFFloat(node->skyAngle);
break;
1051 case F_SKY_COLOR:
readMFColor(node->skyColor);
break;
1053 case F_BOTTOM_URL:
readMFString(node->bottomUrl);
break;
1059 default:
scanner->throwException(
"Undefined field");
1075 case F_BBOX_CENTER:
readSFVec3f(node->bboxCenter);
break;
1076 case F_BBOX_SIZE:
readSFVec3f(node->bboxSize);
break;
1079 case F_ADD_CHILDREN:
1080 case F_REMOVE_CHILDREN:
1087 default:
scanner->throwException(
"Undefined field");
1106 case F_SCALE_ORIENTATION:
readSFRotation(node->scaleOrientation);
break;
1107 case F_TRANSLATION:
readSFVec3f(node->translation);
break;
1108 case F_BBOX_CENTER:
readSFVec3f(node->bboxCenter);
break;
1109 case F_BBOX_SIZE:
readSFVec3f(node->bboxSize);
break;
1113 default:
scanner->throwException(
"Undefined field");
1132 default:
scanner->throwException(
"Undefined field");
1148 case F_AUTO_OFFSET:
readSFBool(node->autoOffset);
break;
1149 case F_DISK_ANGLE:
readSFFloat(node->diskAngle);
break;
1150 case F_ENABLED:
readSFBool(node->enabled);
break;
1151 case F_MAX_ANGLE:
readSFFloat(node->maxAngle);
break;
1152 case F_MIN_ANGLE:
readSFFloat(node->minAngle);
break;
1155 default:
scanner->throwException(
"Undefined field");
1178 scanner->throwException(
"Undefined field" );
1205 scanner->throwException(
"Undefined field" );
1248 scanner->throwException(
"Undefined field" );
1286 case F_COLOR_PER_VERTEX:
1290 case F_CREASE_ANGLE:
1294 case F_NORMAL_PER_VERTEX:
1315 scanner->throwException(
"Undefined field" );
1329 case F_CROSS_SECTION:
1365 case F_CREASE_ANGLE:
1370 scanner->throwException(
"Undefined field" );
1388 case F_WHICH_CHOICE:
1393 scanner->throwException(
"Undefined field" );
1420 scanner->throwException(
"Undefined field");
1455 scanner->throwException(
"Undefined field" );
1468 switch(
scanner->symbolValue){
1494 scanner->throwException(
"Undefined field" );
1512 case F_VISIBILITY_RANGE:
1521 scanner->throwException(
"Undefined field" );
1535 case F_AXIS_OF_ROTATION:
1552 scanner->throwException(
"Undefined field" );
1575 scanner->throwException(
"Undefined field");
1609 case F_AMBIENT_INTENSITY:
1618 scanner->throwException(
"Undefined field" );
1635 case F_DIRECTION:
readSFVec3f(node->direction);
break;
1637 case F_INTENSITY:
readSFFloat(node->intensity);
break;
1639 case F_AMBIENT_INTENSITY:
readSFFloat(node->ambientIntensity);
break;
1641 default:
scanner->throwException(
"Undefined field");
1679 case F_AMBIENT_INTENSITY:
1691 case F_CUT_OFF_RANGE:
1696 scanner->throwException(
"Undefined field" );
1709 if(
scanner->symbolValue != F_SIZE)
1710 scanner->throwException(
"Undefined field");
1726 case F_BOTTOM:
readSFBool(node->bottom);
break;
1727 case F_BOTTOM_RADIUS:
readSFFloat(node->bottomRadius);
break;
1731 default:
scanner->throwException(
"Undefined field");
1747 case F_BOTTOM:
readSFBool(node->bottom);
break;
1753 default:
scanner->throwException(
"Undefined field");
1766 if(
scanner->symbolValue != F_RADIUS)
1767 scanner->throwException(
"Undefined field");
1785 case F_MAX_EXTENT:
readSFFloat(node->maxExtent);
break;
1788 default:
scanner->throwException(
"Undefined field");
1805 case F_HORIZONTAL:
readSFBool(node->horizontal);
break;
1808 case F_LEFT_TO_RIGHT:
readSFBool(node->leftToRight);
break;
1810 case F_SPACING:
readSFFloat(node->spacing);
break;
1812 case F_TOP_TO_BOTTOM:
readSFBool(node->topToBottom);
break;
1814 default:
scanner->throwException(
"Undefined field");
1832 case F_COLOR_INDEX:
readMFInt32(node->colorIndex);
break;
1833 case F_COLOR_PER_VERTEX:
readSFBool(node->colorPerVertex);
break;
1834 case F_COORD_INDEX:
readMFInt32(node->coordIndex);
break;
1836 default:
scanner->throwException(
"Undefined field");
1855 case F_COLOR_INDEX:
readMFInt32(node->colorIndex);
break;
1856 case F_COLOR_PER_VERTEX:
readSFBool(node->colorPerVertex);
break;
1857 case F_COORD_INDEX:
readMFInt32(node->coordIndex);
break;
1860 case F_CONVEX:
readSFBool(node->convex);
break;
1861 case F_SOLID:
readSFBool(node->solid);
break;
1862 case F_CREASE_ANGLE:
readSFFloat(node->creaseAngle);
break;
1863 case F_NORMAL_INDEX:
readMFInt32(node->normalIndex);
break;
1864 case F_NORMAL_PER_VERTEX:
readSFBool(node->normalPerVertex);
break;
1865 case F_TEX_COORD_INDEX:
readMFInt32(node->texCoordIndex);
break;
1874 default:
scanner->throwException(
"Undefined field");
1887 MFVec3f& coord = node->coord->point;
1889 int numUsedVertices = 0;
1890 vector<bool> usedVertices(coord.size(),
false);
1892 int n = index.size();
1895 vector<int> polygon;
1898 bool isSeparated =
false;
1905 polygon.push_back(index[i]);
1906 if(!usedVertices[index[i]]){
1907 usedVertices[index[
i]] =
true;
1913 const int numVertices = polygon.size();
1915 if(numVertices < 3){
1916 cerr <<
"Number of vertices is less than 3 !" << endl;
1918 if(numVertices > 3){
1919 cerr <<
"Polygon is not a triangle in ";
1920 cerr <<
scanner->filename << endl;
1921 for(
int j=0; j < numVertices; j++){
1922 cerr << polygon[j] <<
",";
1927 cerr <<
"Vertex index is not correctly separated by '-1'" << endl;
1930 int n = coord.size();
1931 for(
int j=0; j < numVertices; j++){
1932 if(polygon[j] >= n){
1933 cerr <<
"index " << polygon[j] <<
" is over the number of vertices" << endl;
1937 bool isIndexOverlapped =
false;
1938 bool isVertexOverlapped =
false;
1939 for(
int j = 0; j < numVertices - 1; j++){
1940 for(
int k = j+1; k < numVertices; k++){
1941 if(polygon[j] == polygon[k]){
1942 isIndexOverlapped =
true;
1944 SFVec3f& v1 = coord[polygon[j]];
1945 SFVec3f& v2 = coord[polygon[k]];
1946 if(v1[0] == v2[0] && v1[1] == v2[1] && v1[2] == v2[2]){
1947 isVertexOverlapped =
true;
1951 if(isIndexOverlapped){
1952 cerr <<
"overlapped vertex index in one polygon: ";
1953 for(
int l = 0; l < numVertices; l++){
1954 cerr << polygon[l] <<
",";
1959 if(isVertexOverlapped){
1960 cerr <<
"In " <<
scanner->filename <<
":";
1961 cerr <<
"two vertices in one polygon have the same position\n";
1963 for(
int l = 0; l < numVertices; l++){
1964 SFVec3f& v = coord[polygon[l]];
1965 cerr << polygon[l] <<
" = (" << v[0] <<
"," << v[1] <<
"," << v[2] <<
") ";
1971 if(numUsedVertices < static_cast<int>(coord.size())){
1972 cerr <<
"There are vertices which are not used in" <<
scanner->filename <<
".\n";
1973 cerr <<
"Number of vertices is " << coord.size();
1974 cerr <<
", Number of used ones is " << numUsedVertices << endl;
1984 if(
scanner->symbolValue != F_POINT)
1985 scanner->throwException(
"Undefined field");
1998 if(
scanner->symbolValue != F_POINT)
1999 scanner->throwException(
"Undefined field");
2012 if(
scanner->symbolValue != F_COLOR)
2013 scanner->throwException(
"Undefined field");
2026 if(
scanner->symbolValue != F_VECTOR)
2027 scanner->throwException(
"Undefined field");
2045 case F_TEXTURE_TRANSFORM:
2048 default:
scanner->throwException(
"Undefined field");
2064 case F_AMBIENT_INTENSITY:
readSFFloat(node->ambientIntensity);
break;
2065 case F_DIFFUSE_COLOR:
readSFColor(node->diffuseColor);
break;
2066 case F_EMISSIVE_COLOR:
readSFColor(node->emissiveColor);
break;
2067 case F_SHININESS:
readSFFloat(node->shininess);
break;
2068 case F_SPECULAR_COLOR:
readSFColor(node->specularColor);
break;
2069 case F_TRANSPARANCY:
readSFFloat(node->transparency);
break;
2071 default:
scanner->throwException(
"Undefined field");
2087 case F_REPEAT_S:
readSFBool(node->repeatS);
break;
2088 case F_REPEAT_T:
readSFBool(node->repeatT);
break;
2090 default:
scanner->throwException(
"Undefined field");
2106 case F_ROTATION:
readSFFloat(node->rotation);
break;
2108 case F_TRANSLATION:
readSFVec2f(node->translation);
break;
2110 default:
scanner->throwException(
"Undefined field");
2121 scanner->throwException(
"cannot use proto field value here");
2123 scanner->readWordEx(
"illegal field");
2127 string msg =
"This field(";
2128 msg +=
scanner->stringValue +
") does not exist in proto node";
2131 if(p->second.typeId() != fieldTypeId){
2132 scanner->throwException(
"Unmatched field type");
2141 if(
scanner->readSymbol(F_IS)){
2145 out_value =
scanner->readIntEx(
"illegal int value");
2152 if(
scanner->readSymbol(F_IS)){
2160 out_value.push_back(v);
2162 while(!
scanner->readChar(
']')){
2164 out_value.push_back(v);
2173 if(
scanner->readSymbol(F_IS)){
2177 out_value =
scanner->readDoubleEx(
"illegal float value");
2184 if(
scanner->readSymbol(F_IS)){
2192 out_value.push_back(v);
2194 while(!
scanner->readChar(
']')){
2196 out_value.push_back(v);
2205 if(
scanner->readSymbol(F_IS)){
2209 out_value =
scanner->readQuotedStringEx(
"illegal string");
2216 if(
scanner->readSymbol(F_IS)){
2224 out_value.push_back(s);
2226 while(!
scanner->readChar(
']')){
2228 out_value.push_back(s);
2237 if(
scanner->readSymbol(F_IS)){
2249 if(
scanner->readSymbol(F_IS)){
2257 out_value.push_back(v);
2259 while(!
scanner->readChar(
']')){
2261 out_value.push_back(v);
2270 if(
scanner->readSymbol(F_IS)){
2283 if(
scanner->readSymbol(F_IS)){
2291 out_value.push_back(v);
2293 while(!
scanner->readChar(
']')){
2295 out_value.push_back(v);
2304 if(
scanner->readSymbol(F_IS)){
2316 if(
scanner->readSymbol(F_IS)){
2327 if(
scanner->readSymbol(F_IS)){
2333 for(
int i=0;
i < 3;
i++){
2335 len2 += out_value[
i] * out_value[
i];
2339 const double len = sqrt(len2);
2341 if(fabs(len) < 1.0e-6){
2342 scanner->throwException(
"Rotation axis is zero vector");
2346 for(
int i=0;
i < 3;
i++){
2347 out_value[
i] /= len;
2355 if(
scanner->readSymbol(F_IS)){
2363 out_value.push_back(r);
2365 while(!
scanner->readChar(
']')){
2367 out_value.push_back(r);
2376 if(
scanner->readSymbol(F_IS)){
2378 out_value = field.
sfBool();
2380 switch(
scanner->readSymbolEx(
"no bool value")){
2381 case V_TRUE: out_value =
true;
break;
2382 case V_FALSE: out_value =
false;
break;
2384 default:
scanner->throwException(
"no bool value");
2406 if(
scanner->readSymbol( F_IS ) )
2414 unsigned char componentValue;
2428 for( h=0; h<out_image.
height; h++ )
2430 for( w=0; w<out_image.
width; w++ )
2433 for( i=0, shift=8*( comps - 1 ); i<comps; i++, shift-=8 )
2436 componentValue = (
unsigned char)( (pixelValue>>shift) & 0x000000FF );
2437 out_image.
pixels.push_back( componentValue );
2447 if(
scanner->readSymbol( F_IS )){
2451 out_value =
scanner->readDoubleEx(
"illegal time value" );
2458 if(
scanner->readSymbol(F_IS)){
2466 out_value.push_back( v );
2468 while(!
scanner->readChar(
']')){
2470 out_value.push_back(v);
2480 if(
scanner->readSymbol(F_IS)){
2482 out_node = field.
sfNode();
2483 }
else if(
scanner->readSymbol(V_NULL)){
2493 if(
scanner->readSymbol(F_IS)){
2496 }
else if(
scanner->readSymbol(V_NULL)){
2506 if(
scanner->readSymbol(F_IS)){
2508 out_nodes = field.
mfNode();
2514 out_nodes.push_back(sfnode);
2519 out_nodes.push_back(sfnode);
2521 bool closed =
scanner->readChar(
']');
2525 if(!sfnode && !closed){
2526 scanner->throwException(
"syntax error");
2549 static TSymbol symbols[] = {
2553 { V_FALSE,
"FALSE" },
2557 { T_SFINT32,
"SFInt32" },
2558 { T_MFINT32,
"MFInt32" },
2559 { T_SFFLOAT,
"SFFloat" },
2560 { T_MFFLOAT,
"MFFloat" },
2561 { T_SFVEC2F,
"SFVec2f" },
2562 { T_MFVEC2F,
"MFVec2f" },
2563 { T_SFVEC3F,
"SFVec3f" },
2564 { T_MFVEC3F,
"MFVec3f" },
2565 { T_SFROTATION,
"SFRotation" },
2566 { T_MFROTATION,
"MFRotation" },
2567 { T_SFTIME,
"SFTime" },
2568 { T_MFTIME,
"MFTime" },
2569 { T_SFCOLOR,
"SFColor" },
2570 { T_MFCOLOR,
"MFColor" },
2571 { T_SFSTRING,
"SFString" },
2572 { T_MFSTRING,
"MFString" },
2573 { T_SFNODE,
"SFNode" },
2574 { T_MFNODE,
"MFNode" },
2575 { T_SFBOOL,
"SFBool" },
2576 { T_SFIMAGE,
"SFImage" },
2579 { N_PROTO,
"PROTO" },
2580 { N_INLINE,
"Inline" },
2581 { N_BACKGROUND,
"Background" },
2582 { N_NAVIGATION_INFO,
"NavigationInfo" },
2583 { N_VIEWPOINT,
"Viewpoint" },
2584 { N_GROUP,
"Group" },
2585 { N_TRANSFORM,
"Transform" },
2586 { N_SHAPE,
"Shape" },
2587 { N_APPEARANCE,
"Appearance" },
2588 { N_MATERIAL,
"Material" },
2589 { N_IMAGE_TEXTURE,
"ImageTexture" },
2590 { N_TEXTURE_TRANSFORM,
"TextureTransform" },
2593 { N_CYLINDER,
"Cylinder" },
2594 { N_SPHERE,
"Sphere" },
2596 { N_FONT_STYLE,
"FontStyle" },
2597 { N_INDEXED_LINE_SET,
"IndexedLineSet" },
2598 { N_INDEXED_FACE_SET,
"IndexedFaceSet" },
2599 { N_COLOR,
"Color" },
2600 { N_COORDINATE,
"Coordinate" },
2601 { N_TEXTURE_COORDINATE,
"TextureCoordinate" },
2602 { N_NORMAL,
"Normal" },
2603 { N_CYLINDER_SENSOR,
"CylinderSensor" },
2605 { N_POINTSET,
"PointSet" },
2606 { N_PIXEL_TEXTURE,
"PixelTexture" },
2607 { N_MOVIE_TEXTURE,
"MovieTexture" },
2608 { N_ELEVATION_GRID,
"ElevationGrid" },
2609 { N_EXTRUSION,
"Extrusion" },
2610 { N_SWITCH,
"Switch" },
2612 { N_COLLISION,
"Collision" },
2613 { N_ANCHOR,
"Anchor" },
2615 { N_BILLBOARD,
"Billboard" },
2616 { N_WORLD_INFO,
"WorldInfo" },
2617 { N_POINT_LIGHT,
"PointLight" },
2618 { N_DIRECTIONAL_LIGHT,
"DirectionalLight" },
2619 { N_SPOT_LIGHT,
"SpotLight" },
2622 { N_AUDIO_CLIP,
"AudioClip" },
2623 { N_SOUND,
"Sound" },
2624 { N_COLOR_INTERPOLATOR,
"ColorInterpolator" },
2625 { N_COORDINATE_INTERPOLATOR,
"CoordinateInterpolator" },
2626 { N_ORIENTATION_INTERPOLATOR,
"OrientationInterpolator" },
2627 { N_NORMAL_INTERPOLATOR,
"NormalInterpolator" },
2628 { N_POSITION_INTERPOLATOR,
"PositionInterpolator" },
2629 { N_SCALAR_INTERPOLATOR,
"ScalarInterpolator" },
2630 { N_PLANE_SENSOR,
"PlaneSensor" },
2631 { N_PROXIMITY_SENSOR,
"ProximitySensor" },
2632 { N_SPHERE_SENSOR,
"SphereSensor" },
2633 { N_TIME_SENSOR,
"TimeSensor" },
2634 { N_TOUCH_SENSOR,
"TouchSensor" },
2635 { N_VISIBILITY_SENSOR,
"VisibilitySensor" },
2642 { F_GROUND_ANGLE,
"groundAngle" },
2643 { F_GROUND_COLOR,
"groundColor" },
2644 { F_SKY_ANGLE,
"skyAngle" },
2645 { F_SKY_COLOR,
"skyColor" },
2646 { F_BACK_URL,
"backUrl" },
2647 { F_BOTTOM_URL,
"bottomUrl" },
2648 { F_FRONT_URL,
"frontUrl" },
2649 { F_LEFT_URL,
"leftUrl" },
2650 { F_RIGHT_URL,
"rightUrl" },
2651 { F_TOP_URL,
"topUrl" },
2653 { F_AVATAR_SIZE,
"avatarSize" },
2654 { F_HEADLIGHT,
"headlight" },
2655 { F_SPEED,
"speed" },
2657 { F_VISIBILITY_LIMIT,
"visibilityLimit" },
2659 { F_FIELD_OF_VIEW,
"fieldOfView" },
2661 { F_ORIENTATION,
"orientation" },
2662 { F_POSITION,
"position" },
2663 { F_DESCRIPTION,
"description" },
2665 { F_CHILDREN,
"children" },
2666 { F_ADD_CHILDREN,
"addChildren" },
2667 { F_REMOVE_CHILDREN,
"removeChildren" },
2668 { F_BBOX_CENTER,
"bboxCenter" },
2669 { F_BBOX_SIZE,
"bboxSize" },
2671 { F_CENTER,
"center" },
2672 { F_ROTATION,
"rotation" },
2673 { F_SCALE,
"scale" },
2674 { F_SCALE_ORIENTATION,
"scaleOrientation" },
2675 { F_TRANSLATION,
"translation" },
2677 { F_APPEARANCE,
"appearance" },
2678 { F_GEOMETRY,
"geometry" },
2680 { F_MATERIAL,
"material" },
2681 { F_TEXTURE,
"texture" },
2682 { F_TEXTURE_TRANSFORM,
"textureTransform" },
2684 { F_AMBIENT_INTENSITY,
"ambientIntensity" },
2685 { F_DIFFUSE_COLOR,
"diffuseColor" },
2686 { F_EMISSIVE_COLOR,
"emissiveColor" },
2687 { F_SHININESS,
"shininess" },
2688 { F_SPECULAR_COLOR,
"specularColor" },
2689 { F_TRANSPARANCY,
"transparency" },
2690 { F_DIRECTION,
"direction" },
2692 { F_REPEAT_S,
"repeatS" },
2693 { F_REPEAT_T,
"repeatT" },
2697 { F_BOTTOM,
"bottom" },
2698 { F_BOTTOM_RADIUS,
"bottomRadius" },
2699 { F_HEIGHT,
"height" },
2702 { F_RADIUS,
"radius" },
2705 { F_STRING,
"string" },
2706 { F_FONT_STYLE,
"fontStyle" },
2707 { F_LENGTH,
"length" },
2708 { F_MAX_EXTENT,
"maxExtent" },
2710 { F_FAMILY,
"family" },
2711 { F_HORIZONTAL,
"horizontal" },
2712 { F_JUSTIFY,
"justify" },
2713 { F_LANGUAGE,
"language" },
2714 { F_LEFT_TO_RIGHT,
"leftToRight" },
2715 { F_SPACING,
"spacing" },
2716 { F_STYLE,
"style" },
2717 { F_TOP_TO_BOTTOM,
"topToBottom" },
2719 { F_COLOR,
"color" },
2720 { F_COORD,
"coord" },
2721 { F_COLOR_INDEX,
"colorIndex" },
2722 { F_COLOR_PER_VERTEX,
"colorPerVertex" },
2723 { F_COORD_INDEX,
"coordIndex" },
2726 { F_CONVEX,
"convex" },
2727 { F_SOLID,
"solid" },
2728 { F_CREASE_ANGLE,
"creaseAngle" },
2729 { F_NORMAL_INDEX,
"normalIndex" },
2730 { F_NORMAL,
"normal" },
2731 { F_NORMAL_PER_VERTEX,
"normalPerVertex" },
2732 { F_TEX_COORD_INDEX,
"texCoordIndex" },
2733 { F_TEX_COORD,
"texCoord" },
2735 { F_POINT,
"point" },
2736 { F_VECTOR,
"vector" },
2738 { F_AUTO_OFFSET,
"autoOffset" },
2739 { F_DISK_ANGLE,
"diskAngle" },
2740 { F_ENABLED,
"enabled" },
2741 { F_MAX_ANGLE,
"maxAngle" },
2742 { F_MIN_ANGLE,
"minAngle" },
2743 { F_OFFSET,
"offset" },
2745 { F_IMAGE,
"image" },
2747 { F_X_DIMENSION,
"xDimension" },
2748 { F_Z_DIMENSION,
"zDimension" },
2749 { F_X_SPACING,
"xSpacing" },
2750 { F_Z_SPACING,
"zSpacing" },
2752 { F_CROSS_SECTION,
"crossSection" },
2753 { F_SPINE,
"spine" },
2754 { F_BEGIN_CAP,
"beginCap" },
2755 { F_END_CAP,
"endCap" },
2757 { F_CHOICE,
"choice" },
2758 { F_WHICH_CHOICE,
"whichChoice" },
2760 { F_COLLIDE,
"collide" },
2761 { F_PROXY,
"proxy" },
2763 { F_PARAMETER,
"parameter" },
2765 { F_VISIBILITY_RANGE,
"visibilityRange" },
2766 { F_FOG_TYPE,
"fogType" },
2768 { F_AXIS_OF_ROTATION,
"axisOfRotation" },
2770 { F_TITLE,
"title" },
2773 { F_LOCATION,
"location" },
2775 { F_INTENSITY,
"intensity" },
2776 { F_ATTENUATION,
"attenuation" },
2777 { F_DIRECTION,
"direction" },
2778 { F_BEAM_WIDTH,
"beamWidth" },
2779 { F_CUT_OFF_RANGE,
"cutOffAngle" },
2782 { E_FIELD,
"field" },
2783 { E_EXPOSED_FIELD,
"exposedField" },
2784 { E_EVENTIN,
"eventIn" },
2785 { E_EVENTOUT,
"eventOut" },
2790 { D_ROUTE,
"ROUTE" },
2793 { U_SCRIPT,
"Script" },
2794 { U_EXTERNPROTO,
"EXTERNPROTO" },
2799 for(
int i=0; symbols[
i].id != 0;
i++){
2800 scanner->registerSymbol(symbols[
i].
id, symbols[
i].symbol);
VrmlGroupPtr readGroupNode()
std::vector< SFNode > MFNode
MFRotation & mfRotation()
std::vector< SFFloat > MFFloat
boost::intrusive_ptr< VrmlTextureTransform > VrmlTextureTransformPtr
void readMFVec2f(MFVec2f &out_value)
boost::intrusive_ptr< VrmlCollision > VrmlCollisionPtr
boost::intrusive_ptr< VrmlBackground > VrmlBackgroundPtr
VrmlColorPtr readColorNode()
VrmlPointSetPtr readPointSetNode()
std::vector< SFColor > MFColor
VrmlSpherePtr readSphereNode()
VrmlNavigationInfoPtr readNavigationInfoNode()
Modifications controlling boost library behavior.
boost::intrusive_ptr< VrmlUnsupportedNode > VrmlUnsupportedNodePtr
boost::intrusive_ptr< VrmlText > VrmlTextPtr
boost::intrusive_ptr< VrmlImageTexture > VrmlImageTexturePtr
boost::intrusive_ptr< VrmlTransform > VrmlTransformPtr
std::pair< std::string, VrmlVariantField > TProtoFieldPair
std::vector< unsigned char > pixels
boost::intrusive_ptr< VrmlGroup > VrmlGroupPtr
VrmlUnsupportedNodePtr skipScriptNode()
boost::intrusive_ptr< VrmlElevationGrid > VrmlElevationGridPtr
void readSFBool(SFBool &out_value)
boost::intrusive_ptr< VrmlProtoInstance > VrmlProtoInstancePtr
VrmlIndexedFaceSetPtr readIndexedFaceSetNode()
VrmlBillboardPtr readBillboardNode()
boost::intrusive_ptr< VrmlNavigationInfo > VrmlNavigationInfoPtr
VRML IndexedFaseSet node.
VrmlShapePtr readShapeNode()
boost::intrusive_ptr< VrmlMovieTexture > VrmlMovieTexturePtr
VRML TextureCoordinate node.
boost::intrusive_ptr< VrmlBillboard > VrmlBillboardPtr
boost::intrusive_ptr< VrmlPixelTexture > VrmlPixelTexturePtr
boost::intrusive_ptr< VrmlCone > VrmlConePtr
void readSFColor(SFColor &out_value)
void readMFColor(MFColor &out_value)
VrmlNodePtr evalProtoInstance(VrmlProtoInstancePtr proto, VrmlNodeCategory nodeCategory)
VrmlTransformPtr readTransformNode()
void setProtoInstanceActualNodeExtractionMode(bool isOn)
VrmlCoordinatePtr readCoordNode()
VrmlUnsupportedNodePtr skipUnsupportedNode(const std::string &nodeTypeName)
ProtoToEntityScannerMap protoToEntityScannerMap
boost::intrusive_ptr< VrmlLOD > VrmlLODPtr
boost::intrusive_ptr< VrmlShape > VrmlShapePtr
VrmlIndexedLineSetPtr readIndexedLineSetNode()
boost::intrusive_ptr< VrmlFontStyle > VrmlFontStylePtr
boost::intrusive_ptr< VrmlSwitch > VrmlSwitchPtr
list< string > ancestorPathsList
void readSFImage(SFImage &out_image)
read "SFImage" node
VrmlNodePtr readInlineNode(VrmlNodeCategory nodeCategory)
VrmlElevationGridPtr readElevationGridNode()
void readMFString(MFString &out_value)
void readSFInt32(SFInt32 &out_value)
VrmlNodePtr readSpecificNode(VrmlNodeCategory nodeCategory, int symbol, const std::string &symbolString)
void readSFString(SFString &out_value)
VrmlPixelTexturePtr readPixelTextureNode()
VRML IndexedLineSet node.
map< VrmlProto *, EasyScannerPtr > ProtoToEntityScannerMap
VrmlNormalPtr readNormalNode()
VrmlTextureTransformPtr readTextureTransformNode()
boost::intrusive_ptr< VrmlBox > VrmlBoxPtr
boost::intrusive_ptr< VrmlProto > VrmlProtoPtr
const list< string > * getAncestorPathsList() const
void readSFNode(SFNode &out_node, VrmlNodeCategory nodeCategory)
VrmlUnsupportedNodePtr skipExternProto()
pair< string, VrmlProtoPtr > TProtoPair
map< string, VrmlProtoPtr > TProtoMap
VRML TextureTransform node.
boost::intrusive_ptr< VrmlCylinderSensor > VrmlCylinderSensorPtr
std::vector< SFRotation > MFRotation
boost::intrusive_ptr< VrmlIndexedLineSet > VrmlIndexedLineSetPtr
VrmlVariantField & readProtoField(VrmlFieldTypeId fieldTypeId)
VrmlTextureCoordinatePtr readTextureCoordinateNode()
void readSFVec3f(SFVec3f &out_value)
std::vector< SFVec3f > MFVec3f
map< string, VrmlNodePtr > TDefNodeMap
void load(const std::string &filename)
VrmlNodePtr readNode(VrmlNodeCategory nodeCategory)
VrmlAppearancePtr readAppearanceNode()
void readMFNode(MFNode &out_nodes, VrmlNodeCategory nodeCategory)
VrmlConePtr readConeNode()
boost::array< SFFloat, 2 > SFVec2f
boost::intrusive_ptr< VrmlColor > VrmlColorPtr
boost::intrusive_ptr< VrmlAppearance > VrmlAppearancePtr
void setType(VrmlFieldTypeId typeId0)
This can be called once.
VrmlDirectionalLightPtr readDirectionalLightNode()
VrmlProtoInstancePtr currentProtoInstance
VrmlSwitchPtr readSwitchNode()
VrmlCollisionPtr readCollisionNode()
pair< string, VrmlNodePtr > TDefNodePair
VrmlWorldInfoPtr readWorldInfoNode()
boost::intrusive_ptr< VrmlPointLight > VrmlPointLightPtr
void readSFTime(SFTime &out_value)
VRML node which is instance of VRML Prototype.
boost::intrusive_ptr< VrmlAnchor > VrmlAnchorPtr
VrmlBackgroundPtr readBackgroundNode()
boost::intrusive_ptr< VrmlSphere > VrmlSpherePtr
VrmlPointLightPtr readPointLightNode()
boost::intrusive_ptr< VrmlInline > VrmlInlinePtr
VrmlProtoInstancePtr readProtoInstanceNode(const std::string &proto_name, VrmlNodeCategory nodeCategory)
void readSFFloat(SFFloat &out_value)
VrmlProtoPtr defineProto()
std::vector< SFVec2f > MFVec2f
Base class of VRML Texture nodes.
void readMFRotation(MFRotation &out_value)
boost::intrusive_ptr< VrmlNode > VrmlNodePtr
HRP_UTIL_EXPORT string deleteURLScheme(string url)
VrmlAnchorPtr readAnchorNode()
boost::intrusive_ptr< VrmlWorldInfo > VrmlWorldInfoPtr
VrmlMaterialPtr readMaterialNode()
VrmlSpotLightPtr readSpotLightNode()
bool protoInstanceActualNodeExtractionMode
boost::array< SFFloat, 3 > SFVec3f
boost::intrusive_ptr< VrmlExtrusion > VrmlExtrusionPtr
Parser for VRML97 format.
boost::intrusive_ptr< VrmlSpotLight > VrmlSpotLightPtr
VRML CylinderSensor node.
boost::shared_ptr< EasyScanner > EasyScannerPtr
std::vector< SFString > MFString
void readMFVec3f(MFVec3f &out_value)
boost::intrusive_ptr< VrmlDirectionalLight > VrmlDirectionalLightPtr
boost::intrusive_ptr< VrmlIndexedFaceSet > VrmlIndexedFaceSetPtr
void readSFVec2f(SFVec2f &out_value)
void readSFRotation(SFRotation &out_value)
VrmlTextPtr readTextNode()
void readMFFloat(MFFloat &out_value)
boost::intrusive_ptr< VrmlCoordinate > VrmlCoordinatePtr
VrmlCylinderPtr readCylinderNode()
void load(const string &filename)
HRP_UTIL_EXPORT bool isFileProtocol(const string &ref)
boost::intrusive_ptr< VrmlCylinder > VrmlCylinderPtr
boost::intrusive_ptr< VrmlPointSet > VrmlPointSetPtr
VrmlCylinderSensorPtr readCylinderSensorNode()
void readMFTime(MFTime &out_value)
VrmlParserImpl(VrmlParser *self)
VrmlViewpointPtr readViewpointNode()
boost::intrusive_ptr< VrmlViewpoint > VrmlViewpointPtr
std::vector< SFInt32 > MFInt32
boost::intrusive_ptr< VrmlFog > VrmlFogPtr
boost::intrusive_ptr< VrmlTextureCoordinate > VrmlTextureCoordinatePtr
void checkIndexedFaceSet(VrmlIndexedFaceSetPtr node)
VRML NavigationInfo node.
void readMFInt32(MFInt32 &out_value)
VrmlImageTexturePtr readImageTextureNode()
boost::intrusive_ptr< VrmlNormal > VrmlNormalPtr
VrmlNodePtr newInlineSource(std::string &io_filename)
The header file of a text scanner class.
VrmlFontStylePtr readFontStyleNode()
boost::intrusive_ptr< VrmlMaterial > VrmlMaterialPtr
std::vector< SFTime > MFTime
VrmlMovieTexturePtr readMovieTextureNode()
VrmlExtrusionPtr readExtrusionNode()