FreeMat: vtkProjectedTerrainPath

FreeMat

- Main Page
- Related Pages

vtkProjectedTerrainPath

Section: Visualization Toolkit Hybrid Classes

# Usage

vtkProjectedTerrainPath projects an input polyline onto a terrain. (The terrain is defined by a 2D height image and is the second input to the filter.) The polyline projection is controlled via several modes as follows. 1) Simple mode projects the polyline points onto the terrain, taking into account the height offset instance variable. 2) Non-occluded mode insures that no parts of the polyline are occluded by the terrain (e.g. a line passes through a mountain). This may require recursive subdivision of the polyline. 3) Hug mode insures that the polyine points remain within a constant distance from the surface. This may also require recursive subdivision of the polyline. Note that both non-occluded mode and hug mode also take into account the height offset, so it is possible to create paths that hug terrain a certain distance above it. To use this filter, define two inputs: 1) a polyline, and 2) an image whose scalar values represent a height field. Then specify the mode, and the height offset to use.

An description of the algorithm is as follows. The filter begins by projecting the polyline points to the image (offset by the specified height offset). If the mode is non-occluded or hug, then the maximum error along each line segment is computed and placed into a priority queue. Each line segment is then split at the point of maximum error, and the two new line segments are evaluated for maximum error. This process continues until the line is not occluded by the terrain (non-occluded mode) or satisfies the error on variation from the surface (hug mode). (Note this process is repeated for each polyline in the input. Also, the maximum error is computed in two parts: a maximum positive error and maximum negative error. If the polyline is above the terrain–i.e., the height offset is positive–in non-occluded or hug mode all negative errors are eliminated. If the polyline is below the terrain–i.e., the height offset is negative–in non-occluded or hug mode all positive errors are eliminated.)

To create an instance of class vtkProjectedTerrainPath, simply invoke its constructor as follows

      obj = vtkProjectedTerrainPath

# Methods

The class vtkProjectedTerrainPath has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkProjectedTerrainPath class.

- `string = obj.GetClassName ()` - Standard methids for printing and determining type information.
- `int = obj.IsA (string name)` - Standard methids for printing and determining type information.
- `vtkProjectedTerrainPath = obj.NewInstance ()` - Standard methids for printing and determining type information.
- `vtkProjectedTerrainPath = obj.SafeDownCast (vtkObject o)` - Standard methids for printing and determining type information.
- `obj.SetSource (vtkImageData source)` - Specify the second input (the terrain) onto which the polyline(s) should be projected.
- `vtkImageData = obj.GetSource ()` - Specify the second input (the terrain) onto which the polyline(s) should be projected.
- `obj.SetProjectionMode (int )` - Determine how to control the projection process. Simple projection just projects the original polyline points. Non-occluded projection insures that the polyline does not intersect the terrain surface. Hug projection is similar to non-occulded projection except that produces a path that is nearly parallel to the terrain (within the user specified height tolerance).
- `int = obj.GetProjectionModeMinValue ()` - Determine how to control the projection process. Simple projection just projects the original polyline points. Non-occluded projection insures that the polyline does not intersect the terrain surface. Hug projection is similar to non-occulded projection except that produces a path that is nearly parallel to the terrain (within the user specified height tolerance).
- `int = obj.GetProjectionModeMaxValue ()` - Determine how to control the projection process. Simple projection just projects the original polyline points. Non-occluded projection insures that the polyline does not intersect the terrain surface. Hug projection is similar to non-occulded projection except that produces a path that is nearly parallel to the terrain (within the user specified height tolerance).
- `int = obj.GetProjectionMode ()` - Determine how to control the projection process. Simple projection just projects the original polyline points. Non-occluded projection insures that the polyline does not intersect the terrain surface. Hug projection is similar to non-occulded projection except that produces a path that is nearly parallel to the terrain (within the user specified height tolerance).
- `obj.SetProjectionModeToSimple ()` - Determine how to control the projection process. Simple projection just projects the original polyline points. Non-occluded projection insures that the polyline does not intersect the terrain surface. Hug projection is similar to non-occulded projection except that produces a path that is nearly parallel to the terrain (within the user specified height tolerance).
- `obj.SetProjectionModeToNonOccluded ()` - Determine how to control the projection process. Simple projection just projects the original polyline points. Non-occluded projection insures that the polyline does not intersect the terrain surface. Hug projection is similar to non-occulded projection except that produces a path that is nearly parallel to the terrain (within the user specified height tolerance).
- `obj.SetProjectionModeToHug ()` - This is the height above (or below) the terrain that the projected path should be. Positive values indicate distances above the terrain; negative values indicate distances below the terrain.
- `obj.SetHeightOffset (double )` - This is the height above (or below) the terrain that the projected path should be. Positive values indicate distances above the terrain; negative values indicate distances below the terrain.
- `double = obj.GetHeightOffset ()` - This is the height above (or below) the terrain that the projected path should be. Positive values indicate distances above the terrain; negative values indicate distances below the terrain.
- `obj.SetHeightTolerance (double )` - This is the allowable variation in the altitude of the path with respect to the variation in the terrain. It only comes into play if the hug projection mode is enabled.
- `double = obj.GetHeightToleranceMinValue ()` - This is the allowable variation in the altitude of the path with respect to the variation in the terrain. It only comes into play if the hug projection mode is enabled.
- `double = obj.GetHeightToleranceMaxValue ()` - This is the allowable variation in the altitude of the path with respect to the variation in the terrain. It only comes into play if the hug projection mode is enabled.
- `double = obj.GetHeightTolerance ()` - This is the allowable variation in the altitude of the path with respect to the variation in the terrain. It only comes into play if the hug projection mode is enabled.
- `obj.SetMaximumNumberOfLines (vtkIdType )` - This instance variable can be used to limit the total number of line segments created during subdivision. Note that the number of input line segments will be the minimum number that cab be output.
- `vtkIdType = obj.GetMaximumNumberOfLinesMinValue ()` - This instance variable can be used to limit the total number of line segments created during subdivision. Note that the number of input line segments will be the minimum number that cab be output.
- `vtkIdType = obj.GetMaximumNumberOfLinesMaxValue ()` - This instance variable can be used to limit the total number of line segments created during subdivision. Note that the number of input line segments will be the minimum number that cab be output.
- `vtkIdType = obj.GetMaximumNumberOfLines ()` - This instance variable can be used to limit the total number of line segments created during subdivision. Note that the number of input line segments will be the minimum number that cab be output.