Synopsis

PDX_MSGT igeo_ApproxGetData(long approx_opt, void *approx_data, int *approx_type)

Purpose

Get the next set of approximation data

Description

Extract the next set of approximation data requested from GDX approximation data. This function keeps extracting data until all data has been extracted (IGEO_DONE or error returned) and assumes that @a *approx_data = NULL at the start. The data that is extracted should not be overwritten in the approx_data structure since the data is reused in subsequent extractions. This function MUST be called until IGEO_DONE or an error is returned to insure that all the data allocated for approx_data is freed. The point approximation data structure IGEO_POINT_APPROX_DATA is returned when the approximation type flag is IGEO_POINT_APPROX. The format of the data structure is:

.TS center box tab (/); l l l . Data Type /Field /Description _ long /point_count; /Count of points MTH_3DPNT /(*point_list); /List of 3D points long /seg_count; /Count of segments long /*points_in_seg; /Count of points/segment int /attr_count; /Count of attributes long /*seg_per_attr; /Segments per attribute GDX_ATTRIBUTE_TYPE /*attr_types; /Attribute types void /**attributes; /Attributes .TE

The points_in_seg list indicates how many of the points in point_list form a multpoint linear(polyline)segment. By default, the first segment starts at point index 0 and ends at point index points_in_seg[0] - 1. The next segment starts at 0 + points_in_seg[0] and ends at 0 + points_in_seg[0] + points_in_seg[1] - 1, etc. for seg_per_attr[0]. The attr_count indicates the count of different attributes that need to applied to the segments. In the case where the option has been set to not apply attributes, the seg_per_attr list is NULL and the seg_count value indicates the total number of segments. The attributes list contains the list of IGES_ATTR (See iges_intro for a description of the IGES_ATTR definition) attributes to apply to the approximation data. The attr_types list indicates the type of attribute application. The attribute type for point approximation data is:

.IP IGEO_IGES_ATTR 19 The IGES_ATTR attribute applied to points, lines, or polyline data. .LP

The facet approximation data structure IGEO_FACET_APPROX_DATA is returned when the approximation type flag is IGEO_FACET_APPROX. The format of the data structure is:

.TS center box tab (/); l l l . Data Type /Field /Description _ long /point_count; /Count of points MTH_3DPNT /(*point_list); /List of points long /edge_count; /Count of edges long /(*facet_edges)[2]; /Facet edge list long /seg_count; /Count of segments long /*facet_edges_in_seg; /Count of facet edges/seg. int /attr_count; /Count of attributes long /*seg_per_attr; /Segments per attribute GDX_ATTRIBUTE_TYPE /*attr_types; /Attribute types void /**attributes; /Attributes .TE

The facet_edges_in_seg list indicates how many of the facet_edges form a segment. The first segement starts at edge index 0 and ends at edge index facet_edges_in_seg[0] - 1. A facet is formed from edge pairs where facet_edges is a pair of point indexs that indicate the point geometry in point_list that form a facet edge. The first facet would be created from: facet_edges[0][0], facet_edges[0][1], facet_edges[1][1], facet_edges[1][0]. The number of facets in a segment is equivalent to polgon_edges_in_seg - 1 since there is always one more edge than there are facets. An exception is made when an IGES planar closed area entity is approximated as a polygon. In this case the edge_count is one, and the point_list for point_count form the polygon edges. The attr_count indicates the count of different attributes that need to applied to the segments. In the case where the option has been set to not apply attributes, the seg_per_attr list is NULL and the seg_count value indicates the total number of segments. The attributes list contains the list of IGES_ATTR (See iges_intro for a description of the IGES_ATTR definition) attributes to apply to the approximation data. The attr_types list indicates the type of attribute application. The attribute types for facet approximation data are:

.IP IGEO_IGES_ATTR 30 The IGES_ATTR attribute applied to closed area polygon data where the polygon is formed by the point_count points. .IP IGEO_IGES_RECT_SHELL_ATTR 30 The IGES_ATTR attribute applied to a rectangular shell of facets. The facet_edges_in_seg count is the same for all facet segments. (i.e. seg_count = the number of U facets and facet_eges_in_seg[0] - 1 = the number of V facets) .IP IGEO_IGES_NON_RECT_SHELL_ATTR 30 The IGES_ATTR attribute applied to a non-rectangular shell of facets. The facet_edges_in_seg count may vary from one facet segment to the next. .LP

Input

approx_opt

IGEO_ONESEGATTR

One segment per attribute.

IGEO_ALLSEGATTR

All segments for a given attribute.

IGEO_ALLDATA

All attributes and segments.

IGEO_PLANARFACETS

For facet data, make all facets planar to COPLANAR_TOL tolerance.

approx_data

The pointer to the approximation data pointer.

Output

approx_data

The current set of approximation data. The set can be a list of points (IGEO_POINT_APPROX_DATA*) or a surface polygon mesh (IGEO_FACET_APPROX_DATA*). The data returned is a pointer to a READ ONLY data structure. The address of the structure MUST be initialized to NULL for the first call to this function.

approx_type

IGEO_POINT_APPROX

Linear point segment data

IGEO_FACET_APPROX

Linear facet segments and point segment data

Tolerances

COPLANAR_TOL

Return

      IGEO_NOTDONE - Not done getting approximation data
      IGEO_DONE    - Done getting approximation data
      IGEO_NOMEMORY
      IGEO_INVALIDOPTION
      .fi