CreateSphere

Creates a sphere in the 3D Window.

 

JavaScript

 

CreateSphere(

       Position,

       Radius,

       Style,

       LineColor,

       FillColor,

       SegmentDensity,

       GroupID,

       Description )

 

C#

 

ITerrainSphere66 CreateSphere(

       IPosition66 Position,

       double Radius,

       [SphereStyle Style = SphereStyle.SPHERE_NORMAL],

       [object LineColor = 0xFF00FF00],

       [object FillColor = 0xFF646464],

       [int SegmentDensity = -1],

       [string GroupID = ""],

       [string Description = ""])

 

C++

 

HRESULT CreateSphere(

       IPosition66* Position,

       double Radius,

       SphereStyle Style,

       VARIANT LineColor,

       VARIANT FillColor,

       long SegmentDensity,

       BSTR GroupID,

       BSTR Description,

       ITerrainSphere66** pITerrainSphere66)

 

Parameters

Position

An IPosition66 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 IColor66 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 IColor66 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 IProjectTree66.CreateGroup.

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

·          Traverse the Tree using IProjectTree66 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

pITerrainSphere66

An ITerrainSphere66 representing the newly created sphere.

Exceptions

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