Client applications can add, modify and remove TerraExplorer objects. This enables a whole new level of customization and richness in features such as importing/exporting new files formats, controlling the movements of objects on the terrain from local and remote devices, and more.
Adding objects to the project
ICreator66 is the interface that provides the methods to create all the different types of layers, objects, locations and presentations in the project. Using one of the Create methods (i.e. ICreator66. CreateCircle) you can add the objects to the project and place them in any location in the 3D World. When the client application creates such an object, it gets an interface to the object in return, which can then be used to perform further operations on it.
var circle = SGWorld.Creator.CreateCircle(SGWorld.Creator.CreatePosition(-71.00864, 42.36229,0,2), // Pivot
1000.0, // Radius (1000m)
SGWorld.Creator.CreateColor(0, 0, 0, 0), // Outline color (in this sample, transparent/no outline)
SGWorld.Creator.CreateColor(200, 50, 50, 128) // Fill color
);
Modifying objects’ parameters
Using the ICreator66 and the IProjectTree66 interfaces, you can get an interface to TerraExplorer objects. If the client application created this object, you should have the interface as a return value from the CreateXX method. You can also get an interface from an item ID by using the IProjectTree66.GetObject method.
var node = SGWorld.ProjectTree.GetNextItem(group, 11); // code 11 get the first child in the group
while (node > 0)
{
var object = SGWorld.ProjectTree.GetObject(node);
// Here you can perform operation on the object ...
node = SGWorld.ProjectTree.GetNextItem(node, 13); // code 13 gets the next sibling
}