Table of Contents

Method Transformby

Namespace
VectorDraw.Professional.vdPrimaries
Assembly
VectorDraw.Professional.dll

Transformby(Matrix)

Applies the supplied transformation mat to all geometric properties maintained by this figure. This base implementation updates properties that are common to all figures:

  • scales the figure's PenWidth by the matrix XY scale,
  • delegates the matrix to any extended properties collection (mXProperties),
  • and calls Update() to invalidate cached geometry (bounding box, grip points, rendering lists) so they will be recalculated.

Derived classes that override Transformby(Matrix) should perform any type-specific geometric transformations and must call the base implementation (typically at the end) to preserve the common behaviour documented above.

public virtual void Transformby(Matrix mat)

Parameters

mat Matrix

The transformation Matrix to apply. Must not be null. The matrix's Properties are used to compute scale and rotation values that affect properties such as PenWidth.

Examples

// Example override preserving base behaviour:

public override void Transformby(Matrix mat)
{
    // apply custom transforms here
    base.Transformby(mat); // ensures PenWidth, mXProperties and Update() are handled
}

See also IvdProxyFigure for example of implementing a custom figure with a proxy figure and how to override basic methods of vdFigure for a custom figure.

Remarks

Calling this method modifies the figure's internal state and causes recalculation of dependent values (for example the figure's bounding box). After this call the figure is considered changed and any cached render lists are invalidated by the subsequent Update() call.

Note: this method does not guard against a null mat; callers should ensure a valid matrix is provided. If a null matrix is passed, a ArgumentNullException is thrown by attempting to access mat.Properties.

Exceptions

ArgumentNullException

Thrown when mat is null.