select_region_spatialT_select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial (Operator)
Name
select_region_spatialT_select_region_spatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial
— Pose relation of regions.
Signature
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)
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'"left""left""left""left""left":
Regions2Regions2Regions2Regions2regions2regions_2
is left of
Regions1Regions1Regions1Regions1regions1regions_1
- 'right'"right""right""right""right""right":
Regions2Regions2Regions2Regions2regions2regions_2
is right of
Regions1Regions1Regions1Regions1regions1regions_1
- 'above'"above""above""above""above""above":
Regions2Regions2Regions2Regions2regions2regions_2
is above
Regions1Regions1Regions1Regions1regions1regions_1
- 'below'"below""below""below""below""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
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
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"
Result
The operator select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial
returns the value 2 (H_MSG_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