CoordinateSpaceTree 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.Vision
Assembly: Cognex.Vision.Core.Net (in Cognex.Vision.Core.Net.dll) Version: 9.10.0.0
Syntax

public void AddTree(
	string parentSpaceName,
	CoordinateSpaceTree treeToAdd,
	ITransform2D parentFromTreeRoot,
	bool copyTransform,
	AddSpaceConstants duplicateHandling
)

Parameters

parentSpaceName
Type: System String
A valid nonqualified or fully-qualified space name that indicates the parent space.
treeToAdd
Type: Cognex.Vision CoordinateSpaceTree
The coordinate space tree to add to the given parentSpaceName.
parentFromTreeRoot
Type: Cognex.Vision ITransform2D
An ITransform2D that transforms points from the root of the space tree you are adding to the parent space.
copyTransform
Type: System Boolean
If True, CoordinateSpaceTree adds a copy of the transform to the tree; if False, a reference to the transform is added. . defaults to True.
duplicateHandling
Type: Cognex.Vision AddSpaceConstants
A AddSpaceConstants 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
ArgumentExceptiontreeToAdd or parentFromTreeRoot is NULL.
ArgumentExceptionduplicateHandling value is not a member of AddSpaceConstants.
SpaceTreeExceptionNewSpaceName is a child of the parent space andduplicateHandling is set to DuplicateIsError.
SpaceTreeExceptionparentSpaceName value is not a legal space name.
SpaceTreeExceptionparentSpaceName is a nonqualified space name and more than one instance of it exists in this tree.
Remarks

TreeAdded Raised when a tree is added to 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 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