Creator (ICreator80)

The interface is composed of many methods for creating different objects in a project. When creating an object (using one of the CreateXXX methods) the client gets an interface to the newly created object. The client can then use this returned interface to further control the object (i.e. change its position or its color). 

Each object created through the ICreator80 interface has an ID that uniquely identifies it in the TerraExplorer Pro world (the ITerraExplorerObject80. ID property). This ID can be used by the client to get an interface to that object using the GetObject method of this interface. The client can obtain that ID by either of the following methods:

§   Create the object and store its ID for later use before releasing the object.

§   Find the item if you know its name using IProjectTree80.FindItem.

 

 

Properties

 

GeometryCreator

An IGeometryCreator containing methods to create geometry objects.

 

Methods

 

Create3DArrow

Creates an ITerrain3DArrow80 representing a 3 -dimensional arrow in the 3D Window.

Create3DPolygon

Creates an ITerrain3DPolygon80, representing a 3D polygon. object in the 3D Window.

CreateArc

Creates an ITerrainArc80, representing an arc in the 3D Window.

CreateArrow

Creates an ITerrainArrow80, representing a 2-dimensional arrow in the 3D Window.

CreateBox

Creates an ITerrain3DRectBase80, representing a box in the 3D Window.

CreateBuilding

Creates an ITerrainBuilding80, representing a building in the 3D Window.

CreateCircle

Creates an ITerrainRegularPolygon80, representing a circle in the 3D Window.

CreateColor

Creates an IColor80, representing the custom color by defining the red, green, blue and alpha values.

CreateCommandLineProcessAsync

Launches a TerraExplorer executable tool, such as Make3DML.exe, PyramidTool.exe, or MakeCPT.exe, alongside TerraExplorer. The method executes asynchronously, immediately returning an ICommandLineProcessAsync80 that lets you monitor the progress and success or failure of the command line process.

CreateCone

Creates an ITerrain3DRegBase80, representing the cone in the 3D Window.

CreateCylinder

Creates an ITerrain3DRegBase80, representing the cylinder in the 3D Window.

CreateDynamicObject

Creates an ITerrainDynamicObject80, representing the dynamic object in the 3D Window.

CreateEffect

Creates an ITerrainEffect80 animated effect object.

CreateElevationLayer

Creates an ITerrainRasterLayer80, representing the elevation layer in the 3D Window.

CreateEllipse

Creates an ITerrainEllipse80, representing the ellipse in the 3D Window.

CreateFeatureLayer

Creates an IFeatureLayer80, representing the feature layer in the 3D Window.

CreateFeatureLayerAsync

Creates an IFeatureLayer80, representing the feature layer in the 3D Window. This method executes asynchronously, immediately returning an ITerraExplorerAsync80 object, thereby ensuring that control is promptly handed back to the calling function.

CreateFromStream

Reserved. Currently not used.

CreateHoleOnTerrain

Creates an ITerrainHole80, representing the Hole On Terrain object in the 3D Window.

CreateImageLabel

Creates an ITerrainImageLabel80 representing the image label in the 3D Window.

CreateImageLabelFromBuffer

Creates an ITerrainImageLabel80 representing the image label in the 3D Window. The pixel data of the label's image file is retrieved from a memory buffer.

CreateImageryLayer

Creates an ITerrainRasterLayer80, representing the imagery layer in the 3D Window.

CreateKMLLayer

Creates an IKMLLayer80, representing the KML layer in the 3D Window.

CreateLabel

Creates an ITerrainLabel80, representing the label in the 3D Window.

CreateLabelStyle

Creates an ILabelStyle80 that defines label style properties for text and image labels.

CreateLocation

Creates an ITerrainLocation80, representing the point of interest in the 3D Window.

CreateLocationHere

Creates an ITerrainLocation80 representing the location in the current camera position.

CreateMeshLayerFromFile

Loads from a file an IMeshLayer80 representing a unified, stream optimized 3D Mesh Layer (3DML) database.

CreateMeshLayerFromSGS

Loads from SkylineGlobe Server an IMeshLayer80 representing a unified, stream optimized 3D Mesh Layer (3DML) database.

CreateMessage

Creates an ITerraExplorerMessage80, representing the message object which is displayed in a container.

CreateModel

Imports from a file an ITerrainModel80, representing a model object.

CreateNewFeatureLayer

Creates directly from TerraExplorer an IFeatureLayer80, representing a new feature layer.

CreatePointCloudModel

Imports an ITerrainPointCloudModel80 object from a file.

CreatePolygon

Creates an ITerrainPolygon80 in the 3D Window.

CreatePolygonFromArray

Creates an ITerrainPolygon80 representing the polygon by connecting the points in an array of points.

CreatePolyline

Creates an ITerrainPolyline80, representing the polyline, in the 3D Window.

CreatePolylineFromArray

Creates an ITerrainPolyline80, representing the polyline, by connecting the points in an array of points.

CreatePopupMessage

Creates an IPopupMessage80, representing a message that displays in a floating browser or floating popup.

CreatePosition

Creates an IPosition80, representing the coordinate position.

CreatePresentation

Creates an IPresentation80, representing the presentation.

CreatePyramid

Creates an ITerrain3DRectBase80, representing the pyramid, in the 3D Window.

CreateRectangle

Creates an ITerrainRectangle80, representing the rectangle, in the 3D Window.

CreateRegularPolygon

Creates an ITerrainRegularPolygon80 representing the polygon, in the 3D Window.

CreateRouteWaypoint

Creates IRouteWaypoint80 representing the created waypoint.

CreateScreenOverlay

Creates IScreenOverlay80 representing the newly created screen overlay.

CreateSphere

Creates an ITerrainSphere80 representing the newly created sphere.

CreateTerrainModifier

Creates an ITerrainModifier80 representing the terrain modifier polygon.

CreateTextLabel

Creates an ITerrainLabel80 representing the newly created label.

CreateTreeHotlink

Creates an ITreeHotlink80 representing the newly created hotlink.

CreateVideoOnTerrain

Creates an ITerrainVideo80 representing the newly created video on terrain object.  

DeleteObject

Deletes an object from the terrain.

GetObject

Returns an interface to the object based on the object ID.

 

Create3DArrow

Creates a 3-dimensional arrow and places it in the 3D Window.

 

JavaScript

 

Create3DArrow(

       Position,

       Length, Style,

       ObjectHeight,

       LineColor,

       FillColor,

       GroupID,

       Description

 

C#

 

ITerrain3DArrow80 Create3DArrow(

       IPosition80 Position,

       double Length,

       int Style = 4,

       double ObjectHeight = 10,

       object LineColor = -16711936,

       object FillColor = -10197916,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT Create3DArrow(

       IPosition80 *       Position,

       double        Length,

       long          Style,

       double        ObjectHeight,

       VARIANT      LineColor,

       VARIANT      FillColor,

       BSTR          GroupID,

       BSTR          Description,

       ITerrain3DArrow80 **       pITerrain3DArrow80) 

 

Parameters

Position

An IPosition80 representing the 3D arrow’s head position and the orientation of the object on the terrain.

Length

The length of the 3-dimensional arrow from head to tail in meters.

Style

The style of the 3-dimensional arrow. Can be one of the following when looking at the arrow from a top-view:
 3d-Arrow-Style-COM 

ObjectHeight

The height of the 3-dimensional arrow in meters.

LineColor

The color of the lines that make up the 3-dimensional arrow. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the 3-dimensional arrow, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the 3-dimensional arrow is created. If it is set to zero, the arrow is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the 3-dimensional arrow as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrain3DArrow80

An ITerrain3DArrow80 representing the newly created 3-dimensional arrow.

Exceptions

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

Create3DPolygon

Creates an ITerrain3DPolygon80 object.

 

JavaScript

 

Create3DPolygon(

       pIGeometry,

       ObjectHeight,

       LineColor, FillColor,

       AltitudeType,

       GroupID,

       Description

 

C#

 

ITerrain3DPolygon80 Create3DPolygon(   

       IGeometry    pIGeometry,

       double ObjectHeight = 20,

       object LineColor = -16711936,

       object FillColor = -10197916,

       AltitudeTypeCode AltitudeType = AltitudeTypeCode.ATC_TERRAIN_RELATIVE,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT Create3DPolygon(

       IGeometry *  pIGeometry,

       double        ObjectHeight,

       VARIANT      LineColor,

       VARIANT      FillColor,

       AltitudeTypeCode    AltitudeType,

       BSTR          GroupID,

       BSTR          Description,

       ITerrain3DPolygon80 **     pITerrain3DPolygon80) 

 

Parameters

pIGeometry

An IGeometry representing the geometric properties and behavior of the object.

ObjectHeight

The height of the 3-dimensional polygon in meters.

LineColor

The color of the lines that make up the 3-dimensional polygon. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the 3-dimensional polygon, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

AltitudeType

An enum that determines the altitude type to be used by the object. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the object’s pivot point at a specified altitude above the ground.

·          ATC_TERRAIN_ABSOLUTE = 3

Places the object’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the 3-dimensional polygon is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the 3-dimensional polygon as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrain3DPolygon80

An ITerrain3DPolygon80 object, representing the created object.

Exceptions

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

CreateArc

Creates an arc in the 3D Window.

 

JavaScript

 

CreateArc(

       Position,

       RadiusX,

       RadiusY,

       StartAngle,

       EndEngle,

       LineColor,

       FillColor,

       NumOfSegments,

       GroupID,

       Description)

 

C#

 

ITerrainArc80 CreateArc(  

       IPosition80 Position,

       double        RadiusX,

       double        RadiusY,

       double        StartAngle = -90,

       double        EndEngle = 90,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       int           NumOfSegments = -1,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateArc(

       IPosition80 *       Position,

       double        RadiusX,

       double        RadiusY,

       double        StartAngle,

       double        EndEngle,

       VARIANT      LineColor,

       VARIANT      FillColor,

       long          NumOfSegments,

       BSTR          GroupID,

       BSTR          Description,

       ITerrainArc80 **    pITerrainArc80) 

 

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

RadiusX

The radius, in meters, of the arc along the x-axis.

RadiusY

The radius, in meters, of the arc along the y-axis.

StartAngle

The angle at which the arc begins.

EndAngle

The angle at which the arc ends.

LineColor

The color of the lines that make up the arc. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the arc, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

NumofSegments

The number of segments from which the arc is created. The greater the number of segments; the smoother the shape.

GroupID

The Project Tree group in which the arc was created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the arc as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainArc80

An ITerrainArc80 representing the newly created arc.

Exceptions

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

CreateArrow

Creates a 2-dimensional arrow and places it in the 3D Window.

 

JavaScript

 

CreateArrow(

       Position,

       Length,

       Style,

       LineColor,

       FillColor,

       GroupID,    

       Description )

 

C#

 

ITerrainArrow80 CreateArrow(

       IPosition80 Position,

       double Length,

       int Style = 4,

       object LineColor = -16711936,

       object FillColor = -10197916,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateArrow(

       IPosition80 * Position,

       double Length,

       long Style,

       VARIANT LineColor,

       VARIANT FillColor,

       BSTR GroupID,

       BSTR Description,

       ITerrainArrow80 ** pITerrainArrow80) 

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

Length

The length of the arrow from head to tail in meters.

Style

The style of the arrow. Can be one of the following:
 2d-Arrow-Style-COM

LineColor

The color of the lines that make up the arrow. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the arrow, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the arrow is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the arrow as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainArrow80

An ITerrainArrow80, representing the newly created arrow.

Exceptions

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

Remarks

At creation time, the elevation parameter indicates the tip of the arrow’s head above the terrain. If the client wants to later change that (via the object’s SetPosition method), the height is measured from the center of the arrow.

CreateBox

Creates a box in the 3D Window.

 

JavaScript

 

CreateBox(

       Position,

       ObjectWidth,

       ObjectDepth,

       ObjectHeight,

       LineColor,

       FillColor,

       GroupID,

       Description )

 

C#

 

ITerrain3DRectBase80 CreateBox(

       IPosition80 Position,

       double        ObjectWidth,

       double        ObjectDepth,

       double        ObjectHeight,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateBox(

       IPosition80 *       Position,

       double        ObjectWidth,

       double        ObjectDepth,

       double        ObjectHeight,

       VARIANT      LineColor,

       VARIANT      FillColor,

       BSTR          GroupID,

       BSTR          Description,

       ITerrain3DRectBase80 **    pITerrain3DRectBase80 )

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

ObjectWidth

The width of the box in meters.

ObjectDepth

The depth of the box in meters.

ObjectHeight

The height of the box in meters.

LineColor

The color of the lines that make up the box. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the box, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the box is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the box as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrain3DRectBase80

An ITerrain3DRectBase80, representing the newly created box.

Exceptions

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

CreateBuilding

Creates a building in the 3D Window.

 

JavaScript

 

CreateBuilding(

       pIGeometry,

       RoofHeight,

       AltitudeType,

       GroupID,

       Description )

 

C#

 

ITerrainBuilding80 CreateBuilding(

       IGeometry pIGeometry,

       double RoofHeight = 20,

       AltitudeTypeCode AltitudeType = AltitudeTypeCode.ATC_TERRAIN_RELATIVE,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateBuilding(

       IGeometry *  pIGeometry,

       double        RoofHeight,

       AltitudeTypeCode    AltitudeType,

       BSTR   GroupID,

       BSTR   Description,

       ITerrainBuilding80 **      pITerrainBuilding80 )

 

Parameters

pIGeometry

An IGeometry representing the geometric properties and behavior of the building.

RoofHeight

The height, in meters, of the building roof.

AltitudeType

An enum that determines the altitude type to be used by the object. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the building’s pivot point at a specified altitude above the ground.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the building’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the building is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the building as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainBuilding80

An ITerrainBuilding80, representing the newly created building.

Exceptions

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

CreateCircle

Creates a circle in the 3D Window.

 

JavaScript

 

CreateCircle(

       Position,

       Radius,

       LineColor,

       FillColor,

       GroupID,

       Description )

 

C#

 

ITerrainRegularPolygon80 CreateCircle(

       IPosition80 Position,

       double        Radius,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateCircle(

       IPosition80* Position,

       double Radius,

       VARIANT LineColor,

       VARIANT FillColor,

       BSTR GroupID,

       BSTR Description,

       ITerrainRegularPolygon80** pITerrainRegPolygon80)

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

Radius

The radius of the object in meters.

LineColor

The color of the lines that make up the circle. The color value is used to specify an RGB color. When specifying an explicit RGB color, the color value has the following hexadecimal form: 0x00bbggrr. The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

FillColor

The color with which the circle is filled if the alpha value is greater than 0. The color value is used to specify an RGB color. When specifying an explicit RGB color, the color value has the following hexadecimal form: 0x00bbggrr. The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

GroupID

The Project Tree group in which the regular polygon is created. If it is set to zero, the regular polygon is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the regular polygon as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

PITerrainRegPolygon80

An ITerrainRegularPolygon80, representing the newly created regular polygon.

Remarks:

The CreateCircle method is essentially the same as CreateRegularPolygon. The only difference between the two is that the CreateCircle method has 12 segments as its default number of segments.

Exceptions

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

CreateColor

Creates a custom color by defining the red, green, blue and alpha values.

 

JavaScript

 

CreateColor(

       Red,

       Green,

       Blue,

       Alpha )

 

C#

 

IColor80 CreateColor(

       int    Red = 255,

       int    Green = 255,

       int    Blue = 255,

       int    Alpha = 255)

 

C++

 

HRESULT CreateColor(

       long   Red,

       long   Green,

       long   Blue,

       long   Alpha,

       IColor80 **  pVal )

Parameters

Red

The red component of the RGB color.

Green

The green component of the RGB color.

Blue

The blue component of the RGB color.

Alpha

The alpha component.

Return Value

pVal

An IColor80 representing the color created.

Exceptions

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

CreateCommandLineProcessAsync

CreateCommandLineProcessAsync allows the launching of TerraExplorer executable tools such as Make3DML.exe, PyramidTool.exe, and MakeCPT.exe using a TerraExplorer API call.

Due to established security measures, TerraExplorer only allows file path parameter values from specific locations:

§   The Skyline TerraExplorer directory within the user's AppData folder. Type %APPDATA% in Windows Explorer and then navigate to the Skyline\TerraExplorer subfolder to locate the path on your computer. This will often resolve to: “C:\Users\[User Name]\AppData\Roaming\Skyline\TerraExplorer”

§   Files/folders in a location selected by the user, using the OpenFileDialog method.

§   Files used by a TerraExplorer object.

The method executes asynchronously, immediately returning an ICommandLineProcessAsync80 that lets you monitor the progress and success or failure of the command line process.

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

 

JavaScript

 

CreateCommandLineProcessAsync(

       CommandLine)

 

C#

 

ICommandLineProcessAsync80 CreateCommandLineProcessAsync (

       string        CommandLine)

 

C++

 

HRESULT CreateCommandLineProcessAsync (

       BSTR   CommandLine,

       ICommandLineProcessAsync80 ** pICommandLineProcessAsync80) 

Parameters

CommandLine

The complete command line string for the tool execution, including the executable's name and any accompanying parameters, e.g., "SLMeshConverter.exe param1 param2".

When passing a file path parameter, this can be any of the following:

·          For a file located within the Skyline TerraExplorer directory within the user's AppData folder, pass full path, e.g., "C:\Users\Administrator\AppData\Roaming\Skyline\TerraExplorer\Folder\MyFile.txt"

·          For files/folders in a location selected by the user, using the OpenFileDialog method – pass key from the JSON that is returned. This is then replaced by TerraExplorer with the actual path.

·          For files/folders where a TerraExplorer object file is located - Pass ${OBJECT_ID} e.g. ${0_123456} 

See "Launching a TerraExplorer Executable Tool" for an example of how the JSON key returned by OpenFileDialog is passed to an executable launched using CreateCommandLlineProcessAsync.

Return Value

pICommandLineProcessAsync80

An ICommandLineProcessAsync80 that provides a callback-based mechanism similar to the JavaScript promise and the C# Task object. This enables asynchronous management of the command line process, from process exit, to error outputs and standard outputs (using OnExit, OnStderr, and OnStdout respectively).

Exceptions

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

CreateCone

Creates a cone in the 3D Window.

 

JavaScript

 

CreateCone(

       Position,

       Radius,

       ObjectHeight,

       LineColor,

       FillColor,

       NumOfSegments,

       GroupID,

       Description )

 

C#

 

ITerrain3DRegBase80 CreateCone(

       IPosition80 Position,

       double        Radius,

       double        ObjectHeight = 20,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       int           NumOfSegments = -1,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateCone(

       IPosition80 *       Position,

       double        Radius,

       double        ObjectHeight,

       VARIANT      LineColor,

       VARIANT      FillColor,

       long          NumOfSegments,

       BSTR          GroupID,

       BSTR          Description,

       ITerrain3DRegBase80 **     pITerrain3DRegBase80 )

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

Radius

The radius of the cone in meters.

ObjectHeight

The height of the cone in meters.

LineColor

The color of the lines that make up the cone. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the cone, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

NumOfSegments

The number of segments the cone has. The more segments, the smoother and more circular it appears.

GroupID

The Project Tree group in which the cone is created. If it is set to zero, the object is created in the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the cone as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrain3DRegBase80

An ITerrain3DRegBase80 representing the newly created cone.

Exceptions

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

CreateCylinder

Creates a cylinder in the 3D Window.

 

JavaScript

 

CreateCylinder(

       Position,

       Radius,

       ObjectHeight,

       LineColor,

       FillColor,

       NumOfSegments,

       GroupID,

       Description )

 

C#

 

ITerrain3DRegBase80 CreateCylinder(

       IPosition80 Position,

       double        Radius,

       double        ObjectHeight = 20,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       int           NumOfSegments = -1,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateCylinder(

       IPosition80 *       Position,

       double        Radius,

       double        ObjectHeight,

       VARIANT      LineColor,

       VARIANT      FillColor,

       long          NumOfSegments,

       BSTR          GroupID,

       BSTR          Description,

       ITerrain3DRegBase80 **     pITerrain3DRegBase80 )

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

Radius

The radius of the cylinder in meters.

ObjectHeight

The height of the cylinder in meters.

NumOfSegments

The number of segments the cylinder has. The more segments, the smoother and more circular it appears.

LineColor

The color of the lines that make up the cylinder. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the cylinder, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the cylinder is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the cylinder as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrain3DRegBase80

An ITerrain3DRegBase80, representing the newly created cylinder.

Exceptions

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

CreateDynamicObject

Creates a dynamic object with waypoints.

 

JavaScript

 

CreateDynamicObject(

       Waypoints,

       MotionStyle,

       ObjectType,

       FileNameOrText,

       ScaleFactor,

       AltitudeType,

       GroupID,

       Description )

 

C#

 

ITerrainDynamicObject80 CreateDynamicObject(

       object        Waypoints = 0,

       DynamicMotionStyle MotionStyle = 1,

       DynamicObjectType   ObjectType = 3,

       string        FileNameOrText = "",

       double        ScaleFactor = 1,

       AltitudeTypeCode    AltitudeType = AltitudeTypeCode.ATC_TERRAIN_RELATIVE,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateDynamicObject(

       VARIANT Waypoints

       DynamicMotionStyle MotionStyle,

       DynamicObjectType ObjectType,

       BSTR FileNameOrText,

       double ScaleFactor,

       AltitudeTypeCode AltitudeType,

       BSTR GroupID,

       BSTR Description,

       ITerrainDynamicObject80 ** pITerrainDynamicObject80) 

Parameters

Waypoints

An array of IRouteWaypoint80 objects.

MotionStyle

An enum that determines the style of motion of the dynamic object. The following are the possible values:

·          MOTION_GROUND_VEHICLE = 0
The object is a ground vehicle.

·          MOTION_AIRPLANE = 1
The object sets the pitch angles during the flight according to altitude differences between the waypoints. It also rolls while turning between the waypoints.

·          MOTION_HELICOPTER = 2
The object leans forward with a fixed pitch angle of –15 degrees. It also rolls while turning between the waypoints.

·          MOTION_HOVER = 3
The object always keeps the pitch and roll angles set to zero.

·          MOTION_MANUAL = 4
The yaw, pitch, and roll can be set by the client at each waypoint. If the value -9999 is entered for any of these parameters, a default value will be calculated for this parameter so that the object will point to the next waypoint.

ObjectType

An enum that determines the type of object to be used for the dynamic object. The following are the possible values:

·          DYNAMIC_3D_MODEL = 0
A 3D model is used.

·          DYNAMIC_TEXT_LABEL = 1
A text label is used.

·          DYNAMIC_IMAGE_LABEL = 2
An image label is used.

·          DYNAMIC_VIRTUAL = 3
A virtual type is used. You can attach any object to the virtual dynamic object.

FileNameOrText

If the ObjectType value is set to DYNAMIC_TEXT_LABEL, this parameter is the image label text. If ObjectType is set to DYNAMIC_3D_MODEL or DYNAMIC_IMAGE_LABEL, this is the 3D model file, or image label image file, respectively, to be used.

ScaleFactor

If the ObjectType value is set to DYNAMIC_3D_MODEL, this parameter is the scale value of the 3D model. If ObjectType value is set to DYNAMIC_TEXT_LABEL, or DYNAMIC_IMAGE_LABEL, this is the scale of the label.

AltitudeType

An enum that determines the altitude type to be used by the object. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0

Places the object’s pivot point at a specified altitude above the ground.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the object’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the dynamic object is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the dynamic object as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainDynamicObject80

An ITerrainDynamicObject80, representing the newly created dynamic object.

Exceptions

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

CreateEffect

Creates an ITerrainEffect80 animated effect object.

 

JavaScript

 

CreateEffect(

       Position,

       EffectsXML,

       GroupID,

       Description)

 

C#

 

ITerrainEffect80 CreateEffect(

       IPosition80 Position,

       string EffectsXML = "",

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateEffect(

       IPosition80* Position,

       BSTR EffectsXML,

       BSTR GroupID,

       BSTR Description,

       ITerrainEffect80** pITerrainEffect80);

 

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

EffectsXML

An XML that defines the animation effect’s particle system parameters, such as the shape and size of the particle emitter, and shape and scale factor of the volume that the particles are emitted into. This XML is returned by ITerrainEffect80.EffectXML. SeeParticleEditor Parameters” in the “Effects” chapter in the TerraExplorer User Manual for a description of the XML’s particle system parameters.

GroupID

The Project Tree group in which the effect object is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the effect object as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainEffect80

An ITerrainEffect80, representing the newly created effect.

Exceptions

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

 

CreateElevationLayer

Loads an elevation layer into the project. Adding the elevation source uses a set of plugins that support multiple file formats. The coordinates of the source can be passed via the UpperLeftX/Y and LowerRightX/Y parameters. If all four coordinate field values are zero, the coordinate information, if available, is read from the file. If the source file coordinate system is not the same as the MPT file Terrain Coordinate system, you can reproject it using ITerrainRasterLayer80. CoordinateSystem.

For advanced layers, e.g. from WMS and SGS, string parameters must be passed that describe the plugins used to read the files and their persistence strings (InitParam and PlugName). To retrieve these parameter values, add layers of the required types from TerraExplorer GUI, and then call ITerrainRasterLayer.InitParam and ITerrainRasterLayer.PlugName. You can then use the values returned by these properties to create additional advanced layers.

 

JavaScript

 

CreateElevationLayer(

       ElevationFileName,

       UpperLeftX,

       UpperLeftY,

       LowerRightX,

       LowerRightY,

       InitParam,

       PlugName,

       GroupID,

       Description,

       HScale,

       HOffset )

 

C#

 

ITerrainRasterLayer80 CreateElevationLayer(

       string        ElevationFileName,

       double        UpperLeftX,

       double        UpperLeftY,

       double        LowerRightX,

       double        LowerRightY,

       object        InitParam = "",

       object        PlugName = "",

       string        GroupID = "",

       string        Description = "",

       double        HScale = 1,

       double        HOffset = 0)

 

C++

 

HRESULT CreateElevationLayer(

       BSTR          ElevationFileName,

       double        UpperLeftX,

       double        UpperLeftY,

       double        LowerRightX,

       double        LowerRightY,

       VARIANT      InitParam,

       VARIANT      PlugName,

       BSTR          GroupID,

       BSTR          Description,

       double        HScale,

       double        HOffset,

       ITerrainRasterLayer80 **   pITerrainRasterLayer80) 

 

Parameters

ElevationFileName

A full path name to the elevation to import to the terrain.

UpperLeftX

The West-East coordinate of the elevation layer’s upper left corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

UpperLeftY

The North-South coordinate of the elevation layer’s upper left corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

LowerRightX

The West-East coordinate of the elevation lower right corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

LowerRightY

The North-South coordinate of the elevation lower right corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.   

InitParam

The persistence string used by some plugins, e.g., to describe layer information, for layers not stored on a local storage drive, such as WMS or SGS layers. This string can be retrieved by ITerrainRasterLayer.InitParam.

PlugName

The name of the plugin used to read the file, e.g., “gdlplg.rct“. The available plugins are files with RCT extension that exist in the “TBPlugs directory. This string can be retrieved by ITerrainRasterLayer.PlugName. If an empty string is passed into this parameter, the default plugin for the file type is used.

GroupID

The Project Tree group in which the elevation layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the elevation layer as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

HScale

The scale factor for the elevation value.

HOffset

The offset for the elevation value.

Return Value

pITerrainRasterLayer80

An ITerrainRasterLayer80, representing the newly created elevation layer.

Exceptions

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

CreateEllipse

Creates an ellipse in the 3D Window.

 

JavaScript

 

CreateEllipse(

       Position,

       RadiusX,

       RadiusY,

       LineColor,

       FillColor,

       NumOfSegments,

       GroupID,

       Description )

 

C#

 

ITerrainEllipse80 CreateEllipse(

       IPosition80 Position,

       double        RadiusX,

       double        RadiusY,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       int           NumOfSegments = -1,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateEllipse(

       IPosition80 *       Position,

       double        RadiusX,

       double        RadiusY,

       VARIANT      LineColor,

       VARIANT      FillColor,

       long          NumOfSegments,

       BSTR          GroupID,

       BSTR          Description,

       ITerrainEllipse80 **       pITerrainEllipse80) 

 

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

RadiusX

The radius of the ellipse along the x-axis in meters.

RadiusY

The radius of the ellipse along the y-axis in meters.

LineColor

The color of the lines that make up the ellipse. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the ellipse, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

NumOfSegments

The number of segments the ellipse has. The more segments, the smoother it appears.

GroupID

The Project Tree group in which the ellipse is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the ellipse as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainEllipse80

An ITerrainEllipse80, representing the newly created ellipse.

Exceptions

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

CreateFeatureLayer

CreateFeatureLayer loads a feature layer into the project. A feature layer is a visual representation of a geographic data set like roads, national parks, political boundaries, and rivers using geographic objects such as points, lines, and polygons and optional corresponding annotation objects.

TerraExplorer enables you to load feature layers from remote or local databases. Various file formats are supported through a set of external plug-ins. SeeFeature Layer Connection Strings for a list of the supported connection string values and parameters. You are always connected to the data source (local or remote), and all changes to the feature layers can be saved to the original source file. You can get the latest updates to a layer source by refreshing the layer.

TerraExplorer handles differently layers that are created by loading native feature sources (Shapefiles, GeoPackage, GeoDatabase, PDF or SQLite file files, and all server inputs) and layers that are created by loading non-native feature files (e.g., DXF, ASCII and OpenFlight files). For the former, a layer object containing the geographic objects is created in the Project Tree while for the latter the geographic objects are read and put in the TerraExplorer Project Tree as a Group.

If the source file coordinate system is not the same as the MPT file Terrain Coordinate system, you can reproject it using the IFeatureLayer80.Reproject method.

CreateFeatureLayer only loads a feature layer into the project. If you want to load the new layer on the terrain, use the IFeatureLayer80.Load method.

This method executes synchronously, meaning it returns after the layer is created. If you want to execute asynchronously, use CreateFeatureLayerAsync instead.

 

JavaScript

 

CreateFeatureLayer(

       layerName,

       sConnectionString,

       GroupID)

 

C#

 

IFeatureLayer80 CreateFeatureLayer(

       string        layerName,

       string        sConnectionString,

       string        GroupID = "")

 

C++

 

HRESULT CreateFeatureLayer(

       BSTR   layerName,

       BSTR   sConnectionString,

       BSTR   GroupID,

       IFeatureLayer80 ** pILayer) 

Parameters

layerName

A string representing the name of the layer.

sConnectionString

Specifies information about the data source and the means of connecting to it. SeeFeature Layer Connection Strings” for a list of the supported connection string values and parameters.

GroupID

The Project Tree group in which the layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Return Value

pILayer

An IFeatureLayer80, representing the newly created layer. This method executes synchronously, meaning it returns after the layer is created. If you want to execute asynchronously, use CreateFeatureLayerAsync instead.

Exceptions

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

CreateFeatureLayerAsync

CreateFeatureLayerAsync loads a feature layer into the project. A feature layer is a visual representation of a geographic data set like roads, national parks, political boundaries, and rivers using geographic objects such as points, lines, and polygons and optional corresponding annotation objects.

TerraExplorer enables you to load feature layers from remote or local databases. Various file formats are supported through a set of external plug-ins. SeeFeature Layer Connection Strings for a list of the supported connection string values and parameters. You are always connected to the data source (local or remote), and all changes to the feature layers can be saved to the original source file. You can get the latest updates to a layer source by refreshing the layer.

TerraExplorer handles differently layers that are created by loading native feature sources (Shapefiles, GeoPackage, GeoDatabase, PDF or SQLite file files, and all server inputs) and layers that are created by loading non-native feature files (e.g., DXF, ASCII and OpenFlight files). For the former, a layer object containing the geographic objects is created in the Project Tree while for the latter the geographic objects are read and put in the TerraExplorer Project Tree as a Group.

If the source file coordinate system is not the same as the MPT file Terrain Coordinate system, you can reproject it using the IFeatureLayer80.Reproject method.

CreateFeatureLayerAsync only loads a feature layer into the project. If you want to load the new layer on the terrain, use the IFeatureLayer80.Load method.

This method executes asynchronously, immediately returning an ITerraExplorerAsync80, thereby ensuring that control is promptly handed back to the calling function. The results are delivered when ready using the ITerraExplorerAsync80 object that was returned. The ITerraExplorerAsync80 object provides a callback-based mechanism similar to the JavaScript promise and the C# Task that offers the following functionality:

§   Allows for handling rejections/errors and successful resolution of the asynchronous operation (using OnReject and OnResolve).

§   Upon resolution of the query, enables the passing of an IFeatureLayer80, representing the newly created layer, to the OnResolve callback.

If you want to execute synchronously, use CreateFeatureLayer instead.

JavaScript

 

CreateFeatureLayerAsync(

       layerName,

       sConnectionString,

       GroupID)

 

C#

 

ITerraExplorerAsync80 CreateFeatureLayerAsync (

       string        layerName,

       string        sConnectionString,

       string        GroupID = "")

 

C++

 

HRESULT CreateFeatureLayerAsync (

       BSTR   layerName,

       BSTR   sConnectionString,

       BSTR   GroupID,

       ITerraExplorerAsync80 ** pITerraExplorerObject) 

Parameters

layerName

A string representing the name of the layer.

sConnectionString

Specifies information about the data source and the means of connecting to it. SeeFeature Layer Connection Strings” for a list of the supported connection string values and parameters.

GroupID

The Project Tree group in which the layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Return Value

pITerraExplorerObject

An ITerraExplorerAsync80 object, which provides a callback-based mechanism similar to the JavaScript promise and the C# Task that offers the following functionality:

·          Allows for handling rejections/errors and successful resolution of the asynchronous operation (using OnReject and OnResolve).

·          Upon resolution of the query, enables the passing of an IFeatureLayer80, representing the newly created layer, to the OnResolve callback.

Exceptions

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

CreateHoleOnTerrain

Creates a hole on terrain object in the 3D Window.

 

JavaScript

 

CreateHoleOnTerrain(

       pIGeometry,

       GroupID,

       Description )

 

C#

 

ITerrainHole80 CreateHoleOnTerrain(

       IGeometry    pIGeometry,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateHoleOnTerrain(

        IGeometry *  pIGeometry,

        BSTR  GroupID,

        BSTR  Description,

        ITerrainHole80 **  pITerrainHole80) 

 

Parameters

pIGeometry

An IGeometry representing geometric properties and behavior of the HoleOnTerrain.

GroupID

The Project Tree group in which the hole on terrain is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the Hole on Terrain as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainHole80

An ITerrainHole80, representing the newly created Hole on Terrain.

Exceptions

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

CreateImageLabel

Creates an image label in the 3D Window.

Note:    If no text is being added to the label, it is preferable to use this method rather than the generic CreateLabel method.

 

JavaScript

 

CreateImageLabel(

       Position,

       ImageFileName,

       LabelStyle,

       GroupID,

       Description )

 

C#

 

ITerrainImageLabel80 CreateImageLabel(

       IPosition80 Position,

       string        ImageFileName,

       ILabelStyle80       LabelStyle = null,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateImageLabel(

        IPosition80 *      Position,

        BSTR  ImageFileName,

        ILabelStyle80      LabelStyle,

        BSTR  GroupID,

        BSTR  Description,

        ITerrainImageLabel80 **   pITerrainImageLabel80) 

 

Parameters

Position

An IPosition80 representing the position and orientation of the label on the terrain.

ImageFileName

A full path name or a URL to the image file that appears in the label.

LabelStyle

An ILabelStyle80representing the label style (e.g. color, font and viewing distance properties).

GroupID

The Project Tree group in which the label is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the label as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainImageLabel80

An ITerrainImageLabel80 representing the newly created Image label.

Exceptions

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

CreateImageLabelFromBuffer

Creates an image label in the 3D Window. The pixel data of the label's image file is retrieved from a memory buffer.

 

JavaScript

 

CreateImageLabelFromBuffer(

       Position,

       Buffer,

       Width,

       Height

       LabelStyle,

       GroupID,

       Description )

 

C#

 

ITerrainImageLabel80 CreateImageLabelFromBuffer(

       IPosition80 Position,

       object        Buffer,

       int    Width,

       int    Height,

       ILabelStyle80       LabelStyle = null,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateImageLabelFromBuffer(    

       [in] IPosition80 *  Position,

       [in] VARIANT Buffer,

       [in] long    Width,

       [in] long    Height,

       [in] ILabelStyle80  LabelStyle,

       [in] BSTR    GroupID,

       [in] BSTR    Description,

       [out, retval] ITerrainImageLabel80 **   pITerrainImageLabel80) 

 

Parameters

Position

An IPosition80 representing the position and orientation of the label on the terrain.

Buffer

The memory buffer containing the pixel data of the label's image file. See the C# and JavaScript examples below.

Width

Width, in pixels, of the buffer.

Height

Height, in pixels, of the buffer.

LabelStyle

An ILabelStyle80representing the label style (e.g. color, font and viewing distance properties).

GroupID

The Project Tree group in which the label is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the label as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainImageLabel80

An ITerrainImageLabel80 representing the newly created Image label.

Exceptions

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

 

CreateImageryLayer

Loads an imagery layer into the project. Adding the image uses a set of plugins that support multiple file formats. The coordinates of the source can be passed via the UpperLeftX/Y and LowerRightX/Y parameters. If all four coordinate field values are zero, the coordinate information, if available, is read from the file. If the source file coordinate system is not the same as the MPT file Terrain Coordinate system, you can reproject it using ITerrainRasterLayer80. CoordinateSystem.  

For advanced layers, e.g. from WMS and SGS, string parameters must be passed that describe the plugins used to read the files and their persistence strings (InitParam and PlugName). To retrieve these parameter values, add layers of the required types from TerraExplorer GUI, and then call ITerrainRasterLayer.InitParam and ITerrainRasterLayer.PlugName. You can then use the values returned by these properties to create additional advanced layers.   

 

JavaScript

 

CreateImageryLayer(

       ImageryFileName,

       UpperLeftX,

       UpperLeftY,

       LowerRightX,

       LowerRightY,

       InitParam,

       PlugName,

       GroupID,

       Description )

 

C#

 

ITerrainRasterLayer80 CreateImageryLayer(

       string        ImageryFileName,

       double        UpperLeftX,

       double        UpperLeftY,

       double        LowerRightX,

       double        LowerRightY,

       object        InitParam = "",

       object        PlugName = "",

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateImageryLayer(      

        BSTR         ImageryFileName,

        double      UpperLeftX,

        double      UpperLeftY,

        double      LowerRightX,

        double      LowerRightY,

        VARIANT     InitParam,

        VARIANT     PlugName,

        LONG_PTR    GroupID,

        BSTR         Description,

        ITerrainRasterLayer80 **  pITerrainRasterLayer80) 

Parameters

ImageryFileName

A full path name to the image to import to the terrain.

UpperLeftX

The West-East coordinate of the imagery layer’s upper left corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

UpperLeftY

The North-South coordinate of the imagery layer’s upper left corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

LowerRightX

The West-East coordinate of the imagery layer’s lower right corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

LowerRightY

The North-South coordinate of the imagery layer’s lower right corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

InitParam

The persistence string used by some plugins, e.g., to describe layer information, for layers not stored on a local storage drive, such as WMS or SGS layers. This string can be retrieved by ITerrainRasterLayer.InitParam.

PlugName

The name of the plugin used to read the file, e.g., “gdlplg.rct“. The available plugins are files with RCT extension that exist in the “TBPlugs directory. This string can be retrieved by ITerrainRasterLayer.PlugName. If an empty string is passed into this parameter, the default plugin for the file type is used.

GroupID

The Project Tree group in which the imagery layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the imagery layer as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainRasterLayer80

An ITerrainRasterLayer80, representing the newly created imagery layer.

Exceptions

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

CreateKMLLayer

Loads a KML layer into the project. KML layers loaded into a project are always read directly from the local or remote data source. KML is an XML grammar and file format for modeling and storing geographic features such as points, lines, images and polygons. KML is an OGC standard that is publically defined. See: http://www.opengeospatial.org/standards/kml.

 

JavaScript

 

CreateKMLLayer(

       Path,

       GroupID)

 

C#

 

IKMLLayer80 CreateKMLLayer(

       string Path,

       string GroupID = "")

 

C++

 

HRESULT CreateKMLLayer(

       BSTR Path,

       BSTR GroupID,

       IKMLLayer80 ** pIKMLLayer)

Parameters

Path

A full path name or a URL to the KML layer file to load.

GroupID

The Project Tree group in which the layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Return Value

pIKMLLayer

An IKMLLayer80 representing the newly created layer.

Exceptions

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

CreateLabel

Creates a label in the 3D Window. The method offers an optimization point in the LabelStyle parameter. The parameter allows the client to set all of the label’s style properties at the label creation time. When creating a large numbers of labels at once, the use of ILabelStyle80 avoids unnecessary round-trips between the client and TerraExplorer and therefore gains in performance.

Note:    If no text is being added to the label, it is preferable to use the CreateImageLabel method rather than the generic CreateLabel method.

 

 

JavaScript

 

CreateLabel(

       Position,

       Text,

       ImageFileName,

       LabelStyle,

       GroupID,

       Description )

 

C#

 

ITerrainLabel80 CreateLabel(

       IPosition80  Position,

       string        Text,

       string        ImageFileName,

       ILabelStyle80       LabelStyle = null,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateLabel(

        IPosition80* Position,

        BSTR Text,

        BSTR ImageFileName,

        ILabelStyle80 LabelStyle,

        BSTR GroupID,

        BSTR Description,

        ITerrainLabel80** pITerrainLabel80)

Parameters

Position

An IPosition80 representing the position and orientation of the object on the terrain.

Text

The label text.

ImageFileName

A full path name or a URL to the image file that appears in the label. Passing null in this parameter creates a text label only.

LabelStyle

An ILabelStyle80representing the label style (e.g. color, font and viewing distance properties).

GroupID

The Project Tree group in which the label is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the label as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainLabel80

An ITerrainLabel80, representing the newly created label. This parameter must not be Null.

Exceptions

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

Remarks

After this method call returns, the label is not yet visible on the terrain. The client must first set eitherITerrainLabel80.Text orITerrainLabel80.ImageFileName(or both) properties.

CreateLabelStyle

Creates a text and image label style that defines all label style properties. This style can be applied to any ITerrainLabel80 or ITerrainImageLabel80 object.

 

JavaScript

 

CreateLabelStyle(  

       ls)

 

C#

 

 

ILabelStyle80 CreateLabelStyle(

       SGLabelStyle ls = SGLabelStyle.LS_DEFAULT)

 

C++

 

HRESULT CreateLabelStyle(

        SGLabelStyle       ls,

        ILabelStyle80 **   pVal) 

 

Parameters

ls

An enum that determines the label style type. The following are the possible values:

·          LS_DEFAULT = 0

·          LS_STREET = 1

·          LS_STATE = 2

Return Value

pVal

An ILabelStyle80 representing the label style.

Exceptions

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

CreateLocation

In TerraExplorer, a location is defined as a point of interest (X, Y, Height). The camera is given a direction and distance from which this point of interest is viewed. For example, if you chose the White House as your point of interest, you would need to find the x- and y-coordinates of the White House and pass those coordinates to the CreateLocation method.

 

JavaScript

 

CreateLocation(

       Position,

       GroupID,

       Description )

 

C#

 

ITerrainLocation80 CreateLocation(

       IPosition80 Position = null,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateLocation(

        IPosition80 *      Position,

        BSTR  GroupID,

        BSTR  Description,

        ITerrainLocation80 **     pITerrainLocation80)

Parameters

Position

An IPosition80 representing the position of the location on the terrain.

GroupID

The Project Tree group in which the location is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the location as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainLocation80

An ITerrainLocation80, representing the newly created location.

Exceptions

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

CreateLocationHere

Creates a location in the current camera position. A location defines the geographical coordinates of a point on the terrain as well as the position from which the point is to be viewed. By clicking on a location name in the Project Tree the camera can fly or jump to the location or play one of the predefined patterns (circle, oval, line or arc).

This method creates a location at the center of the 3D Window. If there is no terrain at the center of the window (the camera is facing the sky), the location of interest is set to a distance of two times the current altitude of the camera above the terrain.

 

JavaScript

 

CreateLocationHere(

       Group,

       Description)

 

C#

 

ITerrainLocation80 CreateLocationHere(

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateLocationHere(

       BSTR GroupID,

       BSTR Description,  

       ITerrainLocation80** pITerrainLocation80)

Parameters

GroupID

The Project Tree group in which the location is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the location as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainLocation80

An ITerrainLocation80, representing the newly created location.

Exceptions

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

CreateMeshLayerFromFile

Loads from a file an IMeshLayer80 representing a unified, stream optimized 3D Mesh Layer (3DML) database.

 

JavaScript

 

CreateMeshLayerFromFile(

       FilePath,

       ParentGroupID)

 

C#

 

IMeshLayer80 CreateMeshLayerFromFile(

       string FilePath,

       string ParentGroupID = "")

 

C++

 

HRESULT CreateMeshLayerFromFile(

       BSTR FilePath,

       BSTR ParentGroupID,

       IMeshLayer80** pIMeshLayer)

Parameters

FilePath

A full path of the 3DML layer file to load.

ParentGroupID

The Project Tree group in which the layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Return Value

pIMeshLayer

An IMeshLayer80 representing the newly created layer.

Exceptions

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

CreateMeshLayerFromSGS

Loads from SkylineGlobe Server an IMeshLayer80 representing a unified, stream optimized 3D Mesh Layer (3DML) database.

 

JavaScript

 

CreateMeshLayerFromSGS(

       ServerPath,

       layerName,

       ParentGroupID)

 

C#

 

IMeshLayer80 CreateMeshLayerFromSGS(

       string ServerPath,

       string layerName,

       string ParentGroupID = "")

 

C++

 

HRESULT CreateMeshLayerFromSGS(

       [in] BSTR ServerPath,

       [in] BSTR layerName,

       [in] BSTR ParentGroupID,

       [out, retval] IMeshLayer80** pIMeshLayer)

Parameters

ServerPath

A URL to the SkylineGlobe Server. The SGS URL should be in the following format: http://SGServerAddress/SG/[Site]/streamer.ashx
E.g., http://www.skylineglobe.com/SG/default/streamer.ashx

layerName

A string representing the name of the layer as it appears in the SGS Layers list, e.g., Boston.123321

ParentGroupID

The Project Tree group in which the layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Return Value

pIMeshLayer

An IMeshLayer80 representing the newly created layer.

Exceptions

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

CreateMessage

Creates a message object that is displayed in a container or floating popup. The message can be a text string, HTML page, image, script code, multiple links or any other file.

You can assign a message to any object, location, and Project Tree message element, or activate one as part of a presentation. You can also assign a message to be displayed at the beginning of the project. The message is triggered when the user clicks on the object in the 3D Window or double-clicks on the Project Tree message element which is associated with that message object. When a message object is triggered, the message content is displayed in the message-defined client.

 

JavaScript

 

CreateMessage(

       TargetPosition,

       msgData,

       Type,

       BringToFront)

 

C#

 

ITerraExplorerMessage80 CreateMessage(

       MsgTargetPosition   TargetPosition,

       string        msgData,

       MsgType      Type,

       bool   BringToFront = false)

 

C++

 

HRESULT CreateMessage(

       MsgTargetPosition   TargetPosition,

       BSTR   msgData,

       MsgType      Type,

       VARIANT_BOOL  BringToFront,

       ITerraExplorerMessage80 **        pITerraExplorerMessage80) 

 

Parameters

TargetPosition

An enum that determines where the message appears.

The MsgTargetPosition enum can have one of the following values:

·          MTP_LEFT = 0
The message docks in TerraExplorer’s left container.

·          MTP_MAIN = 2
The message appears in TerraExplorer's main container.

·          MTP_MESSAGE_BAR = 3
The message appears in TerraExplorer's message bar.

·          MTP_FLOAT = 4
The message appears in the default external web browser. This value is invalid for Text messages.

·          MTP_POPUP = 5
The message appears in a floating popup window.

msgData

The message that is displayed. The MsgType parameter determines how this parameter is interpreted. If the MsgType parameter is set to TYPE_TEXT, this parameter is the text to be displayed. If MsgType parameter is set to TYPE_URL, this should be a full URL address (or a full path name) of a web page. If MsgType parameter is set to TYPE_ SCRIPT, this should be the content of the VBScript code.

Type

An enum that determines the type of message to be displayed. The MsgType can have one of the following values:

·          TYPE_TEXT = 0

·          TYPE_URL = 1

·          TYPE_SCRIPT = 3

BringToFront

If the client for this message (i.e. the left container) already contains other items (i.e. Project Tree or HTML pages) those items appear in separate tabs. When this message is triggered, a message tab is added to that container (if the message tab already exists the message content replaces the content of the previous message). This parameter determines whether this tab becomes the active tab when the message is triggered. The parameter is ignored if TargetPosition is not set to MTP_LEFT or MTP_MAIN.

Return Value

pITerraExplorerMessage80

An ITerraExplorerMessage80 that represents the newly created message.

Exceptions

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

Remarks

Several objects can own the message object that is created by this method. A rectangle for example, may own a message object that is also owned (at the same time) by a circle object. This means that both objects, the rectangle and the circle, display the same message when either object in the 3D Window or either object’s Project Tree entry is clicked.

CreateModel

Loads an object from a file and places it in the 3D Window. Currently, TerraExplorer supports X and FLT formats (.x, .xpc, .flt, .fpc, .3ds, .xpl, .xpl2 or .dae).

 

JavaScript

 

CreateModel(

       Position,

       FileName,

       Scale,

       ModelType,

       GroupID,

       Description )

 

C#

 

ITerrainModel80 CreateModel(

       IPosition80  Position,

       string        FileName,

       double        Scale = 1,

       ModelTypeCode       ModelType = ModelTypeCode.MT_NORMAL,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateModel(

       IPosition80* Position,

       BSTR FileName,

       double Scale,

       ModelTypeCode ModelType,

       BSTR GroupID,

       BSTR Description,

       ITerrainModel80** pITerrainModel80)

 

Parameters

Position

An IPosition80 representing the position and orientation of the model on the terrain.

FileName

A full path name or a URL to the model that you want to load.

Scale

The scale factor for the model. The actual size of the model in the 3D World is the size of the model in its internal coordinate system times the Scale value. (i.e., if the model has a width of 5 units and the scale is set to 10 meters per pixel, the width of the object in the 3D World is 50 meters.)

ModelType

An enum that indicates the model type. The following are the possible values for this code:

·          MT_NORMAL = 0
Regular model.

·          MT_ANIMATION = 1
Direct X animation model.

·          MT_PROGRESSIVE = 2
Reserved.

GroupID

The Project Tree group in which the model is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the model as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainModel80

An ITerrainModel80 representing the newly created model.

Exceptions

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

CreateNewFeatureLayer

The CreateNewFeatureLayer method enables you to create a new feature layer directly from TerraExplorer. The layer can be saved as a shapefile (.shp), Excel (.xlsx), SQLite (.sqlite), GEOPackage (.gpkg), GeoDatabase (.gdb), or PDF (.pdf).

§   When saving as a shapefile, the connection string must include the following parameters:
"FileName=NameOfShapeFile.shp;TEPlugName=OGR"

§   When saving as an Excel file, the connection string must include the following parameters:

"FileName=NameOfExcelFile.xlsx;TEPlugName=OGR"

Note:    Only point layers can be saved to Microsoft Excel.

§   When saving as an SQLite file, the connection string must include the following parameters:
"FileName=NameofSQLiteFile.sqlite;TEPlugName=OGR;LayerName=newlayername"

§   When saving as a GeoPackage, the connection string must include the following parameters:
"FileName=NameOfGeoPackageFile.gpkg;TEPlugName=OGR;LayerName=newlayername"

§   When saving as a GeoDatabase, the connection string must include the following parameters:
"FileName=NameOfGeoDatabaseFile.gdb;TEPlugName=OGR;LayerName=newlayername"

§   When saving as a Geospatial PDF, the connection string must include the following parameters:
"FileName=NameOfGeospatialPDFFile.pdf;TEPlugName=OGR;LayerName=newlayername"

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

 

CreateNewFeatureLayer(

       layerName,

       LayerGeomType,

       sConnectionString,

       GroupID)

 

C#

 

IFeatureLayer80 CreateNewFeatureLayer(

       string        layerName,

       LayerGeometryType   LayerGeomType,

       string        sConnectionString,

       string        GroupID = "")

 

C++

 

HRESULT CreateNewFeatureLayer(

        BSTR  layerName,

        LayerGeometryType  LayerGeomType,

        BSTR  sConnectionString,

        BSTR  GroupID,

        IFeatureLayer80 **        pILayer) 

 

Parameters

layerName

The name of the layer as it appears in the Project Tree.

LayerGeomType

An enum that determines the geometry type. The following are the possible values:

·          LGT_NONE = -1

·          LGT_POINT = 0

·          LGT_POLYLINE = 1

·          LGT_POLYGON = 2

·          LGT_COLLECTION = 3

sConnectionString

A string that specifies information about the layer data source and the means of connecting to it.

§   When saving as a shapefile, the connection string must include the following parameters:
"FileName=NameOfShapeFile.shp;TEPlugName=OGR"

§   When saving as an SQLite file, the connection string must include the following parameters:
"FileName=NameofSQLiteFile.sqlite;TEPlugName=OGR;LayerName=newlayername"

§   When saving as a GeoPackage, the connection string must include the following parameters:
"FileName=NameOfGeoPackageFile.gpkg;TEPlugName=OGR;LayerName=newlayername"

§   When saving as a GeoDatabase, the connection string must include the following parameters:
"FileName=NameOfGeoDatabaseFile.gdb;TEPlugName=OGR;LayerName=newlayername"

§   When saving as a Geospatial PDF, the connection string must include the following parameters:
"FileName=NameOfGeospatialPDFFile.pdf;TEPlugName=OGR;LayerName=newlayername"

GroupID

The Project Tree group in which the layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Return Value

pILayer 

An IFeatureLayer80, representing the newly created layer.

Exceptions

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

CreatePointCloudModel

Imports a Point Cloud object from a file and places it in the 3D Window. These models are created from a list of points in a 3D area that are collected by various 3D scanners. Currently, TerraExplorer supports Skyline’s proprietary Point Cloud files (CPT).

 

JavaScript

 

CreatePointCloudModel(

       ModelFileName,

       Position,

       GroupID,

       Description )

 

C#

 

ITerrainPointCloudModel80 CreatePointCloudModel(

       string        ModelFileName,

       IPosition80 Position,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreatePointCloudModel(  

        BSTR  ModelFileName,

        IPosition80 *      Position,

        BSTR  GroupID,

        BSTR  Description,

        ITerrainPointCloudModel80 **    pITerrainPointCloudModel80) 

 

Parameters

ModelFileName

A full path name or a URL to the point cloud model to import to the terrain.

Position

An IPosition80 representing the position and orientation of the model on the terrain.

GroupID

The Project Tree group in which the point cloud model is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the point cloud model as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainPointCloudModel80

An ITerrainPointCloudModel80, representing the newly created point cloud model.

Exceptions

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

CreatePolygon

Create a polygon in the 3D Window.

Note:    To polygonize the resulting polygon (in order to find and resolve any intersecting lines) call StartEdit() followed by EndEdit().

 

JavaScript

 

CreatePolygon(     

       Geometry,

       LineColor,

       FillColor,

       AltitudeType,

       GroupID,

       Description )

 

C#

 

ITerrainPolygon80 CreatePolygon(

       IGeometry    Geometry,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       AltitudeTypeCode    AltitudeType = AltitudeTypeCode.ATC_ON_TERRAIN,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreatePolygon(

        IGeometry *  Geometry,

        VARIANT     LineColor,

        VARIANT     FillColor,

        AltitudeTypeCode   AltitudeType,

        BSTR         GroupID,

        BSTR         Description,

        ITerrainPolygon80 **      pITerrainPolygon80 

Parameters

Geometry

An IGeometry representing geometric properties of the polygon.

LineColor

The color of the lines that make up the polygon. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the polygon, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

AltitudeType

An enum that determines the altitude type to be used by the polygon. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the polygon’s pivot point at a specified altitude above the ground.

·          ATC_PIVOT_RELATIVE = 1
Places each point of the polygon at a specified altitude above the pivot point altitude, defined by its Point Altitude. In addition, for this value only, X and Y coordinates are also relative to the polygon’s pivot. The pivot is located at the center of the polygon.

·          ATC_ON_TERRAIN = 2
Creates the polygon on the terrain itself.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the polygon’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the polygon is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the polygon as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainPolygon80

An ITerrainPolygon80, representing the newly created polygon.

Exceptions

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

CreatePolygonFromArray

Creates a polygon from an array of points.

Note:    To polygonize the resulting polygon (in order to find and resolve any intersecting lines) call StartEdit() followed by EndEdit().

 

JavaScript

 

CreatePolygonFromArray(

       verticesArray,

       LineColor,

       FillColor,

       AltitudeType,

       GroupID,

       Description)

 

C#

 

ITerrainPolygon80 CreatePolygonFromArray(

       object verticesArray,

       object        LineColor = -16711936,

       object        FillColor = -10197916,

       AltitudeTypeCode AltitudeType = AltitudeTypeCode.ATC_ON_TERRAIN,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreatePolygonFromArray(

       VARIANT verticesArray,

       VARIANT LineColor,

       VARIANT FillColor,

       AltitudeTypeCode AltitudeType,

       BSTR GroupID,

       BSTR Description,

       ITerrainPolygon80** pITerrainPolygon80)

Parameters

verticesArray

An array that contains triplets of doubles. Each triplet is composed of an x-coordinate, a y-coordinate, and a height.

LineColor

The color of the lines that make up the polygon. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the polygon, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

AltitudeType

An enum that determines the altitude type to be used by the polygon. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the polygon’s pivot point at a specified altitude above the ground.

·          ATC_ON_TERRAIN = 2
Creates the polygon on the terrain itself.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the polygon’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the polygon is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the polygon as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainPolygon80

An ITerrainPolygon80, representing the newly created polygon.

Exceptions

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

CreatePolyline

Creates a polyline in the 3D Window.

 

JavaScript

 

CreatePolyline(

       Geometry,

       LineColor,

       AltitudeType,

       GroupID,

       Description )

 

C#

 

ITerrainPolyline80 CreatePolyline(

       IGeometry Geometry = null,

       object        LineColor = -16711936,

       AltitudeTypeCode AltitudeType = 2,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreatePolyline(

       IGeometry* pIGeometry,

       VARIANT LineColor,

       AltitudeTypeCode AltitudeType,

       BSTR GroupID,

       BSTR Description,

       ITerrainPolyline80** pITerrainPolyline80)

 

Parameters

Geometry

An IGeometry representing geometric properties of the polyline.

LineColor

The color of the lines that make up the polyline. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

AltitudeType

An enum that determines the altitude type to be used by the object. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the polyline’s pivot point at a specified altitude above the ground.

·          ATC_PIVOT_RELATIVE = 1
Places each point of the polyline at a specified altitude above the pivot point altitude, defined by its Point Altitude. In addition, for this value only, X and Y coordinates are also relative to the polyline’s pivot. The pivot is located at the center of the polyline. You can use this feature to create horizontal polylines in mountainous terrain.

·          ATC_ON_TERRAIN = 2
Creates the polyline on the terrain itself. This selection also changes the drawing method of the polyline. Instead of straight lines between the polyline’s points, it paints the terrain in the selected color. It is recommended to use this feature to improve performance.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the polyline’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the polyline is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the polyline as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainPolyline80

An ITerrainPolyline80, representing the newly created polyline.

Exceptions

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

CreatePolylineFromArray

Creates a polyline by connecting the points in an array of points.

 

JavaScript

 

CreatePolylineFromArray(

       verticesArray,

       LineColor,

       AltitudeType,

       GroupID,

       Description)

 

C#

 

ITerrainPolyline80 CreatePolylineFromArray(

       object verticesArray,

       object        LineColor = -16711936,

       AltitudeTypeCode AltitudeType = AltitudeTypeCode.ATC_ON_TERRAIN,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreatePolylineFromArray(

       VARIANT verticesArray,

       VARIANT LineColor,

       AltitudeTypeCode AltitudeType,

       BSTR GroupID,

       BSTR Description,

       ITerrainPolyline80** pITerrainPolyline80)

Parameters

verticesArray

An array that contains triplets of doubles. Each triplet is composed of an x-coordinate, a y-coordinate, and a height.

LineColor

The color of the lines that make up the polyline. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

AltitudeType

An enum that determines the altitude type to be used by the object. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the polyline’s pivot point at a specified altitude above the ground.

·          ATC_PIVOT_RELATIVE = 1
Places each point of the polyline at a specified altitude above the pivot point altitude, defined by its Point Altitude. In addition, for this value only, X and Y coordinates are also relative to the polygon’s pivot. The pivot is located at the center of the polyline. You can use this feature to create horizontal polylines in mountainous terrain.

·          ATC_ON_TERRAIN = 2
Creates the polyline on the terrain itself. This selection also changes the drawing method of the polyline. Instead of straight lines between the polyline’s points, it paints the terrain in the selected color. It is recommended to use this feature to improve performance.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the polyline’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the polyline is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the polyline as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainPolyline80

An ITerrainPolyline80, representing the newly created polyline.

Exceptions

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

CreatePopupMessage

Displays an HTML pop-up window that contains Microsoft Internet Explorer browser or simple text.

 

JavaScript

 

CreatePopupMessage(

       Caption,

       Src,

       Left,

       Top,

       Width,

       Height,

       Timeout )

 

C#

 

IPopupMessage80 CreatePopupMessage(

       string Caption = "",

       string Src = "",

       int Left = 0,

       int Top = 0,

       int Width = 0,

       int Height = 0,

       int Timeout = -1)

 

C++

 

HRESULT CreatePopupMessage(

       BSTR Caption,

       BSTR Src,

       long Left,

       long Top,

       long Width,

       long Height,

       long Timeout,

       IPopupMessage80** pIPopupMessage80)

Parameters

Caption

A caption string which is displayed on the pop-up window caption area. This parameter is also used as the pop-up window identifier. When using the same Caption names, the new content replaces the content of the window with the same name.

Src

A URL that is the source HTML to be displayed in the pop-up window. If this property is undefined, the pop-up is assumed to be a simple text string.

Left

The window top left X position (in pixels) relative to the 3D Window top left position.

Top

The window top left Y position (in pixels) relative to the 3D Window top left position.

Width

The width of the pop-up window (in pixels). This value includes all captions and borders.

Height

The pop-up window height (in pixels). This value includes all captions and borders.

Timeout

Sets the timeout in milliseconds for closing the pop-up window. Use -1 to disable this feature.

Return Value

pIPopupMessage80

An IPopupMessage80, representing the newly created message.

Exceptions

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

CreatePosition

Creates a position in the 3D Window with specific coordinate information (X, Y, Altitude), orientation properties (Yaw, Pitch, Roll) and distance from which to observe the point of interest.

 

JavaScript

 

CreatePosition(

       X,

       Y,

       Altitude,

       AltitudeType,

       Yaw,

       Pitch,

       Roll,

       Distance)

 

C#

 

IPosition80 CreatePosition(

       double X = 0,

       double Y = 0,

       double Altitude = 0,

       AltitudeTypeCode AltitudeType = AltitudeTypeCode.ATC_TERRAIN_RELATIVE,

       double Yaw = 0,

       double Pitch = 0,

       double Roll = 0,

       double Distance = 0)

 

C++

 

HRESULT CreatePosition(

       double X,

       double Y,

       double Altitude,

       AltitudeTypeCode AltitudeType,

       double Yaw,

       double Pitch,

       double Roll,

       double Distance,

       IPosition80** pVal)

 

Parameters

X

The West-East coordinate of the location of interest represented in the project’s coordinate system units. You can use the ITerrain80 interface to retrieve information about the project’s coordinate system units.

Y

The North-South coordinate of the location of interest represented in coordinate system units. You can use the ITerrain80 interface to retrieve information about the project’s coordinate system units.

Altitude

The elevation of the location of interest relative to the terrain.

AltitudeType

An enum that determines the altitude type to be used by the object. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the object’s pivot point at a specified altitude above the ground.

·          ATC_PIVOT_RELATIVE = 1
Places each point of the object at a specified altitude above the pivot point altitude, defined by its Point Altitude. The pivot is located at the center of the object.

·          ATC_ON_TERRAIN = 2
Creates the object on the terrain itself.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the object’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

·          ATC_3DML_RELATIVE  = 4
Places the object’s pivot point at a specified altitude above the 3DML layer.

Note:    ATC_PIVOT_RELATIVE and ATC_ON_TERRAIN values apply only for 2D shapes and polygons. ATC_3DML_RELATIVE only applies to image and text labels.

Yaw

The Yaw angle between the viewer and the point of interest. Range from 0 to 360 where 0=North, 90=East, 180=South and 270=West.

Pitch

The Pitch angle between the viewer and the point of interest. Range from -90 to +90 where 0 = Horizon, +90 = straight up and –90 = straight down.

Roll

The Roll angle between the viewer and the point of interest. Range from -90 to +90 where 0 = Horizon, +90 = Full roll right and –90 = Full roll left.

Distance

The distance from which the x, y and height coordinates must be viewed.

Return Value

pVal

An IPosition80representing the created position.

Exceptions

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

CreatePresentation

The CreatePresentation method enables you to create an empty presentation. You can then add actions and steps to the presentation using the IPresentation80 interface.

 

JavaScript

 

CreatePresentation(

       GroupID,

       Description )

 

C#

 

IPresentation80 CreatePresentation(

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreatePresentation(

       BSTR GroupID,

       BSTR Description,

       IPresentation80** pIPresentation80)

 

Parameters

GroupID

The Project Tree group in which the presentation is created. If it is set to zero, the presentation is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the presentation as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pIPresentation80

An IPresentation80, representing the newly created presentation.

Exceptions

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

CreatePyramid

Creates a pyramid in the 3D Window.

 

JavaScript

 

CreatePyramid(

       Position,

       ObjectWidth,

       ObjectDepth,

       ObjectHeight,

       LineColor,

       FillColor,

       GroupID,

       Description )

 

C#

 

ITerrain3DRectBase80 CreatePyramid(

       IPosition80 Position,

       double ObjectWidth,

       double ObjectDepth,

       double ObjectHeight,

       object LineColor = -16711936,

       object FillColor = -10197916,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreatePyramid(

       IPosition80* Position,

       double ObjectWidth,

       double ObjectDepth,

       double ObjectHeight,

       VARIANT LineColor,

       VARIANT FillColor,

       BSTR GroupID,

       BSTR Description,

       ITerrain3DRectBase80** pITerrain3DRectBase80)

 

Parameters

Position

An IPosition80 representing the position and orientation of the pyramid on the terrain.

ObjectWidth

The width of the pyramid in meters.

ObjectDepth

The depth of the pyramid in meters.

ObjectHeight

The height of the pyramid in meters.

LineColor

The color of the lines that make up the pyramid. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the pyramid, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the pyramid is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the pyramid as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrain3DRectBase80

An ITerrain3DRectBase80 representing the newly created pyramid.

Exceptions

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

CreateRectangle

Creates a rectangle in the 3D Window.

 

JavaScript

 

CreateRectangle(

       Position,

       ObjectWidth,

       ObjectDepth,

       LineColor,

       FillColor,

       GroupID,

       Description )

 

C#

 

ITerrainRectangle80 CreateRectangle(

       IPosition80 Position,

       double ObjectWidth,

       double ObjectDepth,

       object LineColor = -16711936,

       object FillColor = -10197916,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateRectangle(

       IPosition80* Position,

       double ObjectWidth,

       double ObjectDepth,

       VARIANT LineColor,

       VARIANT FillColor,

       BSTR GroupID,

       BSTR Description,

       ITerrainRectangle80** pITerrainRectangle80)

Parameters

Position

An IPosition80 representing the position and orientation of the rectangle on the terrain.

ObjectWidth

The width of the rectangle in meters.

ObjectDepth

The depth of the rectangle in meters.

LineColor

The color of the lines that make up the rectangle. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the rectangle, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the rectangle is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the rectangle as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainRectangle80

An ITerrainRectangle80, representing the newly created rectangle.

Exceptions

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

Remarks

The rectangle is initially created with its orientation aligned with the north. The client can then change its orientation using the IPosition80 interface.

CreateRegularPolygon

Creates a polygon with equal-length segments in the 3D Window.

 

JavaScript

 

CreateRegularPolygon(

       Position,

       Radius,

       NumOfSegments,

       LineColor,

       FillColor,

       GroupID,

       Description )

 

C#

 

ITerrainRegularPolygon80 CreateRegularPolygon(

       IPosition80 Position,

       double Radius,

       int NumOfSegments,

       object LineColor = -16711936,

       object FillColor = -10197916,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateRegularPolygon(

       IPosition80* Position,

       double Radius,

       long NumOfSegments,

       VARIANT LineColor,

       VARIANT FillColor,

       BSTR GroupID,

       BSTR Description,

       ITerrainRegularPolygon80** pITerrainRegPolygon80)

Parameters

Position

An IPosition80 representing the position and orientation of the polygon on the terrain.

Radius

The radius of the regular polygon in meters.

NumOfSegments

The number of segments the regular polygon has. The more segments, the smoother and more circular it appears.

LineColor

The color of the lines that make up the regular polygon. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the regular polygon, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the regular polygon is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the regular polygon as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

PITerrainRegPolygon80

An ITerrainRegularPolygon80 representing the newly created regular polygon.

Exceptions

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

CreateRouteWaypoint

You can generate a route for dynamic objects by creating a list of waypoints. Each waypoint defines the position of the camera and its speed at that waypoint. If you define a route using individual waypoints, TerraExplorer Pro generates the route by computing a line that passes through each location.

JavaScript

 

CreateRouteWaypoint(

       X,

       Y,

       Altitude,

       Speed,

       Yaw,

       Pitch,

       Roll,

       MessageID )

 

C#

 

IRouteWaypoint80 CreateRouteWaypoint(

       double X = 0,

       double Y = 0,

       double Altitude = 0,

       double Speed = 300,

       double Yaw = 0,

       double Pitch = 0,

       double Roll = 0,

       string MessageID = "")

 

C++

 

HRESULT CreateRouteWaypoint(

       double X,

       double Y,

       double Altitude,

       double Speed,

       double Yaw,

       double Pitch,

       double Roll,

       BSTR MessageID,

       IRouteWaypoint80** pVal)

Parameters

X

The West-East coordinate of the location of interest represented in coordinate system units. You can use the ITerrain80 interface to retrieve information about the coordinate system units.

Y

The North-South coordinate of the location of interest represented in coordinate system units. You can use the ITerrain80 interface to retrieve information about the coordinate system units.

Altitude

The elevation of the location of interest relative to the terrain.

Speed

The speed of the camera.

Yaw

The Yaw angle between the viewer and the point of interest. Range from 0 to 360 where 0=North, 90=East, 180=South and 270=West.

Pitch

The Pitch angle between the viewer and the point of interest. Range from -90 to +90 where 0 = Horizon, +90 = straight up and –90 = straight down.

Roll

The Roll angle between the viewer and the point of interest. Range from -90 to +90 where 0 = Horizon, +90 = Full roll right and –90 = Full roll left.

MessageID

The ID of the message object to activate when this waypoint is reached. 

Return Value

pVal 

An IRouteWaypoint80 representing the created waypoint.

Exceptions

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

CreateScreenOverlay

Creates an image overlay fixed to the screen, e.g., for a logo.

 

JavaScript

 

CreateScreenOverlay(

       ImageFileName,

       GroupID,

       Description)

 

C#

 

IScreenOverlay80 CreateScreenOverlay (

       String ImageFileName,

       String GroupID,

       String Description)

 

C++

 

HRESULT CreateScreenOverlay(

       BSTR ImageFileName,

       BSTR GroupID,

       BSTR Description,

       IScreenOverlay80** pIScreenOverlay80)

 

Parameters

ImageFileName

A full path name or a URL to an image file for the screen overlay. Only BMP, JPEG, or GIF file types are supported.  

GroupID

The Project Tree group in which the screen overlay is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the screen overlay object as it appears in the Project Tree. If an empty string is passed to this parameter, TerraExplorer assigns it a unique name.

Return Value

pIScreenOverlay80

An IScreenOverlay80 representing the newly created overlay.

Exceptions

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

 

CreateSphere

Creates a sphere in the 3D Window.

 

JavaScript

 

CreateSphere(

       Position,

       Radius,

       Style,

       LineColor,

       FillColor,

       SegmentDensity,

       GroupID,

       Description )

 

C#

 

ITerrainSphere80 CreateSphere(

       IPosition80 Position,

       double Radius,

       SphereStyle Style = SphereStyle.SPHERE_NORMAL,

       object LineColor = -16711936,

       object FillColor = -10197916,

       int SegmentDensity = -1,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateSphere(

       IPosition80* Position,

       double Radius,

       SphereStyle Style,

       VARIANT LineColor,

       VARIANT FillColor,

       long SegmentDensity,

       BSTR GroupID,

       BSTR Description,

       ITerrainSphere80** pITerrainSphere80)

 

Parameters

Position

An IPosition80 representing the position and orientation of the sphere on the terrain.

Radius

The radius of the sphere in meters.

Style

An enum that determines which part of the sphere is visible.

The SphereStyle enum can have one of the following values:

·          SPHERE_NORMAL = 0
The entire sphere is visible.

·          SPHERE_UPPER_HALF = 1
The top half is visible.

·          SPHERE_LOWER_HALF = 2
The lower half is visible.

·          SPHERE_ UPPER_HALF_BASE = 3
The upper half, with a base, is visible.

·          SPHERE_LOWER_HALF_BASE = 4
The lower half, with a base, is visible.

SegmentDensity

Determines the density of the mesh that composes the sphere. The density can be any number between 1 and 10.

LineColor

The color of the lines that make up the sphere. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

FillColor

The color which fills the sphere, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

GroupID

The Project Tree group in which the sphere is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the sphere as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainSphere80

An ITerrainSphere80 representing the newly created sphere.

Exceptions

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

CreateTerrainModifier

A terrain modifier object is a unique polygon in the TerraExplorer world that changes the elevation values of the terrain based on a polygon.

 

JavaScript

 

CreateTerrainModifier(

       pIGeometry,

       Mode,

       Flat,

       Feather,

       GroupID,

       Description )

 

C#

 

ITerrainModifier80 CreateTerrainModifier(

       IGeometry pIGeometry,

       ElevationBehaviorMode Mode = ElevationBehaviorMode.EB_REPLACE,

       bool Flat = true,

       double Feather = 0,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateTerrainModifier(

       IGeometry* pIGeometry,

       ElevationBehaviorMode Mode,

       VARIANT_BOOL Flat,

       double Feather,

       BSTR GroupID,

       BSTR Description,

       ITerrainModifier80** pITerrainModifier80)

 

Parameters

pIGeometry

An IGeometry representing geometric properties of the terrain modifier polygon.

Mode

An enum determining the elevation behavior mode.

The ElevationBehaviorMode enum can use any of the following values:

·          EB_REPLACE = 0
Replaces the area defined by the polygon with the selected elevation value.

·          EB_BELOW = 1
Replaces all elevation values that are lower than the selected elevation value with the selected elevation value

·          EB_ABOVE = 2
Replaces all elevation values that are higher than the selected elevation value with the selected elevation value

·          EB_OFFSET = 3
Offsets the area defined by the polygon with the selected elevation value.

Flat

A Boolean that determines if the modified terrain creates a flat surface.

Feather

The size of the feather radius in meters.

GroupID

The Project Tree group in which the terrain modifier is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the terrain modifier as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainModifier80

An ITerrainModifier80 representing the terrain modifier polygon.

Exceptions

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

CreateTextLabel

Creates a text label in the 3D Window.

Note:    If you want to create an image label, use the CreateLabel or CreateImageLabel methods.

 

JavaScript

 

CreateTextLabel(

       Position,

       Text,

       LabelStyle,

       GroupID,

       Description )

 

C#

 

ITerrainLabel80 CreateTextLabel(

       IPosition80 Position,

       string Text,

       ILabelStyle80 LabelStyle = null,

       string GroupID = "",

       string Description = ""

 

C++

 

HRESULT CreateTextLabel(

       IPosition80* Position,

       BSTR Text,

       ILabelStyle80 LabelStyle,

       BSTR GroupID,

       BSTR Description,

       ITerrainLabel80** pITerrainLabel80)

 

Parameters

Position

An IPosition80 representing the position and orientation of the label on the terrain.

Text

The label text.

LabelStyle

An ILabelStyle80representing the label style (e.g. color, font and viewing distance properties).

GroupID  

The Project Tree group in which the label is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the label as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainLabel80 

An ITerrainLabel80 representing the newly created label.

Exceptions

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

CreateTreeHotlink

Creates a Project Tree entry that has only a hotlink that is not attached to a terrain object. In most cases, if an entry in the Project Tree is not a group, it usually represents an object on the terrain. It is, however, sometimes necessary to create an entry in the Project Tree that can be linked to a web page, for example, without the link actually being related to a terrain object. To create a Tree hotlink, you should first create a message object (using the CreateMessage method) and then pass the ID of that message object to the CreateTreeHotlink method.

 

JavaScript

 

CreateTreeHotlink(

       MessageID,

       GroupID,

       Description )

 

C#

 

ITreeHotlink80 CreateTreeHotlink(

       string MessageID,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateTreeHotlink(

       BSTR MessageID,

       BSTR GroupID,

       BSTR Description,

       ITreeHotlink80** pITreeHotlink80)

 

Parameters

MessageID

The ID of the message object that the client wants to have activated once the user clicks on the hotlink in the Project Tree.

GroupID

The Project Tree group in which the hotlink is created. If it is set to zero, the object created in the route. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the hotlink as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITreeHotlink80

An ITreeHotlink80 representing the newly created hotlink.

Exceptions

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

CreateVideoOnTerrain

Plays a movie draped on the terrain.

 

JavaScript

 

CreateVideoOnTerrain(

       VideoFileName,

       Position,

       GroupID,

       Description )

 

C#

 

ITerrainVideo80 CreateVideoOnTerrain(

       string VideoFileName,

       IPosition80 Position,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateVideoOnTerrain(

       BSTR VideoFileName,

       IPosition80* Position,

       BSTR GroupID,

       BSTR Description,

       ITerrainVideo80** pITerrainVideo80)

 

Parameters

VideoFileName

A full path name or a URL to the video file that you would like to import to the terrain.

Position

An IPosition80 representing the position and orientation of the video object on the terrain.

GroupID

The Project Tree group in which the video on terrain is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the video on terrain object as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainVideo80

An ITerrainVideo80representing the newly created video on terrain object.

Exceptions

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

DeleteObject

Deletes an object from the terrain.

 

JavaScript

 

DeleteObject(

       ObjectID)

 

C#

 

void DeleteObject(

       string ObjectID)

 

C++

 

HRESULT DeleteObject(

       BSTR ObjectID)

Parameters

ObjectID

The ID of the object to be deleted.

Exceptions

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

GetObject

Returns an interface to the object based on the object ID.

 

JavaScript

 

GetObject(

       ObjectID)

 

C#

 

ITerraExplorerObject80 GetObject(

       string ObjectID)

 

C++

 

HRESULT GetObject(

       BSTR ObjectID,

       ITerraExplorerObject80** pITerraExplorerObject80)

 

Parameters

ObjectID

The ID of the object requested.

Return Value

pITerraExplorerObject80

An ITerraExplorerObject80 representing the created object.

Exceptions

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

Remarks

In some situations, it is helpful to know the object ID, for example, when you need to get an interface to the object in order to perform some operation.