ClassesClasses | | Operators

select_region_spatialT_select_region_spatialSelectRegionSpatialSelectRegionSpatial (Operator)

Name

select_region_spatialT_select_region_spatialSelectRegionSpatialSelectRegionSpatial — 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

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)

Description

The operator select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatial chooses the regions from Regions2Regions2Regions2Regions2regions2 which are sufficient for the neighboring relation DirectionDirectionDirectionDirectiondirection. The regions to be examined have to be passed in Regions1Regions1Regions1Regions1regions1 or Regions2Regions2Regions2Regions2regions2, respectively. Regions1Regions1Regions1Regions1regions1 can have three different states:

Possible values for DirectionDirectionDirectionDirectiondirection are:

'left':

Regions2Regions2Regions2Regions2regions2 is left of Regions1Regions1Regions1Regions1regions1

'right':

Regions2Regions2Regions2Regions2regions2 is right of Regions1Regions1Regions1Regions1regions1

'above':

Regions2Regions2Regions2Regions2regions2 is above Regions1Regions1Regions1Regions1regions1

'below':

Regions2Regions2Regions2Regions2regions2 is below Regions1Regions1Regions1Regions1regions1

The operator select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatial 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 RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1 and RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2, i.e., the region with the index RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2[n] has the indicated relation with the region with the index RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1[n]. Access to regions via the index can be obtained via the operator copy_objcopy_objCopyObjCopyObjCopyObj.

Execution Information

Parameters

Regions1Regions1Regions1Regions1regions1 (input_object)  region(-array) objectHRegionHRegionHobject

Starting regions

Regions2Regions2Regions2Regions2regions2 (input_object)  region(-array) objectHRegionHRegionHobject

Comparative regions

DirectionDirectionDirectionDirectiondirection (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Desired neighboring relation.

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

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

RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1 (output_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices in the input tuples (Regions1Regions1Regions1Regions1regions1 or Regions2Regions2Regions2Regions2regions2), respectively.

RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2 (output_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices in the input tuples (Regions1Regions1Regions1Regions1regions1 or Regions2Regions2Regions2Regions2regions2), respectively.

Result

The operator select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatial returns the value 2 (H_MSG_TRUE) if Regions2Regions2Regions2Regions2regions2 is not empty. The behavior in case of empty parameter Regions2Regions2Regions2Regions2regions2 (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>). 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>). If necessary an exception is raised.

Possible Predecessors

thresholdthresholdThresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionConnectionConnection

Alternatives

area_centerarea_centerAreaCenterAreaCenterAreaCenter, intersectionintersectionIntersectionIntersectionIntersection

See also

spatial_relationspatial_relationSpatialRelationSpatialRelationSpatialRelation, find_neighborsfind_neighborsFindNeighborsFindNeighborsFindNeighbors, copy_objcopy_objCopyObjCopyObjCopyObj, obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToInteger

Module

Foundation


ClassesClasses | | Operators