<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="X-UA-Compatible" content="IE=9" />
|
<title>ToolTitle</title>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<link rel="StyleSheet" href="../css/Style.css" type="text/css">
|
<link rel="stylesheet" href="../css/coomom.css" />
|
<style>
|
html, body {
|
overflow:hidden;
|
}
|
.s8 .PropertiesSheet tr td{
|
background-color:#151515;
|
color:white;
|
}
|
table .s8 .PropertiesSheet select,table .s8 .PropertiesSheet input{
|
color: white;
|
background-color: #151515;
|
}
|
table .s8 .PropertiesSheet tr td{
|
text-align: center;
|
}
|
</style>
|
</head>
|
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px" id="Body" class="hideUntillTranslated" onload="Init()">
|
<!--oncontextmenu="return false;"> onclick="bHide=true;HideOptionsNow()" > -->
|
<div class="border">
|
<div class="FourBorder">
|
<div class="topleft"></div>
|
<div class="topright"></div>
|
<div class="bottomleft"></div>
|
<div class="bottomright"></div>
|
</div>
|
<div class="content">
|
<table border="0" width="100%" cellspacing="0" cellpadding="0">
|
<tr>
|
<td class="ToolTopArea" id="TopAreaTD" width="100%" valign="middle" style="display:none;">
|
<table border="0" width="100%" cellspacing="0" cellpadding="0">
|
<tr>
|
<td width="55px"><img style="margin-left:5px;" src="ToolIcon.png" alt="" /></td>
|
<td id="TitleTD" align="center" class="s12w i18n">ToolName</td>
|
<td align="right" id="CloseHelpTd"><img style="margin-right:5px;" alt="" src="./img/help.png" border="0" class="i18n" alt="help" title="help" onclick="DisplayHelpPopup6(SGLang.i18nFile('help.html'),SGLang.i18n('help'))" style="cursor: pointer;"></td>
|
</tr>
|
</table>
|
</td>
|
</tr>
|
<tr style="display:none;">
|
<td class="ToolTopSeperator"></td>
|
</tr>
|
<tr class="s8">
|
<td>
|
<table class="PropertiesSheet" cellspacing="0" cellpadding="2">
|
<tr class='TableOtherLine'>
|
<td class="s8b">
|
<label for="createAs" class="i18n">Text0</label>
|
</td>
|
<td align="left">
|
<select id="createAs">
|
<option class="i18n" value="Layer">Text2</option>
|
<option class="i18n" value="LayerStreaming" selected="selected">Text3</option>
|
</select>
|
</td>
|
</tr>
|
<tr style="display:none;">
|
<!--Shadow type-->
|
<td class="s8b">
|
<label for="createAs" class="i18n">Text5</label>
|
</td>
|
<td align="left">
|
<select id="ShadowType">
|
<option class="i18n" value="1" selected="selected">Text37</option>
|
<option class="i18n" value="2">Text38</option>
|
<option class="i18n" value="3">Text39</option>
|
</select>
|
</td>
|
</tr>
|
<tr class='TableOtherLine'>
|
<!-- Distance between points-->
|
<td class="s8b ">
|
<span id="DistanceText" class="i18n">Text8</span>
|
</td>
|
<td align="left">
|
<input id="distance" type="text" value="10" size="7" onchange="CheckNumberEx(distance,10,0.01,999999)" />
|
<span class="i18n">Text9</span>
|
</td>
|
</tr>
|
<tr>
|
<!-- Min Altitude above ground-->
|
<td class="s8b ">
|
<span id="Span1" class="i18n">Text10</span>
|
</td>
|
<td align="left">
|
<input id="minAltitude" type="text" value="1.8" size="7" onchange="CheckNumberEx(minAltitude,1.8,0.01,999999)">
|
<span class="i18n">Text9</span>
|
</td>
|
</tr>
|
<tr class='TableOtherLine'>
|
<!-- max Altitude above ground-->
|
<td class="s8b ">
|
<span id="Span2" class="i18n">Text11</span>
|
</td>
|
<td align="left">
|
<input id="maxAltitude" type="text" value="1.8" size="7" onchange="CheckNumberEx(maxAltitude,1.8,0.01,999999)">
|
<span class="i18n">Text9</span>
|
</td>
|
</tr>
|
<tr>
|
<td class="s8b i18n">
|
<!--Time zone -->
|
Text25
|
</td>
|
<td align="left">
|
<select id="TimeZoneList" size="1" style="z-index: 1;">
|
<option timeZoneId="1" gmtAdjustment="GMT-12:00" useDaylightTime="0" value="-12">(GMT-12:00) International Date Line West</option>
|
<option timeZoneId="2" gmtAdjustment="GMT-11:00" useDaylightTime="0" value="-11">(GMT-11:00) Midway Island, Samoa</option>
|
<option timeZoneId="3" gmtAdjustment="GMT-10:00" useDaylightTime="0" value="-10">(GMT-10:00) Hawaii</option>
|
<option timeZoneId="4" gmtAdjustment="GMT-09:00" useDaylightTime="1" value="-9">(GMT-09:00) Alaska</option>
|
<option timeZoneId="5" gmtAdjustment="GMT-08:00" useDaylightTime="1" value="-8">(GMT-08:00) Pacific Time (US & Canada)</option>
|
<option timeZoneId="6" gmtAdjustment="GMT-08:00" useDaylightTime="1" value="-8">(GMT-08:00) Tijuana, Baja California</option>
|
<option timeZoneId="7" gmtAdjustment="GMT-07:00" useDaylightTime="0" value="-7">(GMT-07:00) Arizona</option>
|
<option timeZoneId="8" gmtAdjustment="GMT-07:00" useDaylightTime="1" value="-7">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option>
|
<option timeZoneId="9" gmtAdjustment="GMT-07:00" useDaylightTime="1" value="-7">(GMT-07:00) Mountain Time (US & Canada)</option>
|
<option timeZoneId="10" gmtAdjustment="GMT-06:00" useDaylightTime="0" value="-6">(GMT-06:00) Central America</option>
|
<option timeZoneId="11" gmtAdjustment="GMT-06:00" useDaylightTime="1" value="-6">(GMT-06:00) Central Time (US & Canada)</option>
|
<option timeZoneId="12" gmtAdjustment="GMT-06:00" useDaylightTime="1" value="-6">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option>
|
<option timeZoneId="13" gmtAdjustment="GMT-06:00" useDaylightTime="0" value="-6">(GMT-06:00) Saskatchewan</option>
|
<option timeZoneId="14" gmtAdjustment="GMT-05:00" useDaylightTime="0" value="-5">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option>
|
<option timeZoneId="15" gmtAdjustment="GMT-05:00" useDaylightTime="1" value="-5">(GMT-05:00) Eastern Time (US & Canada)</option>
|
<option timeZoneId="16" gmtAdjustment="GMT-05:00" useDaylightTime="1" value="-5">(GMT-05:00) Indiana (East)</option>
|
<option timeZoneId="17" gmtAdjustment="GMT-04:00" useDaylightTime="1" value="-4">(GMT-04:00) Atlantic Time (Canada)</option>
|
<option timeZoneId="18" gmtAdjustment="GMT-04:00" useDaylightTime="0" value="-4">(GMT-04:00) Caracas, La Paz</option>
|
<option timeZoneId="19" gmtAdjustment="GMT-04:00" useDaylightTime="0" value="-4">(GMT-04:00) Manaus</option>
|
<option timeZoneId="20" gmtAdjustment="GMT-04:00" useDaylightTime="1" value="-4">(GMT-04:00) Santiago</option>
|
<option timeZoneId="21" gmtAdjustment="GMT-03:30" useDaylightTime="1" value="-3.5">(GMT-03:30) Newfoundland</option>
|
<option timeZoneId="22" gmtAdjustment="GMT-03:00" useDaylightTime="1" value="-3">(GMT-03:00) Brasilia</option>
|
<option timeZoneId="23" gmtAdjustment="GMT-03:00" useDaylightTime="0" value="-3">(GMT-03:00) Buenos Aires, Georgetown</option>
|
<option timeZoneId="24" gmtAdjustment="GMT-03:00" useDaylightTime="1" value="-3">(GMT-03:00) Greenland</option>
|
<option timeZoneId="25" gmtAdjustment="GMT-03:00" useDaylightTime="1" value="-3">(GMT-03:00) Montevideo</option>
|
<option timeZoneId="26" gmtAdjustment="GMT-02:00" useDaylightTime="1" value="-2">(GMT-02:00) Mid-Atlantic</option>
|
<option timeZoneId="27" gmtAdjustment="GMT-01:00" useDaylightTime="0" value="-1">(GMT-01:00) Cape Verde Is.</option>
|
<option timeZoneId="28" gmtAdjustment="GMT-01:00" useDaylightTime="1" value="-1">(GMT-01:00) Azores</option>
|
<option timeZoneId="29" gmtAdjustment="GMT+00:00" useDaylightTime="0" value="0">(GMT+00:00) Casablanca, Monrovia, Reykjavik</option>
|
<option timeZoneId="30" gmtAdjustment="GMT+00:00" useDaylightTime="1" value="0">(GMT+00:00) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London</option>
|
<option timeZoneId="31" gmtAdjustment="GMT+01:00" useDaylightTime="1" value="1">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option>
|
<option timeZoneId="32" gmtAdjustment="GMT+01:00" useDaylightTime="1" value="1">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option>
|
<option timeZoneId="33" gmtAdjustment="GMT+01:00" useDaylightTime="1" value="1">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris</option>
|
<option timeZoneId="34" gmtAdjustment="GMT+01:00" useDaylightTime="1" value="1">(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
|
<option timeZoneId="35" gmtAdjustment="GMT+01:00" useDaylightTime="1" value="1">(GMT+01:00) West Central Africa</option>
|
<option timeZoneId="36" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Amman</option>
|
<option timeZoneId="37" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Athens, Bucharest, Istanbul</option>
|
<option timeZoneId="38" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Beirut</option>
|
<option timeZoneId="39" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Cairo</option>
|
<option timeZoneId="40" gmtAdjustment="GMT+02:00" useDaylightTime="0" value="2">(GMT+02:00) Harare, Pretoria</option>
|
<option timeZoneId="41" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius</option>
|
<option timeZoneId="42" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Jerusalem</option>
|
<option timeZoneId="43" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Minsk</option>
|
<option timeZoneId="44" gmtAdjustment="GMT+02:00" useDaylightTime="1" value="2">(GMT+02:00) Windhoek</option>
|
<option timeZoneId="45" gmtAdjustment="GMT+03:00" useDaylightTime="0" value="3">(GMT+03:00) Kuwait, Riyadh, Baghdad</option>
|
<option timeZoneId="46" gmtAdjustment="GMT+03:00" useDaylightTime="1" value="3">(GMT+03:00) Moscow, St. Petersburg, Volgograd</option>
|
<option timeZoneId="47" gmtAdjustment="GMT+03:00" useDaylightTime="0" value="3">(GMT+03:00) Nairobi</option>
|
<option timeZoneId="48" gmtAdjustment="GMT+03:00" useDaylightTime="0" value="3">(GMT+03:00) Tbilisi</option>
|
<option timeZoneId="49" gmtAdjustment="GMT+03:30" useDaylightTime="1" value="3.5">(GMT+03:30) Tehran</option>
|
<option timeZoneId="50" gmtAdjustment="GMT+04:00" useDaylightTime="0" value="4">(GMT+04:00) Abu Dhabi, Muscat</option>
|
<option timeZoneId="51" gmtAdjustment="GMT+04:00" useDaylightTime="1" value="4">(GMT+04:00) Baku</option>
|
<option timeZoneId="52" gmtAdjustment="GMT+04:00" useDaylightTime="1" value="4">(GMT+04:00) Yerevan</option>
|
<option timeZoneId="53" gmtAdjustment="GMT+04:30" useDaylightTime="0" value="4.5">(GMT+04:30) Kabul</option>
|
<option timeZoneId="54" gmtAdjustment="GMT+05:00" useDaylightTime="1" value="5">(GMT+05:00) Yekaterinburg</option>
|
<option timeZoneId="55" gmtAdjustment="GMT+05:00" useDaylightTime="0" value="5">(GMT+05:00) Islamabad, Karachi, Tashkent</option>
|
<option timeZoneId="56" gmtAdjustment="GMT+05:30" useDaylightTime="0" value="5.5">(GMT+05:30) Sri Jayawardenapura</option>
|
<option timeZoneId="57" gmtAdjustment="GMT+05:30" useDaylightTime="0" value="5.5">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi</option>
|
<option timeZoneId="58" gmtAdjustment="GMT+05:45" useDaylightTime="0" value="5.75">(GMT+05:45) Kathmandu</option>
|
<option timeZoneId="59" gmtAdjustment="GMT+06:00" useDaylightTime="1" value="6">(GMT+06:00) Almaty, Novosibirsk</option>
|
<option timeZoneId="60" gmtAdjustment="GMT+06:00" useDaylightTime="0" value="6">(GMT+06:00) Astana, Dhaka</option>
|
<option timeZoneId="61" gmtAdjustment="GMT+06:30" useDaylightTime="0" value="6.5">(GMT+06:30) Yangon (Rangoon)</option>
|
<option timeZoneId="62" gmtAdjustment="GMT+07:00" useDaylightTime="0" value="7">(GMT+07:00) Bangkok, Hanoi, Jakarta</option>
|
<option timeZoneId="63" gmtAdjustment="GMT+07:00" useDaylightTime="1" value="7">(GMT+07:00) Krasnoyarsk</option>
|
<option timeZoneId="64" gmtAdjustment="GMT+08:00" useDaylightTime="0" value="8">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
|
<option timeZoneId="65" gmtAdjustment="GMT+08:00" useDaylightTime="0" value="8">(GMT+08:00) Kuala Lumpur, Singapore</option>
|
<option timeZoneId="66" gmtAdjustment="GMT+08:00" useDaylightTime="0" value="8">(GMT+08:00) Irkutsk, Ulaan Bataar</option>
|
<option timeZoneId="67" gmtAdjustment="GMT+08:00" useDaylightTime="0" value="8">(GMT+08:00) Perth</option>
|
<option timeZoneId="68" gmtAdjustment="GMT+08:00" useDaylightTime="0" value="8">(GMT+08:00) Taipei</option>
|
<option timeZoneId="69" gmtAdjustment="GMT+09:00" useDaylightTime="0" value="9">(GMT+09:00) Osaka, Sapporo, Tokyo</option>
|
<option timeZoneId="70" gmtAdjustment="GMT+09:00" useDaylightTime="0" value="9">(GMT+09:00) Seoul</option>
|
<option timeZoneId="71" gmtAdjustment="GMT+09:00" useDaylightTime="1" value="9">(GMT+09:00) Yakutsk</option>
|
<option timeZoneId="72" gmtAdjustment="GMT+09:30" useDaylightTime="0" value="9.5">(GMT+09:30) Adelaide</option>
|
<option timeZoneId="73" gmtAdjustment="GMT+09:30" useDaylightTime="0" value="9.5">(GMT+09:30) Darwin</option>
|
<option timeZoneId="74" gmtAdjustment="GMT+10:00" useDaylightTime="0" value="10">(GMT+10:00) Brisbane</option>
|
<option timeZoneId="75" gmtAdjustment="GMT+10:00" useDaylightTime="1" value="10">(GMT+10:00) Canberra, Melbourne, Sydney</option>
|
<option timeZoneId="76" gmtAdjustment="GMT+10:00" useDaylightTime="1" value="10">(GMT+10:00) Hobart</option>
|
<option timeZoneId="77" gmtAdjustment="GMT+10:00" useDaylightTime="0" value="10">(GMT+10:00) Guam, Port Moresby</option>
|
<option timeZoneId="78" gmtAdjustment="GMT+10:00" useDaylightTime="1" value="10">(GMT+10:00) Vladivostok</option>
|
<option timeZoneId="79" gmtAdjustment="GMT+11:00" useDaylightTime="1" value="11">(GMT+11:00) Magadan, Solomon Is., New Caledonia</option>
|
<option timeZoneId="80" gmtAdjustment="GMT+12:00" useDaylightTime="1" value="12">(GMT+12:00) Auckland, Wellington</option>
|
<option timeZoneId="81" gmtAdjustment="GMT+12:00" useDaylightTime="0" value="12">(GMT+12:00) Fiji, Kamchatka, Marshall Is.</option>
|
<option timeZoneId="82" gmtAdjustment="GMT+13:00" useDaylightTime="0" value="13">(GMT+13:00) Nuku'alofa</option>
|
</select>
|
|
</td>
|
</tr>
|
<tr class='TableOtherLine'>
|
<td class="s8b i18n">
|
<!--Start Time -->
|
Text14
|
</td>
|
<td align="left">
|
<select id="startTime" size="1" style="z-index: 1;">
|
<option value="6" class="i18n">Text6AM</option>
|
<option value="7" class="i18n">Text7AM</option>
|
<option value="8" class="i18n">Text8AM</option>
|
<option value="9" class="i18n" selected="selected">Text9AM</option>
|
<option value="10" class="i18n">Text10AM</option>
|
<option value="11" class="i18n">Text11AM</option>
|
<option value="12" class="i18n">Text12AM</option>
|
<option value="13" class="i18n">Text1PM</option>
|
<option value="14" class="i18n">Text2PM</option>
|
<option value="15" class="i18n">Text3PM</option>
|
<option value="16" class="i18n">Text4PM</option>
|
<option value="17" class="i18n">Text5PM</option>
|
<option value="18" class="i18n">Text6PM</option>
|
<option value="19" class="i18n">Text7PM</option>
|
<option value="20" class="i18n">Text8PM</option>
|
</select>
|
</td>
|
</tr>
|
<tr>
|
<td class="s8b i18n">
|
<!--End Time -->
|
Text15
|
</td>
|
<td align="left">
|
<select id="endTime" size="1" style="z-index: 1;">
|
<option value="6" class="i18n">Text6AM</option>
|
<option value="7" class="i18n">Text7AM</option>
|
<option value="8" class="i18n">Text8AM</option>
|
<option value="9" class="i18n">Text9AM</option>
|
<option value="10" class="i18n">Text10AM</option>
|
<option value="11" class="i18n">Text11AM</option>
|
<option value="12" class="i18n">Text12AM</option>
|
<option value="13" class="i18n">Text1PM</option>
|
<option value="14" class="i18n">Text2PM</option>
|
<option value="15" class="i18n">Text3PM</option>
|
<option value="16" class="i18n" selected="selected">Text4PM</option>
|
<option value="17" class="i18n">Text5PM</option>
|
<option value="18" class="i18n">Text6PM</option>
|
<option value="19" class="i18n">Text7PM</option>
|
<option value="20" class="i18n">Text8PM</option>
|
</select>
|
</td>
|
</tr>
|
<tr class='TableOtherLine'>
|
<td class="s8b i18n">
|
<!--End Time -->
|
Text4
|
</td>
|
<td align="left">
|
<select id="TimeInterval" size="1" style="z-index: 1;">
|
<option value="15" class="i18n">15</option>
|
<option value="30" class="i18n">30</option>
|
<option value="60" class="i18n" selected="selected">60</option>
|
</select>
|
<span class="i18n">Text6</span>
|
</td>
|
</tr>
|
</table>
|
<tr class="s8">
|
<td colspan="2" align="center" class="ToolButtonsArea">
|
<button id="lineButton" class="MenuButton" onclick="CreateObjects(1);" title="沿线">
|
<img src="../img/polyline.png" /><br /> <!--<span class="i18n">Text33</span></button>-->
|
<button id="areaButton" class="MenuButton" onclick="CreateObjects(2);" title="区域"><img src="../img/polygon.png" /><br /><!--<span class="i18n">Text34</span>--></button>
|
<!--<button id="groupButton" class="MenuButton" onclick="SelectGroupObjects()"><img src="./img/group.png" /><br /><span class="i18n">Text35</span></button>
|
<button id="clipboardButton" class="MenuButton MenuButtonLast" onclick="SelectClipboardObjects()"><img src="./img/Clipboard.png" /><br /><span class="i18n">Text36</span></button>-->
|
</td>
|
</tr>
|
</table>
|
</div>
|
</div>
|
<object id="SGWorld" classid="CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1"></object>
|
|
<script language="javascript" src="../tooljs/ToolsCommon65.js"></script>
|
|
<script language="JavaScript">
|
|
|
//** this is a global variables for the polyline/polygon drawings
|
var gPolyObj = null;
|
var gPolyMethod;
|
var gPolygonText = SGLang.i18n("Text35");
|
var gPolylineText = SGLang.i18n("Text36");
|
var gDrawPolyClick = null;
|
var gEndDrawPoly = DrawPoly;
|
//**
|
|
var PointLayer;
|
var gPositionsArray = [];
|
var gLightArray = [];
|
var gSampleArray = [];
|
var gPointsIndex = 0;
|
var gVisibilityDistance;
|
var gFoundLine = false;
|
|
var bInEdit;
|
var bFirstTime;
|
var bDontAskme;
|
var gStartDate;
|
var gEndDate;
|
///var gTotalHours;
|
var rootId;
|
|
Date.prototype.stdTimezoneOffset = function () {
|
var jan = new Date(this.getFullYear(), 0, 1);
|
var jul = new Date(this.getFullYear(), 6, 1);
|
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
|
}
|
|
Date.prototype.dst = function () {
|
return this.getTimezoneOffset() < this.stdTimezoneOffset();
|
}
|
|
//--------------
|
// Init
|
function Init() {
|
if (GetParamValue("inSG", "") == "1") {
|
$("#TopAreaTD").attr("height", "57");
|
$("#TitleTD").attr("align", "left");
|
$("#CloseHelpTd").attr("display", "none");
|
}
|
|
rootId = GetParamValue("rootId", SGWorld.ProjectTree.RootID);
|
gDrawPolyAltitudeType = 3; // draw lines and polygon as absolute lines
|
|
// Set Time Zone default selection according to the current camera position
|
var currZone = CalculateTimeZone(SGWorld.Navigate.GetPosition());
|
$("#TimeZoneList").val(currZone);
|
SGWorld.DateTime.SetMode(2); // Display the one year time sliders
|
Reset(1, 0);
|
|
}
|
//------------------
|
// Reset
|
//------------------
|
function Reset(FirstTime, FromMouseInputMode) {
|
|
try {
|
if (gPolyObj != null)
|
SGWorld.Creator.DeleteObject(gPolyObj.ID);
|
} catch (e) { }
|
|
if (gPointsIndex > 0) {
|
if (AnalyzePoints())
|
DrawPoints();
|
}
|
|
if (PointLayer != null) {
|
PointLayer.Save();
|
}
|
gPolyObj = null;
|
GroupID = null;
|
PointLayer = null;
|
gPointsIndex = 0;
|
gPositionsArray = [];
|
gLightArray = [];
|
gSampleArray = [];
|
gVisibilityDistance = 3000;
|
|
bDontAskme = false;
|
|
$("#lineButton").removeClass("MenuButtonHighlight");
|
$("#areaButton").removeClass("MenuButtonHighlight");
|
$("#groupButton").removeClass("MenuButtonHighlight");
|
$("#clipboardButton").removeClass("MenuButtonHighlight");
|
|
SGWorld.ProjectTree.EnableRedraw(1);
|
SGWorld.Window.HideMessageBarText();
|
|
if (bInEdit) {
|
SGWorld.DetachEvent("OnLButtonDown", DrawPolyLButtonDown);
|
SGWorld.DetachEvent("OnRButtonUp", DrawPolyRButtonUp);
|
SGWorld.DetachEvent("OnFrame", DrawPolyOnFrame);
|
SGWorld.DetachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
|
}
|
bInEdit = false;
|
|
if (FirstTime != 1 && FromMouseInputMode == 0)
|
SGWorld.Window.SetInputMode(0);
|
}
|
//---------------
|
// CalculateTimeZone
|
function CalculateTimeZone(pos) {
|
try {
|
var srcCoordSys = SGWorld.Terrain.CoordinateSystem;
|
var destCoordSys = SGWorld.CoordServices.CreateCoordinateSystem("");
|
destCoordSys.InitLatLong();
|
var xLatLong = SGWorld.CoordServices.Reproject(srcCoordSys, destCoordSys, pos.X, pos.Y).X;
|
}
|
catch (err) { return 0 }
|
|
return Math.round(xLatLong / 15);
|
}
|
//--------------
|
// CreateObjects
|
//--------------
|
function CreateObjects(method) {
|
if (!bInEdit) {
|
bInEdit = true;
|
SGWorld.AttachEvent("OnLButtonDown", DrawPolyLButtonDown);
|
SGWorld.AttachEvent("OnRButtonUp", DrawPolyRButtonUp);
|
SGWorld.AttachEvent("OnFrame", DrawPolyOnFrame);
|
SGWorld.AttachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
|
|
|
gPolyMethod = method;
|
SGWorld.Window.SetInputMode(1, "", true);
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text16"));
|
$(event.srcElement).addClass("MenuButtonHighlight");
|
|
}
|
else {
|
DrawPolyRButtonUp(0, 0, 0, 0);
|
}
|
}
|
//-----------
|
// SelectGroupObjects
|
function SelectGroupObjects() {
|
var node = SGWorld.ProjectTree.GetNextItem("", 10);
|
if (node == 0 || !(SGWorld.ProjectTree.IsGroup(node) || SGWorld.ProjectTree.IsLayer(node))) {
|
alert(SGLang.i18n("Text24"));
|
return;
|
}
|
$(event.srcElement).addClass("MenuButtonHighlight");
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
|
gFoundLine = false;
|
searchGeometries2(node, DrawPoly);
|
if (!gFoundLine)
|
alert(SGLang.i18n("Text48"));
|
Reset(0, 0);
|
}
|
//-----------
|
// SelectClipboardObjects
|
function SelectClipboardObjects() {
|
$(event.srcElement).addClass("MenuButtonHighlight");
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"), -1);
|
gFoundLine = false;
|
searchGeometriesClipboard(DrawPoly);
|
if (!gFoundLine)
|
alert(SGLang.i18n("Text49"));
|
Reset(0, 0);
|
}
|
|
//-------------
|
// DrawPoly
|
function DrawPoly(geometry, type, altitudeType) {
|
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
|
SGWorld.ProjectTree.EnableRedraw(0);
|
if (!ValidateInput())
|
return false;
|
|
if (type == 1) {
|
if (!DrawOnPolyline(geometry, type, altitudeType))
|
return false;
|
}
|
else if (type == 2) {
|
if (!DrawOnPolygon(geometry, type, altitudeType))
|
return false;
|
}
|
else // Selected points
|
{
|
var tmpCoord = geometry.Copy(); // to avoid changes in the CurrCoord value in the DrawObject function
|
//AddPoint(tmpCoord); // Removed - according to bug #20614
|
|
}
|
|
|
return true;
|
|
}
|
//----
|
// DrawOnPolyline
|
function DrawOnPolyline(polylineGeometry, type, altitudeType) {
|
var lastCoord;
|
var currCoord;
|
var tmpCoord;
|
var SegmentLength;
|
var lastSegmentLenght;
|
var distance = validateNumber($("#distance").attr("value"));
|
gFoundLine = true;
|
var LeftOver = 0;
|
var totlaDistance = 0;
|
|
for (var k = 1; k < polylineGeometry.Points.count; k++) // calculate total distance
|
{
|
lastCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(k - 1).X, polylineGeometry.Points.Item(k - 1).Y, polylineGeometry.Points.Item(k - 1).Z, altitudeType);
|
currCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(k).X, polylineGeometry.Points.Item(k).Y, polylineGeometry.Points.Item(k).Z, altitudeType);
|
totlaDistance += lastCoord.DistanceTo(currCoord);
|
}
|
|
var firstSegment = true;
|
for (var i = 1; i < polylineGeometry.Points.count; i++) {
|
lastCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(i - 1).X, polylineGeometry.Points.Item(i - 1).Y, polylineGeometry.Points.Item(i - 1).Z, altitudeType);
|
currCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(i).X, polylineGeometry.Points.Item(i).Y, polylineGeometry.Points.Item(i).Z, altitudeType);
|
|
lastCoord.yaw = lastCoord.AimTo(currCoord).yaw;
|
lastCoord = lastCoord.MoveToward(currCoord, -LeftOver);
|
|
if (firstSegment) {
|
tmpCoord = lastCoord.Copy();
|
if (AddToPointsList(tmpCoord) == false)
|
return false;
|
}
|
SegmentLength = lastCoord.DistanceTo(currCoord);
|
lastSegmentLenght = SegmentLength;
|
|
while (SegmentLength >= distance && lastSegmentLenght >= SegmentLength) {
|
lastSegmentLenght = SegmentLength;
|
lastCoord = lastCoord.MoveToward(currCoord, distance);
|
tmpCoord = lastCoord.Copy();
|
if (AddToPointsList(tmpCoord) == false)
|
return false;
|
SegmentLength = lastCoord.DistanceTo(currCoord);
|
}
|
|
LeftOver = SegmentLength;
|
|
firstSegment = false;
|
}
|
// fix for bug #14439
|
//Restore3DModelToGroundObject();
|
return true;
|
}
|
//-----------
|
// DrawOnPolygon
|
function DrawOnPolygon(polygonGeometry, type, altitudeType) {
|
var envelope = polygonGeometry.Envelope; // Multi polygon evnelope (min/max)
|
|
|
//// var pos = SGWorld.Navigate.GetPosition();
|
CreateTheObjects = true;
|
gFoundLine = true;
|
var MinX = Math.min(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
|
var MaxX = Math.max(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
|
var MinY = Math.min(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
|
var MaxY = Math.max(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
|
|
var XDist = SGWorld.CoordServices.GetDistance(MinX, MinY, MaxX, MinY);
|
var YDist = SGWorld.CoordServices.GetDistance(MinX, MinY, MinX, MaxY);
|
var distanceVal = validateNumber($("#distance").attr("value"));
|
|
var currCoord;
|
switch (polygonGeometry.GeometryType) {
|
case 3: // ipolygon
|
currCoord = SGWorld.Creator.CreatePosition(MinX, MinY, polygonGeometry.Rings(0).Points.Item(0).Z, altitudeType, 0);
|
break;
|
case 6: // imultipolygon
|
currCoord = SGWorld.Creator.CreatePosition(MinX, MinY, polygonGeometry.Item(0).Rings(0).Points.Item(0).Z, altitudeType, 0);
|
break;
|
}
|
|
var currCoordAlt = currCoord.Altitude;
|
|
while (currCoord.x < MaxX) {
|
currCoord.y = MinY;
|
while (currCoord.y < MaxY) {
|
var pointGeometry = SGWorld.Creator.GeometryCreator.CreatePointGeometry([currCoord.x, currCoord.y, 0]);
|
if (polygonGeometry.SpatialRelation.Intersects(pointGeometry)) {
|
var tmpCoord = currCoord.Copy(); // to avoid changes in the CurrCoord value in the DrawObject function
|
if (AddToPointsList(tmpCoord) == false)
|
return false;
|
}
|
currCoord = currCoord.Move(distanceVal, 0, 0);
|
currCoord.Altitude = currCoordAlt;
|
}
|
currCoord = currCoord.Move(distanceVal, 90, 0);
|
currCoord.Altitude = currCoordAlt;
|
}
|
|
return true;
|
}
|
//------------
|
// AddToPointsList
|
function AddToPointsList(position) {
|
var minAltitude = validateNumber($("#minAltitude").val());
|
var maxAltitude = validateNumber($("#maxAltitude").val());
|
var distanceVal = validateNumber($("#distance").attr("value"));
|
|
position.AltitudeType = 3;
|
var groundAltitude = SGWorld.Terrain.GetGroundHeightInfo(position.X, position.Y, 2, true).Position.Altitude;
|
for (var currAltitude = minAltitude; currAltitude <= maxAltitude; currAltitude += distanceVal) {
|
position.Altitude = groundAltitude + currAltitude;
|
AddPoint(position);
|
}
|
|
var posNew;
|
var neighborAltitude;
|
var altitudeDiff = -1;
|
var found = false;
|
for (var yaw = 270; yaw >= 0; yaw -= 90) {
|
posNew = position.Copy();
|
posNew = posNew.Move(distanceVal, yaw, 0);
|
neighborAltitude = SGWorld.Terrain.GetGroundHeightInfo(posNew.X, posNew.Y, 0, true).Position.Altitude; // including buildings
|
altitudeDiff = Math.max(altitudeDiff, neighborAltitude - groundAltitude);
|
}
|
|
if (altitudeDiff > distanceVal * 2)
|
for (var currAltitude = minAltitude + distanceVal; currAltitude <= maxAltitude + altitudeDiff; currAltitude += distanceVal) {
|
position.Altitude = groundAltitude + currAltitude;
|
AddPoint(position);
|
}
|
}
|
//-------------
|
// AddPoint
|
function AddPoint(pos) {
|
var position1 = pos.ToAbsolute(0);
|
gPositionsArray[gPointsIndex] = position1;
|
gLightArray[gPointsIndex] = 0;
|
gPointsIndex += 1;
|
|
}
|
//------------
|
// AnalyzePoints
|
function AnalyzePoints() {
|
|
var startHr = $("#startTime").attr("value") * 1.0;
|
var endHr = $("#endTime").attr("value") * 1.0;
|
var timeIntrvl = $("#TimeInterval").attr("value");
|
var Index = 1;
|
var PointVisible = 0;
|
var currDate;
|
var maxAltitude = validateNumber($("#maxAltitude").val());
|
var ShadowType = validateNumber($("#ShadowType").val());
|
//alert(ShadowType);
|
|
var totalPoints = gPointsIndex;
|
var CreateTheObjects = true;
|
if (totalPoints > 10000)
|
CreateTheObjects = confirm(SGLang.i18n("Text20") + totalPoints + SGLang.i18n("Text21"));
|
if (!CreateTheObjects)
|
return false;
|
|
var BBoxPosition = CalculateBBox();
|
if (BBoxPosition.Distance > 1000) {
|
alert(SGLang.i18n("Text47"));
|
return false;
|
}
|
BBoxPosition.Distance = Math.max(maxAltitude, BBoxPosition.Distance) + 300; // add 300 meters to make sure buildings in the area will be calculated
|
|
var UTCOffset = parseFloat($("#TimeZoneList").val());
|
if (gPointsIndex > 0) {
|
var firstPointUTC = CalculateTimeZone(gPositionsArray[0]);
|
if (Math.abs(UTCOffset - firstPointUTC) > 1)
|
if (!confirm(SGLang.i18n("Text28")))
|
return false;
|
}
|
// Find current date and time
|
try {
|
gStartDate = new Date(SGWorld.DateTime.Current);
|
var DayLightSavingTimeOffset = 0;
|
if (gStartDate.dst()) {
|
DayLightSavingTimeOffset = 1;
|
}
|
gStartDate.setUTCHours(startHr - UTCOffset - DayLightSavingTimeOffset, 0, 0);
|
|
currDate = new Date(gStartDate);
|
gEndDate = new Date(SGWorld.DateTime.Current);
|
gEndDate.setUTCHours(endHr - UTCOffset - DayLightSavingTimeOffset, 0, 0);
|
}
|
catch (err) { alert(err); return; }
|
|
while (currDate <= gEndDate) {
|
try {
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text22") + currDate.toUTCString(), -1);
|
SGWorld.DateTime.Current = currDate;
|
switch (ShadowType) {
|
case 1: // Global + Selected
|
|
// Calculate slection shadow for this time
|
try {
|
SGWorld.Analysis.StartShadowVisibilityQuery(BBoxPosition, BBoxPosition.Distance, 2);
|
for (var i = 0; i < gPointsIndex; i++) {
|
try {
|
PointVisible = AnalyzePoint(gPositionsArray[i]); // Returns 1 for light or 0 for shadow
|
gSampleArray[i] = PointVisible;
|
}
|
catch (err) { gSampleArray[i] = 1; }
|
}
|
// Release viewshed buffer
|
SGWorld.Analysis.EndVisibilityQuery();
|
}
|
catch (err) { for (var i = 0; i < gPointsIndex; i++) { gSampleArray[i] = 1; } }
|
|
// Calculate global shadow for this time
|
SGWorld.Analysis.StartShadowVisibilityQuery(BBoxPosition, BBoxPosition.Distance, 1);
|
for (var i = 0; i < gPointsIndex; i++) {
|
try {
|
PointVisible = AnalyzePoint(gPositionsArray[i]); // Returns 1 for light or 0 for shadow
|
PointVisible = Math.min(PointVisible, gSampleArray[i]);
|
gLightArray[i] = (((gLightArray[i] * (Index - 1)) / 100 + PointVisible) * 100) / Index; // Calculate the new avarage value in presentages
|
}
|
catch (err) { gLightArray[i] = "-1"; }
|
}
|
// Release viewshed buffer
|
SGWorld.Analysis.EndVisibilityQuery();
|
|
break;
|
|
case 2: // Selected
|
// Create the Shadow analysis buffer
|
SGWorld.Analysis.StartShadowVisibilityQuery(BBoxPosition, BBoxPosition.Distance, ShadowType); //**** need to calculate the center and radius *******
|
|
for (var i = 0; i < gPointsIndex; i++) {
|
try {
|
PointVisible = AnalyzePoint(gPositionsArray[i]); // Returns 1 for light or 0 for shadow
|
gLightArray[i] = (((gLightArray[i] * (Index - 1)) / 100 + PointVisible) * 100) / Index; // Calculate the new avarage value in presentages
|
}
|
catch (err) { gLightArray[i] = "-1"; }
|
}
|
|
// Release viewshed buffer
|
SGWorld.Analysis.EndVisibilityQuery();
|
break;
|
|
case 3: // Selected Shadow suplement (selected-global)
|
// Calculate global shadow for this time
|
SGWorld.Analysis.StartShadowVisibilityQuery(BBoxPosition, BBoxPosition.Distance, 1);
|
for (var i = 0; i < gPointsIndex; i++) {
|
try {
|
PointVisible = AnalyzePoint(gPositionsArray[i]); // Returns 1 for light or 0 for shadow
|
gSampleArray[i] = PointVisible;
|
}
|
catch (err) { gLightArray[i] = "-1"; }
|
}
|
// Release viewshed buffer
|
SGWorld.Analysis.EndVisibilityQuery();
|
|
// Calculate slection shadow for this time
|
SGWorld.Analysis.StartShadowVisibilityQuery(BBoxPosition, BBoxPosition.Distance, 2);
|
for (var i = 0; i < gPointsIndex; i++) {
|
// try {
|
PointVisible = AnalyzePoint(gPositionsArray[i]); // Returns 1 for light or 0 for shadow
|
if (PointVisible < gSampleArray[i])
|
PointVisible = 0;
|
else
|
PointVisible = 1;
|
gLightArray[i] = (((gLightArray[i] * (Index - 1)) / 100 + PointVisible) * 100) / Index; // Calculate the new avarage value in presentages
|
// }
|
// catch (err) { gLightArray[i] = "-1"; }
|
}
|
// Release viewshed buffer
|
SGWorld.Analysis.EndVisibilityQuery();
|
|
break;
|
}
|
|
currDate.setTime(currDate.getTime() + (timeIntrvl * 60 * 1000));
|
Index++;
|
}
|
catch (err) {
|
if (ShadowType == 1)
|
alert(SGLang.i18n("Text40"));
|
else if (ShadowType == 2)
|
alert(SGLang.i18n("Text41"));
|
else
|
alert(SGLang.i18n("Text42"));
|
|
return false;
|
}
|
}
|
|
return true;
|
}
|
|
//---------
|
// CalculateBBox
|
function CalculateBBox() {
|
// Calculate BBox
|
var minX = 99999999;
|
var minY = 99999999;
|
var maxX = -99999999;
|
var maxY = -99999999;
|
|
for (var i = 0; i < gPointsIndex; i++) {
|
minX = Math.min(minX, gPositionsArray[i].X);
|
minY = Math.min(minY, gPositionsArray[i].Y);
|
maxX = Math.max(maxX, gPositionsArray[i].X);
|
maxY = Math.max(maxY, gPositionsArray[i].Y);
|
}
|
|
var maxPos = SGWorld.Creator.CreatePosition(maxX, maxY, 0, 0, 0, 0, 0, 1);
|
var minPos = SGWorld.Creator.CreatePosition(minX, minY, 0, 0, 0, 0, 0, 1);
|
var radius = maxPos.DistanceTo(minPos) / 2;
|
var avrPos = maxPos.MoveToward(minPos, radius);
|
|
avrPos.Distance = radius;
|
|
return avrPos;
|
|
}
|
//------------
|
// DrawPoints
|
function DrawPoints() {
|
for (var i = 0; i < gPointsIndex; i++) {
|
DrawObject(gPositionsArray[i], i);
|
}
|
return true;
|
}
|
|
//---------
|
// DrawObject
|
function DrawObject(position, index) {
|
var node;
|
var TEObj;
|
var ObjType = "ImageLabel";
|
var distance = validateNumber($("#distance").attr("value"));
|
var size = distance / 100;
|
|
var noiseVal = 0;
|
var createAs = $("#createAs").val();
|
var PointVisible;
|
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text31") + " " + index, -1);
|
|
var LightValue = Math.round(gLightArray[index]);
|
if (LightValue < 0) // point outside the Viewshed/Shadow range
|
return true;
|
var ShadowValue = 100 - LightValue;
|
|
var IconColor = 0; // red + green * 256 + blue * 65536;
|
if (LightValue < 35)
|
IconColor = 255 + 0 * 256 + 0 * 65536; // red
|
else if (LightValue < 65)
|
IconColor = 244 + 167 * 256 + 68 * 65536; // orange
|
else if (LightValue < 99)
|
IconColor = 255 + 255 * 256 + 0 * 65536; // yellow
|
else
|
IconColor = 0 + 255 * 256 + 0 * 65536; // green
|
|
if (createAs != "Group") { // Create a feature layer
|
if (PointLayer == null) {
|
CreateGroupOrLayer();
|
|
// style the feature group
|
if (featureLayerStyles[ObjType] != null) {
|
var result = featureLayerStyles[ObjType](size, abspath() + "/img/point.gif", "[IconColor]");
|
if (result === false)
|
return false;
|
}
|
}
|
|
PointLayer.FeatureGroups.Point.CreateFeature([position.X, position.Y, position.Altitude], gStartDate.toUTCString() + ";" + gEndDate.toUTCString() + ";" + ShadowValue + ";" + IconColor);
|
}
|
|
return true;
|
|
}
|
//----------
|
// CreateGroupOrLayer
|
function CreateGroupOrLayer() {
|
|
var ShadowAttName = $("#ShadowType").val() == 3 ? SGLang.i18n("Text45") : SGLang.i18n("Text46");
|
|
var distance = 10;
|
distance = validateNumber($("#distance").attr("value"));
|
|
if (PointLayer == null) {
|
var postfix = new Date().getTime();
|
var LayerName = SGLang.i18n("Text13") + "-" + $("#ShadowType option:selected").text();
|
PointLayer = SGWorld.Creator.CreateNewFeatureLayer(LayerName, LayerGeometryType.LGT_POINT, "FileName=ShadowQuery" + postfix + ".shp;TEPlugName=OGR;", rootId);
|
PointLayer.Streaming = $("#createAs").val() == "LayerStreaming";
|
PointLayer.BlockWidth = distance * 60;
|
PointLayer.Refresh();
|
PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text43"), 0, 40, 0);
|
PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text44"), 0, 40, 0);
|
PointLayer.DataSourceInfo.Attributes.CreateAttribute(ShadowAttName, 1, 20, 0);
|
PointLayer.DataSourceInfo.Attributes.CreateAttribute("IconColor", 1, 20, 0);
|
PointLayer.DataSourceInfo.Attributes.ImportAll = true;
|
PointLayer.Visibility.MaxVisibilityDistance = gVisibilityDistance;
|
// style the feature group
|
PointLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_LABEL;
|
|
}
|
|
}
|
var featureLayerStyles = {
|
|
"ImageLabel": function (size, param, param2) {
|
PointLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_IMAGE_LABEL;
|
PointLayer.FeatureGroups.Point.SetProperty("Image file", param)
|
PointLayer.FeatureGroups.Point.SetProperty("Image Color", param2)
|
PointLayer.FeatureGroups.Point.SetProperty("Scale", size);
|
PointLayer.FeatureGroups.Point.SetProperty("Altitude Method", 1);
|
PointLayer.FeatureGroups.Point.SetProperty("Limit growth", true);
|
if ($("#ShadowType").val() == 3)
|
PointLayer.FeatureGroups.Point.SetProperty("Tool Tip", SGLang.i18n("Text45") + " [" + SGLang.i18n("Text45") + "]");
|
else
|
PointLayer.FeatureGroups.Point.SetProperty("Tool Tip", SGLang.i18n("Text46") + " [" + SGLang.i18n("Text46") + "]");
|
}
|
|
}
|
|
//----
|
// AnalyzePoint
|
function AnalyzePoint(position) {
|
// try {
|
var a = SGWorld.Analysis.QueryPointVisibility(position);
|
return a;
|
// }
|
// catch (err) {alert (err);return -1;}
|
}
|
|
|
|
|
//---------------
|
// ValidateInput
|
function ValidateInput() {
|
if ($("#startTime").attr("value") * 1.0 > $("#endTime").attr("value") * 1.0) {
|
alert(SGLang.i18n("Text23"));
|
return false;
|
}
|
|
return true;
|
}
|
//--------------
|
// CheckNumberEx
|
function CheckNumberEx(field, defVal, MinNum, MaxNum) {
|
try {
|
field.value = validateNumber(field.value);
|
|
if (field.value < MinNum)
|
field.value = MinNum;
|
if (field.value > MaxNum)
|
field.value = MaxNum;
|
}
|
catch (e) { field.value = defVal }
|
}
|
|
</script>
|
|
</body>
|
</html>
|
<!--Sig:00000040YPJltV6W46667A8EiFdWaNScrW3STW5jCkSN90MIvuE0RV7WdM0PgSWlkILbml6hcUjSsihxSSOmw9aKZCUOMzJJ-->
|