Application (IApplication80)

This interface controls various application level settings. You can return information about the data and executable path, enable or disable the joystick, and add or remove application containers.

 

 

Properties

 

Caption

Gets and sets a caption for the application.

Clipboard

An IClipboard80 representing TerraExplorer application’s clipboard.

Containers

An IContainers80 representing TerraExplorer application’s containers.

CPUSaveMode

Gets and sets a Boolean that determines whether TerraExplorer stops the render cycle until the user interface is utilized, or until another call is made passing false as its parameter.

DataPath

Gets the path for the application data of the user.

EnableJoystick

Gets and sets a Boolean that determines whether the joystick is enabled.

ExecutablePath

Gets the path for the TerraExplorer executable file that started the application, not including the executable name.

FullScreen

Gets and sets an enum that determines the application layout.

Multiple3DWindows

An IMultiple3DWindows80 that provides services related to synchronization and management of multiple 3D windows that are embedded in the same application.

Selection

An ISelection80 representing TerraExplorer’s currently selected items.

SuppressUIErrors

Gets and sets a Boolean that determines whether error messages are suppressed.

TargetFrameRate

Gets and sets a specific value for TerraExplorer’s frame rate.

 

Methods

 

OpenFileDialog

This method is used to support calls to CreateCommandLineProcessAsync. The OpenFileDialog method allows you to open a dialog in which the user can designate a specific file or directory from which path values can be passed as parameters to an executable.

Search

Searches for a string in the Project Tree and ribbon commands and returns results on the OnSGWorld event.

 

Caption

Gets and sets a caption for the application.

 

JavaScript

 

Caption

 

C#

 

string Caption { get; set; }

 

C++

 

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

HRESULT Caption([in] BSTR* pVal)

 

CPUSaveMode

Gets and sets a Boolean that determines whether TerraExplorer stops the render cycle until the user interface is utilized, or until another call is made passing FALSE as its parameter. If TRUE, TerraExplorer stops the render cycle until the user interface is utilized, or until another call is made passing FALSE as its parameter. Since TerraExplorer extensively utilizes the CPU to render the terrain, if the client wants to perform a few operations, instructing TerraExplorer to enter CPU saving mode may help the client complete those operations quicker.

 

JavaScript

 

CPUSaveMode

 

C#

 

bool CPUSaveMode { get; set; }

 

C++

 

HRESULT CPUSaveMode([out, retval] VARIANT_BOOL* pVal)

HRESULT CPUSaveMode([in] VARIANT_BOOL* pVal)

DataPath

Gets the path for the application data of the user. If a path does not exist, one is created

 

JavaScript

 

DataPath

 

C#

 

string DataPath { get; }

 

C++

 

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

EnableJoystick

Gets and sets a Boolean that determines whether the joystick is enabled.

 

JavaScript

 

EnableJoystick

 

C#

 

bool EnableJoystick { get; set; }

 

C++

 

HRESULT EnableJoystick([in] VARIANT_BOOL pVal)

HRESULT EnableJoystick([out, retval] VARIANT_BOOL pVal)

ExecutablePath

Gets the path for the TerraExplorer executable file that started the application, not including the executable name.

 

JavaScript

 

ExecutablePath

 

C#

 

string ExecutablePath { get; }

 

C++

 

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

 

FullScreen

Gets and sets an enum that determines the application layout. The following are the possible values:

§   FULL_SCREEN_NONE = 0
TerraExplorer restored to normal size. If the layout was customized, then it is restored to the customized layout.

§   FULL_SCREEN_STANDARD = 1
3D Window maximized, and Ribbon hidden.

§   FULL_SCREEN_D3D = 2
3D Window maximized to cover the entire desktop, hiding all running applications.

§   FULL_SCREEN_STEREOSCOPIC = 3
Side-by-side stereo view on any supporting displays.

§   FULL_SCREEN_WITH_CAPTION = 4
TerraExplorer displayed in window with caption. Within the window, 3D Window is maximized and Ribbon is hidden.

 

JavaScript

 

FullScreen

 

C#

 

FullScreenMode FullScreen { get; set;}

 

C++

 

HRESULT FullScreen([in] FullScreenMode pVal)

HRESULT FullScreen([out, retval] FullScreenMode* pVal)

 

SuppressUIErrors

Gets and sets a Boolean that determines whether error messages are suppressed.

 

JavaScript

 

SuppressUIErrors

 

C#

 

bool SuppressUIErrors { get; set; }

 

C++

 

HRESULT SuppressUIErrors([in] VARIANT_BOOL* pVal)

HRESULT SuppressUIErrors([out, retval] VARIANT_BOOL* pVal)

TargetFrameRate

Gets and sets a specific value for TerraExplorer’s frame rate. Note that there may be slight deviations from the frame rate value, based on system constraints.

 

JavaScript

 

TargetFrameRate

 

C#

 

int TargetFrameRate { get; set; }

 

C++

 

HRESULT TargetFrameRate ([in] long pVal)

HRESULT TargetFrameRate ([out, retval] long* pVal)

 

OpenFileDialog

This method is used to support calls to CreateCommandLineProcessAsync. Due to established security measures, TerraExplorer only allows files or folders that were selected by the user to be passed as parameter values to executables (.exe).

This method allows you to open a dialog in which the user can designate a specific file or directory whose path can be passed as a parameter to an executable. OpenFileDialog returns a JSON that includes a file/directory path key. This key can be passed in CreateCommandLineProcessAsync's CommandLine parameter. It is then replaced by TerraExplorer with the actual path.

See "Launching a TerraExplorer Executable Tool" for an example of how this method is implemented.

JavaScript

 

OpenFileDialog (

       Folder,

       Filter)

 

C#

 

string OpenFileDialog (

       [bool Folder = False],

       [string Filter = ])

 

C++

 

HRESULT OpenFileDialog (

       VARIANT_BOOL Folder,

       BSTR Filter,

       BSTR* json)

 

Parameters

Folder

A Boolean that determines whether a file selection or folder selection dialog will open. Set to TRUE to open a folder selection dialog.

Filter

Any valid filter which determines the choices that appear in the dialog. For each filtering option, the filter string contains a description of the filter, followed by the vertical bar (|) and the filter pattern. The strings for different filtering options are separated by the vertical bar.
This parameter is applied only when the Folder parameter is set to TRUE.
The following is an example of a filter string:

"3dml files (*.3dml)|*.3dml"

Return Value

json

A JSON that includes the selected file/directory path and a key with this information. This key can be passed in CreateCommandLineProcessAsync's CommandLine parameter. It is then replaced by TerraExplorer with the actual path. E.g.,

{

   "file_path" : "C:\\Folder\\FileName.3dml",

   "key" : "${58526B12-746D-4F71-936A-E35ED27D8EB9}"

}

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.

Search

Searches for a string in the Project Tree and ribbon commands and returns results on the OnSGWorld event as a JSON file. The JSON file includes three main sections under the “SearchResult” section: “searchString”, with the search string and “ProjectTree”, and “Ribbon” with the search results for each category.

Examples:

{"SearchResult":

       {"searchString":"Paris",   (The search string sent. Note that this is not part of the returning JSON)

       "ProjectTree":

              [

                     {

                           "objectID":"0_101",  (The object’s ID in the Project Tree. Note that this is not part of the returning JSON)

                           "description":"Paris (Location)",   (The object’s name in the Project Tree. Note that this is not part of the returning JSON)

                           "resID":"206"   (Allows extracting the tree icon of this object using e.g. var icon = “res://” + SGWorld.Application.ExecutablePath + \\TerraExplorerX.dll/#2/#+ ProjectObj.SearchResult.ProjectTree[index].resID; Note that this is not part of the returning JSON)

                     },

                     {

                           "objectID":"0_104",

                           "description":"Loc 1 (Location)",

                           "resID":"206"

                     }

              ],

       "Ribbon":[]}

}

 

{

       "SearchResult":

              {"searchString":"poly",

              "ProjectTree":[],

              "Ribbon":

                     [

                           {

                                  "commandID":"1012", (The command execute code. Note that this is not part of the returning JSON)

                                  "commandParam":"7", (The command execute param. Note that this is not part of the returning JSON)

                                  "description":"Create Regular Polygon"  (Name of command in ribbon with tooltip in parenthesis. Note that this is not part of the returning JSON)

                           },

                           {

                                  "commandID":"1012",

                                  "commandParam":"5",

                                  "description":"Polygon ( Create a polygon.)"

                           },

                           {

                                  "commandID":"1012",

                                  "commandParam":"16",

                                  "description":"Hole on Terrain ( Create a polygon by which you cut holes in the terrain exposing the other side of the terrain.)"},{"commandID":"1037","description":"3D Plane Area ( Measure the area of a polygon on an arbitrary plane whose orientation is determined by the first three points selected.)"},{"commandID":"1012","commandParam":"15","description":"Modify Terrain ( Create a polygon, according to which you change elevation values of the terrain.)"},{"commandID":"1012","commandParam":"17","description":"Create 3D Polygon"},{"commandID":"1071","description":"Spatial Query ( Area - Draw a polygon to edit all features contained within it.)"},{"commandID":"1080","description":"Clip ( Clip - Clip one selected polygon from another selected polygon that overlaps with it.)"},{"commandID":"1047","description":"2D Viewshed ( Calculate and mark with polygons the areas on the terrain that are visible from a selected viewpoint.)"},{"commandID":"1082","description":"Intersect ( Intersect - Create a new feature from the common areas of the selected polygons.)"},{"commandID":"1012","commandParam":"4","description":"Polyline ( Create a polyline.)"},{"commandID":"1077","description":"Add Polyline"},{"commandID":"1072","description":"Line ( Line - Draw a polyline to edit all features intersected by it.)"

                           }

                     ]

              }

}

 

JavaScript

 

Search (stringToSearch)

 

C#

 

void Search {string stringToSearch}

 

C++

 

HRESULT Search([in] BSTR stringToSearch)

 

Parameters

stringToSearch

The string to search for.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list.