- Timestamp:
- Mar 1, 2016 1:55:42 PM (8 years ago)
- Location:
- geovis/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Picker.cpp
r6083 r6084 94 94 osgEarth::Features::FeatureIndex *index = osgEarth::Registry::objectIndex()->get<osgEarth::Features::FeatureIndex>(id); 95 95 osgEarth::Features::Feature *feature = index ? index->getFeature(id) : 0L; 96 INFO("Hover hit");96 TRACE("Hover hit"); 97 97 if (feature) { 98 INFO("Hit feature ID: %lu (of %d), oid: %lu", feature->getFID(), index->size(), id);98 TRACE("Hit feature ID: %lu (of %d), oid: %lu", feature->getFID(), index->size(), id); 99 99 const osgEarth::Features::AttributeTable &attrs = feature->getAttrs(); 100 100 for (osgEarth::Features::AttributeTable::const_iterator itr = attrs.begin(); itr != attrs.end(); ++itr) { 101 INFO(" attr: %s", itr->first.c_str());101 TRACE(" attr: %s", itr->first.c_str()); 102 102 switch (itr->second.first) { 103 103 case osgEarth::Features::ATTRTYPE_STRING: 104 INFO(" value: %s", itr->second.getString().c_str());104 TRACE(" value: %s", itr->second.getString().c_str()); 105 105 break; 106 106 case osgEarth::Features::ATTRTYPE_INT: 107 INFO(" value: %d", itr->second.getInt());107 TRACE(" value: %d", itr->second.getInt()); 108 108 break; 109 109 case osgEarth::Features::ATTRTYPE_DOUBLE: 110 INFO(" value: %g", itr->second.getDouble());110 TRACE(" value: %g", itr->second.getDouble()); 111 111 break; 112 112 case osgEarth::Features::ATTRTYPE_BOOL: 113 INFO(" value: %s", itr->second.getBool() ? "true" : "false");113 TRACE(" value: %s", itr->second.getBool() ? "true" : "false"); 114 114 break; 115 115 default: 116 INFO(" value: unknown type");116 TRACE(" value: unknown type"); 117 117 } 118 118 } 119 // INFO("Feature name: %s", feature->getString("name").c_str());119 //TRACE("Feature name: %s", feature->getString("name").c_str()); 120 120 } else { 121 121 osgEarth::Annotation::AnnotationNode* anno = … … 129 129 } 130 130 if (anno != NULL && anno->getDecoration().empty()) { 131 INFO("Hit AnnotationNode: %p", anno);131 TRACE("Hit AnnotationNode: %p", anno); 132 132 #if 0 133 133 if (hovered.find(anno) == hovered.end()) { … … 153 153 void HoverCallback::onMiss() 154 154 { 155 INFO("Hover miss");155 TRACE("Hover miss"); 156 156 std::set<osgEarth::Annotation::AnnotationNode*> toUnHover; 157 157 std::set<osgEarth::Annotation::AnnotationNode*>& hovered = _renderer->getHovered(); … … 189 189 osgEarth::Features::FeatureIndex *index = osgEarth::Registry::objectIndex()->get<osgEarth::Features::FeatureIndex>(id); 190 190 osgEarth::Features::Feature *feature = index ? index->getFeature(id) : 0L; 191 INFO("Select hit oid: %lu at %g,%g", id, _pickPoint.x(), _pickPoint.y());191 TRACE("Select hit oid: %lu at %g,%g", id, _pickPoint.x(), _pickPoint.y()); 192 192 if (feature) { 193 193 osgEarth::Features::FeatureSourceIndex *fsi = dynamic_cast<osgEarth::Features::FeatureSourceIndex *>(index); … … 199 199 } 200 200 } 201 INFO("Hit feature ID: %lu (of %d) layer: %s", feature->getFID(), index->size(), layerName.c_str());201 TRACE("Hit feature ID: %lu (of %d) layer: %s", feature->getFID(), index->size(), layerName.c_str()); 202 202 203 203 _renderer->clearSelection(); … … 213 213 osgEarth::Registry::objectIndex()->get<osgEarth::Annotation::AnnotationNode>(id); 214 214 if (anno != NULL) { 215 INFO("Hit AnnotationNode: %p, \"%s\"", anno, anno->getName().c_str());215 TRACE("Hit AnnotationNode: %p, \"%s\"", anno, anno->getName().c_str()); 216 216 char mesg[256]; 217 217 snprintf(mesg, sizeof(mesg), "nv>select annotation %u {%s}\n", id, anno->getName().c_str()); … … 227 227 void SelectCallback::onMiss() 228 228 { 229 INFO("Select miss");229 TRACE("Select miss"); 230 230 _renderer->clearSelection(); 231 231 -
geovis/trunk/Placard.cpp
r5974 r6084 64 64 placardConf.getEntry(i, name, label); 65 65 oss << label << ": "; 66 INFO(" attr: %s '%s'", name.c_str(), label.c_str());66 TRACE(" attr: %s '%s'", name.c_str(), label.c_str()); 67 67 osgEarth::Features::AttributeTable::const_iterator itr = _attrs.find(name); 68 68 if (itr == _attrs.end()) … … 70 70 switch (itr->second.first) { 71 71 case osgEarth::Features::ATTRTYPE_STRING: 72 INFO(" value: %s", itr->second.getString().c_str());72 TRACE(" value: %s", itr->second.getString().c_str()); 73 73 oss << itr->second.getString() << std::endl; 74 74 break; 75 75 case osgEarth::Features::ATTRTYPE_INT: 76 INFO(" value: %d", itr->second.getInt());76 TRACE(" value: %d", itr->second.getInt()); 77 77 oss << itr->second.getInt() << std::endl; 78 78 break; 79 79 case osgEarth::Features::ATTRTYPE_DOUBLE: 80 INFO(" value: %g", itr->second.getDouble());80 TRACE(" value: %g", itr->second.getDouble()); 81 81 oss << itr->second.getDouble() << std::endl; 82 82 break; 83 83 case osgEarth::Features::ATTRTYPE_BOOL: 84 INFO(" value: %s", itr->second.getBool() ? "true" : "false");84 TRACE(" value: %s", itr->second.getBool() ? "true" : "false"); 85 85 oss << (itr->second.getBool() ? "true" : "false") << std::endl; 86 86 break; … … 113 113 placardConf.getEntry(i, name, label); 114 114 oss << label << ": "; 115 INFO(" attr: %s '%s'", name.c_str(), label.c_str());115 TRACE(" attr: %s '%s'", name.c_str(), label.c_str()); 116 116 osgEarth::Features::AttributeTable::const_iterator itr = _attrs.find(name); 117 117 if (itr == _attrs.end()) … … 119 119 switch (itr->second.first) { 120 120 case osgEarth::Features::ATTRTYPE_STRING: 121 INFO(" value: %s", itr->second.getString().c_str());121 TRACE(" value: %s", itr->second.getString().c_str()); 122 122 oss << itr->second.getString() << std::endl; 123 123 break; 124 124 case osgEarth::Features::ATTRTYPE_INT: 125 INFO(" value: %d", itr->second.getInt());125 TRACE(" value: %d", itr->second.getInt()); 126 126 oss << itr->second.getInt() << std::endl; 127 127 break; 128 128 case osgEarth::Features::ATTRTYPE_DOUBLE: 129 INFO(" value: %g", itr->second.getDouble());129 TRACE(" value: %g", itr->second.getDouble()); 130 130 oss << itr->second.getDouble() << std::endl; 131 131 break; 132 132 case osgEarth::Features::ATTRTYPE_BOOL: 133 INFO(" value: %s", itr->second.getBool() ? "true" : "false");133 TRACE(" value: %s", itr->second.getBool() ? "true" : "false"); 134 134 oss << (itr->second.getBool() ? "true" : "false") << std::endl; 135 135 break; -
geovis/trunk/Renderer.cpp
r6083 r6084 1748 1748 pt.y() >= _latMin && pt.y() <= _latMax) { 1749 1749 if (_renderer->select(placeNode)) { 1750 INFO("Select PlaceNode: %g %g n:'%s' t:'%s'",1750 TRACE("Select PlaceNode: %g %g n:'%s' t:'%s'", 1751 1751 pt.x(), pt.y(), placeNode->getName().c_str(), 1752 1752 placeNode->getText().c_str()); … … 1924 1924 } 1925 1925 if (_picker->pick(_viewer.get(), mouseX, mouseY)) { 1926 INFO("Hover pick queued: %g %g", mouseX, mouseY);1927 } else { 1928 INFO("Failed to queue pick: %g %g", mouseX, mouseY);1926 TRACE("Hover pick queued: %g %g", mouseX, mouseY); 1927 } else { 1928 TRACE("Failed to queue pick: %g %g", mouseX, mouseY); 1929 1929 } 1930 1930 } … … 2344 2344 ext = ts->getProfile()->getExtent(); 2345 2345 } 2346 INFO("Image layer %s srs: %s extent: %g %g %g %g",2346 TRACE("Image layer %s srs: %s extent: %g %g %g %g", 2347 2347 name, ext.getSRS() ? ext.getSRS()->getName().c_str() : "nil", 2348 2348 ext.xMin(), ext.yMin(), ext.xMax(), ext.yMax()); … … 2369 2369 ext = ts->getProfile()->getExtent(); 2370 2370 } 2371 INFO("Elevation Layer %s srs: %s extent: %g %g %g %g",2371 TRACE("Elevation Layer %s srs: %s extent: %g %g %g %g", 2372 2372 name, ext.getSRS() ? ext.getSRS()->getName().c_str() : "nil", 2373 2373 ext.xMin(), ext.yMin(), ext.xMax(), ext.yMax()); … … 2401 2401 return false; 2402 2402 } 2403 INFO("Model Layer %s srs: %s extent: %g %g %g %g",2403 TRACE("Model Layer %s srs: %s extent: %g %g %g %g", 2404 2404 name, ext.getSRS() ? ext.getSRS()->getName().c_str() : "nil", 2405 2405 ext.xMin(), ext.yMin(), ext.xMax(), ext.yMax()); … … 2453 2453 osgEarth::Units distanceUnits = getMapSRS()->getUnits(); 2454 2454 if (getMapSRS()->isProjected() && !getMapSRS()->isPlateCarre()) { 2455 INFO("Projected");2455 TRACE("Projected"); 2456 2456 osg::ref_ptr<const osgEarth::SpatialReference> fromSRS = 2457 2457 srs ? srs : osgEarth::SpatialReference::create("wgs84"); … … 2461 2461 _viewer->getCamera()->getProjectionMatrixAsPerspective(fovy, aspect, near, far); 2462 2462 distance = height / (2. * tan(osg::DegreesToRadians(fovy)/2.)); 2463 INFO("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2);2463 TRACE("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2); 2464 2464 x = x1 + (x2 - x1)/2.0; 2465 2465 y = y1 + (y2 - y1)/2.0; 2466 INFO("x: %g y: %g, dist: %g", x, y, distance);2466 TRACE("x: %g y: %g, dist: %g", x, y, distance); 2467 2467 } else if (getMapSRS()->isGeographic() && !getMapSRS()->isPlateCarre()) { 2468 2468 // World coords are ECEF 2469 INFO("Geocentric");2469 TRACE("Geocentric"); 2470 2470 osg::ref_ptr<const osgEarth::SpatialReference> fromSRS = 2471 2471 srs ? srs : osgEarth::SpatialReference::create("wgs84"); 2472 2472 fromSRS->transformExtentToMBR(getMapSRS(), x1, y1, x2, y2); 2473 INFO("(%g, %g, %g, %g)", x1, y1, x2, y2);2473 TRACE("(%g, %g, %g, %g)", x1, y1, x2, y2); 2474 2474 // These are angular units 2475 2475 x = x1 + (x2 - x1)/2.0; … … 2485 2485 // point on line between top and bottom points 2486 2486 world4 = world1 + (world2 - world1)/2.0; 2487 INFO("world1: %g,%g,%g world2: %g,%g,%g",2487 TRACE("world1: %g,%g,%g world2: %g,%g,%g", 2488 2488 world1.x(), world1.y(), world1.z(), 2489 2489 world2.x(), world2.y(), world2.z()); 2490 INFO("world3: %g,%g,%g world4: %g,%g,%g",2490 TRACE("world3: %g,%g,%g world4: %g,%g,%g", 2491 2491 world3.x(), world3.y(), world3.z(), 2492 2492 world4.x(), world4.y(), world4.z()); … … 2498 2498 if (distance < 0.0) distance = 0.0; 2499 2499 distanceUnits = osgEarth::Units::METERS; 2500 INFO("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2);2501 INFO("x: %g y: %g, dist: %g", x, y, distance);2500 TRACE("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2); 2501 TRACE("x: %g y: %g, dist: %g", x, y, distance); 2502 2502 } else { 2503 2503 assert(getMapSRS()->isPlateCarre()); … … 2505 2505 return; 2506 2506 } 2507 INFO("Map units: %d", getMapSRS()->getUnits().getType());2507 TRACE("Map units: %d", getMapSRS()->getUnits().getType()); 2508 2508 osgEarth::Viewpoint vpt; 2509 2509 vpt.focalPoint()->set(getMapSRS(), x, y, 0.0, osgEarth::ALTMODE_ABSOLUTE); … … 2525 2525 osgEarth::Units distanceUnits = extent.getSRS()->getUnits(); 2526 2526 if (extent.getSRS()->isProjected() && !extent.getSRS()->isPlateCarre()) { 2527 INFO("Projected");2527 TRACE("Projected"); 2528 2528 double height = y2 - y1; 2529 2529 double fovy, aspect, near, far; 2530 2530 _viewer->getCamera()->getProjectionMatrixAsPerspective(fovy, aspect, near, far); 2531 2531 distance = height / (2. * tan(osg::DegreesToRadians(fovy)/2.)); 2532 INFO("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2);2532 TRACE("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2); 2533 2533 x = x1 + (x2 - x1)/2.0; 2534 2534 y = y1 + (y2 - y1)/2.0; 2535 INFO("x: %g y: %g, dist: %g", x, y, distance);2535 TRACE("x: %g y: %g, dist: %g", x, y, distance); 2536 2536 } else if (extent.getSRS()->isGeographic() && !extent.getSRS()->isPlateCarre()) { 2537 2537 // World coords are ECEF 2538 INFO("Geocentric");2539 INFO("(%g, %g, %g, %g)", x1, y1, x2, y2);2538 TRACE("Geocentric"); 2539 TRACE("(%g, %g, %g, %g)", x1, y1, x2, y2); 2540 2540 // These are angular units 2541 2541 x = x1 + (x2 - x1)/2.0; … … 2558 2558 if (distance < 0.0) distance = 0.0; 2559 2559 distanceUnits = osgEarth::Units::METERS; 2560 INFO("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2);2561 INFO("x: %g y: %g, dist: %g", x, y, distance);2560 TRACE("fov: %g a: %g n: %g f: %g (%g, %g, %g, %g)", fovy, aspect, near, far, x1, y1, x2, y2); 2561 TRACE("x: %g y: %g, dist: %g", x, y, distance); 2562 2562 } else { 2563 2563 assert(extent.getSRS()->isPlateCarre()); … … 3041 3041 } 3042 3042 } else if (proto == "local") { 3043 INFO("Local protocol: '%s'", getLocalFilePath(url).c_str());3043 TRACE("Local protocol: '%s'", getLocalFilePath(url).c_str()); 3044 3044 std::ostringstream oss; 3045 3045 oss << getCacheDirectory() << "/" << getLocalFilePath(url); 3046 3046 retStr = oss.str(); 3047 3047 } else if (proto == "file") { 3048 INFO("File: '/%s'", osgDB::getServerFileName(url).c_str());3048 TRACE("File: '/%s'", osgDB::getServerFileName(url).c_str()); 3049 3049 std::ostringstream oss; 3050 3050 oss << "/" << osgDB::getServerFileName(url); … … 3052 3052 } else if (proto == "idata") { 3053 3053 std::string fileName = osgDB::getServerFileName(url); 3054 INFO("IData protocol: coll: '%s', '%s'", osgDB::getServerAddress(url).c_str(), fileName.c_str());3054 TRACE("IData protocol: coll: '%s', '%s'", osgDB::getServerAddress(url).c_str(), fileName.c_str()); 3055 3055 int collection = atoi(osgDB::getServerAddress(url).c_str()); 3056 3056 { … … 3071 3071 } 3072 3072 } else { 3073 INFO("Protocol: '%s' url: '%s'", proto.c_str(), url.c_str());3073 TRACE("Protocol: '%s' url: '%s'", proto.c_str(), url.c_str()); 3074 3074 retStr = url; 3075 3075 } -
geovis/trunk/RendererCmd.cpp
r6075 r6084 973 973 fullPath << g_renderer->getCacheDirectory() << "/" << dirPath; 974 974 if (!dirPath.empty()) { 975 INFO("Make dir: %s", fullPath.str().c_str());975 TRACE("Make dir: %s", fullPath.str().c_str()); 976 976 osgDB::makeDirectory(fullPath.str()); 977 977 fullPath << "/"; … … 986 986 fclose(fp); 987 987 free(data); 988 INFO("Wrote %d bytes to %s", bytesWritten, fullPath.str().c_str());988 TRACE("Wrote %d bytes to %s", bytesWritten, fullPath.str().c_str()); 989 989 return (bytesWritten == size) ? TCL_OK : TCL_ERROR; 990 990 } … … 1388 1388 osgEarth::Config styleConf("style", Tcl_GetString(objv[12])); 1389 1389 styleConf.add("type", "text/css"); 1390 INFO("style CSS: %s", styleConf.value().c_str());1390 TRACE("style CSS: %s", styleConf.value().c_str()); 1391 1391 osgEarth::Config stylesheetConf; 1392 1392 stylesheetConf.add(styleConf); … … 1399 1399 std::string scripts(Tcl_GetString(objv[13])); 1400 1400 if (!scripts.empty()) { 1401 INFO("script: %s", scripts.c_str());1401 TRACE("script: %s", scripts.c_str()); 1402 1402 osg::ref_ptr<osgEarth::Symbology::StyleSheet::ScriptDef> scriptDef = 1403 1403 new osgEarth::Symbology::StyleSheet::ScriptDef(scripts); 1404 1404 aggOpts.styles()->setScript(scriptDef.get()); 1405 1405 } else { 1406 INFO("no script");1406 TRACE("no script"); 1407 1407 } 1408 1408 } … … 1426 1426 char *value = Tcl_GetString(fields[f+1]); 1427 1427 fieldMap[name] = value; 1428 INFO("selector[%s] = %s", name, value);1428 TRACE("selector[%s] = %s", name, value); 1429 1429 } 1430 1430 osgEarth::Symbology::StyleSelector ss; … … 1439 1439 itr = fieldMap.find("styleExpression"); 1440 1440 if (itr != fieldMap.end()) { 1441 INFO("selector: %s", itr->second.c_str());1441 TRACE("selector: %s", itr->second.c_str()); 1442 1442 ss.styleExpression() = osgEarth::Symbology::StringExpression(itr->second); 1443 1443 } … … 1456 1456 return TCL_ERROR; 1457 1457 } 1458 INFO("query bounds: %g %g %g %g", xmin, ymin, xmax, ymax);1458 TRACE("query bounds: %g %g %g %g", xmin, ymin, xmax, ymax); 1459 1459 query.bounds() = osgEarth::Bounds(xmin, ymin, xmax, ymax); 1460 1460 } … … 1680 1680 osgEarth::Config styleConf("style", Tcl_GetString(objv[10])); 1681 1681 styleConf.add("type", "text/css"); 1682 INFO("style CSS: %s", styleConf.value().c_str());1682 TRACE("style CSS: %s", styleConf.value().c_str()); 1683 1683 #if 1 1684 1684 geomOpts.styles() = new osgEarth::Symbology::StyleSheet(); … … 1694 1694 osgEarth::Symbology::Style style(blockConf); 1695 1695 1696 INFO("Style: %s", style.getName().c_str());1697 INFO("%s", itr->c_str());1696 TRACE("Style: %s", style.getName().c_str()); 1697 TRACE("%s", itr->c_str()); 1698 1698 1699 1699 if (style.has<osgEarth::Symbology::IconSymbol>()) { 1700 INFO("Found icon symbol");1700 TRACE("Found icon symbol"); 1701 1701 osgEarth::Symbology::IconSymbol *is = 1702 1702 style.get<osgEarth::Symbology::IconSymbol>(); 1703 1703 if (is->url().isSet()) { 1704 INFO("Icon url before: expr: '%s' eval: '%s'",1704 TRACE("Icon url before: expr: '%s' eval: '%s'", 1705 1705 is->url()->expr().c_str(), is->url()->eval().c_str()); 1706 1706 // eval() will try to evaluate the expr() … … 1708 1708 //setInfix() to set the expr() string, setLiteral() will quote 1709 1709 is->url()->setLiteral(path); 1710 INFO("Icon url after: %s", path.c_str());1710 TRACE("Icon url after: %s", path.c_str()); 1711 1711 } 1712 1712 } … … 1734 1734 std::string scripts(Tcl_GetString(objv[11])); 1735 1735 if (!scripts.empty()) { 1736 INFO("script: %s", scripts.c_str());1736 TRACE("script: %s", scripts.c_str()); 1737 1737 osg::ref_ptr<osgEarth::Symbology::StyleSheet::ScriptDef> scriptDef = 1738 1738 new osgEarth::Symbology::StyleSheet::ScriptDef(scripts); 1739 1739 geomOpts.styles()->setScript(scriptDef.get()); 1740 1740 } else { 1741 INFO("no script");1741 TRACE("no script"); 1742 1742 } 1743 1743 } … … 1748 1748 return TCL_ERROR; 1749 1749 } 1750 INFO("Num Selectors: %d", numSelectors);1750 TRACE("Num Selectors: %d", numSelectors); 1751 1751 for (int i = 0; i < numSelectors; i++) { 1752 1752 int numFields; … … 1762 1762 char *value = Tcl_GetString(fields[f+1]); 1763 1763 fieldMap[name] = value; 1764 INFO("selector[%s] = %s", name, value);1764 TRACE("selector[%s] = %s", name, value); 1765 1765 } 1766 1766 osgEarth::Symbology::StyleSelector ss; … … 1775 1775 itr = fieldMap.find("styleExpression"); 1776 1776 if (itr != fieldMap.end()) { 1777 INFO("selector: %s", itr->second.c_str());1777 TRACE("selector: %s", itr->second.c_str()); 1778 1778 ss.styleExpression() = osgEarth::Symbology::StringExpression(itr->second); 1779 1779 } … … 1792 1792 return TCL_ERROR; 1793 1793 } 1794 INFO("query bounds: %g %g %g %g", xmin, ymin, xmax, ymax);1794 TRACE("query bounds: %g %g %g %g", xmin, ymin, xmax, ymax); 1795 1795 query.bounds() = osgEarth::Bounds(xmin, ymin, xmax, ymax); 1796 1796 }
Note: See TracChangeset
for help on using the changeset viewer.