Changeset 4973 for geovis/trunk/RendererCmd.cpp
- Timestamp:
- Jan 31, 2015 11:27:43 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/RendererCmd.cpp
r4957 r4973 1727 1727 } 1728 1728 1729 static int 1730 MapTimeOp(ClientData clientData, Tcl_Interp *interp, int objc, 1731 Tcl_Obj *const *objv) 1732 { 1733 osgEarth::DateTime now; 1734 int year, month, day; 1735 double hours; 1736 year = now.year(); 1737 month = now.month(); 1738 day = now.day(); 1739 hours = now.hours(); 1740 if (objc > 2) { 1741 if (Tcl_GetDoubleFromObj(interp, objv[2], &hours) != TCL_OK) { 1742 return TCL_ERROR; 1743 } 1744 } 1745 if (objc > 3) { 1746 if (Tcl_GetIntFromObj(interp, objv[3], &day) != TCL_OK) { 1747 return TCL_ERROR; 1748 } 1749 } 1750 if (objc > 4) { 1751 if (Tcl_GetIntFromObj(interp, objv[4], &month) != TCL_OK) { 1752 return TCL_ERROR; 1753 } 1754 } 1755 if (objc > 5) { 1756 if (Tcl_GetIntFromObj(interp, objv[5], &year) != TCL_OK) { 1757 return TCL_ERROR; 1758 } 1759 } 1760 1761 g_renderer->setEphemerisTime(year, month, day, hours); 1762 return TCL_OK; 1763 } 1764 1729 1765 static CmdSpec mapOps[] = { 1730 1766 {"box", 1, MapBoxOp, 3, 0, "op ?params..."}, … … 1739 1775 {"setpos", 1, MapSetPositionOp, 2, 4, "x y"}, 1740 1776 {"terrain", 1, MapTerrainOp, 3, 0, "op ?params...?"}, 1777 {"time", 1, MapTimeOp, 2, 6, "?hours? ?day? ?month? ?year?"}, 1741 1778 }; 1742 1779 static int nMapOps = NumCmdSpecs(mapOps);
Note: See TracChangeset
for help on using the changeset viewer.