vtContourConverter Class Reference
[Utility classes]

List of all members.

Detailed Description

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:
    vtContourConverter cc;
    cc.Setup(pTerrain, RGBf(1,1,0), 10);
    cc.GenerateContours(100);
    cc.Finish();
Or, you can generate specific contour lines:
    vtContourConverter cc;
    cc.Setup(pTerrain, RGBf(1,1,0), 10);
    cc.GenerateContour(75);
    cc.GenerateContour(125);
    cc.GenerateContour(250);
    cc.Finish();
If you keep a pointer to the geometry, you can toggle or delete it later:
    vtContourConverter cc;
    vtGeom *geom = cc.Setup(pTerrain, RGBf(1,1,0), 10);
    [...]
    geom->SetEnabled(bool); // set visibility
    [...]
    pTerrain->GetScaledFeatures()->RemoveChild(geom);
    geom->Release();        // delete


Public Member Functions

vtGeomSetup (vtTerrain *pTerr, const RGBf &color, float fHeight)
void GenerateContour (float fAlt)
void GenerateContours (float fAInterval)
void Finish ()


Member Function Documentation

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.

vtGeom * vtContourConverter::Setup vtTerrain pTerr,
const RGBf color,
float  fHeight
 

Set up the class to do draping 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.


Generated on Tue Apr 22 10:11:06 2008 for vtlib library by  doxygen 1.4.5