Project (IProject80)

The IProject80 interface gives access to project settings and to basic methods for opening and saving the project.

 

 

Properties

 

FileVersion

Returns an ITEVersionInfo80 representing the version of TerraExplorer that the current Fly file was saved in.

Name

Gets the name and path of the currently loaded Fly file.

Settings

Allows defining the value of a specified parameter in the Fly file Project Settings.

 

Methods

 

Close

Closes a Fly file or terrain database.

LoadFiles

Loads an array of files of different file types into a project, with each file loaded as the best matched TerraExplorer object.

Open

Opens a Fly file or terrain database.

PublishToSGS

Publishes a project and all its layers, resources, and styling to SkylineGlobe Server.

Save

Saves the current project to a Fly file.

SaveAs

Saves the current project to a Fly file with a specified name.

Name

Gets the name and path of the currently loaded Fly file. If no Fly file is loaded, an empty string is returned.

 

JavaScript

 

Name

 

C#

 

string Name { get; }

 

C++

 

HRESULT Name([out, retval] BSTR* pVal)

Settings

Allows defining the value of a specified parameter in the Fly file Project Settings. Each parameter is accessed by a unique identification string. This property is exposed in C# and JavaScript in the following ways:

§   In C#, this property is exposed as Settings, e.g.,

SGWorld80.Project.Settings["CopyrightText"] = "My Copyright";

Note:    In older versions of C#, this property is exposed as set_Settings and get_Settings, e.g.,

SGWorld80.Project.set_Settings["CopyrightText"] = "My Copyright";

§   In JavaScript use:

SGWorld80.Project.Settings("CopyrightText") = "My Copyright";

 

JavaScript

 

Settings(paramName)

 

C#

 

dynamic Settings { get; set; }

 

C++

 

HRESULT Settings(

       [in] BSTR paramName,

       [out, retval] VARIANT* pVal)

HRESULT Settings(

       [in] BSTR paramName,

       [in] VARIANT pVal)

 

The following table describes the supported parameter string values and the respective parameter value options:

 

paramName

[In/Out] Type

pVal

 

General

 

"StartupMessageID"

[in, out] long

Determines the message to be shown when the project is opened.

To set startup script use: Project.Settings("StartupMessageID",msgID)

To remove the startup script use: Project.Settings("StartupMessageID","") 

“GenerateLevelsOfDetailFor3DModels”

[in, out] long

Determines whether all loaded models are automatically optimized by conversion to XPL2 upon loading.

 

“DoubleSidedRenderingOf3DModels”

[in, out] long

Determines whether the faces of 3D models are rendered from two sides.

 

Layout

"TerraExplorerWindowSize"

[in, out] safe array of integers

Determines the size of the TerraExplorer window and containers.

To set specific values, pass an array with the following values = [Width, Height, LeftContainerWidth, TopContainerHeight, RightContainerWidth, BottomContainerHeight]

Alternatively, set the value as one of the following:

§   1 – Capture the current layout. It will be saved in the FLY file the next time the project is saved.

§   0 – Restore to default sizes and then capture the layout. It will be saved in the FLY file the next time the project is saved

Note:     In JavaScript, use the VBArray object, E.g.,  

var windowSize = SGWorld.Project.Settings("TerraExplorerWindowSize");

var arr = new VBArray(windowSize).toArray();

Terrain Database

 

"ReprojectElevationDefaultSetting"

[in, out] long

Determines the default Reproject Elevation setting for 3DML, elevation, and feature layers when they are initially loaded into the project. 1 – TerraExplorer reprojects the layer’s elevation values to the terrain’s coordinate system, if the layer includes vertical datum or is a 3DML created in TerraExplorer 7.1 or PhotoMesh 7.4 or higher. 0 – TerraExplorer does not reproject.

Note:    Geocentric layers are always reprojected.

 

Screen Overlay

 

“CopyrightText”

[in, out] BSTR

A string description of the copyright text that appears on the 3D Window.

 

"RemoveSkylineCopyright"

[in, out] long

Determines whether the Skyline copyright text is removed. 1 – removed or 0 – displayed.

 

Environment

 

"FogColor"

[in, out] long

The color of the fog that covers the terrain in hexadecimal form: 0x00bbggrr.

 

"SkyColor"

[in, out] long

The color of the sky in the hexadecimal form: 0x00bbggrr.

 

"VisualRange"

[in, out] double

Distance to the horizon, in meters

 

"FogStart "

[in, out] double

Distance, in meters, at which the fog starts

 

"DisplaySun"

[in, out] long

Determines whether the sun is used as the light source. 1 – displayed or 0 – hidden.

 

"SunAndMoonUseFixedLocalTime "

[in, out] long

Determines whether the currently used date and time value is defined in local time (1) or global date and time (0).

Note:    Changes only take effect after saving and reopening the TerraExplorer project.

 

"SunAndMoonFixedLocalTime"

[in, out] VT_DATE

Date (Javascript) or DateTime (C#) object that represents the currently used local time. SeeTime” for information on valid formats for this parameter.

Note:    Changes only take effect after saving and reopening the TerraExplorer project.

 

"SunAndMoonTime"

[in, out] VT_DATE

Date (Javascript) or DateTime (C#) object that represents the currently used global date and time. SeeTime” for information on valid formats for this parameter.

Note:    Changes only take effect after saving and reopening the TerraExplorer project.

 

"TimeZoneListXML"

[out] BSTR

An XML string that defines the available time zones in the operating system. For example:

<SELECT ID="TimeZoneList" SIZE="XX">

<OPTION VALUE ="Alaska Standard Time">(GMT-09:00) Alaska<OPTION>

. . .

<SELECT>

 

"SunAndMoonTimeZoneDisplayName"

[out] BSTR

A string description of the currently used time zone, e.g., "(GMT-09:00) Alaska". The string corresponds to the value of the OPTION node in the XML returned from "TimeZoneListXML”

 

"SunAndMoonTimeZoneKey"

[in, out] BSTR

A string key of the used time zone, e.g., "Alaska Standard Time". The key can be one of the VALUE attributes of an OPTION node in the XML returned from "TimeZoneListXML.

Note:    Changes only take effect after saving and reopening the TerraExplorer project.

 

Navigation

 

"AltitudeMinimumAltitude"

[in, out] double

Determines the minimum altitude in meters or feet above ground level.

 

“AltitudeUndergroundSurface”

[in, out] double

Determines the altitude above the terrain database vertical datum base ellipsoid.

 

"AltitudeUndergroundSurface"

[in, out] double

Determines the altitude above the terrain database vertical datum base ellipsoid.

 

"KeyboardAndMouseNavigationSpeed"

[in, out] double

Determines the navigation speed when using the keyboard controls and mouse.

 

“JoystickNavigationSpeed”

[in, out] double

Determines the joystick speed.

 

Close

Closes a Fly file or terrain database.

 

JavaScript

 

bool Close(

       bSuppressConfirmation)

 

C#

 

bool Close(

       bool bSuppressConfirmation = false)

 

C++

 

HRESULT Close(

       VARIANT_BOOL bSuppressConfirmation,

       VARIANT_BOOL * pbClosed) 

 

Parameters

bSuppressConfirmation

A Boolean that determines whether a dialog should display confirming the Close request.

Return Value

pbClosed

A Boolean return value that indicates whether or not the file is closed.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

LoadFiles

Loads multiple files of different file types into the current project, adding each one as the TerraExplorer object that is the best match for the respective file based on an analysis of the file’s properties as well as other factors. All file types supported in TerraExplorer can be included in the array, and are loaded into the project as follows:

File Type

How Loaded

FLY (no project open)

Project file

FLY (project already open)

Project layer

MPT (no MPT already open)

Terrain database

MPT (MPT already open)

Ignored

Geo-referenced Layer

Loaded in correct location on terrain

Feature Layer

Loaded with default settings

Raster Layer: Width & height < 1000px

Image label

Raster Layer: Width & height > 1000px, elevation-specific file format

Elevation layer

Raster Layer: Width & height > 1000px, not elevation-specific file format

Imagery layer

 

JavaScript

 

LoadFiles(

       FileNamesArray,

       GroupID)

 

C#

 

void LoadFiles (

       object FileNamesArray,

       string GroupID = "")

 

C++

 

HRESULT LoadFiles (

       VARIANT FileNamesArray,

       BSTR GroupID) 

 

Parameters

FileNamesArray

An array of full path names or URLs of the files to be loaded.

GroupID

The Project Tree group into which the files should be loaded. If it is set to an empty string, the files are loaded under the root.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

Open

Opens a Fly file or terrain database. Open passes the user name and password for the terrain database opened. In addition, Open can work in synchronous or asynchronous mode. In synchronous mode the method returns after the file is loaded. In asynchronous mode, the method returns immediately. You can then use ISGWorld.OnLoadFinished to be notified when the file is loaded.

 

JavaScript

 

Open(

       ProjectURL,

       Asynchronous,

       User,

       Password )

 

C#

 

void Open(

       string ProjectURL,

       bool Asynchronous = false,

       string User = "",

       string Password = "")

 

C++

 

HRESULT Open(

       BSTR ProjectURL,

       VARIANT_BOOL Asynchronous,

       BSTR User,

       BSTR Password) 

 

Parameters

ProjectURL

A full path name or a URL of a Fly file to be loaded by TerraExplorer. You can also load a local terrain database file by using a full path name to an MPT file, or a terrain database from TerraGate by following the format: “TerrainDatabase.Type@TerraGateAddress:PortNumber” (e.g., [email protected]).

Asynchronous

When set to TRUE, the method executes asynchronously, meaning returns immediately. When set to FALSE, the method executes synchronously.

User

File’s security user name. If the file is not secure, the user name is ignored.

Password 

Security password for the specified user. If the file is not secure, the password is ignored.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

PublishToSGS

Publishes a project and all its layers, resources, and styling to SkylineGlobe Server. Through a single publishing operation, the project is made available to desktop, mobile and TE for Web clients, as well as standard geospatial clients such as WFS/WFS-T/WMS/WMTS/3D Tiles (Cesium).

This method executes asynchronously, i.e., it returns immediately. You can then use ISGWorld.OnPublishFinished to be notified when publishing is complete.

 

JavaScript

 

PublishToSGS (

       HideProgressDialog,

       UseExistingLayers,

       ConvertModelLayersTo3DML,

       viewAccess,

       editAccess,

       Tag,

       viewerToken)

 

C#

 

void PublishToSGS (

       bool HideProgressDialog = False,

       bool UseExistingLayers = True,

       bool ConvertModelLayersTo3DML = True,

       TerraExplorerX.SGPublishPermission viewAccess = 3,

       TerraExplorerX.SGPublishPermission editAccess = 3,

       string Tag = "",

       string viewerToken = "")

 

C++

 

HRESULT PublishToSGS(

       [in] VARIANT_BOOL HideProgressDialog,

       [in] VARIANT_BOOL UseExistingLayers,

       [in] VARIANT_BOOL ConvertModelLayersTo3DML,

       [in] SGPublishPermission viewAccess,

       [in] SGPublishPermission editAccess,

       [in] BSTR Tag,

       [in] BSTR viewerToken);

 

Parameters

HideProgressDialog

A Boolean that determines whether to hide the progress dialog that shows the approximate percentage of completion.

UseExistingLayers

A Boolean that determines whether to use existing layers on the server for layers for which a match was found. For more information, see the TerraExplorer User Manual.

ConvertModelLayersTo3DML

A Boolean that determines whether to convert model layers to the optimized, fully textured 3DML format.

viewAccess

An enum that determines the view access for the published project. Users with View access can view and load the project from the Layers page. The following are the possible values:

·          SG_PERMISSION_ONLY_ME = 0,

·          SG_PERMISSION_MY_GROUP = 1,

·          SG_PERMISSION_MY_SITE = 2,

·          SG_PERMISSION_EVERYONE = 3

editAccess

An enum that determines the edit access for the published project. Edit access adds the ability to load, edit and save changes to the project from TerraExplorer and the browser. The following are the possible values:

·          SG_PERMISSION_ONLY_ME = 0,

·          SG_PERMISSION_MY_GROUP = 1,

·          SG_PERMISSION_MY_SITE = 2,

·          SG_PERMISSION_EVERYONE = 3

Tag

Tags, i.e., key words or terms associated with the project file for advanced searches, represented as a semi-colon delimited string. E.g., if the project has three tags, pass "a;b;c" for this parameter, where "a" is the value of the first tag, "b" is the value of the second, and "c" the value of the third.

viewerToken

Viewer token (generated in SkylineGlobe Server Manager) that can be used to grant view access to the project. The token is appended to the project URL that is generated in the publishing process, e.g., https://cloud.skylineglobe.com/sg/TEF/te.html?project=https://cloud.skylineglobe.com/SG/demos/projects/Mexico_Beach_Emergency_Response&token=13ccec69e6dc4cfd88828db25609dc7c, and it enables a user to directly access SGS project layers that are non-public, without logging in to SGS. See the Access Token property in the "Adding Users and Setting User Properties" chapter of the SkylineGlobe Server User Guide for more information.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

Save

Saves the current project to a Fly file.

Note: The current project must be a Fly file(. If the current file is an MPT, the method fails.

Not supported by TerraExplorer Viewer

 

JavaScript

 

Save()

 

C#

 

void Save()

 

C++

 

HRESULT Save()

SaveAs

Saves the current project to a Fly file with a specified name. For security reasons the file is saved to a predefined “Skyline\TerraExplorer” folder in the “Application Data” space of the current user. The full path of the saved file is provided in the method’s return value. You can also use %APPDATA% in Windows Explorer to locate the path on your computer.

Note: If the folder contains a file by the same name, the existing file is overwritten without a prompt.

Note: The Application Data folder path changes between different users and different Windows operating systems. To find the path used by your client look at the %APPDATA% environment variable.

 

JavaScript

 

SaveAs(

       ProjectFileName)

 

C#

 

string SaveAs(

       string ProjectFileName)

 

C++

 

HRESULT SaveAs(

       BSTR ProjectFileName,

       BSTR * pVal) 

Parameters

ProjectFileName

The name for the Fly file. If it is not specified, a FLY extension is added to the file name automatically. 
Note: A file name with a full path cannot be used here.

Return Value:

pVal

A full path of the Fly file being created.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.