replace_objreplace_objReplaceObjReplaceObjreplace_obj (算子)
名称
replace_objreplace_objReplaceObjReplaceObjreplace_obj — 替换图标对象元组的一个或多个元素。
签名
void ReplaceObj(const HObject& Objects, const HObject& ObjectsReplace, HObject* Replaced, const HTuple& Index)
HObject HObject::ReplaceObj(const HObject& ObjectsReplace, const HTuple& Index) const
HObject HObject::ReplaceObj(const HObject& ObjectsReplace, Hlong Index) const
HImage HImage::ReplaceObj(const HImage& ObjectsReplace, const HTuple& Index) const
HImage HImage::ReplaceObj(const HImage& ObjectsReplace, Hlong Index) const
HRegion HRegion::ReplaceObj(const HRegion& ObjectsReplace, const HTuple& Index) const
HRegion HRegion::ReplaceObj(const HRegion& ObjectsReplace, Hlong Index) const
HXLD HXLD::ReplaceObj(const HXLD& ObjectsReplace, const HTuple& Index) const
HXLD HXLD::ReplaceObj(const HXLD& ObjectsReplace, Hlong Index) const
HXLDCont HXLDCont::ReplaceObj(const HXLDCont& ObjectsReplace, const HTuple& Index) const
HXLDCont HXLDCont::ReplaceObj(const HXLDCont& ObjectsReplace, Hlong Index) const
HXLDPoly HXLDPoly::ReplaceObj(const HXLDPoly& ObjectsReplace, const HTuple& Index) const
HXLDPoly HXLDPoly::ReplaceObj(const HXLDPoly& ObjectsReplace, Hlong Index) const
HXLDPara HXLDPara::ReplaceObj(const HXLDPara& ObjectsReplace, const HTuple& Index) const
HXLDPara HXLDPara::ReplaceObj(const HXLDPara& ObjectsReplace, Hlong Index) const
HXLDModPara HXLDModPara::ReplaceObj(const HXLDModPara& ObjectsReplace, const HTuple& Index) const
HXLDModPara HXLDModPara::ReplaceObj(const HXLDModPara& ObjectsReplace, Hlong Index) const
HXLDExtPara HXLDExtPara::ReplaceObj(const HXLDExtPara& ObjectsReplace, const HTuple& Index) const
HXLDExtPara HXLDExtPara::ReplaceObj(const HXLDExtPara& ObjectsReplace, Hlong Index) const
static void HOperatorSet.ReplaceObj(HObject objects, HObject objectsReplace, out HObject replaced, HTuple index)
HObject HObject.ReplaceObj(HObject objectsReplace, HTuple index)
HObject HObject.ReplaceObj(HObject objectsReplace, int index)
HImage HImage.ReplaceObj(HImage objectsReplace, HTuple index)
HImage HImage.ReplaceObj(HImage objectsReplace, int index)
HRegion HRegion.ReplaceObj(HRegion objectsReplace, HTuple index)
HRegion HRegion.ReplaceObj(HRegion objectsReplace, int index)
HXLD HXLD.ReplaceObj(HXLD objectsReplace, HTuple index)
HXLD HXLD.ReplaceObj(HXLD objectsReplace, int index)
HXLDCont HXLDCont.ReplaceObj(HXLDCont objectsReplace, HTuple index)
HXLDCont HXLDCont.ReplaceObj(HXLDCont objectsReplace, int index)
HXLDPoly HXLDPoly.ReplaceObj(HXLDPoly objectsReplace, HTuple index)
HXLDPoly HXLDPoly.ReplaceObj(HXLDPoly objectsReplace, int index)
HXLDPara HXLDPara.ReplaceObj(HXLDPara objectsReplace, HTuple index)
HXLDPara HXLDPara.ReplaceObj(HXLDPara objectsReplace, int index)
HXLDModPara HXLDModPara.ReplaceObj(HXLDModPara objectsReplace, HTuple index)
HXLDModPara HXLDModPara.ReplaceObj(HXLDModPara objectsReplace, int index)
HXLDExtPara HXLDExtPara.ReplaceObj(HXLDExtPara objectsReplace, HTuple index)
HXLDExtPara HXLDExtPara.ReplaceObj(HXLDExtPara objectsReplace, int index)
描述
replace_objreplace_objReplaceObjReplaceObjReplaceObjreplace_obj replaces one or more elements of the
iconic input tuple ObjectsObjectsObjectsObjectsobjectsobjects and returns them with ReplacedReplacedReplacedReplacedreplacedreplaced.
At this, IndexIndexIndexIndexindexindex determines the indices of the elements
and ObjectsReplaceObjectsReplaceObjectsReplaceObjectsReplaceobjectsReplaceobjects_replace the corresponding objects to replace.
The parameter IndexIndexIndexIndexindexindex must contain one or more integer values
(any floating point number must represent an integer value without
fraction). Indices of iconic object elements start at 1.
If ObjectsReplaceObjectsReplaceObjectsReplaceObjectsReplaceobjectsReplaceobjects_replace contains only
one value, this value will be replaced at all indices of IndexIndexIndexIndexindexindex.
If a value of IndexIndexIndexIndexindexindex is greater than the length of the iconic input
object tuple ObjectsObjectsObjectsObjectsobjectsobjects, ReplacedReplacedReplacedReplacedreplacedreplaced will be extended
accordingly and initialized with empty regions.
Exception: Empty input object
If either IndexIndexIndexIndexindexindex or ObjectsReplaceObjectsReplaceObjectsReplaceObjectsReplaceobjectsReplaceobjects_replace is empty and the other is
not, an exception is raised. If both are empty, the output object tuple
ReplacedReplacedReplacedReplacedreplacedreplaced corresponds to the input ObjectsObjectsObjectsObjectsobjectsobjects. If both are not
empty, but the input ObjectsObjectsObjectsObjectsobjectsobjects is, the empty object will be
extended as described above.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
ObjectsObjectsObjectsObjectsobjectsobjects (输入对象) object(-array) → objectHObjectHObjectHObjectHobject
Iconic Input Object.
ObjectsReplaceObjectsReplaceObjectsReplaceObjectsReplaceobjectsReplaceobjects_replace (输入对象) object(-array) → objectHObjectHObjectHObjectHobject
Element(s) to replace.
ReplacedReplacedReplacedReplacedreplacedreplaced (输出对象) object(-array) → objectHObjectHObjectHObjectHobject *
Tuple with replaced elements.
IndexIndexIndexIndexindexindex (输入控制) number(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index/Indices of elements to be replaced.
示例(HDevelop)
gen_empty_obj (Images)
for Index := 1 to 10 by 1
gen_image_const (Image, 'byte', Index, Index)
concat_obj (Images, Image, Images)
endfor
gen_empty_obj (Replace)
replace_obj (Images, Replace, Images, 1)
替代
select_objselect_objSelectObjSelectObjSelectObjselect_obj
另见
count_objcount_objCountObjCountObjCountObjcount_obj,
select_objselect_objSelectObjSelectObjSelectObjselect_obj,
copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj,
insert_objinsert_objInsertObjInsertObjInsertObjinsert_obj
模块
基础