Table of Contents

Class DynamicRotation

Namespace
Hi.Mech.Topo
Assembly
HiMech.dll

Dynamic rotate transformer.

public class DynamicRotation : IDynamicRotation, IDynamicRegular, IDynamicTransformer, ITransformer, IMakeXmlSource, IGetInverseTransformer, IToPresentDto
Inheritance
DynamicRotation
Implements
Derived
Inherited Members
Extension Methods

Constructors

DynamicRotation()

Ctor.

public DynamicRotation()

DynamicRotation(vec3d_t, double)

Ctor with the pivot at the origin.

public DynamicRotation(vec3d_t axis, double angle_rad = 0)

Parameters

axis vec3d_t

Axis

angle_rad double

Angle_rad

DynamicRotation(vec3d_t, double, vec3d_t)

Ctor.

public DynamicRotation(vec3d_t axis, double angle_rad, vec3d_t pivot)

Parameters

axis vec3d_t

Axis

angle_rad double

Angle_rad

pivot vec3d_t

Pivot

DynamicRotation(XElement)

Ctor.

public DynamicRotation(XElement src)

Parameters

src XElement

XML

Properties

Angle_deg

Rotation angle in degree.

public double Angle_deg { get; set; }

Property Value

double

Angle_rad

Rotation angle in radian: the object's own value, what the setters wrote (and a step batch mirrored). A view of the transformer – ToPresentDto(), MakeXmlSource(string, string, bool) – shows the bound branch's native step instead, and this value only while unbound.

public double Angle_rad { get; set; }

Property Value

double

Axis

Rotation axis.

public vec3d_t Axis { get; set; }

Property Value

vec3d_t

Remarks

A property (a whole-value write) since the topology core moved to native: the setter pushes the transformer to the Branch it is bound to — assign a new vec3d_t.

Pivot

pivot

public vec3d_t Pivot { get; set; }

Property Value

vec3d_t

Remarks

A property (a whole-value write) since the topology core moved to native; see Axis.

Step

Gets or sets the step.

public double Step { get; set; }

Property Value

double

The step.

XName

Static name.

public static string XName { get; }

Property Value

string

Methods

Clone()

Clones this instance.

public virtual ITransformer Clone()

Returns

ITransformer

clone

GetInverseTransformer()

Gets the inverse transformer of this transformer.

public ITransformer GetInverseTransformer()

Returns

ITransformer

The inverse transformer.

GetMat()

Gets the transform matrix.

public mat4d_t GetMat()

Returns

mat4d_t

The transform matrix.

GetMatInv()

Gets the inverse transform matrix.

public mat4d_t GetMatInv()

Returns

mat4d_t

The inverse transform matrix.

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public virtual XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if true, the extended file creation is suppressed.

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.

Reg(XFactory)

Registers this type's deserializer with the given XFactory (or Default when factory is null). Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory

Set(DynamicRotation)

Copy from src.

public void Set(DynamicRotation src)

Parameters

src DynamicRotation

src

ToPresentDto()

Convert DynamicRotation to presentation DTO (Data Transfer Object) for JSON serialization. The returned object includes type metadata for web API presentation. Angle_deg is the angle of the branch this transformer is bound to, read natively (ReadStepForView(ITransformer, double)): the truth a play or a step batch wrote past the object; the object's own Angle_rad only while unbound.

public object ToPresentDto()

Returns

object

DTO dictionary with Type, Axis, Angle_deg, and Pivot keys