SDK

Functions

void SPI_CAL_gravity_profile (int pos, double *pt)
 Calculates the point of the center of gravity of the profile.
 
double SPI_CAL_surface_profile (int pos, int plane)
 Calculates the area of a profile.
 
double SPI_CAL_distance_point_profile (int pos, int plane, double *pt)
 Calculates the minimum distance between a point and a profile.
 
double SPI_CAL_sort_point (int sortType, int indTab1stPt, int indTab2ndPt)
 Optimizes an array of points and returns the total distance.
 

Detailed Description

Basic

Function Documentation

◆ SPI_CAL_distance_point_profile()

double SPI_CAL_distance_point_profile ( int pos,
int plane,
double * pt )

Calculates the minimum distance between a point and a profile.

Parameters
[in]posindex of a profile element in the database
[in]planeplane of the point used to calculate the distance
[in]ptpoint of reference
Returns
minimum distance between a point and the profile
dist := RCALL(SPI_CAL_distance_point_profile,ipos,1,pt);
double SPI_CAL_distance_point_profile(int pos, int plane, double *pt)
Calculates the minimum distance between a point and a profile.
Definition sp_cal02.c:113

◆ SPI_CAL_gravity_profile()

void SPI_CAL_gravity_profile ( int pos,
double * pt )

Calculates the point of the center of gravity of the profile.

Parameters
[in]posindex of a profile element in the database
[out]ptpoint of center of gravity (TR3)
PCALL(SPI_CAL_gravity_profile,ipos,pt);
void SPI_CAL_gravity_profile(int pos, double *pt)
Calculates the point of the center of gravity of the profile.
Definition sp_cal02.c:42

◆ SPI_CAL_sort_point()

double SPI_CAL_sort_point ( int sortType,
int indTab1stPt,
int indTab2ndPt )

Optimizes an array of points and returns the total distance.

Parameters
[in]sortTypesorting method
  • 1 Back and forth grid X + and Y +
  • 2 Grid back and forth X- and Y +
  • 3 Back and forth grid X + and Y-
  • 4 Grid go back X- and Y-
  • 5 Single aisle grid X + and Y +
  • 6 Single aisle grid X- and Y +
  • 7 Single aisle grid X + and Y-
  • 8 Single aisle grid X- and Y-
  • 9 Back and forth grid Y + and X +
  • 10 Grid back and forth Y + and X-
  • 11 Back and forth grid Y- and X +
  • 12 Grid back and forth Y- and X-
  • 13 Single aisle grid Y + and X +
  • 14 Single aisle grid Y + and X-
  • 15 Single aisle grid Y- and X +
  • 16 Single aisle grid Y- and X-
  • 17 Auto Optimization
  • 18 Euclidean Distance
  • 19 TaxiDistance
  • 20 DistanceSup
  • 21 Euclidean Distance with bipoint
  • 22 TaxiDistance with bipoint
  • 23 DistanceSup with bipoint
[in]indTab1stPtindex of the table containing the starting points
[in]indTab2ndPtindex of the table containing the end points (in case of profiles), or -1
Returns
total distance between points
ind_tab := ICALL(SPI_LOC_find_first_array);
Ier := ICALL(SPI_LOC_alloc_array,SPI_LOC_TYPTR3,4,ind_tab);
ier := ICALL(SPI_LOC_write_one_in_array,0,pt1,ind_tab);
ier := ICALL(SPI_LOC_write_one_in_array,1,pt2,ind_tab);
ier := ICALL(SPI_LOC_write_one_in_array,2,pt3,ind_tab);
ier := ICALL(SPI_LOC_write_one_in_array,3,pt4,ind_tab);
dist := RCALL(SPI_CAL_sort_point,17,ind_tab,-1);
int SPI_LOC_write_one_in_array(int pos, const void *adr, int ind)
Writes a field in an array.
Definition sp_loc01.c:428
int SPI_LOC_alloc_array(int typ, int nb, int ind)
Allocates an array at a given size.
Definition sp_loc01.c:352
int SPI_LOC_find_first_array()
Finds the first free array and return its number.
Definition sp_loc01.c:58
double SPI_CAL_sort_point(int sortType, int indTab1stPt, int indTab2ndPt)
Optimizes an array of points and returns the total distance.
Definition sp_cal02.c:150

The table ind_tab now contains the points sorted according to the method "Auto Optimization"

See also
SPI_LOC_alloc_array, SPI_LOC_free_array
SPI_LOC_write_one_in_array, SPI_LOC_read_one_in_array

◆ SPI_CAL_surface_profile()

double SPI_CAL_surface_profile ( int pos,
int plane )

Calculates the area of a profile.

Parameters
[in]posindex of a profile element in the database
[in]planereference plane
Returns
SIGNED value of the profile ( < 0 Trigo > 0 clockwise)
Remarks
If the profile is open it will be closed artificially by a segment
rval := RCALL(SPI_CAL_surface_profile,ipos,1);
double SPI_CAL_surface_profile(int pos, int plane)
Calculates the area of a profile.
Definition sp_cal02.c:75