Function Prototypes

<< Click to Display Table of Contents >>

Navigation:  TerraScan User Guide > Programming Interface > MDL Public Functions >

Function Prototypes

Function Prototypes

 

/*-------------------------------------------------------------------

Classify points from one class to another.

 FromClass    source class (999 for any)

 ToClass      destination class

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyClass( int FromClass, int ToClass, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify local minimum points which are more than Dz lower than

any other source point within XyDst distance.

 FromClass    source class (999 for any)

 ToClass      destination class

 GrpCnt       maximum number of low points in a group (1...99)

 Dz           minimum elevation difference to other points (m)

 XyDst        search radius (m)

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyLow( int FromClass, int ToClass, int GrpCnt, double Dz,

                           double XyDst, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points up in the air. Compare each point against all

points within a search rectangle with radius (=half of rectangle

edge length) XyDst. If there are at least ReqCnt points and

point in question is higher than:

  MedianElevation + (Lim * StandardDeviationOfElevations)

classify it into ToClass class.

 ClsLst       list of source classes, example "1,7-9"

 ToClass      destination class

 XyDst        search radius (m)

 ReqCnt       minimum point count within search rectangle

 Lim          minimum factor

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyAir( wchar_t *ClsLst, int ToClass, double XyDst, int ReqCnt,

                           double Lim, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify isolated points which have fewer than LimCnt other

points within 3D search radius Dst.

  ClsLst       list of source classes, example "1,7-9"

  ToClass      destination class

  LimCnt       classify if fewer than Lim other points

  Dst          search radius (m)

  Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyIsolated( wchar_t *ClsLst, int ToClass, int LimCnt, wchar_t *CmpLst,

                                double Dst, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points which have another point closeby.

 FromLst      list of source classes, example "1,7-9"

 FromLine     list of source classes, example "0-65535"

 FromScr      list of source scanners, example "0-255"

 ToClass      destination class

 Dim          search type 2=2D, 3=3D

 Rad          3D search radius (m)

 OtherLine    if nonzero, other point must be from another line

 OtherScr     if nonzero, other point must be from another scanner

 SpecCls      if nonzero, other point must be from specific class

 ClsLst       list of classes, example "10,14"

 SpecLine     if nonzero, other point must be from specific line

 LineLst      list of lines, example "1000-1999"

 SpecScr      if nonzero, other point must be from specific scanner

 ScrLst       list of scanners, example "2"

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

Return -4 if out of memory.

*/

 

_int64  FnScanClassifyCloseby( wchar_t *FromLst, wchar_t *FromLine, wchar_t *FromScr, int To,

                               int Dim, double Rad, int OtherLine, int OtherScr, int SpecCls,

                               wchar_t *ClsLst, int SpecLine, wchar_t *LineLst, int SpecScr,

                               wchar_t *ScrLst, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify ground points by iteratively molding a triangulated

ground model upwards.

 FromLst      list of source classes, example "1,3"

 ToClass      destination class

 CurLst       list of current ground classes, example "2,8"

 InitLow      initial points: 0=current ground points, 1=low

 BldSz        - maximum building size (m) if InitLow=1

 MaxAng       maximum terrain angle (degrees)

 IterAng      iteration angle (degrees)

 IterDst      iteration distance (m)

 Reduce       reduce iteration length?

 RedLen       - when edge length < RedLen

 Stop         stop iteration?

 StopLen      - when edge length < StopLen

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

Return -4 if out of memory.

*/

 

_int64  FnScanClassifyGround( wchar_t *FromLst, int ToClass, wchar_t *CurLst, int InitLow,

                              double BldSz, double MaxAng, double IterAng, double IterDst,

                              int Reduce, double RedLen, int Stop, double StopLen, int Fence);

 

 

/*-------------------------------------------------------------------

Classify hard surface points.

 FromClass    source class (999 for any)

 ToClass      destination class

 PlaTol       planarity tolerance (m)

 MaxSlp       max terrain angle (deg) excluding vertical walls

 IterAng      iteration angle (deg)

 StopLen      stop when edge length < StopLen

 MinDet       minimum detail (m2)

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

Return -4 if out of memory.

*/

 

_int64  FnScanClassifyHard( wchar_t *FromLst, int ToClass, double PlaTol, double MaxSlp,

                            double IterAng, double StopLen, double MinDet, int Fence) ;

 

 

*-------------------------------------------------------------------

Classify surface points.

 FromClass    source class (999 for any)

 ToClass      destination class

 Tol          tolerance (m)

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

*/

 

_int64  FnScanClassifySurface( wchar_t *FromLst, int ToClass, double Tol, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points below surface. Compare each point against

a plane equation fitted to closest neighbours. Classify point

if it is clearly below the plane.

Routine computes the distance from each point to the plane and

computes the standard deviation of these distances. Point is

classified if it is more than Tol below the plane and more than

 Lim * StandardDeviation below the plane.

 FromClass    source class -- normally ground

 ToClass      destination class -- normally low point

 Lim          limit

 Tol          elevation tolerance

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyBelow( int FromClass, int ToClass, double Lim, double TolZ, int Fence);

 

 

/*-------------------------------------------------------------------

Classify points points by height from ground.

 Grd          ground class or 1000000+TerraModeler surface id

 MaxLen       maximum ground triangle length

 FromClass    source class (999 for any)

 ToClass      destination class

 MinH         minimum height above ground

 MaxH         maximum height above ground

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyHgtGrd( int Grd, double MaxLen, int FromClass, int ToClass,

                              double MinH, double MaxH, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points by height from multiple ground classes.

 GrdLst       list of ground classes, example L"2,8"

 MaxLen       maximum ground triangle length

 FromClass    source class (999 for any)

 ToClass      destination class

 MinH         minimum height above ground

 MaxH         maximum height above ground

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyHgtLst( wchar_t *GrdLst, double MaxLen, int FromClass, int ToClass,

                              double MinH, double MaxH, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points within given elevation range. This classifies

points which satisfy MinZ <= Z < MaxZ.

 FromClass    source class (999 for any)

 ToClass      destination class

 MinZ         minimum elevation

 MaxZ         maximum elevation

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyAbsElev( int FromClass, int ToClass, double MinZ, double MaxZ,

                               int Fence);

 

 

/*-------------------------------------------------------------------

Classify points within given intensity range. This classifies

points which satisfy MinV <= Intensity < MaxV.

 FromClass    source class (999 for any)

 ToClass      destination class

 MinV         minimum intensity

 MaxV         maximum intensity

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyIntensity( int FromClass, int ToClass, double MinV, double MaxV,

                                 int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points within given distance range. This classifies

points which satisfy MinV <= Distance <= MaxV.

 ClsLst       list of source classes, example L"2,14"

 ToClass      destination class

 MinV         minimum intensity

 MaxV         maximum intensity

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyDistance( wchar_t *ClsLst, int ToClass, double MinV, double MaxV,

                                int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points within given color range which is given using

HSV color model.

 FromClass    source class (9999 for any)

 ToClass      destination class

 Source       color source: 0=laser, 1=ortho, 2=raw images

 Foot         laser footprint diameter (m) in ortho/raw images

 Hue          hue value

 Tol          +- tolerance for hue

 SatMin       minimum saturation

 SatMax       maximum saturation

 ValMin       minimum value

 ValMax       maximum value

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyColor( int FromClass, int ToClass, int Hue, int Tol, int SatMin,

                             int SatMax, int ValMin, int ValMax, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points within given time range. This classifies

points which satisfy Beg <= Time <= End.

  FromClass    source class (999 for any)

  ToClass      destination class

  Beg          start time (seconds)

  End          end time (seconds)

  Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyTime( int FromClass, int ToClass, double Beg, double End, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify model keypoints which produce a triangulated surface

model of given accuracy.

 ClsLst       list of source classes, example L"2,14"

 ToClass      destination class

 InitDst      initial sampling distance (m)

 Above        distance points may be above model (m)

 Below        distance points may be below model (m)

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyModelKey( wchar_t *ClsLst, int ToClass, double InitDst,

                                double Above, double Below, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify contour keypoints which produce a triangulated surface

suitable for generating contours.

 ClsLst       source classes, for example L"2,14"

 ToClass      destination class

 Interval     contour interval (m)

 Init         initial sampling distance (m)

 Lim          limit for classification

              (1=accure/many points, 100=pretty/few points)

 Peaks        0=no, 1=keep peaks and pits

 PeakArea     minimum area (m2) for peak to keep

 PitArea      minimum area (m2) for pit to keep

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyContourKey( wchar_t *ClsLst, int ToClass, double Interval, double Init,

                                  int Lim, int Peaks, double PeakArea, double PitArea,

                                  int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points based on selected centerline element. Alignment

element must be selected with selection tool before executing

this function.

 ClsLst       list of source classes, example L"1,7-9"

 ToClass      destination class

 Cmp          compare with 0=any line, 1=closest line

 Side         -1=left, 0=either, 1=right side

 OffMin       minimum xy offset from element (m)

 OffMax       maximum xy offset from element (m)

 UseDz        if true, use dz from alignment

 DzMin        minimum dz value

 DzMax        maximum dz value

 UseDst       if true, use distance from closest vertex

 DstMin       minimum longitudinal distance to vertex

 DstMax       minimum longitudinal distance to vertex

Return number of points classified (0...n).

Return -1 if invalid or no selection.

Return -2 if was aborted.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyCtrline( wchar_t *ClstLst, int ToClass, int Cmp, int Side,

                              double OffMin, double OffMax, int UseDz, double DzMin,

                              double DzMax, int UseDst, double DstMin, double DstMax) ;

 

 

/*-------------------------------------------------------------------

Classify points based on echo information.

  FromClass    source class (999 for any)

  ToClass      destination class

  Echo         from echo

  Fence        0=all points, 1=inside fence

Valid values for Echo parameter are:

  0  only echo

  1  first of many

  2  intermediate

  3  last of many

 11  any first (only echo or first of many)

 13  any last (only echo or last of many)

 21  first echo

 22  second echo

 23  third echo

 24  fourth echo

 25  fifth echo

 26  sixth echo

 27  seventh echo

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyEcho( int FromClass, int ToClass, int Echo, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points based on scan direction or edge flag.

 FromClass    source class (9999 for any)

 ToClass      destination class

 Direction    0=negative direction, 1=positive direction, 2=edge

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if no direction flag available.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyDirection( int FromClass, int ToClass, int Direction, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points which are hits on building roofs.

 GrdClass     ground class

 FromClass    source class (high vegetation)

 ToClass      destination class

 MinArea      minimum area of building (m2)

 Tol          plane tolerance (m)

 UseEcho      use echo information?

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyBuilding( int GrdClass, int FromClass, int ToClass, double MinArea,

                                double Tol, int UseEcho, int Fence) ;

 

 

/*-------------------------------------------------------------------

Classify points which are hits on wall like surfaces.

 ClsLst       list of source classes, example "4-5"

 ToClass      destination class

 Fence        0=all points, 1=inside fence

Return number of points classified (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if no normal vectors.

Return -3 if invalid parameters.

*/

 

_int64  FnScanClassifyWall( wchar_t *ClsLst, int ToClass, double MinArea, double Tol,

                            int Fence);

 

 

/*-------------------------------------------------------------------

Classify points inside shape elements on a given level in the

active CAD file or any reference file with Locate lock on.

 ClsLst       list of source classes, example "4-5,11"

 ToClass      destination class

 Lvl          level

 ByClr        filter by color?

 Clr          - color

 ByWgt        filter by weight?

 Wgt          - weight

 BySty        filter by style?

 Sty          - style

 Dgn          0=active design and references, 1=active CAD file, 2=reference files

Return number of points classified (0...n).

Return -2 if out of memory.

*/

 

_int64  FnScanClassifyShapes( wchar_t *ClsLst, int ToClass, int Lvl, int ByClr, int Clr,

                              int ByWgt, int Wgt, int BySty, int Sty, double Expand, int Dgn);

 

 

/*-------------------------------------------------------------------

Classify points close to 3D polygons on a given level in the

active CAD file or any reference file with Locate lock on.

 ClsLst       list of source classes, example L"4-5,11"

 ToClass      destination class

 Lvl          level

 ByClr        filter by color?

 Clr          - color

 ByWgt        filter by weight?

 Wgt          - weight

 BySty        filter by style?

 Sty          - style

 Exp          distance to expand polygons (m)

 OffMin       offset minimum, -inside, +outside (m)

 OffMax       offset minimum, -inside, +outside (m)

 Dgn          0=active design and references, 1=active CAD file, 2=reference files

Return number of points classified (0...n).

Return -2 if out of memory.

*/

 

_int64  FnScanClassifyPolygon3d( wchar_t *ClsLst, int ToClass, int Lvl, int ByClr, int Clr,

                                 int ByWgt, int Wgt, int BySty, int Sty, double Exp,

                                 double OffMin, double OffMax, int Dgn) ;

 

 

/*-------------------------------------------------------------------

Classify points close to wire vector elements.

 ClsLst       list of source classes, example L"4-5,11"

 ToClass      destination class

 Obj          0=TerraScan wires, 1=any linear elements

 Lvls         list of wire levels, example L"17-21"

 Find         search logic 0=dz, 1=3d distace, 2=falling tree

 Dst          distance limit

 Offset       offset limit to speed up search

 Grd          ground class for falling tree logic

Return number of points classified (0...n).

Return -1 if invalid paramters.

Return -2 if out of memory.

*/

 

_int64  FnScanClassifyDanger( wchar_t *ClsLst, int ToClass, int Obj, wchar_t *Lvls, int Find,

                              double Dst, double Offset, int Ground) ;

 

 

/*-------------------------------------------------------------------

Classify every Mark=1 point from class FromClass to class

ToClass. Redraw the points during the process.

Return number of classified points.

*/

 

_int64  FnScanClassifyMarked( int FromClass, int ToClass) ;

 

 

/*-------------------------------------------------------------------

Delete points in a given class.

 Class        source class to delete

 Fence        0=all points, -1=outside fence, 1=inside fence

Return number of points deleted (0...n).

Return -1 if no fence defined (and Fence was nonzero).

*/

 

_int64  FnScanDeleteClass( int Class, int Fence) ;

 

 

/*-------------------------------------------------------------------

Set the withheld bit for points in a given class of an LAS 1.4 file.

 Class        source class

 Fence        0=all points, -1=outside fence, 1=inside fence

Return number of points effected (0...n).

Return -1 if no fence defined (and Fence was nonzero).

*/

 

_int64  FnScanDeleteClassBit( int Class, int Fence) ;

 

 

/*-------------------------------------------------------------------

Delete points from a given line or measurement.

 Line         line or measurement to delete

 Fence        0=all points, -1=outside fence, 1=inside fence

Return number of points deleted (0...n).

Return -1 if no fence defined (and Fence was nonzero).

*/

 

_int64  FnScanDeleteLine( int Line, int Fence) ;

 

 

/*-------------------------------------------------------------------

Transform coordinates of points using a transformation defined

in TerraScan settings.

 LineLst      list of flighline to transform L"2001,3017-3019"

 ClsLst       classes to transform, example L"1,7-9"

 Name         name of transformation in TerraScan settings

 Fence        0=all points, 1=inside fence

Return number of points deleted (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if was aborted.

Return -3 if invalid parameters.

Return -4 if transformation was not found.

*/

 

_int64  FnScanTransform( wchar_t *LineLst, wchar_t *ClsLst, wchar_t *Name, int Fence) ;

 

 

/*-------------------------------------------------------------------

Redraw contents of all views which may be displaying points.

Return 1 always.

*/

 

int FnScanUpdateViews( void) ;

 

 

/*-------------------------------------------------------------------

Sort points to By order:

  0   increasing easting

  1   decreasing northing

  2   increasing easting

  3   decreasing northing

  4   increasing time stamp

Return 1 if points were sorted.

Return 0 if nothing was done.

*/

 

int FnScanSort( int By) ;

 

 

/*-------------------------------------------------------------------

Output points to a file.

 File      Output file name.

            Active project directory will be used if File does

            not include a directory specification.

           Following code strings are replaced:

           #bnumber   active block number

           #block     active block file name

           #bpath     active block file path

           #pdir      project data directory

           #name      file name component of active file

 ClsLst    list of classes to output, example L"1,7-9"

 Fmt       Format of output file.

 Delim     Delimiter (0=space, 1=tabulator, 2=comma) for formats 1-5

 Decim     Number of decimals for xyz values (0, 1, 2, 3 or 4).

 Trans     Name of transformation in TerraScan settings.

           Pass zero or "" for none.

 Append    If true, add to end of a possibly existing file.

 Fence     0=all points, 1=inside fence

 Active    0=all points, 1=active block only

 Surf      Ground surface: list of surface class(es) such as L"2,10" or

           1000000 + surface id from TerraModeler such as L"1000002".

Format can be:

   1        X Y Z

   2        Class X Y Z

   3        X Y Z Intensity

   5        Class X Y Z Intensity

   7        TerraScan binary 8 bit line numbers

   8        TerraScan binary 16 bit line numbers

  13        EarthData binary

  23        Grass Sites format

 200+       User defined file format

Return number of points written.

Return -1 if no fence defined (and Fence was nonzero).

Return -2 if failed to write to file.

Return -3 if invalid parameters.

Return -4 if transformation was not found.

*/

 

_int64  FnScanOutput( wchar_t *File, wchar_t *ClsLst, int Fmt, int Delim, int Decim,

                      wchar_t *Trans, int Append, int Fence, int Active, wchar_t *Surf) ;

 

 

/*-------------------------------------------------------------------

Output points to a file based on line number. This

will generate multiple output files if Line == -1 in which

case one output file will be generated for every line.

 File      Output file name.

            If File contains string "#line", that string will

            be replaced by flight line number.

            Active project directory will be used if File does

            not include a directory specification.

 LineLst   List of lines to output -- "7" or "101-107,201-203".

           Pass "0-65535" for all lines and use "#line" as part of File name.

 Class     List of classes to output, example "1,7-9".

 Fmt       Format of output file.

 Delim     Delimiter (0=space, 1=tabulator, 2=comma).

 Decim     Number of decimals for xyz values (0, 1, 2, 3 or 4).

 Trans     Name of transformation in TerraScan settings.

           Pass zero or "" for none.

 Append    If true, add to end of a possibly existing file.

Format can be:

   1         X Y Z

   2         Class X Y Z

   3         X Y Z Intensity

   5         Class X Y Z Intensity

   7         TerraScan binary 8 bit line numbers

   8         TerraScan binary 16 bit line numbers

Return number of points written.

Return -2 if failed to write to file.

Return -3 if invalid parameters.

Return -4 if transformation was not found.

*/

 

_int64  FnScanOutputLine( wchar_t *File, wchar_t *LineLst, wchar_t *ClsLst, int Fmt,

                          int Delim, int Decim, wchar_t *Trans, int Append) ;

 

 

/*-------------------------------------------------------------------

Return information about the active project. Set:

 Type   project type: 0=airborne, 1=ground based

 Fmt    storage format: 0=TerraScan binary, 1=EarthData

 Dir    data file directory

Return number of blocks (0 - n).

Return -1 if no active project.

*/

 

int FnScanProjectInfo( int *Type, int *Fmt, char *Dir) ;

 

 

/*-------------------------------------------------------------------

Return information about project block index Ind. Set:

 Vrt[]   boundary vertices (up to 41)

 File    binary file name including full path

Return number of boundary vertices (0 - 41).

Return -1 if invalid index or no active project.

*/

 

int FnScanProjectBlock( Dpoint3d *Vrt, char *File, int Ind) ;

 

 

/*-------------------------------------------------------------------

Create lattice model from laser points in class Class and

write that to file File.

 File      Output file name.

           Active project directory will be used if File does

            not include a directory specification.

           Following code strings are replaced:

           #bnumber   active block number

           #block     active block file name

           #bpath     active block file path

           #pdir      project data directory

           #name      file name component of active file

 ClsLst    list of classes to write, example L"4-6"

 Elev      0=lowest, 1=average, 2=highest hit, 3=triangle model

 GrdLst    list of ground classes, example L"2"

 Step      Grid step size (m).

 Len       Number of gap pixels to fill if Elev != 3.

           Maximum triangle length if Elev == 3.

 Fmt       Format of output file.

 UnitZ     Unit of Z values: 0=uor, 1=mm, 2=cm, 3=dm, 4=m

           Used only with Intergraph and Raw binary formats.

 CrdBlk    0=no coordinate block, nonzero=output.

           Used only with Intergraph format and GeoTIFF.

 Out       Value to output in undefined area. Pass NULL to skip.

           Used only with ArcInfo and Xyz text formats.

 Decim     Number of decimals in elevation values.

           Used only with ArcInfo, Xyz text and Surfer ASC formats.

 Area      0=whole area of points, 1=active block boundary

Format can be:

  0         Intergraph GRD

  5         Raw binary 16 bit

  6         Raw binary 32 bit

  7         Raw binary 64 bit double

  8         ArcInfo GRIDASCII

  9         Xyz text

Return  1 on success.

Return  0 if no source points.

Return -2 if failed to write to file.

*/

 

_int64  FnScanExportLattice( wchar_t *File, wchar_t *ClsLst, int Elev, wchar_t *GrdLst,

                             double Step, double Len, int Fmt, int UnitZ, int CrdBlk,

                             wchar_t *Out, int Decim, int Area)

 

 

/*-------------------------------------------------------------------

Read points from file File into RAM.

 File      Full path of input file(s)

           Multiple file names should be separated by '\n'

 First     Class for non-last echos (if not in input)

 Last      Class for last echos (if not in input)

 Line      Line number (if not in input)

 Inc       When line number is incremented

           0=never, 2=new file, 3=new file name, 4=new dir

 Trans     Name of transformation in TerraScan settings

           Pass zero or "" for none

 Fence     0=all points, 1=inside fence

 Every     0=every, 1=every, n=every n:th

Return number of points found.

Return -2 if failed to open or recognize format of first file.

Return -3 if invalid parameters.

Return -4 if transformation was not found.

Return -5 if out of memory.

*/

 

_int64  FnScanRead( wchar_t *File, int First, int Last, int Line, int Inc,

                    wchar_t *Trans, int Fence, int Every)

 

 

/*-------------------------------------------------------------------

Smoothen surface by adjusting point elevations.

moving points points by adjusting elevations by a maximum of

 ModLst       classes to smoothen, example "1,7-9"

 UpCm         maximum movement up (cm)

 DnCm         maximum movement down (cm)

 FixLst       immovable classes to include in surface, "5-6"

 Fence        0=all points, -1=outside fence, 1=inside fence

Return  1 if points were adjusted.

Return  0 if nothing was done.

Return -2 if out of memory.

*/

 

_int64  FnScanSmoothen( wchar_t *ModLst, double UpMax, double DownMax, wchar_t *FixLst,

                        int Fence) ;

 

 

/*-------------------------------------------------------------------

Thin data set by removing points close to another point.

Point can be removed if it is within Dxy horizontal distance

and Dz elevation difference from another point.

 

  FromLst      list of source classes, "4" or "2-6" or "0-255"

  To           destination class (997 for delete)

  Keep         point to keep in a group:

                 0=highest,1=lowest,2=central,3=create average

                 1000 = Class 0, 1001 = Class 1, 1002 = Class 2, ...

  Dxy          xy distance limit

  Dz           dz limit

  Fence        0=all points, -1=outside fence, 1=inside fence

 

Return number of points removed (0...n).

Return -1 if no fence defined (and Fence was nonzero).

Return -3 if invalid parameters.

*/

 

_int64  FnScanThinPoints( wchar_t *FromLst, int To, int Keep, double Dxy, double Dz,

                          int Fence);

 

 

/*-------------------------------------------------------------------

Cut points from overlapping lines by either line

quality or by offset from trajectory.

 

  ClsLst       List of coverage classes, example "0-255"

  Action       Action: 0=add constant, 1=classify, 2=delete

  Val          If Action == 0, value to add to class

               If Action == 1, class to classify to

  Quality      0=no, 1=cut by trajectory quality

  Gap           - radius of empty area to consider a gap

  Single       0=no, 1=cut single scanner edges

  KeepSng       - minimum corridor to keep (degrees)

  Offset       0=no, 1=cut by offset

  Keep          - minimum corridor to keep (degrees)

  Range        0=no, 1=cut by range

  Radius        - if a closer line has a point within Radius (m)

  Rml           - range multiplier (grows Radius by range)

  KeepDst       - minimum range to keep (m)

  Use           - 3=3d range, 2=offset range

 Lens         0=no, 1=cut by density

  Drd           - if a denser sensor has a point within Radius (m)

  KeepLst       - classes to always keep, example "2,6"

  Grp           - optional scanner groups, example "0-2;3,5"

  ClsLst       List of coverage classes, example "0-255"

  Action       Action: 0=add constant, 1=classify, 2=delete

  Val          If Action == 0, value to add to class

               If Action == 1, class to classify to

  Quality      0=no, 1=cut by trajectory quality

  Gap           - radius of empty area to consider a gap

  Offset       0=no, 1=cut by offset

  Keep          - minimum corridor to keep (degrees)

 

Return number of points affected (0...n).

Return -3 if invalid parameters.

Return -4 if no trajectories.

*/

 

_int64 FnScanCutOverlap( wchar_t *ClsLst, int Action, int Val, int Quality, double Gap,

                         int Single, int KeepSng, int Offset, int Keep, int Range,

                         double Radius, double Rml, double KeepDst, int Use, int Dens,

                         double Drd, wchar_t *KeepLst, wchar_t *Grp) ;

 

 

/*-------------------------------------------------------------------

Adjust laser points using an angular change to the vector

from scanner position to the point.

 Line      Line to adjust. Pass -1 for all lines.

 Fix       Coordinate axis to fix: 1=z, 2=xy, 3=xyz

 Input     Angle unit used: 0=degrees, 1=radians, 2=ratio

 Head      Heading correction angle

 Roll      Roll correction angle

 Pitch     Pitch correction angle

 Div       Angle divider corresponding to full circle.

           Used if Input == 2.

Return number of points adjusted.

Return -1 if no trajectories loaded.

*/

 

int FnScanAdjustAngles( int Line, int Fix, int Input, double Head, double Roll,

                         double Pitch, double Div) ;

 

 

/*-------------------------------------------------------------------

Return address of point coordinates and number of points.

Note that this address may change any time when points have

been added or deleted from the table.

Return number of points.

Return zero if failed.

*/

 

_int64  FnScanGetPnt( Point3d **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to laser point classes and number of points.

Return number of points.

Return zero if no point classes.

*/

 

_int64  FnScanGetCls( BYTE **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to laser point mark values and number of points.

Return number of points.

Return zero if no mark values.

*/

 

_int64  FnScanGetMrk( BYTE **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to laser point flag values and number of points.

Return number of points.

Return zero if no flag values.

*/

 

_int64  FnScanGetFlg( BYTE **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to laser point intensities and number of points.

Return number of points.

Return zero if no intensities.

*/

 

_int64  FnScanGetInt( USHORT **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to laser point line numbers and number of points.

Return number of points.

Return zero if no line values.

*/

 

_int64  FnScanGetLin( USHORT **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to time stamp table and number of points.

Return number of points.

Return zero if no time stamps.

*/

 

_int64  FnScanGetDbl( double **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to laser point echo bits and number of points.

Return number of points.

Return zero if no echo bits.

*/

 

_int64  FnScanGetEch( BYTE **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to laser point mirror angles and number of points.

Return number of points.

Return zero if no angles.

*/

 

_int64  FnScanGetAng( char **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to color table and number of points.

Return number of points.

Return zero if no color values.

*/

 

int_int64  FnScanGetClr( RgbClr **Tbl) ;

 

 

/*-------------------------------------------------------------------

Return address to scanner numbers and number of points.

Return number of points.

Return zero if no scanner numbers.

*/

 

_int64  FnScanGetScr( BYTE **Tbl) ;

 

 

/*-------------------------------------------------------------------

Get current coordinate setup. Routine stores coordinate system

origin in *Org.

To compute master unit coordinates *D from laser point integer

coordinates *P, you would use:

 double  Mul ;

 Mul = 1.0 / UorPerMast ;

 D->x = Org->x + (Mul * P->x) ;

 D->y = Org->y + (Mul * P->y) ;

 D->z = Org->z + (Mul * P->z) ;

where UorPerMast is the return value from this routine.

Return number of integer units per master unit.

*/

 

int  FnScanGetCoordSetup( Dp3d *Org) ;

 

 

/*-------------------------------------------------------------------

Mark every point to have mark value MarkVal.

*/

 

int FnScanMarkAll( int MarkVal) ;

 

 

/*-------------------------------------------------------------------

Mark every point inside fence to have Mark=1 and every point

outside fence to have Mark=0.

Set *Fst and *Lst as the indexes of first and last point inside

fence.

Return 1 on success.

Return 0 if failed.

*/

 

int FnScanMarkFence( int *Fst, int *Lst) ;

 

 

/*-------------------------------------------------------------------

Fill option button with class names.

Return 0 always.

*/

 

int FnScanClassOption( RawItemHdr *Raw, int Nbr, int Fst) ;

 

 

/*-------------------------------------------------------------------

Fill string list with:

- class numbers and names if Nbr is true

- class names only if Nbr is zero

Return number of classes.

*/

 

int FnScanClassList( StringList *Lst, int Nbr) ;

 

 

/*-------------------------------------------------------------------

Ask user to select point classes to use. Set character array

to indicate which classes were selected.

Sel[] should be allocated for 256 items.

Sel[0] indicates if code 0 is selected.

Sel[1] indicates if code 1 is selected.

Return number of classes selected.

Return -1 if canceled.

*/

 

int FnScanSelectClasses( char *Sel) ;

 

 

/*-------------------------------------------------------------------

Save laser points to a temporary file Path in binary format.

Return 1 on success.

Return 0 if failed to write.

*/

 

int FnScanSave( char *Path) ;

 

 

/*-------------------------------------------------------------------

Reload laser points from a temporary file Path.

Return  1 on success.

Return  0 if failed to read file.

Return -1 if we already have points in memory.

Return -2 if out of memory.

*/

 

int FnScanReload( char *Path) ;

 

 

/*-------------------------------------------------------------------

Outside application plans to call FnScanFreeTable().

Ask user if he wants to save modified points.

Return  1 if were saved or user decided not to.

Return  0 if no points or not modified.

*/

 

int FnScanPreFree( void) ;

 

 

/*-------------------------------------------------------------------

Free memory allocated for laser points.

Return 1 always.

*/

 

int FnScanFreeTable( void) ;

 

 

/*-------------------------------------------------------------------

Find laser point closest to point Cp which is within distance

R of point Cp when drawn in view Vw.

 Fp        Point where the coordinates will be stored.

 Class     Class of points to output. Pass 999 for all points.

 Cp        Point at which to search.

 R         Search radius (m).

 Vw        View index for rotation of search (pass -1 for top

           view search logic).

Return index of point if found (0,1,2,...).

Return -1 if no point found.

*/

 

_int64  FnScanFindClosest( Dp3d *Fp, int Class, Dp3d *Cp, double R, int Vw) ;