This function creates a clone of the entity, applies the transform transformation matrix to the clone, and then returns the transformed clone.
Warning For AutoCAD built-in complex entities such as polylines, this function produces a shallow clone of the header entity only, which also owns the original set of "owned" entities (such as vertices for a polyline) which are then transformed by the transform matrix. This results in a corrupt drawing (two header entities owning the same set of "owned" entities) as well as transforming the original set of "owned" entities instead of a copied set.
Function implementation in derived classes
The default Entity implementation of this function should be adequate for most derived entity types. However, derived entity classes that wish to support non-uniform scaling or non-orthogonal transformations will need to override this method with their own implementation.
This function must create a copy of the entity (using memory that has been dynamically allocated), apply the transformation matrix transform to the copy and then return the transformed copy.
Determining what constitutes a valid transformation matrix and whether to do a shallow clone (that is, the entity's clone() method), a deepclone (if the entity owns other objects), or no clone at all (that is, make this function a no-op), is up to the implementer.
Default implementation
If the entity is uniformly scaled and orthogonal, Entity.GetTransformedCopy will call the entity's clone() method to create a clone of the entity, then call Entity.TransformBy() on the clone, and then return the transformed clone.
Public Function GetTransformedCopy( transform As Matrix3d ) As Entity
public Entity GetTransformedCopy( Matrix3d transform );
Parameters |
Description |
Matrix3d transform |
Input matrix by which to transform the copy of the entity |
Comments? |