This class provides the ability to easily construct contour lines on a terrain. It does so by calling the QuikGrid library to generate contour vectors, then converts those vectors into 3D line geometry draped on the terrain.
- Here is an example of how to use it:
- Or, you can generate specific contour lines:
- If you keep a pointer to the geometry, you can toggle or delete it later:
[...]
geom->SetEnabled(bool);
[...]
pTerrain->GetScaledFeatures()->RemoveChild(geom);
geom->Release();
void vtContourConverter::Finish |
( |
| ) |
|
Finishes the contour generation process. Call once when you are done using the class to generate contours.
void vtContourConverter::GenerateContour |
( |
float |
fAlt | ) |
|
Generate a contour line to be draped on the terrain.
- Parameters
-
fAlt | The altitude (elevation) of the line to be generated. |
void vtContourConverter::GenerateContours |
( |
float |
fInterval | ) |
|
Generate a set of contour lines to be draped on the terrain.
- Parameters
-
fInterval | The vertical spacing between the contours. For example, if the elevation range of your data is from 50 to 350 meters, then an fIterval of 100 will place contour bands at 100,200,300 meters. |
Set up the class to create geometry on a terrain.
- Parameters
-
pTerr | The terrain you will generate the contour lines on. |
color | The colors of the generated lines. |
fHeight | The height above the terrain to drape the lines. Generally you will want to use a small offset value here, to keep the lines from colliding with the terrain itself. |
- Returns
- A geometry node which contains the contours.
Set up the class to create line features on a terrain.
- Parameters
-
pTerr | The terrain you will generate the contour lines on. |
fset | The featureset to receive the polylines. |
- Returns
- True if successful.