SDTS_AL
|
#include <sdts_al.h>
Public Member Functions | |
int | AssembleRings () |
virtual void | Dump (FILE *) override |
Public Attributes | |
int | nRings |
int | nVertices |
int * | panRingStart |
double * | padfX |
double * | padfY |
double * | padfZ |
![]() | |
SDTSModId | oModId |
int | nAttributes |
SDTSModId * | paoATID |
Class for holding information about a polygon feature.
When directly read from a polygon module, the polygon has no concept of its geometry. Just it's ID, and references to attribute records. However, if the SDTSLineReader::AttachToPolygons() method is called on the module containing the lines forming the polygon boundaries, then the nEdges/papoEdges information on the SDTSRawPolygon will be filled in.
Once this is complete the AssembleRings() method can be used to fill in the nRings/nVertices/panRingStart/padfX/padfY/padfZ information defining the ring geometry.
Note that the rings may not appear in any particular order, nor with any meaningful direction (clockwise or counterclockwise).
int SDTSRawPolygon::AssembleRings | ( | ) |
This method will assemble the edges associated with a polygon into rings, returning FALSE if problems are encountered during assembly.
Form border lines (arcs) into outer and inner rings.
See SDTSPolygonReader::AssemblePolygons() for a simple one step process to assembling geometry for all polygons in a transfer.
This method will assemble the lines attached to a polygon into an outer ring, and zero or more inner rings. Before calling it is necessary that all the lines associated with this polygon have already been attached. Normally this is accomplished by calling SDTSLineReader::AttachToPolygons() on all line layers that might contain edges related to this layer.
This method then forms the lines into rings. Rings are formed by:
Once ring assembly from lines is complete, another pass is made to order the rings such that the exterior ring is first, the first ring has counter-clockwise vertex ordering and the inner rings have clockwise vertex ordering. This is accomplished based on the assumption that the outer ring has the largest area, and using the +/- sign of area to establish direction of rings.
|
overridevirtual |
Dump readable description of feature to indicated stream.
Implements SDTSFeature.
int SDTSRawPolygon::nRings |
Number of rings in assembled polygon.
int SDTSRawPolygon::nVertices |
Total number of vertices in all rings of assembled polygon.
double* SDTSRawPolygon::padfX |
List of nVertices X coordinates for the polygon (split over multiple rings via panRingStart.
double* SDTSRawPolygon::padfY |
List of nVertices Y coordinates for the polygon (split over multiple rings via panRingStart.
double* SDTSRawPolygon::padfZ |
List of nVertices Z coordinates for the polygon (split over multiple rings via panRingStart. The values are almost always zero.
int* SDTSRawPolygon::panRingStart |
Offsets into padfX/padfY/padfZ for the beginning of each ring in the polygon. This array is nRings long.