|The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....|
|Home ChartPack RChart Class TContourPlot Using TContourPlot|
The TContourPlot component is inherited from the TRChart component and is thus closely related to it. Many of the methods and properties of TContourPlot are similar or even euqual to their counterparts in TRChart. Thus we describe here only the general principles of TContourPlot and those properties and methods which differ from TRChart. Please refer to the section on How to Use RChart for further information on the common features.
TContourPlot is considerably simpler than TRChart as it does not support more than one data layer nor does it provide more than one crosshair. The basic idea behind TContourPlot is as follows: The base plane of the 3D surface to be visualized as a contour plot is covered by a regularly spaced pivot grid, whose resolution is controlled by the property PivotResolution. During the rendering of the contour plot the component asks for the z-values at each pivot point by triggering the OnEstimateZVal event. The user has to provide the z-value either by evaluating the mathematical function to be displayed or by taking the data from a suitable matrix. The contour plot engine uses these pivot points to calculate either a color-coded contour map, a monochrome set of isohypses, or a color-coded set of isohypses. The type of the plot can be controlled by the property PlotMode.
The colors of both the color-coded contour map and the color-coded isohypses are taken from the color array IsoColors. The colors are mapped in a way that the first color of the color array corresponds to a z-value given by IsoLow, and the last color of the color array corresponds to a z-value specified by IsoHigh.
In the case of isohypses (either monochrome or color-coded) the properties IsoLow and IsoHigh specify the z-values of the lowest and highest isohypses to be displayed. The property IsoDist controls the distance between the isohypses.
The range of the displayed surface and the appearance of the scales along the ground plane can be controlled by setting the properties ScaleX and ScaleY. Note when changing the view port it is more efficient to use the method SetRange than to set the lower and upper borders of the scale individually.
The TContourPlot component can be forced to redraw the contour plot by calling the method DrawPlot. This is necessary only if the data to be displayed has been changed, in most other situations (e.g. after changing the scale range) the contour plot is redraws automatically.
In order to indicate the color coding of the contour plot the component TColorScale may be used. If the property AttachedColorScale is set, any changes of the colors will be reflected automatically in the color scale attached to the TContourPlot component.