AddSpecOfPolygonArea

Declaration: TSpecCollection.AddSpecOfPolygonArea (it, cl: integer; capt, catstring: string; Polyg: TPIntArray; Spec, SDev: TDoubleArray): integer;
The function AddSpecOfPolygonArea adds the spectrum defined by the parameter Spec, assuming that the spectrum is the mean spectrum of a polygonal area specified by the parameter Polyg. The parameter SDev is the standard deviation of the mean spectrum. The parameter it specifies the time slot, the parameter cl specifies the class number.

The parameter capt contains the caption of the spectrum. The catstring parameter contains the user-defined categories (see the spectral collection data format for details on the format.

The function returns the following error codes:

≥0 ... everthing is OK, the returned number is the index of the newly added spectrum
-1 ... the lengths of Spec and SDev do not match
-2 ... the number of polygon points is too low (less than 3)

Hint: In order to access the spectral collection currently loaded in the Spectral Collection Editor you can use the pre-declared global variable SCData.