<!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" />
|
<script language="javascript" src="../tooljs/ToolsCommon65.js" type="text/javascript"></script>
|
<script language="javascript" src="../tooljs/jquery-1.8.0.min.js" type="text/javascript"></script>
|
<script language="javascript" src="../tooljs/FenceAndWall.js" type="text/javascript"></script>
|
<link rel="StyleSheet" href="../css/Style.css" type="text/css" />
|
<style type="text/css">
|
.ImageNotSelected,
|
th div img
|
{
|
padding: 0px;
|
border: 3px solid #E8EBF4;
|
margin: 1px 2px 1px 2px;
|
width: 50px;
|
height: 50px;
|
cursor: pointer;
|
}
|
th div img { cursor: auto; }
|
|
.ImageSelected
|
{
|
border:3px solid #FF9900;
|
margin: 1px 2px 1px 2px;
|
width: 50px;
|
height: 50px;
|
cursor:pointer;
|
}
|
#tblBasicIcons
|
{
|
background-color:#ffffff
|
width:100%;
|
}
|
.TextureTD
|
{
|
padding: 1px;
|
margin: 2px;
|
border: 1px solid #AEE2FD;
|
background-color: #E8EBF4;
|
width: 50px;
|
height: 50px;
|
top: auto;
|
right: auto;
|
vertical-align: middle;
|
bottom: auto;
|
left: auto;
|
}
|
.FenceWallBigIcon {
|
width: 8px;
|
height:50px;
|
background-color:#151515;
|
}
|
th
|
{
|
text-align:left;
|
font-style:normal;
|
font-weight:bold;
|
font-size:11px;
|
font-family: Arial, Helvetica, sans-serif;
|
color:rgb(49,74,95);
|
vertical-align:top;
|
}
|
.nobr
|
{
|
white-space:nowrap;
|
}
|
|
INPUT, SELECT
|
{
|
font-family: Arial, Helvetica, sans-serif;
|
font-size: 11px;
|
font-style: normal;
|
font-weight: normal;
|
color: #000000;
|
text-decoration: none;
|
}
|
|
|
</style>
|
<script type="text/javascript">
|
$(document).ready(function () {
|
gDrawPolyAltitudeType = 3; // draw lines and polygon as absolute lines
|
$('TD > SPAN.ddl').click(function() {
|
|
// If this list is currently open, don't continue
|
var doContinue = $(this).parent().find('UL.ddl:visible').length;
|
|
// Close other open lists
|
$('ul.ddl').hide();
|
|
if (doContinue > 0)
|
return;
|
|
$(this).parent().find('UL').css("top", $(this).position().top + $(this).innerHeight() + 1);
|
$(this).parent().find('UL').show();
|
$(this).parent().find('UL').focus();
|
|
if ($(this).parent().find('ul > li.selected').length > 0)
|
$(this).parent().find('ul').scrollTop(Math.abs($(this).parent().find('ul > li.selected').position().top));
|
else
|
$(this).parent().find('ul').scrollTop(0);
|
});
|
|
$('ul.ddl > li').click(function(e)
|
{
|
$(this).parent().parent().find("SPAN.ddl > img").attr("src", $(this).find("img").attr("src"));
|
$(this).parent().parent().find('ul.ddl').hide();
|
$(this).parent().find("li.selected").removeClass("selected");
|
$(this).addClass('selected');
|
$(this).parent().scrollTop(Math.abs($(this).parent().find('li.selected').position().top));
|
|
$(this).parent().change();
|
e.preventDefault();
|
});
|
|
$('.TextureTD > img').click(function(e)
|
{
|
var paramsObject = GetParamsFromUI();
|
|
$('.TextureTD > img')
|
.removeClass('ImageSelected')
|
.addClass('ImageNotSelected');
|
|
$(this).addClass('ImageSelected');
|
if ($(this).attr("src").match(/fence/i))
|
{
|
if (paramsObject.ObjectType != OBJECTTYPE.MeshFence)
|
{
|
paramsObject = {};
|
$.extend(paramsObject,DEFAULT_FENCE_PARAMS);
|
}
|
}
|
else
|
{
|
if (paramsObject.ObjectType != OBJECTTYPE.Wall)
|
{
|
paramsObject = {};
|
$.extend(paramsObject,DEFAULT_WALL_PARAMS);
|
}
|
}
|
paramsObject.FillStyle = FILLSTYLE.Texture;
|
var url = abspath().substr(0, abspath().indexOf('tool'));
|
paramsObject.Texture = url + "img/" + $(this).attr("src").substr($(this).attr("src").indexOf('texture'), $(this).attr("src").length);
|
//alert(url + "img/" + $(this).attr("src").substr($(this).attr("src").indexOf('texture'), $(this).attr("src").length));
|
//
|
// Set the global parameters object with predefined params
|
//
|
g_OperationParameters = paramsObject;
|
//
|
// Make the UI show the operation parameters
|
//
|
ReflectParamsInUI(paramsObject);
|
});
|
|
$("#ddlObjectType").change(function()
|
{
|
//populate attributes with the defaults for that type
|
switch ($("#ddlObjectType").val()) {
|
case "Option_Fence":
|
ReflectParamsInUI(DEFAULT_FENCE_PARAMS);
|
break;
|
case "Option_Wall":
|
ReflectParamsInUI(DEFAULT_WALL_PARAMS);
|
break;
|
case "Option_WallWithFence":
|
ReflectParamsInUI(DEFAULT_WALLWITHFENCE_PARAMS);
|
break;
|
case "Option_WireStrandFence":
|
ReflectParamsInUI(DEFAULT_WIRESTRAND_PARAMS);
|
break;
|
default:
|
throw new Error(2000, "Unexpected object type - select fence or wall");
|
}
|
|
resetBackgroundTrColor($("#mainTable > tbody"));
|
});
|
|
$('input.fileButton[type="button"]').click(function()
|
{
|
$("#fileChooser").val($("#file" + $(this).attr("id").substr(3)).val());
|
$("#fileChooser").data("caller", "#file" + $(this).attr("id").substr(3));
|
$("#fileChooser").click();
|
});
|
$('#fileChooser').change(function()
|
{
|
$($(this).data("caller"))
|
.val($(this).val())
|
.change();
|
$(this).val("");
|
$("#fileChooser").removeData("caller");
|
|
});
|
$('input[id$="TextureFile"][type="text"]').change(function()
|
{
|
if ($(this).val() == SGLang.i18n("Select_A_File") || $(this).val().match(/^\s*$/))
|
{
|
$("#img" + $(this).attr("id").substr(4)).parent().hide();
|
$("#img" + $(this).attr("id").substr(4)).attr("src", "");
|
}
|
else
|
{
|
$("#img" + $(this).attr("id").substr(4)).parent().show();
|
$("#img" + $(this).attr("id").substr(4)).attr("src", $(this).val());
|
}
|
});
|
|
$('input.ColorButton[type="button"]').click(function()
|
{
|
if ($("#divColorPicker:visible").length > 0)
|
{
|
$("#divColorPicker").hide();
|
return;
|
}
|
$("#divColorPicker").show();
|
$("#divColorPicker").data("caller", $(this).attr("id"));
|
if ($.browser.msie && $.browser.version == "7.0")
|
$("#divColorPicker").attr("style", "position:absolute;left:" + $(this).position().left + "px;top:" + ($(this).position().top + $(this).outerHeight()).toString() + "px;");
|
else
|
{
|
$("#divColorPicker").css("left", $(this).position().left);
|
$("#divColorPicker").css("top", $(this).position().top + $(this).outerHeight());
|
}
|
});
|
|
$('select.fillStyleSelect').change(function()
|
{
|
var prefix = $(this).attr("id").substr(3, $(this).attr("id").indexOf("FillStyle") - 3);
|
|
switch ($(this).val())
|
{
|
case "Color":
|
$('tr[id="tr' + prefix + 'FillColor"]').show();
|
$('tr[id="tr' + prefix + 'FillTextureFile"]').hide();
|
break;
|
case "Texture":
|
$('tr[id="tr' + prefix + 'FillColor"]').hide();
|
$('tr[id="tr' + prefix + 'FillTextureFile"]').show();
|
break;
|
}
|
resetBackgroundTrColor($(this).closest("tbody"));
|
});
|
|
$('select.postTypeSelect').change(function()
|
{
|
$(this).closest('tbody').find('tr:gt(1)').hide();
|
if ($(this).val() !== "None")
|
{
|
$(this).closest('tbody').find('tr:gt(1)').show();
|
$(this).closest('tbody').find('tr[id$="FillStyle"] > td > select').change();
|
}
|
else
|
resetBackgroundTrColor($(this).closest('tbody'))
|
});
|
|
$("#divIconsTableAdvance > img").click(function()
|
{
|
if ($("#divBasic:visible").length > 0)
|
{
|
$("#divBasic").hide();
|
$("#divAdvanced").show();
|
$(this).attr("alt", "Advance");
|
$(this).attr("src", "../img/Fence_Back.gif");
|
$(this).parent().css("text-align", "left");
|
resetBackgroundTrColor($("#mainTable > tbody"));
|
}
|
else
|
{
|
$("#divBasic").show();
|
$("#divAdvanced").hide();
|
$(this).attr("alt", "Back");
|
$(this).attr("src", "../img/Fence_Advance.gif");
|
$(this).parent().css("text-align", "right");
|
}
|
});
|
|
// BEGIN INIT STUFF
|
$('#divBasic >table >tbody >tr >td.TextureTD:first >img').click();
|
$("#ddlObjectType").val("Option_Fence");
|
$("#ddlObjectType").change();
|
createColorPickerTable();
|
$("#divIconsTableAdvance > img").click();
|
resetBackgroundTrColor($("#mainTable > tbody"));
|
|
$('input[type="text"]').css("font-size", "11px");
|
});
|
|
function resetBackgroundTrColor(parentContainer)
|
{
|
$(parentContainer).find('tr.TableOtherLine').removeClass("TableOtherLine");
|
$(parentContainer).find("tr:gt(0):not([style*='none']):even").addClass("TableOtherLine");
|
}
|
|
function createColorPickerTable()
|
{
|
var colors = [
|
["#000000", "#333333", "#666666", "#999999", "#C0C0C0", "#FFFFFF"],
|
["#800000", "#FF0000", "#FF3333", "#FF6666", "#FF9999", "#FFC0C0"],
|
["#808000", "#FFFF00", "#FFFF33", "#FFFF66", "#FFFF99", "#FFFFC0"],
|
["#008000", "#00FF00", "#33FF33", "#66FF66", "#99FF99", "#C0FFC0"],
|
["#008080", "#00FFFF", "#33FFFF", "#66FFFF", "#99FFFF", "#C0FFFF"],
|
["#000080", "#0000FF", "#3333FF", "#6666FF", "#9999FF", "#C0C0FF"],
|
["#800080", "#FF00FF", "#FF33FF", "#FF66FF", "#FF99FF", "#FFC0FF"]];
|
|
$("body").prepend('<div id="divColorPicker" style="position:absolute;display:none;"></div>');
|
$('body > div[id="divColorPicker"]').prepend('<table id="tblColorPicker" border="5" cellpadding="0" cellspacing="0"></table>');
|
|
$.each(colors, function()
|
{
|
$('#tblColorPicker').append('<tr></tr>');
|
$.each($(this), function()
|
{
|
$('#tblColorPicker > tbody > tr:last').append("<td></td>");
|
$('#tblColorPicker > tbody > tr:last > td:last')
|
.addClass("ColorWin")
|
.data("colorVal", this)
|
.css("background-color", this)
|
.bind("click", function() {
|
$("#divColorPicker").hide();
|
if ($.browser.msie && $.browser.version == "7.0")
|
$("#" + $("#divColorPicker").data("caller"))
|
.data("colorVal", $(this).data("colorVal"))
|
.attr("style", "background-color:" + $(this).data("colorVal"));
|
else
|
$("#" + $("#divColorPicker").data("caller"))
|
.data("colorVal", $(this).data("colorVal"))
|
.css("background-color", $(this).data("colorVal"));
|
});
|
if ($.browser.msie && $.browser.version == "7.0")
|
$('#tblColorPicker > tbody > tr:last > td:last')
|
.attr("style", "background-color:" + this);
|
});
|
});
|
}
|
|
//------------
|
// ReflectParamsInUI
|
//
|
/* call with params struct/object as a parameter */
|
/* params values will be selected/updated in UI */
|
function ReflectParamsInUI(params) {
|
if (params == null)
|
{
|
return;
|
}
|
|
$("#divColorPicker").hide();
|
$('#mainTable > tbody:gt(0) > tr').hide();
|
$('input[id*="Opacity"]').parent().show();
|
|
//Create As
|
switch (params.CreateAs)
|
{
|
case CREATEAS.Group:
|
$("#ddlCreateAs").val("Group");
|
break;
|
case CREATEAS.Layer_Entire:
|
$("#ddlCreateAs").val("Layer");
|
break;
|
case CREATEAS.Layer_Streaming:
|
$("#ddlCreateAs").val("LayerStreaming");
|
break;
|
default:
|
//TODO: error
|
}
|
|
//Visibility Distance
|
$("#txtVisibilityDistance").val(params.VisibilityDistance);
|
|
//Object Type
|
switch (params.ObjectType)
|
{
|
case OBJECTTYPE.MeshFence:
|
{
|
$("#ddlObjectType").val("Option_Fence");
|
$(".fenceAttribute").show();
|
|
//Fill Style
|
switch (params.FillStyle)
|
{
|
case FILLSTYLE.Color:
|
$('#ddlFenceFillStyle').val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$('#ddlFenceFillStyle').val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$('#ddlFenceFillStyle').change();
|
|
//Fill Color & Opacity
|
$("#trFenceFillColor > th > label").text(SGLang.i18n("Text_Color"));
|
$("#btnFenceFillColorPicker")
|
.data('colorVal', params.Color)
|
.css('background-color', params.Color);
|
$("#txtFenceFillColorOpacity").val(params.Opacity);
|
|
//Fill Texture
|
$("#fileFenceTextureFile")
|
.val(params.Texture)
|
.change();
|
|
$("#trFenceSettings > th > h2").text(SGLang.i18n("Settings_Fence"));
|
|
//Height
|
$("#txtFenceHeight").val(params.Height);
|
|
//Sampling
|
$("#txtFenceSampling").val(params.Sampling);
|
|
//Simplify Line
|
$("#cbFenceSimplifyLine").prop('checked', params.SimplifyLine);
|
|
//Post Style
|
switch (params.PostStyle)
|
{
|
case POSTSTYLE.None:
|
$("#ddlFencePostType").val("None");
|
break;
|
case POSTSTYLE.Circular:
|
$("#ddlFencePostType").val("Circular");
|
break;
|
case POSTSTYLE.Square:
|
$("#ddlFencePostType").val("Square");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlFencePostType").change();
|
|
//Post Fill Style
|
switch (params.PostFillStyle)
|
{
|
case FILLSTYLE.Color:
|
$("#ddlFencePostFillStyle").val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$("#ddlFencePostFillStyle").val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlFencePostFillStyle").change();
|
|
//Post Fill Color
|
$("#btnFencePostFillColorPicker")
|
.data('colorVal', params.PostColor)
|
.css('background-color', params.PostColor);
|
|
//Post Fill Texture
|
$("#fileFencePostFillTextureFile")
|
.val(params.PostTexture)
|
.change();
|
|
//Post Spacing
|
$("#txtFencePostSpacing").val(params.PostSpacing);
|
|
//Post Extension
|
$("#txtFencePostExtension").val(params.PostExtension);
|
|
//Post Diameter
|
$("#txtFencePostDiameter").val(params.PostDiameter);
|
}
|
break;
|
case OBJECTTYPE.Wall:
|
{
|
$("#ddlObjectType").val("Option_Wall");
|
$(".wallAttribute").show();
|
|
//Fill Style
|
switch (params.FillStyle)
|
{
|
case FILLSTYLE.Color:
|
$('#ddlWallFillStyle').val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$('#ddlWallFillStyle').val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$('#ddlWallFillStyle').change();
|
|
//Fill Color & Opacity
|
$("#trWallFillColor > th > label").text(SGLang.i18n("Text_Color"));
|
$("#btnWallFillColorPicker")
|
.data('colorVal', params.Color)
|
.css('background-color', params.Color);
|
$("#txtWallFillColorOpacity").val(params.Opacity);
|
|
//Fill Texture
|
$("#fileWallTextureFile")
|
.val(params.Texture)
|
.change();
|
|
//Height
|
$("#txtWallHeight").val(params.Height);
|
|
//Width
|
$("#txtWallWidth").val(params.Width);
|
|
//Sampling
|
$("#txtWallSampling").val(params.Sampling);
|
|
//Simplify Line
|
$("#cbWallSimplifyLine").prop('checked', params.SimplifyLine);
|
|
//Post Style
|
switch (params.PostStyle)
|
{
|
case POSTSTYLE.None:
|
$("#ddlWallPostType").val("None");
|
break;
|
case POSTSTYLE.Circular:
|
$("#ddlWallPostType").val("Circular");
|
break;
|
case POSTSTYLE.Square:
|
$("#ddlWallPostType").val("Square");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlWallPostType").change();
|
|
//Post Fill Style
|
switch (params.PostFillStyle)
|
{
|
case FILLSTYLE.Color:
|
$("#ddlWallPostFillStyle").val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$("#ddlWallPostFillStyle").val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlWallPostFillStyle").change();
|
|
//Post Fill Color
|
$("#btnWallPostFillColorPicker")
|
.data('colorVal', params.PostColor)
|
.css('background-color', params.PostColor);
|
|
//Post Fill Texture
|
$("#fileWallPostFillTextureFile")
|
.val(params.PostTexture)
|
.change();
|
|
//Post Spacing
|
$("#txtWallPostSpacing").val(params.PostSpacing);
|
|
//Post Extension
|
$("#txtWallPostExtension").val(params.PostExtension);
|
|
//Post Diameter
|
$("#txtWallPostDiameter").val(params.PostDiameter);
|
}
|
break;
|
case OBJECTTYPE.WallWithFence:
|
{
|
$("#ddlObjectType").val("Option_WallWithFence");
|
$(".wallAndFenceAttribute").show();
|
|
$("#txtVisibilityDistance").val(params.WallParameters.VisibilityDistance);
|
|
//Fill Style
|
switch (params.WallParameters.FillStyle)
|
{
|
case FILLSTYLE.Color:
|
$('#ddlWallFillStyle').val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$('#ddlWallFillStyle').val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$('#ddlWallFillStyle').change();
|
|
//Fill Color & Opacity
|
$("#trWallFillColor > th > label").text(SGLang.i18n("Text_Color"));
|
$("#btnWallFillColorPicker")
|
.data('colorVal', params.WallParameters.Color)
|
.css('background-color', params.WallParameters.Color);
|
$("#txtWallFillColorOpacity").val(params.WallParameters.Opacity);
|
|
//Fill Texture
|
$("#fileWallTextureFile")
|
.val(params.WallParameters.Texture)
|
.change();
|
|
//Height
|
$("#txtWallHeight").val(params.WallParameters.Height);
|
|
//Width
|
$("#txtWallWidth").val(params.WallParameters.Width);
|
|
//Sampling
|
$("#txtWallSampling").val(params.WallParameters.Sampling);
|
|
//Simplify Line
|
$("#cbWallSimplifyLine").prop('checked', params.WallParameters.SimplifyLine);
|
|
//Post Style
|
switch (params.WallParameters.PostStyle)
|
{
|
case POSTSTYLE.None:
|
$("#ddlWallPostType").val("None");
|
break;
|
case POSTSTYLE.Circular:
|
$("#ddlWallPostType").val("Circular");
|
break;
|
case POSTSTYLE.Square:
|
$("#ddlWallPostType").val("Square");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlWallPostType").change();
|
|
//Post Fill Style
|
switch (params.WallParameters.PostFillStyle)
|
{
|
case FILLSTYLE.Color:
|
$("#ddlWallPostFillStyle").val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$("#ddlWallPostFillStyle").val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlWallPostFillStyle").change();
|
|
//Post Fill Color
|
$("#btnWallPostFillColorPicker")
|
.data('colorVal', params.WallParameters.PostColor)
|
.css('background-color', params.WallParameters.PostColor);
|
|
//Post Fill Texture
|
$("#fileWallPostFillTextureFile")
|
.val(params.WallParameters.PostTexture)
|
.change();
|
|
//Post Spacing
|
$("#txtWallPostSpacing").val(params.WallParameters.PostSpacing);
|
|
//Post Extension
|
$("#txtWallPostExtension").val(params.WallParameters.PostExtension);
|
|
//Post Diameter
|
$("#txtWallPostDiameter").val(params.WallParameters.PostDiameter);
|
|
//Fill Style
|
switch (params.FenceParameters.FillStyle)
|
{
|
case FILLSTYLE.Color:
|
$('#ddlFenceFillStyle').val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$('#ddlFenceFillStyle').val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$('#ddlFenceFillStyle').change();
|
|
//Fill Color & Opacity
|
$("#trFenceFillColor > th > label").text(SGLang.i18n("Text_Color"));
|
$("#btnFenceFillColorPicker")
|
.data('colorVal', params.FenceParameters.Color)
|
.css('background-color', params.FenceParameters.Color);
|
$("#txtFenceFillColorOpacity").val(params.FenceParameters.Opacity);
|
|
//Fill Texture
|
$("#fileFenceTextureFile")
|
.val(params.FenceParameters.Texture)
|
.change();
|
|
$("#trFenceSettings > th > h2").text(SGLang.i18n("Settings_Fence"));
|
|
//Height
|
$("#txtFenceHeight").val(params.FenceParameters.Height - params.WallParameters.Height);
|
|
//Sampling
|
$("#txtFenceSampling").val(params.FenceParameters.Sampling);
|
|
//Post Style
|
switch (params.FenceParameters.PostStyle)
|
{
|
case POSTSTYLE.None:
|
$("#ddlFencePostType").val("None");
|
break;
|
case POSTSTYLE.Circular:
|
$("#ddlFencePostType").val("Circular");
|
break;
|
case POSTSTYLE.Square:
|
$("#ddlFencePostType").val("Square");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlFencePostType").change();
|
|
//Post Fill Style
|
switch (params.FenceParameters.PostFillStyle)
|
{
|
case FILLSTYLE.Color:
|
$("#ddlFencePostFillStyle").val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$("#ddlFencePostFillStyle").val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlFencePostFillStyle").change();
|
|
//Post Fill Color
|
$("#btnFencePostFillColorPicker")
|
.data('colorVal', params.FenceParameters.PostColor)
|
.css('background-color', params.FenceParameters.PostColor);
|
|
//Post Fill Texture
|
$("#fileFencePostFillTextureFile")
|
.val(params.FenceParameters.PostTexture)
|
.change();
|
|
//Post Spacing
|
$("#txtFencePostSpacing").val(params.FenceParameters.PostSpacing);
|
|
//Post Extension
|
$("#txtFencePostExtension").val(params.FenceParameters.PostExtension);
|
|
//Post Diameter
|
$("#txtFencePostDiameter").val(params.FenceParameters.PostDiameter);
|
}
|
break;
|
case OBJECTTYPE.WireStrandFence:
|
{
|
$("#ddlObjectType").val("Option_WireStrandFence");
|
$(".wireStrandFenceAttribute").show();
|
|
//Number of Strands
|
$("#txtNumStrands").val(params.NumberOfStrands);
|
|
//Fill Color
|
$("#trFenceFillColor > th > label").text(SGLang.i18n("Text_StrandColor"));
|
$("#btnFenceFillColorPicker")
|
.data('colorVal', params.Color)
|
.css('background-color', params.Color);
|
$("#txtFenceFillColorOpacity").val(params.Opacity);
|
$("#txtFenceFillColorOpacity").parent().hide();
|
|
$("#trFenceSettings > th > h2").text(SGLang.i18n("Settings_Wire"));
|
|
//Height
|
$("#txtFenceHeight").val(params.Height);
|
|
//Sampling
|
$("#txtFenceSampling").val(params.Sampling);
|
|
//Simplify Line
|
$("#cbFenceSimplifyLine").prop('checked', params.SimplifyLine);
|
|
//Post Style
|
switch (params.PostStyle)
|
{
|
case POSTSTYLE.None:
|
$("#ddlFencePostType").val("None");
|
break;
|
case POSTSTYLE.Circular:
|
$("#ddlFencePostType").val("Circular");
|
break;
|
case POSTSTYLE.Square:
|
$("#ddlFencePostType").val("Square");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlFencePostType").change();
|
|
//Post Fill Style
|
switch (params.PostFillStyle)
|
{
|
case FILLSTYLE.Color:
|
$("#ddlFencePostFillStyle").val("Color");
|
break;
|
case FILLSTYLE.Texture:
|
$("#ddlFencePostFillStyle").val("Texture");
|
break;
|
default:
|
//TODO: error
|
}
|
$("#ddlFencePostFillStyle").change();
|
|
//Post Fill Color
|
$("#btnFencePostFillColorPicker")
|
.data('colorVal', params.PostColor)
|
.css('background-color', params.PostColor);
|
|
//Post Fill Texture
|
$("#fileFencePostFillTextureFile")
|
.val(params.PostTexture)
|
.change();
|
|
//Post Spacing
|
$("#txtFencePostSpacing").val(params.PostSpacing);
|
|
//Post Diameter
|
$("#txtFencePostDiameter").val(params.PostDiameter);
|
}
|
break;
|
}
|
}
|
//------------
|
// GetParamsFromUI
|
//
|
/* returns a parameter struct built from the values of the UI */
|
function GetParamsFromUI() {
|
var params = new Object();
|
|
|
//Create As
|
switch ($("#ddlCreateAs").val())
|
{
|
case "Group":
|
params.CreateAs = CREATEAS.Group;
|
break;
|
case "Layer":
|
params.CreateAs = CREATEAS.Layer_Entire;
|
break;
|
case "LayerStreaming":
|
params.CreateAs = CREATEAS.Layer_Streaming;
|
break;
|
default:
|
//TODO: error
|
}
|
|
params.VisibilityDistance = parseFloat($("#txtVisibilityDistance").val());
|
switch ($("#ddlObjectType").val())
|
{
|
case "Option_Fence":
|
{
|
params.ObjectType = OBJECTTYPE.MeshFence;
|
switch ($("#ddlFenceFillStyle").val()) {
|
case "Color":
|
params.FillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.FillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
params.Color = $("#btnFenceFillColorPicker").data("colorVal");
|
params.Opacity = parseInt($("#txtFenceFillColorOpacity").val());
|
params.Texture = $("#fileFenceTextureFile").val();
|
params.Height = parseFloat($("#txtFenceHeight").val());
|
params.Sampling = parseFloat($("#txtFenceSampling").val());
|
params.SimplifyLine = $("#cbFenceSimplifyLine").prop('checked');
|
switch ($("#ddlFencePostType").val()) {
|
case "None":
|
params.PostStyle = POSTSTYLE.None;
|
break;
|
case "Circular":
|
params.PostStyle = POSTSTYLE.Circular;
|
break;
|
case "Square":
|
params.PostStyle = POSTSTYLE.Square;
|
break;
|
default:
|
//TODO: error
|
}
|
switch ($("#ddlFencePostFillStyle").val()) {
|
case "Color":
|
params.PostFillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.PostFillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
params.PostColor = $("#btnFencePostFillColorPicker").data("colorVal");
|
params.PostTexture = $("#fileFencePostFillTextureFile").val();
|
params.PostSpacing = parseFloat($("#txtFencePostSpacing").val());
|
params.PostExtension = parseFloat($("#txtFencePostExtension").val());
|
params.PostDiameter = parseFloat($("#txtFencePostDiameter").val());
|
}
|
break;
|
case "Option_Wall":
|
{
|
params.ObjectType = OBJECTTYPE.Wall;
|
switch ($("#ddlWallFillStyle").val())
|
{
|
case "Color":
|
params.FillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.FillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
params.Color = $("#btnWallFillColorPicker").data("colorVal");
|
params.Opacity = parseInt($("#txtWallFillColorOpacity").val());
|
params.Texture = $("#fileWallTextureFile").val();
|
params.Height = parseFloat($("#txtWallHeight").val());
|
params.Width = parseFloat($("#txtWallWidth").val());
|
params.Sampling = parseFloat($("#txtWallSampling").val());
|
params.SimplifyLine = $("#cbWallSimplifyLine").prop('checked');
|
switch ($("#ddlWallPostType").val())
|
{
|
case "None":
|
params.PostStyle = POSTSTYLE.None;
|
break;
|
case "Circular":
|
params.PostStyle = POSTSTYLE.Circular;
|
break;
|
case "Square":
|
params.PostStyle = POSTSTYLE.Square;
|
break;
|
default:
|
//TODO: error
|
}
|
switch ($("#ddlWallPostFillStyle").val())
|
{
|
case "Color":
|
params.PostFillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.PostFillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
params.PostColor = $("#btnWallPostFillColorPicker").data("colorVal");
|
params.PostTexture = $("#fileWallPostFillTextureFile").val();
|
params.PostSpacing = parseFloat($("#txtWallPostSpacing").val());
|
params.PostExtension = parseFloat($("#txtWallPostExtension").val());
|
params.PostDiameter = parseFloat($("#txtWallPostDiameter").val());
|
}
|
break;
|
case "Option_WallWithFence":
|
{
|
params.ObjectType = OBJECTTYPE.WallWithFence;
|
params.WallParameters = {};
|
params.WallParameters.ObjectType = OBJECTTYPE.Wall;
|
params.FenceParameters = {};
|
params.FenceParameters.ObjectType = OBJECTTYPE.MeshFence;
|
switch ($("#ddlFenceFillStyle").val())
|
{
|
case "Color":
|
params.FenceParameters.FillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.FenceParameters.FillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
switch ($("#ddlWallFillStyle").val())
|
{
|
case "Color":
|
params.WallParameters.FillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.WallParameters.FillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
params.FenceParameters.Color = $("#btnFenceFillColorPicker").data("colorVal");
|
params.FenceParameters.Opacity = parseInt($("#txtFenceFillColorOpacity").val());
|
params.WallParameters.Color = $("#btnWallFillColorPicker").data("colorVal");
|
params.WallParameters.Opacity = parseInt($("#txtWallFillColorOpacity").val());
|
params.FenceParameters.Texture = $("#fileFenceTextureFile").val();
|
params.WallParameters.Texture = $("#fileWallTextureFile").val();
|
params.WallParameters.Height = parseFloat($("#txtWallHeight").val());
|
params.FenceParameters.Height = params.WallParameters.Height + parseFloat($("#txtFenceHeight").val());
|
params.WallParameters.Width = parseFloat($("#txtWallWidth").val());
|
params.FenceParameters.Sampling = parseFloat($("#txtWallSampling").val());
|
params.WallParameters.Sampling = parseFloat($("#txtWallSampling").val());
|
params.FenceParameters.SimplifyLine = $("#cbWallSimplifyLine").prop('checked');
|
params.WallParameters.SimplifyLine = $("#cbWallSimplifyLine").prop('checked');
|
switch ($("#ddlFencePostType").val())
|
{
|
case "None":
|
params.FenceParameters.PostStyle = POSTSTYLE.None;
|
break;
|
case "Circular":
|
params.FenceParameters.PostStyle = POSTSTYLE.Circular;
|
break;
|
case "Square":
|
params.FenceParameters.PostStyle = POSTSTYLE.Square;
|
break;
|
default:
|
//TODO: error
|
}
|
switch ($("#ddlWallPostType").val())
|
{
|
case "None":
|
params.WallParameters.PostStyle = POSTSTYLE.None;
|
break;
|
case "Circular":
|
params.WallParameters.PostStyle = POSTSTYLE.Circular;
|
break;
|
case "Square":
|
params.WallParameters.PostStyle = POSTSTYLE.Square;
|
break;
|
default:
|
//TODO: error
|
}
|
switch ($("#ddlFencePostFillStyle").val())
|
{
|
case "Color":
|
params.FenceParameters.PostFillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.FenceParameters.PostFillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
switch ($("#ddlWallPostFillStyle").val())
|
{
|
case "Color":
|
params.WallParameters.PostFillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.WallParameters.PostFillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
params.FenceParameters.PostColor = $("#btnFencePostFillColorPicker").data("colorVal");
|
params.WallParameters.PostColor = $("#btnWallPostFillColorPicker").data("colorVal");
|
params.FenceParameters.PostTexture = $("#fileFencePostFillTextureFile").val();
|
params.FenceParameters.PostSpacing = parseFloat($("#txtFencePostSpacing").val());
|
params.WallParameters.PostTexture = $("#fileWallPostFillTextureFile").val();
|
params.WallParameters.PostSpacing = parseFloat($("#txtWallPostSpacing").val());
|
params.FenceParameters.PostExtension = parseFloat($("#txtFencePostExtension").val());
|
params.WallParameters.PostExtension = parseFloat($("#txtWallPostExtension").val());
|
params.FenceParameters.PostDiameter = parseFloat($("#txtFencePostDiameter").val());
|
params.WallParameters.PostDiameter = parseFloat($("#txtWallPostDiameter").val());
|
params.FenceParameters.VisibilityDistance = params.VisibilityDistance;
|
params.WallParameters.VisibilityDistance = params.VisibilityDistance;
|
params.WallParameters.CreateAs = params.CreateAs;
|
params.FenceParameters.CreateAs = params.CreateAs;
|
}
|
break;
|
case "Option_WireStrandFence":
|
{
|
params.ObjectType = OBJECTTYPE.WireStrandFence;
|
|
params.NumberOfStrands = parseInt($("#txtNumStrands").val());
|
params.Color = $("#btnFenceFillColorPicker").data("colorVal");
|
params.Opacity = 100;
|
params.Height = parseFloat($("#txtFenceHeight").val());
|
params.Sampling = parseFloat($("#txtFenceSampling").val());
|
params.SimplifyLine = $("#cbFenceSimplifyLine").prop('checked');
|
switch ($("#ddlFencePostType").val())
|
{
|
case "None":
|
params.PostStyle = POSTSTYLE.None;
|
break;
|
case "Circular":
|
params.PostStyle = POSTSTYLE.Circular;
|
break;
|
case "Square":
|
params.PostStyle = POSTSTYLE.Square;
|
break;
|
default:
|
//TODO: error
|
}
|
switch ($("#ddlFencePostFillStyle").val())
|
{
|
case "Color":
|
params.PostFillStyle = FILLSTYLE.Color;
|
break;
|
case "Texture":
|
params.PostFillStyle = FILLSTYLE.Texture;
|
break;
|
default:
|
//TODO: error
|
}
|
params.PostColor = $("#btnFencePostFillColorPicker").data("colorVal");
|
params.PostTexture = $("#fileFencePostFillTextureFile").val();
|
params.PostSpacing = parseFloat($("#txtFencePostSpacing").val());
|
params.PostExtension = 0;
|
params.PostDiameter = parseFloat($("#txtFencePostDiameter").val());
|
}
|
break;
|
default:
|
//TODO: error
|
}
|
return params;
|
}
|
</script>
|
</head>
|
<body class="hideUntillTranslated" style="margin:0px;overflow-x:hidden; ">
|
<object id="SGWorld" classid="CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1" style="display: none;"></object>
|
<input id="fileChooser" style="display:none;" type="file" />
|
|
<table border="0" width="100%" cellspacing="0" cellpadding="2">
|
<!--<tr>
|
<td class="ToolTopArea" id="TopAreaTD" width="100%" valign="middle" >
|
<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="../CommonImg/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>
|
<td class="ToolTopSeperator"></td>
|
</tr>-->
|
<tr>
|
<td colspan="2">
|
<br />
|
</td>
|
</tr>
|
</table>
|
<div id="divIconsTableAdvance" style="width:100%;text-align:right;">
|
<img src="../img/Fence_Advance.gif" alt="Advance" style="cursor:pointer;padding-right:10px" />
|
</div>
|
|
<div id="divBasic" style="overflow-x:auto; width:100%; overflow-y: hidden; overflow-x:scroll; text-align:center; " class="scrollbar-dark">
|
<table id="tblBasicIcons">
|
<tr align="center">
|
<td rowspan="3" valign="middle" class="FenceWallBigIcon"><img src="../img/Fence_fences.gif" /></td>
|
|
<td class="TextureTD"> <img id="idDefaultImage" src="../img/texture/fence1.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/fence2.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/fence3.gif" class="ImageNotSelected" /></td>
|
|
<td rowspan="3" valign="middle" class="FenceWallBigIcon"><img src="../img/Fence_walls.gif" /></td>
|
|
<td class="TextureTD"> <img src="../img/texture/wall1.jpg" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/wall2.jpg" class="ImageNotSelected" /></td>
|
</tr>
|
<tr align="center">
|
<td class="TextureTD"> <img src="../img/texture/fence4.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/fence5.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/fence6.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/wall3.jpg" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/wall4.jpg" class="ImageNotSelected" /></td>
|
</tr>
|
<tr align="center">
|
<td class="TextureTD"> <img src="../img/texture/fence7.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/fence8.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/fence9.gif" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/wall5.jpg" class="ImageNotSelected" /></td>
|
<td class="TextureTD"> <img src="../img/texture/wall5-1.jpg" class="ImageNotSelected" /></td>
|
</tr>
|
</table>
|
</div>
|
|
<div id="divAdvanced" style="width:100%;">
|
<table class="PropertiesSheet" border="0" cellspacing="0" cellpadding="0" style="width:100%" id="mainTable">
|
<tbody>
|
<tr id="trGeneralSettings">
|
<th colspan="2"><h2 class="i18n">Settings_General</h2></th>
|
</tr>
|
<tr id="trObjectType">
|
<th>
|
<label for="ddlObjectType" class="i18n">Text_ObjectType</label>
|
</th>
|
<td>
|
<select id="ddlObjectType">
|
<option value="Option_Fence" class="i18n" selected="selected">Text_Fence</option>
|
<option value="Option_Wall" class="i18n" >Text_Wall</option>
|
<option value="Option_WallWithFence" class="i18n" >Text_WallWithFence</option>
|
<option value="Option_WireStrandFence" class="i18n" >Text_WireStrandFence</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trCreateAs">
|
<th>
|
<label for="ddlCreateAs" class="i18n">Text_CreateAs</label>
|
</th>
|
<td>
|
<select id="ddlCreateAs">
|
<option class="i18n" value="Group" selected="selected">Text_Group</option>
|
<option class="i18n" value="Layer">Text_Layer</option>
|
<option class="i18n" value="LayerStreaming">Text_LayerStreaming</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trVisibilityDistance">
|
<th>
|
<label for="txtVisibilityDistance" class="i18n">Text_VisibilityDistance</label>
|
</th>
|
<td>
|
<input id="txtVisibilityDistance" class="visibilityDistance" type="text" value="5000" size="7" /> <span class="i18n">Text_Meters</span>
|
</td>
|
</tr>
|
</tbody>
|
<tbody class="wallAttribute wallAndFenceAttribute">
|
<tr id="trWallSettings" class="wallAttribute wallAndFenceAttribute">
|
<th colspan="2"><h2 class="i18n">Settings_Wall</h2></th>
|
</tr>
|
<tr id="trWallFillStyle" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="ddlWallFillStyle" class="i18n">Text_FillStyle</label>
|
</th>
|
<td>
|
<select id="ddlWallFillStyle" class="fillStyleSelect">
|
<option value="Color">Color</option>
|
<option value="Texture">Texture</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trWallFillTextureFile" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="fileWallTextureFile" class="i18n">Text_Texture</label>
|
<div><img id="imgWallTextureFile" src="" /></div>
|
</th>
|
<td>
|
<input id="fileWallTextureFile" type="text" class="file" />
|
<input type="button" id="btnWallTextureFile" class="fileButton i18n" value="Text_Browse" />
|
</td>
|
</tr>
|
<tr id="trWallFillColor" class="wallAndFenceAttribute wallAttribute">
|
<th>
|
<label for="btnWallFillColorPicker" class="i18n">Text_Color</label>
|
</th>
|
<td>
|
<input id="btnWallFillColorPicker" type="button" class="ColorButton" />
|
<input id="txtWallFillColorOpacity" type="text" class="fillOpacity" style="width: 30px" value="0" />%
|
</td>
|
</tr>
|
<tr id="trWallHeight" class="wallAndFenceAttribute wallAttribute">
|
<th>
|
<label for="txtWallHeight" class="i18n">Text_WallHeight</label>
|
</th>
|
<td>
|
<input id="txtWallHeight" class="height" type="text" value="0" size="5" /> <span class="nobr i18n">Text_Meters</span>
|
</td>
|
</tr>
|
<tr id="trWallWidth" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtWallWidth" class="i18n">Text_WallWidth</label>
|
</th>
|
<td>
|
<input id="txtWallWidth" class="width" type="text" value="0" size="5" /> <span class="i18n">Text_Meters</span>
|
</td>
|
</tr>
|
<tr id="trWallSampling" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtWallSampling" class="i18n">Text_Sampling</label>
|
</th>
|
<td>
|
<input id="txtWallSampling" type="text" class="sampling" value="10" size="5" /> <span class="nobr i18n">Text_Meters</span>
|
</td>
|
</tr>
|
<tr id="trWallSimplifyLine" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="cbWallSimplifyLine" class="i18n">Text_SimplifyLine</label>
|
</th>
|
<td>
|
<input id="cbWallSimplifyLine" type="checkbox" class="checkbox simplifyLine" />
|
</td>
|
</tr>
|
</tbody>
|
<tbody class="wallAttribute wallAndFenceAttribute">
|
<tr id="trWallPostSettings" class="wallAttribute wallAndFenceAttribute">
|
<th colspan="2"><h2 class="i18n">Settings_WallPosts</h2></th>
|
</tr>
|
<tr id="trWallPostType" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="ddlWallPostType" class="i18n">Text_PostStyle</label>
|
</th>
|
<td>
|
<select id="ddlWallPostType" class="postTypeSelect">
|
<option value="None">None</option>
|
<option value="Circular">Circular</option>
|
<option value="Square">Square</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trWallPostFillStyle" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="ddlWallPostFillStyle" class="i18n">Text_FillStyle</label>
|
</th>
|
<td>
|
<select id="ddlWallPostFillStyle" class="fillStyleSelect">
|
<option value="Color">Color</option>
|
<option value="Texture">Texture</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trWallPostFillTextureFile" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="fileWallPostFillTextureFile" class="i18n">Text_Texture</label>
|
<div><img id="imgWallPostFillTextureFile" src="" /></div>
|
</th>
|
<td>
|
<input id="fileWallPostFillTextureFile" type="text" class="file" />
|
<input type="button" id="btnWallPostFillTextureFile" class="fileButton i18n" value="Text_Browse" />
|
</td>
|
</tr>
|
<tr id="trWallPostFillColor" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="btnWallPostFillColorPicker" class="i18n">Text_Color</label>
|
</th>
|
<td>
|
<input id="btnWallPostFillColorPicker" type="button" class="ColorButton" />
|
</td>
|
</tr>
|
<tr id="trWallPostSpacing" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtWallPostSpacing" class="i18n">Text_PostSpacing</label>
|
</th>
|
<td>
|
<input id="txtWallPostSpacing" class="postSpacing" type="text" value="5" size="5" /> <span class="nobr i18n">Text_Meters</span>
|
</td>
|
</tr>
|
<tr id="trWallPostExtension" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtWallPostExtension" class="i18n">Text_PostExtension</label>
|
</th>
|
<td>
|
<input id="txtWallPostExtension" class="postExtension" type="text" value="10" size="5" /> <span class="i18n">Text_Meters_Above_WallTop</span>
|
</td>
|
</tr>
|
<tr id="trWallPostDiameter" class="wallAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtWallPostDiameter" class="i18n">Text_PostDiameterStyle</label>
|
</th>
|
<td>
|
<input id="txtWallPostDiameter" class="postDiameter" type="text" value="0.2" size="5" /> <span class="i18n">Text_Meters</span>
|
</td>
|
</tr>
|
</tbody>
|
<tbody class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<tr id="trFenceSettings" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th colspan="2"><h2 class="i18n">Settings_Fence</h2></th>
|
</tr>
|
<tr id="trNumStrands" class="wireStrandFenceAttribute">
|
<th>
|
<label for="txtNumStrands" class="i18n">Text_NumStrands</label>
|
</th>
|
<td>
|
<input id="txtNumStrands" class="numStrands" type="text" value="3" size="5" />
|
</td>
|
</tr>
|
<tr id="trFenceFillStyle" class="fenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="ddlFenceFillStyle" class="i18n">Text_FillStyle</label>
|
</th>
|
<td>
|
<select id="ddlFenceFillStyle" class="fillStyleSelect">
|
<option value="Color">Color</option>
|
<option value="Texture">Texture</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trFenceFillTextureFile" class="fenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="fileFenceTextureFile" class="i18n">Text_Texture</label>
|
<div><img id="imgFenceTextureFile" src="" /></div>
|
</th>
|
<td>
|
<input id="fileFenceTextureFile" type="text" class="file" />
|
<input type="button" id="btnFenceTextureFile" class="fileButton i18n" value="Text_Browse" />
|
</td>
|
</tr>
|
<tr id="trFenceFillColor" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="btnFenceFillColorPicker" class="i18n">Text_Color</label>
|
</th>
|
<td>
|
<input id="btnFenceFillColorPicker" type="button" class="ColorButton" />
|
<span><input id="txtFenceFillColorOpacity" type="text" class="fillOpacity" style="width: 30px" value="0" />%</span>
|
</td>
|
</tr>
|
<tr id="trFenceHeight" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtFenceHeight" class="i18n">Text_WallHeight</label>
|
</th>
|
<td>
|
<input id="txtFenceHeight" class="height" type="text" value="0" size="5" /> <span class="nobr i18n">Text_Meters</span>
|
</td>
|
</tr>
|
<tr id="trFenceSampling" class="fenceAttribute wireStrandFenceAttribute">
|
<th>
|
<label for="txtFenceSampling" class="i18n">Text_Sampling</label>
|
</th>
|
<td>
|
<input id="txtFenceSampling" type="text" class="sampling" value="10" size="5" /> <span class="nobr i18n">Text_Meters</span>
|
</td>
|
</tr>
|
<tr id="trFenceSimplifyLine" class="fenceAttribute wireStrandFenceAttribute">
|
<th>
|
<label for="cbFenceSimplifyLine" class="i18n">Text_SimplifyLine</label>
|
</th>
|
<td>
|
<input id="cbFenceSimplifyLine" type="checkbox" class="checkbox simplifyLine" />
|
</td>
|
</tr>
|
</tbody>
|
<tbody class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<tr id="trFencePostSettings" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th colspan="2"><h2 class="i18n">Settings_FencePosts</h2></th>
|
</tr>
|
<tr id="trFencePostType" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="ddlFencePostType" class="i18n">Text_PostStyle</label>
|
</th>
|
<td>
|
<select id="ddlFencePostType" class="postTypeSelect">
|
<option value="None">None</option>
|
<option value="Circular">Circular</option>
|
<option value="Square">Square</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trFencePostFillStyle" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="ddlFencePostFillStyle" class="i18n">Text_FillStyle</label>
|
</th>
|
<td>
|
<select id="ddlFencePostFillStyle" class="fillStyleSelect">
|
<option value="Color">Color</option>
|
<option value="Texture">Texture</option>
|
</select>
|
</td>
|
</tr>
|
<tr id="trFencePostFillTextureFile" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="fileFencePostFillTextureFile" class="i18n">Text_Texture</label>
|
<div><img id="imgFencePostFillTextureFile" src="" /></div>
|
</th>
|
<td>
|
<input id="fileFencePostFillTextureFile" class="file" type="text" />
|
<input type="button" id="btnFencePostFillTextureFile" class="fileButton i18n" value="Text_Browse" />
|
</td>
|
</tr>
|
<tr id="trFencePostFillColor" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="btnFencePostFillColorPicker" class="i18n">Text_Color</label>
|
</th>
|
<td>
|
<input id="btnFencePostFillColorPicker" type="button" class="ColorButton" />
|
</td>
|
</tr>
|
<tr id="trFencePostSpacing" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtFencePostSpacing" class="i18n">Text_PostSpacing</label>
|
</th>
|
<td>
|
<input id="txtFencePostSpacing" class="postSpacing" type="text" value="5" size="5" /> <span class="nobr i18n">Text_Meters</span>
|
</td>
|
</tr>
|
<tr id="trFencePostExtension" class="fenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtFencePostExtension" class="i18n">Text_PostExtension</label>
|
</th>
|
<td>
|
<input id="txtFencePostExtension" class="postExtension" type="text" value="10" size="5" /> <span class="i18n">Text_Meters_Above_FenceTop</span>
|
</td>
|
</tr>
|
<tr id="trFencePostDiameter" class="fenceAttribute wireStrandFenceAttribute wallAndFenceAttribute">
|
<th>
|
<label for="txtFencePostDiameter" class="i18n">Text_PostDiameterStyle</label>
|
</th>
|
<td>
|
<input id="txtFencePostDiameter" class="postDiameter" type="text" value="0.2" size="5" /> <span class="i18n">Text_Meters</span>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<table width="100%">
|
<tr class="s8">
|
<td colspan="2" align="center" class="ToolButtonsArea">
|
<button id="lineButton" class="MenuButton" onclick="FollowLineClicked();" title="跟随线">
|
<img src="../img/polyline.png" alt="Create Line"/><br/>
|
<!--<span class="i18n">Text_FollowLine</span>-->
|
</button>
|
<button id="areaButton" class="MenuButton" onclick="CreatePolygonClicked();" title="画多边形">
|
<img src="../img/polygon.png" alt="Create Polygon" /><br/>
|
<!--<span class="i18n">Text_CreatePolygon</span>-->
|
</button>
|
</td>
|
</tr>
|
</table>
|
<script language="JavaScript" type="text/javascript">
|
"use strict;"
|
//** this is a global variables for the polyline/polygon drawings
|
var gPolyMethod;
|
var gPolyObj;
|
var gPolygonText = SGLang.i18n("Text_NewPolygon");
|
var gPolylineText = SGLang.i18n("Text_NewPolyline");
|
var gDrawPolyClick = null;
|
var gEndDrawPoly = callbackEditingDoneDrawPoly;
|
var g_InEdit;
|
var gFoundLine = false;
|
|
//--------------
|
// Reset
|
function Reset(FirstTime, FromMouseInputMode) {
|
//
|
//
|
//
|
|
if (gPolyObj != null) {
|
SGWorld.Creator.DeleteObject(gPolyObj.ID);
|
}
|
|
gPolyObj = null;
|
gPolyMethod = "";
|
$("#lineButton").removeClass("MenuButtonHighlight");
|
$("#areaButton").removeClass("MenuButtonHighlight");
|
$("#groupButton").removeClass("MenuButtonHighlight");
|
$("#clipboardButton").removeClass("MenuButtonHighlight");
|
|
SGWorld.ProjectTree.EnableRedraw(1);
|
SGWorld.Window.HideMessageBarText();
|
|
if (g_InEdit) {
|
SGWorld.DetachEvent("OnLButtonDown",DrawPolyLButtonDown);
|
SGWorld.DetachEvent("OnRButtonUp", DrawPolyRButtonUp);
|
SGWorld.DetachEvent("OnFrame", DrawPolyOnFrame);
|
SGWorld.DetachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
|
}
|
|
g_InEdit = false;
|
|
if (FirstTime != 1 && FromMouseInputMode == MouseInputMode.MI_FREE_FLIGHT)
|
SGWorld.Window.SetInputMode(MouseInputMode.MI_FREE_FLIGHT);
|
}
|
|
//------------
|
// FollowLineClicked
|
//
|
function FollowLineClicked() {
|
//Validate our UI params first
|
var params = GetParamsFromUI();
|
|
if (ValidateParameters(params))
|
{
|
//copy over the parameters into g_OperationParameters
|
$.extend(g_OperationParameters, params);
|
//
|
// The argument method is saved as global in CreateObjects (gPolyMethod)
|
//
|
|
CreateObjects(ObjectTypeCode.OT_POLYLINE);
|
}
|
|
}
|
//
|
//------------
|
// CreatePolygonClicked
|
//
|
function CreatePolygonClicked() {
|
//Validate our UI params first
|
var params = GetParamsFromUI();
|
|
if (ValidateParameters(params))
|
{
|
//copy over the parameters into g_OperationParameters
|
$.extend(g_OperationParameters, params);
|
//
|
// The argument method is saved as global in CreateObjects (gPolyMethod)
|
//
|
CreateObjects(ObjectTypeCode.OT_POLYGON);
|
}
|
}
|
|
//
|
//
|
//
|
function SelectedGroupClicked() {
|
//
|
// This is 1 of the 3 entry point to start an actual operation
|
//
|
//Validate our UI params first
|
var params = GetParamsFromUI();
|
if (ValidateParameters(params))
|
{
|
//copy over the parameters into g_OperationParameters
|
$.extend(g_OperationParameters, params);
|
WorkOnSelectedItem();
|
}
|
}
|
function ClipboardClicked() {
|
//
|
// This is 1 of the 3 entry point to start an actual operation
|
//
|
//Validate our UI params first
|
var params = GetParamsFromUI();
|
|
if (ValidateParameters(params))
|
{
|
//copy over the parameters into g_OperationParameters
|
$.extend(g_OperationParameters, params);
|
gFoundLine = false;
|
gFoundLine = WorkOnClipboardItems();
|
if (!gFoundLine)
|
alert(SGLang.i18n("Text33"));
|
}
|
} //
|
//
|
//
|
//
|
function CreateAShapeAndWorkOnIt(linesGeometry, type) {
|
//
|
//
|
|
var theTerrainObject;
|
//
|
// Create a temporary terrain object
|
//
|
if (type == ObjectTypeCode.OT_POLYLINE) {
|
//
|
// Create a line
|
//
|
theTerrainObject = SGWorld.Creator.CreatePolyline(linesGeometry, 0xFFB3FF44, AltitudeTypeCode.ATC_TERRAIN_ABSOLUTE);
|
|
}
|
else if (type == ObjectTypeCode.OT_POLYGON) {
|
//
|
// Create a polygon
|
//
|
theTerrainObject = SGWorld.Creator.CreatePolygon(linesGeometry, 0xFFB3FF44, 0xFFB3FF44, AltitudeTypeCode.ATC_TERRAIN_RELATIVE);
|
}
|
else {
|
throw new Error(2000, "Unexpected type for creation");
|
}
|
theTerrainObject.Position.AltitudeType = 3;
|
WorkOnAPolygonOrPolyline(theTerrainObject, g_OperationParameters);
|
SGWorld.Creator.DeleteObject(theTerrainObject.ID);
|
}
|
|
//--------------
|
// CreateObjects
|
function CreateObjects(method) {
|
if (!g_InEdit) {
|
g_InEdit = true;
|
SGWorld.AttachEvent("OnLButtonDown", DrawPolyLButtonDown);
|
SGWorld.AttachEvent("OnRButtonUp", DrawPolyRButtonUp);
|
SGWorld.AttachEvent("OnFrame", DrawPolyOnFrame);
|
SGWorld.AttachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
|
|
|
gPolyMethod = method;
|
SGWorld.Window.SetInputMode(MouseInputMode.MI_COM_CLIENT);
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text_EditMessage"), -1);
|
$(event.srcElement).addClass("MenuButtonHighlight");
|
|
}
|
else {
|
DrawPolyRButtonUp(0, 0, 0, 0);
|
}
|
}
|
|
//
|
//-------------
|
// callbackEditingDoneDrawPoly
|
//
|
function callbackEditingDoneDrawPoly(geometry, type) {
|
|
|
SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text31") ,-1);
|
SGWorld.ProjectTree.EnableRedraw(0);
|
var retVal;
|
CreateAShapeAndWorkOnIt(geometry, type)
|
}
|
|
</script>
|
</body>
|
</html>
|