<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<title>ToolTitle</title>
|
<meta http-equiv="X-UA-Compatible" content="IE=9" />
|
<!--<meta http-equiv="Content-Type" content="text/html; charset=utf-8">-->
|
<link rel="StyleSheet" href="Style.css" type="text/css" />
|
<link type="text/css" rel="StyleSheet" href="Jquery/slider.css" />
|
<link href="Jquery/css/dark-hive/jquery-ui-1.10.4.custom.css" rel="stylesheet" />
|
<link href="Jquery/jquery-ui-Override.css" rel="stylesheet" />
|
<script src="Jquery/jquery-1.10.2.js" type="text/javascript"></script>
|
<script src="Jquery/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
|
<script type="text/javascript" language="javascript" src="js/ToolsCommon70.js"></script>
|
<script type="text/javascript" src="Jquery/slider.js"></script>
|
<style>
|
|
</style>
|
</head>
|
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px"
|
id="Body" class="hideUntillTranslated" onload="Init()" onunload="Exit();">
|
<!--oncontextmenu="return false;"> onclick="bHide=true;HideOptionsNow()" > -->
|
<table border="0" width="100%" cellspacing="0" cellpadding="10">
|
<tr>
|
<td align="center">
|
<div id="MoveSlider" style="display: block; width: 250px; height: 1px; margin: 3px;">
|
</div>
|
</td>
|
</tr>
|
</table>
|
<script language="JavaScript" type="text/javascript">
|
var gDebug = false;
|
var gObjID = "";
|
var gBoxObj = null;
|
var gOrigPos = null;
|
var MoveSlider;
|
var gOriginBoxSize = 0;
|
var gGeometry;
|
|
var SGWorld = new ActiveXObject("TerraExplorerX.SGWorld70");
|
|
//--------------
|
// Init
|
function Init() {
|
try {
|
// debugger;
|
gObjID = GetParamValue("ObjID", "0");
|
|
gBoxObj = SGWorld.ProjectTree.GetObject(gObjID);
|
gOrigPos = gBoxObj.Position.Copy();
|
gOriginBoxSize = gBoxObj.Width;
|
SGWorld.AttachEvent("OnFrame", showCrossSection);
|
|
$("#MoveSlider").slider({
|
value: 0,
|
min: -50,
|
max: 200,
|
slide: function (event, ui) {
|
setMove();
|
},
|
change: function (event, ui) {
|
setMove();
|
}
|
});
|
|
}
|
catch (err) { }
|
}
|
//------------------
|
function Exit() {
|
|
try {
|
SGWorld.Analysis.HideCrossSectionBox();
|
|
//SGWorld.Window.ShowMessageBarText("隐藏截面:" + gBoxObj.ID);
|
|
}
|
catch (err) { }
|
|
}
|
|
//--------------
|
function setMove() {
|
try {
|
var distanceVal = $("#MoveSlider").slider("value") * gBoxObj.Width / 100;
|
if (gBoxObj.Position.Pitch == 90) { // vertical
|
gBoxObj.Position = gOrigPos.Move(-distanceVal.toFixed(2), gBoxObj.Position.Yaw.toFixed(2), 0);
|
gBoxObj.Position.Pitch = 90;
|
}
|
else
|
gBoxObj.Position.Altitude = gOrigPos.Altitude - distanceVal;
|
}
|
catch (err) { }
|
}
|
var gLastPos = null;
|
//-------------------
|
function showCrossSection() {
|
setMove();
|
try {
|
if (gBoxObj == null)
|
return;
|
|
if (gLastPos == null || !gLastPos.IsEqual(gBoxObj.Position)) {
|
var vertices = [];
|
var sectionSize = gBoxObj.Width * 5;
|
gLastPos = gBoxObj.Position.Copy();
|
var pos = gBoxObj.Position;
|
var planeTolarance = gOriginBoxSize / 100;
|
if (gBoxObj.Position.Pitch == 90) {
|
var yaw = gBoxObj.Position.Yaw - 180;
|
pos = pos.Move(planeTolarance, yaw - 180, 0); // make sure the cut area doesn't include the box
|
pos = pos.Move(gBoxObj.Width / 2, 0, -90);
|
pos = pos.Move(gBoxObj.Width / 2, yaw + 90, 0);
|
vertices[0] = pos;
|
pos = pos.Move(sectionSize, yaw - 180, 0);
|
vertices[1] = pos;
|
pos = pos.Move(gBoxObj.Width, yaw - 90, 0);
|
vertices[2] = pos;
|
pos = pos.Move(sectionSize, yaw, 0);
|
vertices[3] = pos;
|
vertices[4] = vertices[0].Move(gBoxObj.Width, 0, 90);
|
vertices[5] = vertices[1].Move(gBoxObj.Width, 0, 90);
|
vertices[6] = vertices[2].Move(gBoxObj.Width, 0, 90);
|
vertices[7] = vertices[3].Move(gBoxObj.Width, 0, 90);
|
}
|
else {
|
pos = pos.Move(planeTolarance, 0, 90); // make sure the cut area doesn't include the box
|
pos = pos.Move(gBoxObj.Width / 2, gBoxObj.Position.Yaw, 0);
|
pos = pos.Move(gBoxObj.Width / 2, gBoxObj.Position.Yaw + 90, 0);
|
vertices[0] = pos;
|
pos = pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw - 180, 0);
|
vertices[1] = pos;
|
pos = pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw - 90, 0);
|
vertices[2] = pos;
|
pos = pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw, 0);
|
vertices[3] = pos;
|
vertices[4] = vertices[0].Move(sectionSize, 0, 90);
|
vertices[5] = vertices[1].Move(sectionSize, 0, 90);
|
vertices[6] = vertices[2].Move(sectionSize, 0, 90);
|
vertices[7] = vertices[3].Move(sectionSize, 0, 90);
|
}
|
|
gGeometry = SGWorld.Creator.GeometryCreator.CreateLineStringGeometry(vertices);
|
// tmpBox = SGWorld.Creator.CreatePolyline(geometry, $("#color").val(), 3, "", "dd");
|
SGWorld.Analysis.ShowCrossSectionBox(gGeometry, false, "#ff" + $("#color").val()); //
|
}
|
}
|
catch (err) { }
|
}
|
|
</script>
|
</body>
|
</html>
|
<!--Sig:00000040YFf3GyOIQX9gzWX9h.sCzs4t#QLO8w2ER9KyGySg4me#3IR4qALzXHLLM#n#WLNrwJDAf4lbvnrGIXMa00s7X8JJ-->
|