Share

AcDbEntity::transformBy

C++

ACDBCORE2D_PORT ADESK_SEALED_VIRTUAL Acad::ErrorStatus transformBy(
    const AcGeMatrix3d& xform
);

Description

Function usage

This function provides a means by which AutoCAD and ObjectARX applications can ask the entity to apply a transformation matrix (xform) to itself.

Each entity class must implement this function, so restrictions on what types of transformations are supported are up to the implementer of the entity class. The AutoCAD built-in entity classes for entity types that existed before R13 (that is, all the classes listed in the header file dbents.h such as AcDbCircle, AcDbLine, AcDbArc, AcDb2dPolyline, etc.) require that the transformation matrix represent a uniformly scaling orthogonal transformation (if it is not, then Acad::eCannotScaleNonUniformly will be returned). Other AutoCAD built-in classes have no restrictions.

Returns Acad::eOk if successful. Return values for errors are implementation-dependent.

Function implementation in derived classes

This function must apply the transformation matrix xform to the entity and change the entity's state to reflect the transformation. It is completely up to the implementer as to how to apply the transformation. It is also up to the implementer to decide what, if any, restrictions will be placed on the type of transformations supported. If any restrictions are desired, then it's up to the implementation of this function to enforce them.

If your derived class implements transformBy() without calling the base class, you must call AcDbObject:: xDataTransformBy() or your Xdata will not be transformed.

If this function successfully transforms the entity, then it should return Acad::eOk.

Return values for error conditions are completely up to the implementer of this function. However, if the error is caused by a non-uniformly scaling or non-orthogonal matrix, then to be consistent with other entities that have this restriction, it is recommended that Acad::eCannotScaleNonUniformly be returned.

Note If this method is not overridden, then AutoCAD commands such as MOVE, ROTATE, SCALE, etc. will have no effect on entities of this class.

Default implementation

Calls assertWriteEnabled(Adesk::kFalse, Adesk::kFalse) and then returns Acad::eNotApplicable.

Parameters

Parameters Description
xform Input transformation matrix to be applied to the entity

Links

AcDbEntity

Was this information helpful?