跳到主要内容
版本:v10.0

M3D / M3D / Actions / TransformAction

Class: TransformAction

M3D.Actions.TransformAction

Memberof

M3D.Actions

Description

变换动作类

Author

YW

Date

2022-5-17

Copyright

All Rights Reserved. Copyright (C) 2022 HOTEAMSOFT, Ltd

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new TransformAction(): TransformAction

Returns

TransformAction

Description

构造函数

Inherited from

Action.constructor

Properties

id

id: number

Inherited from

Action.id


count

Static count: number

Inherited from

Action.count

Methods

execute

execute(): ActionState

Returns

ActionState

Description

执行Action

Inherited from

Action.execute


getEvents

getEvents(): M3DEvent[]

Returns

M3DEvent[]

Description

获得事件列表

Inherited from

Action.getEvents


getId

getId(): number

Returns

number

Description

获取id

Inherited from

Action.getId


registerEvent

registerEvent(event): void

Parameters

NameTypeDescription
eventM3DEventM3D事件

Returns

void

Description

注册事件

Inherited from

Action.registerEvent


removeEvent

removeEvent(): void

Returns

void

Description

删除事件

Inherited from

Action.removeEvent


setId

setId(v): void

Parameters

NameTypeDescription
vnumberShapeId

Returns

void

Description

设置id

Inherited from

Action.setId


rotate

rotate(model, quaternion): any

Parameters

NameTypeDescription
modelModel需要旋转的模型
quaternionQuaternion需要旋转的角度以及坐标轴形成的四元数对象

Returns

any

Description

旋转模型(待实现)

rotate(viewport, model, angle, axisType, axis): any

Parameters

NameTypeDescription
viewportViewport旋转模型所在的视口对象
modelModel需要旋转的模型
anglenumber需要旋转的角度
axisTypenumber需要旋转的坐标轴类型,0为绕X轴旋转,1为绕Y轴旋转,2为绕Z轴旋转,3为绕中心旋转
axisVector3旋转的坐标轴

Returns

any

Description

旋转模型(待实现)


scale

scale(model, scale): void

Parameters

NameTypeDescription
modelModel需要缩放的模型
scaleVector3缩放比例以及方向

Returns

void

Description

缩放模型(待实现)


translate

translate(model, direction): void

Parameters

NameTypeDescription
modelModel需要平移的模型对象(待实现)
directionVector3需要平移的方向以及距离

Returns

void

Description

平移模型