Through Terrain Model Explorer, a three dimensional surface model can be generated from data. In the ActiveX Object Model, you can create and query this three dimensional model through the Surfaces collection. You can use the Surface collection to iterate through all of the existing Surfaces, create an new Surface, or delete an existing Surface. These are just a few of the Surface operations at the collection level.
A Surface is broken down into inputs (SurfaceInputs) and outputs (SurfaceOutputs). You can modify the SurfaceInputs by changing the ContourItems, Breaklines, Boundaries, PointFiles, PointGroups or DEMFiles. From the SurfaceOutputs, you can get the TinPoints, Edges, Faces, ElevationContours, and Watersheds.
Volume information can be created by using the Surfaces.DifferenceGrid or the Surfaces.CompositeGrid methods. Both methods create a new Surface. This new Surface can then be queried for volume information.
Surface Boundary Points
The implementation of IAeccBoundaries::Add() will close a boundary, if the last point and first point are not identical. In addition, if the last and first points are not identical and cause lines that intersect each other, the surface will not behave as expected. If two points on the boundary are co-located, the boundary will be rejected. The best way to create a boundary is to allow the implementation to close the boundary automatically.
Using Breaklines and Boundaries, areas of a Surface can be made invisible. Watersheds and Contours will not be returned for the invisible areas. Faces, Edges, and TinPoints will be returned for the invisible areas.
Surface.Build will use the settings defined in Terrain Model Explorer Build dialog. These settings include the "Apply Edit History" and "Log Errors To File" options.
Edit History is not exposed in this release of the ActiveX Object Model. However, if the "Apply Edit History" is turned on in Terrain Model Explorer, then Surface.Build will use this setting.
Initially, all Surfaces have no locks applied to them. When a method or property is called, then the Surface is opened. At that time, a lock will be created on that Surface. The ActiveX Object Model will always try to create a write lock (kWriteLock). If someone else has control of that Surface, you will get a read lock (kReadLock). If the Surface is selected as the Current Surface, the locks will also be generated. When the object has gone out of scope, the Surface will go back to its original state. If it was opened and locked before the ActiveX Object Model object was created, then it will stay opened and locked. If the Surface was not opened (and therefore, not locked), then when the ActiveX Object Model object goes out of scope, the Surface will be closed and unlocked.
After a surface has been build, you can generate contour data by setting the ElevationContours.Elevation property. Zero or more ElevationContour objects will be added to the collection, depending on the elevation you set. You can use the ElevationContour.Coordinates property to set the vertices of an AeccContour object.