string
tMsg = String.Empty;
ILinearRing cRing =
null
;
IGeometry cPolygonGeometry =
null
;
ITerrainPolyline66 cpolyo =
null
;
var
sgworld =
new
SGWorld66();
List<IPosition66> posl = pos;
int
sin = 0;
sin = posl.Count*3;
double
[] cVerticesArray =
new
double
[sin];
for
(
int
i = 0; i < posl.Count; i++)
{
cVerticesArray[i*3] = posl[i].X;
cVerticesArray[i*3+1] = posl[i].Y;
cVerticesArray[i * 3 + 2] = posl[i].Altitude;
}
{
cRing = sgworld.Creator.GeometryCreator.CreateLinearRingGeometry(cVerticesArray);
cPolygonGeometry = sgworld.Creator.GeometryCreator.CreateLinearRingGeometry(cRing);
}
{
uint
nLineColor = 0xFF00FF00;
AltitudeTypeCode AltitudeType = AltitudeTypeCode.ATC_ON_TERRAIN;
cpolyo = sgworld.Creator.CreatePolyline(cPolygonGeometry, nLineColor, AltitudeType,
string
.Empty,
"Polygon"
);
///注意坐标
sgworld.Window.PixelToWorld(sgworld.Window.Rect.Left, sgworld.Window.Rect.Top, WorldPointType.WPT_TERRAIN);
}