CogCoordinateSpaceTree VerifyChild Method Cognex VisionPro
Return true if the given ChildSpaceName is a direct or indirect child of ParentSpaceName. Otherwise, return false. The formatted child name, or "", can be obtained through the optional FoundChildName argument.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Syntax

public bool VerifyChild(
	string parentSpaceName,
	string childSpaceName,
	CogSpaceTreePathnameConstants pathnameFormat,
	bool childrenOnly,
	out string foundChildName
)

Parameters

parentSpaceName
Type: System String

A valid nonqualified or fully-qualified name that indicates the parent space.

childSpaceName
Type: System String

A valid nonqualified or fully-qualified name that indicates the child space to verify.

pathnameFormat
Type: Cognex.VisionPro CogSpaceTreePathnameConstants

A CogSpaceTreePathnameConstants value that indicates how the returned name should be formatted.

childrenOnly
Type: System Boolean

If False, the parent space is considered a valid descendant of itself, which allows you to find space names that are at or descended from the given parent space name. If True, the parent space is not a valid descendant of itself.

foundChildName
Type: System String 

If VerifyChild(String, String, CogSpaceTreePathnameConstants, Boolean, String ) returns True, foundChildName contains the formatted child space name. Otherwise, it contains "".

Return Value

Type: Boolean

True if the given childSpaceName is a descendant of parentSpaceName; otherwise, False.

Exceptions

ExceptionCondition
ArgumentException

pathnameFormat value is not a member of CogSpaceTreePathnameConstants.

CogSpaceTreeInvalidNameSyntaxException

parentSpaceName or childSpaceName value is not a legal space name.

CogSpaceTreeNotUniqueException

parentSpaceName or childSpaceName is a nonqualified space name and more than one instance of it exists in this tree.

Remarks

Returns True if the given childSpaceName is a descendant of parentSpaceName. Otherwise, returns False. Both spaces must exist in the tree.

By default, a coordinate space is considered to be a child only if it is a descendant of the given parent space. In some applications, however, you may need to test whether a space is a descendant of the given parent or is the parent space itself. To do this, set the optional childrenOnly parameter to False.

See Also