MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTerrainContour Class Reference

Detailed Description

This class provides an interface to the contouring functionality of the Terrain SDK. It can be used to generate contour lines from arbitrary data provided to it in the form of TSLTerrainContourVertexes.

Rendering of the contour lines is entirely dictated by the client due to the use of rendering callbacks. Client provided callback methods are invoked for each calculated contour line, leaving the appearence of the contours entirely up to the user.

Deprecated
Deprecated as of MapLink 11.1.

Public Member Functions

 TSLTerrainContour ()
 
void clearNullValue ()
 
void contourSmoothing (bool enable)
 
void destroy ()
 
bool drawContourLine (int attributeLevel, double attribute, TSLTerrainContourLineType contourType=TSLTerrainContourLineTypeStandard, const char *textPrefix=0, TSLVerticalAlignment textAlignment=TSLVerticalAlignmentMiddle, int textWidth=0)
 
bool drawContourPolygon (int attributeLevel, double minAttribute, double maxAttribute)
 
void drawTIN (int attributeLevel, double attribute)
 
TSLTerrainContourVertexListgetVertices ()
 
void notifyChanged ()
 
TSLTerrainReturn process (TSLTerrainContourLineType type, int attributeLevel, double attribute, bool qualityMesh=true, double maxError=0.0)
 
TSLTerrainContourBaseCallbackssetCallbackHandler (TSLTerrainContourBaseCallbacks *handler)
 
void setNullValue (double nullValue, double nullError=0.01)
 
void setVertices (TSLTerrainContourVertexList *vertexList)
 
void * operator new (size_t size)
 
void operator delete (void *mem, size_t s)
 
void * operator new (size_t size, char *filename, int line)
 

Constructor & Destructor Documentation

◆ TSLTerrainContour()

TSLTerrainContour::TSLTerrainContour ( )

Default constructor.

Member Function Documentation

◆ clearNullValue()

void TSLTerrainContour::clearNullValue ( )

Clears the currently set NULL value.

After the NULL value is cleared, the contouring algorithm does not stop at any value.

◆ contourSmoothing()

void TSLTerrainContour::contourSmoothing ( bool enable)

Enables or disables smoothing of contour lines. The default is not to smooth contour lines.

◆ destroy()

void TSLTerrainContour::destroy ( )

Deletes this object. This method should be called instead of deleting the contour object.

◆ drawContourLine()

bool TSLTerrainContour::drawContourLine ( int attributeLevel,
double attribute,
TSLTerrainContourLineType contourType = TSLTerrainContourLineTypeStandard,
const char * textPrefix = 0,
TSLVerticalAlignment textAlignment = TSLVerticalAlignmentMiddle,
int textWidth = 0 )

Draws contour lines using the specified algorithm and data provided in the setVertex() method.

Note that text labels will only be generated when using the TSLContourType Standard algorithm.

Parameters
attributeLevelIndex from the attribute list of the vertices to use when contouring. For data with multiple attributes this allows selection of the group of attribute data to use for the contouring process.
attributeThe value of the attribute in the data for which to draw the contour lines.
contourTypeA member of the TSLContourType enumeration specifying which algorith to use to generate the contour lines.
textPrefixText prefix to pass to the text rendering callback.
textAlignmentWhere to display the text labels in relation to the contour lines. If the value is TSLVerticalAlignmentMiddle then the contour lines will be split to accomodate the labels.
textWidthMaximum width of the text labels in the units of the vertex data. This parameter is ignored if textAlignment is not TSLVerticalAlignmentMiddle.

◆ drawContourPolygon()

bool TSLTerrainContour::drawContourPolygon ( int attributeLevel,
double minAttribute,
double maxAttribute )

Draws contour polygons using the data provided in the setVertex() method.

Parameters
attributeLevelIndex from the attribute list of the vertices to use when contouring. For data with multiple attributes this allows selection of the group of attribute data to use for the contouring process.
minAttributeThe lowest attribute value to include in the generated polygons.
maxAttributeThe highest attribute value to include in the generated polygons.

◆ drawTIN()

void TSLTerrainContour::drawTIN ( int attributeLevel,
double attribute )

Draws point generated from the TIN (Triangulated Irregular Network) model. This method shows the triangles generated rather than the result of processing these into contour lines.

Parameters
attributeLevelIndex from the attribute list of the vertices to use when contouring. For data with multiple attributes this allows selection of the group of attribute data to use for the contouring process.
attributeThe value of the attribute in the data for which to draw the contour lines.

◆ getVertices()

TSLTerrainContourVertexList * TSLTerrainContour::getVertices ( )

Returns the current vertex list held by the contour object. The contour object still retails ownership of the list and so it should not be deleted by the user.

If the contents of the vertex list is modified after the grids have been generated by calling process() or any of the draw methods, then the notify Changed() method should be called to inform the library that it should discard any precalculated information regarding the generated contours.

Returns the vertex list held by the contour object, or NULL if it currently has no list.

◆ notifyChanged()

void TSLTerrainContour::notifyChanged ( )

Informs the contouring library that the vertex data it holds has been modified and that it should discard any precalculated contour data. The data will be regenerated based on the new vertex data on the next call to process() or any of the draw() methods.

◆ operator delete()

void TSLTerrainContour::operator delete ( void * mem,
size_t s )

◆ operator new() [1/2]

void * TSLTerrainContour::operator new ( size_t size)

◆ operator new() [2/2]

void * TSLTerrainContour::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ process()

TSLTerrainReturn TSLTerrainContour::process ( TSLTerrainContourLineType type,
int attributeLevel,
double attribute,
bool qualityMesh = true,
double maxError = 0.0 )

Precalculates information needed for the contouring operations from the data provided in setVertices. Calling this function means that the data necessary to perform a contouring operation has already been generated prior to a call to either drawContourLine() or drawContourPolygon(), reducing the time the drawing operation takes to complete.

When called with the type parameter as TSLContourLineTypeStandard or TSLContourLineTypeSimple this method will generate the TIN needed to generate contour lines for these algorithms. When called with TSLContourLine TypeCONREC this will generate the necessary intermediate values for calculating contour lines with this algorithm in addition to precalculating the contour lines for the attribute level and attribute specified.

Note that invoking this method is optional. If it is not called then the draw() methods will perform the necessary calculations themselves.

Parameters
attributeLevelattributeLevel: Index from the attribute list of the vertices to use when contouring. For data with multiple attributes this allows selection of which group of attribute data to use for the contouring process.
attributeThe value of the attribute in the data for which to draw the contour lines.
typewhich type of contour operation to prepare for.
qualityMeshif this flag is true the generated TIN will be a quality mesh. Only used when type is set to TSLContourTypeSimple or TSLContourLineType Standard.
maxErrorif the maximum error is greater than 0.0 the TIN is thinned so that only enough points to generate a TIN with a greatest point error equal to this value. Only used when type is set to TSLContourLineTypeSimple or TSLContourLineTypeStandard.

◆ setCallbackHandler()

TSLTerrainContourBaseCallbacks * TSLTerrainContour::setCallbackHandler ( TSLTerrainContourBaseCallbacks * handler)

Sets the callback handler to use.

If a class derived from TSLTerrainContourCallbacks or TSLTerrainContour GeometryCallbacks is set then callbacks are invoked from the process(), draw ContourLine(), drawContourPolygon() and drawTIN() methods.

Parameters
handlerPointer to a class that implements the TSLTerrainContourCallbacks interface. Pass NULL to clear an existing callback handler.
Returns
the current callback handler set.

◆ setNullValue()

void TSLTerrainContour::setNullValue ( double nullValue,
double nullError = 0.01 )

Sets the NULL value for the contouring algorithm. Contours will not be displayed through planes containing NULL values. Only one NULL value can be defined at any one time.

Parameters
nullValueValue to be considered NULL.
nullErrorAmount of deviation from NULL value to be considered NULL. For avoiding rounding errors.

◆ setVertices()

void TSLTerrainContour::setVertices ( TSLTerrainContourVertexList * vertexList)

Set the vertices for the grid. The contour object assumes ownership of the vertex list.

Parameters
vertexListThe vertex list to set. Pass NULL to clear an existing vertex list.