select_region_spatialT_select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial (Operator)

Name

select_region_spatialT_select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial — Pose relation of regions.

Signature

select_region_spatial(Regions1, Regions2 : : Direction : RegionIndex1, RegionIndex2)

Herror T_select_region_spatial(const Hobject Regions1, const Hobject Regions2, const Htuple Direction, Htuple* RegionIndex1, Htuple* RegionIndex2)

void SelectRegionSpatial(const HObject& Regions1, const HObject& Regions2, const HTuple& Direction, HTuple* RegionIndex1, HTuple* RegionIndex2)

HTuple HRegion::SelectRegionSpatial(const HRegion& Regions2, const HString& Direction, HTuple* RegionIndex2) const

HTuple HRegion::SelectRegionSpatial(const HRegion& Regions2, const char* Direction, HTuple* RegionIndex2) const

HTuple HRegion::SelectRegionSpatial(const HRegion& Regions2, const wchar_t* Direction, HTuple* RegionIndex2) const   (Windows only)

static void HOperatorSet.SelectRegionSpatial(HObject regions1, HObject regions2, HTuple direction, out HTuple regionIndex1, out HTuple regionIndex2)

HTuple HRegion.SelectRegionSpatial(HRegion regions2, string direction, out HTuple regionIndex2)

def select_region_spatial(regions_1: HObject, regions_2: HObject, direction: str) -> Tuple[Sequence[int], Sequence[int]]

Description

The operator select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial chooses the regions from Regions2Regions2Regions2Regions2regions2regions_2 which are sufficient for the neighboring relation DirectionDirectionDirectionDirectiondirectiondirection. The regions to be examined have to be passed in Regions1Regions1Regions1Regions1regions1regions_1 or Regions2Regions2Regions2Regions2regions2regions_2, respectively. Regions1Regions1Regions1Regions1regions1regions_1 can have three different states:

Possible values for DirectionDirectionDirectionDirectiondirectiondirection are:

'left':

Regions2Regions2Regions2Regions2regions2regions_2 is left of Regions1Regions1Regions1Regions1regions1regions_1

'right':

Regions2Regions2Regions2Regions2regions2regions_2 is right of Regions1Regions1Regions1Regions1regions1regions_1

'above':

Regions2Regions2Regions2Regions2regions2regions_2 is above Regions1Regions1Regions1Regions1regions1regions_1

'below':

Regions2Regions2Regions2Regions2regions2regions_2 is below Regions1Regions1Regions1Regions1regions1regions_1

The operator select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial calculates the centers of the regions to be compared and decides according to the angle between the center straight lines and the x axis whether the direction relation is fulfilled. The relation is fulfilled within the area of -45 degree to +45 degree around the coordinate axes. Thus, the direction relation can be understood in such a way that the center of the second region must be located left (or right, above, below) of the center of the first region. The indices of the regions fulfilling the direction relation are located at the n-th position in RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1 and RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2, i.e., the region with the index RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2[n] has the indicated relation with the region with the index RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1[n]. Access to regions via the index can be obtained via the operator copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj.

Execution Information

Parameters

Regions1Regions1Regions1Regions1regions1regions_1 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Starting regions

Regions2Regions2Regions2Regions2regions2regions_2 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Comparative regions

DirectionDirectionDirectionDirectiondirectiondirection (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Desired neighboring relation.

Default value: 'left' "left" "left" "left" "left" "left"

List of values: 'above'"above""above""above""above""above", 'below'"below""below""below""below""below", 'left'"left""left""left""left""left", 'right'"right""right""right""right""right"

RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1 (output_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices in the input tuples (Regions1Regions1Regions1Regions1regions1regions_1 or Regions2Regions2Regions2Regions2regions2regions_2), respectively.

RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2 (output_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices in the input tuples (Regions1Regions1Regions1Regions1regions1regions_1 or Regions2Regions2Regions2Regions2regions2regions_2), respectively.

Result

The operator select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial returns the value TRUE if Regions2Regions2Regions2Regions2regions2regions_2 is not empty. The behavior in case of empty parameter Regions2Regions2Regions2Regions2regions2regions_2 (no input regions available) is set via the operator set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>). The behavior in case of empty region (the region is the empty set) is set via set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

Alternatives

area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, intersectionintersectionIntersectionIntersectionIntersectionintersection

See also

spatial_relationspatial_relationSpatialRelationSpatialRelationSpatialRelationspatial_relation, find_neighborsfind_neighborsFindNeighborsFindNeighborsFindNeighborsfind_neighbors, copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj, obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToIntegerobj_to_integer

Module

Foundation