Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions
ILSortables Interface Reference

This interface expose APIs to sort or apply permutation to a LPV class contains a collection of sortable objects. More...

Inheritance diagram for ILSortables:
LBarcodeResults LBlobResults LSorter LCircleResults LLineResults LContourResults LCrossMarkResults LPathResults LMatchResults

Public Member Functions

void ApplySort (LArray< int > sortedIndexes)
 
ILSortableGetSortable (int index)
 
void Sort (LPVSortBy sortBy, LPVSortOrder sortOrder, LPVPositionMode posMode)
 
int SortableCount ()
 
LArray< int > SortTo (LPVSortBy sortBy, LPVSortOrder sortOrder, LPVPositionMode posMode)
 

Detailed Description

This interface expose APIs to sort or apply permutation to a LPV class contains a collection of sortable objects.

All other LPV classes that provides sort functionalities implements this interface. To use this interface, you should firstly cast the LPV classes to ILSortables interface.

The following lists some sortable collection LPV classes:

LPVGeomLibLPoints
LPVPatLibLMatchResults
LPVBlobLibLBlobResults
LPVLocateLibLLineResults, LCircleResults
LPVLocateXLibLPathResults, LContourResults
LPVBarcodeLibLBarcodeResults

Example Code

Member Function Documentation

◆ ApplySort()

void ApplySort ( LArray< int >  sortedIndexes)

Change the order of the collection according to the pass-in indexes.

Parameters
[in]sortedIndexesThe given indexes, usually you may get them from SortTo().

◆ GetSortable()

ILSortable* GetSortable ( int  index)

Get the sortable object of the given index

Parameters
[in]indexThe input index
See also
SortableCount()

◆ Sort()

void Sort ( LPVSortBy  sortBy,
LPVSortOrder  sortOrder,
LPVPositionMode  posMode 
)

Sort in-place, the source indexes are changed.

Parameters
[in]sortByThe sorting type.
[in]sortOrderThe sorting order.
[in]posModeSpecify which point is used as the object's position, by default it's LPVPosModeCenter means use the center point.

◆ SortableCount()

int SortableCount ( )

Get the count of the sortable objects in the collection

See also
GetSortable()

◆ SortTo()

LArray<int> SortTo ( LPVSortBy  sortBy,
LPVSortOrder  sortOrder,
LPVPositionMode  posMode 
)

Sort and report the sorted indexes, the source indexes are not changed.

Parameters
[in]sortByThe sorting type.
[in]sortOrderThe sorting order.
[in]posModeSpecify which point is used as the object's position, by default it's LPVPosModeCenter means use the center point.
Return values
sortedIndexesReturn the sorted indexes, each value representing the object's index in the source.