SE_shape_build |
Assembles a set of line segments into polygons or linestrings using the specified mode.
LONG SE_shape_build (SE_SHAPE src_shape, SE_BUILD_MODE mode, BOOL dissolve, LONG match_mask, SE_SHAPE tgt_shape);
src_shape | A handle to an active line shape object |
mode | Determines the type of output shapes |
dissolve | Determines whether to remove duplicate line segments |
match_mask | If set, z-coordinates are used to check for duplicates |
tgt_shape | A handle to an active shape object, returned as the new shape |
This function takes a line (spaghetti) shape (the raw shape) and assembles it into polygons or simple lines according to the mode. The mode is specified with:
typedef enum {
SE_Build_Polygons_From_All_Rings,
SE_Build_Polygons_From_Clockwise_Rings,
SE_Build_Polygons_From_CounterClockwise_Rings,
SE_Build_SimpleLines
} SE_BUILD_MODE;
The first enumeration, SE_Build_Polygons_From_All_Rings, will use all segments in the shape to create a polygon. SE_Build_From_Clockwise_Rings will use the clockwise lines only to build the polygon shape. SE_Build_From_CounterClockwise_Rings will use the counterclockwise lines only to build the polygon shape. SE_Build_SimpleLines will convert a set of lines (spaghetti) into a multipart simple line shape.
If the dissolve flag is TRUE, then all duplicate line segments are eliminated. The match_mask determines whether to use z values in addition to x,y to check for duplicates, when z values are present. The match_mask is valid when building simple lines only. A simple line can cross itself if the z values are different at the point of intersection. The match_mask definition is in sg.h and is:
SG_MATCH_ZEDS
You can use both definitions with
LONG match_mask;
match_mask = SG_MATCH_ZEDS
SE_SUCCESS
SE_INVALID_ENTITY_TYPE
SE_INVALID_SHAPE
SE_INVALID_SHAPE_OBJECT
SE_OUT_OF_CLMEM
SE_READ_ONLY_SHAPE
• If you pass a shape returned from SE_stable_search or SE_stable_get_shape to 'shape', the SE_READ_ONLY_SHAPE error is returned. See 'Shape table functions' for more information.
• Ignores any CAD data in the source shape, and removes any CAD data in the target shape.