CogCoordinateSpaceTree AddTree Method Cognex VisionPro 9.20
Add a tree of coordinate spaces to the given ParentSpaceName of this tree using the supplied ParentFromTreeRoot transform. The tree is added by reference, so any changes to it will be visible to clients of both trees.

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

public void AddTree(
	string parentSpaceName,
	CogCoordinateSpaceTree treeToAdd,
	ICogTransform2D parentFromTreeRoot,
	bool copyTransform,
	CogAddSpaceConstants duplicateHandling
)

Parameters

parentSpaceName
Type: System String

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

treeToAdd
Type: Cognex.VisionPro CogCoordinateSpaceTree

The coordinate space tree to add to the given parentSpaceName.

parentFromTreeRoot
Type: Cognex.VisionPro ICogTransform2D

An CogTransform2D that transforms points from the root of the space tree you are adding to the parent space.

copyTransform
Type: System Boolean

If True, CogCoordinateSpaceTree adds a copy of the transform to the tree; if False, a reference to the transform is added. . defaults to True.

duplicateHandling
Type: Cognex.VisionPro CogAddSpaceConstants

A CogAddSpaceConstants value that specifies what do if the parent coordinate space already contains an immediate child with the same name as the root of treeToAdd. The options are to return an error, replace the named child with the given tree, or do nothing.. defaults to DuplicateIsError: it treats a duplicate as an error.

Exceptions

ExceptionCondition
ArgumentException

treeToAdd or parentFromTreeRoot is NULL.

ArgumentException

duplicateHandling value is not a member of CogAddSpaceConstants.

CogSpaceTreeDuplicateChildNameException

NewSpaceName is a child of the parent space andduplicateHandling is set to DuplicateIsError.

CogSpaceTreeInvalidNameSyntaxException

parentSpaceName value is not a legal space name.

CogSpaceTreeNotUniqueException

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

Remarks

Adds a tree of coordinate spaces to the given parent space name of this tree. You must also supply a transformation that defines the relationship between the parent space and the root of the new spaces.

By default, AddTree(String, CogCoordinateSpaceTree, ICogTransform2D, Boolean, CogAddSpaceConstants) saves a copy of the supplied transform. You can also add the transform by-reference. Although this is more efficient, it may result in errors for users who unknowingly continue to modify the original transform object.

Trees are added by-reference. If you copy the parent tree, the copy contains an additional reference to the supplied tree. You must avoid creating new trees that contain circular references to other coordinate space trees.

See Also