AnyCAD Rapid API 2026
Help you to create a better world!
载入中...
搜索中...
未找到
AnyCAD.Foundation.DraggableWidget类 参考

可拖拽控件基类 更多...

类 AnyCAD.Foundation.DraggableWidget 继承关系图:
AnyCAD.Foundation.GeneralSceneNode AnyCAD.Foundation.SceneNode AnyCAD.Foundation.GfxObject AnyCAD.Foundation.FrameWidget AnyCAD.Foundation.MoveWidget AnyCAD.Foundation.RotateWidget AnyCAD.Foundation.ScaleWidget AnyCAD.Foundation.TransformWidget

Public 成员函数

 DraggableWidget (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
new string GetName ()
 
new void SetName (string val)
 
ulong GetDragGrip ()
 
Vector3d GetDragPosition ()
 
Matrix4d GetStartFrame ()
 
void SetStartFrame (Matrix4d val)
 
Matrix4d GetTargetFrame ()
 
double GetScaleFactor ()
 
void SetScaleFactor (double val)
 
bool GetDragGripLocked ()
 
Vector3d GetPosition ()
 获取控件位置
 
virtual void BeforeRendering (ViewContext ctx)
 渲染前回调
 
bool OnMouseDown (ViewContext ctx, InputEvent evt)
 鼠标按下事件处理
 
bool OnMouseUp (ViewContext ctx, InputEvent evt)
 鼠标释放事件处理
 
bool OnMouseMove (ViewContext ctx, InputEvent evt)
 鼠标移动事件处理
 
virtual void SetDragGrip (ulong id)
 设置拖拽夹点
 
virtual bool BeginDrag ()
 开始拖拽
 
virtual bool Dragging (Ray pick)
 拖拽中
 
virtual void EndDrag ()
 结束拖拽
 
- Public 成员函数 继承自 AnyCAD.Foundation.GeneralSceneNode
 GeneralSceneNode (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
 GeneralSceneNode ()
 构造函数
 
virtual bool IsDocumentNode ()
 判断是否为文档节点
 
- Public 成员函数 继承自 AnyCAD.Foundation.SceneNode
 SceneNode (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
string GetName ()
 
void SetName (string val)
 
ulong GetUserId ()
 
void SetUserId (ulong val)
 
ulong GetParentId ()
 
void SetParentId (ulong val)
 
Matrix4d GetTransform ()
 
AABox GetBoundingBox ()
 
void SetBoundingBox (AABox val)
 
Matrix4d GetWorldTransform ()
 
AABox GetWorldBBox ()
 
uint GetState ()
 
SceneNode GetParent ()
 
void SetParent (SceneNode val)
 
float GetPickOrder ()
 
void SetPickOrder (float val)
 
uint GetUpdateVersion ()
 
void SetUpdateVersion (uint val)
 
MaterialInstance GetOverrideFaceMaterial ()
 
void SetOverrideFaceMaterial (MaterialInstance val)
 
MaterialInstance GetOverrideEdgeMaterial ()
 
void SetOverrideEdgeMaterial (MaterialInstance val)
 
bool GetCastShadow ()
 是否投射阴影
 
void SetCastShadow (bool bEnabled)
 设置投射阴影
 
bool GetPickable ()
 是否可被选
 
void SetPickable (bool bEnabled)
 设置是否可选
 
bool GetPickByBox ()
 是否用包围盒选择,粗选(InfiniteSize对象始终用包围盒选择)
 
void SetPickByBox (bool bEnabled)
 设置是否选择包围盒就算选中,不精确选择
 
bool GetCulling ()
 是否参与场景剔除
 
void SetCulling (bool bEnabled)
 设置是否可被剔除
 
bool GetVisible ()
 是否可见
 
void SetVisible (bool bEnabled)
 设置可见性
 
bool GetChildrenPickable ()
 子节点是否可选
 
void SetChildrenPickable (bool bEnabled)
 设置子节点是否可选
 
bool GetContainer ()
 是否为根节点容器
 
void SetContainer (bool bEnabled)
 设置是否为根节点容器
 
bool GetFixedSize ()
 是否屏幕固定大小,不随相机缩放而缩放
 
void SetFixedSize (bool bEnabled)
 设置相对屏幕显示固定大小
 
void SetFixedSizeByShader (bool bEnabled)
 设置相对屏幕显示固定大小
 
bool GetFixedSizeByShader ()
 是否屏幕固定大小,不随相机缩放而缩放
 
bool GetInfiniteSize ()
 设置是否为无限大,无限大则不影响场景包围盒大小。
 
void SetInfiniteSize (bool bEnabled)
 设置是否为无限大
 
bool GetPhysics ()
 是否参与物理引擎计算。默认为否
 
void SetPhysics (bool bEnabled)
 设置是否参与物理计算。
 
void SetTransform (Matrix4d trf)
 设置变换矩阵。覆盖之前的矩阵
 
SceneNode GetRootNode ()
 
virtual SceneNode Clone ()
 
void RequestUpdate ()
 请求更新
 
void AddTransform (Matrix4d trf)
 multiply the transform to the existing one
 
void SetWorldTransform (Matrix4d world)
 
virtual void UpdateTransform (Matrix4d parent)
 Update the local transform.
 
virtual AABox ComputeBoundingBox (Matrix4d parent)
 
bool IsVisiblePath ()
 
- Public 成员函数 继承自 AnyCAD.Foundation.GfxObject
 GfxObject (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
void Dispose ()
 
uint GetUuid ()
 

静态 Public 成员函数

static new DraggableWidget Cast (GfxObject obj)
 
- 静态 Public 成员函数 继承自 AnyCAD.Foundation.GeneralSceneNode
static new GeneralSceneNode Cast (GfxObject obj)
 
- 静态 Public 成员函数 继承自 AnyCAD.Foundation.SceneNode
static SceneNode Cast (GfxObject obj)
 

详细描述

可拖拽控件基类

提供交互式拖拽功能的基础控件,支持鼠标事件处理和拖拽状态管理。 所有变换控件(移动、旋转、缩放)都继承自此类。

成员函数说明

◆ BeforeRendering()

virtual void AnyCAD.Foundation.DraggableWidget.BeforeRendering ( ViewContext ctx)
virtual

渲染前回调

参数
ctx视图上下文

更新控件的显示状态

AnyCAD.Foundation.MoveWidget , 以及 AnyCAD.Foundation.ScaleWidget 重载.

◆ BeginDrag()

virtual bool AnyCAD.Foundation.DraggableWidget.BeginDrag ( )
virtual

开始拖拽

返回
true 表示成功开始拖拽

记录初始状态,准备拖拽操作

AnyCAD.Foundation.MoveWidget, AnyCAD.Foundation.RotateWidget, AnyCAD.Foundation.ScaleWidget , 以及 AnyCAD.Foundation.TransformWidget 重载.

◆ Dragging()

virtual bool AnyCAD.Foundation.DraggableWidget.Dragging ( Ray pick)
virtual

拖拽中

参数
pick拾取射线
返回
true 表示拖拽成功

根据射线与控件的交点计算新的变换

AnyCAD.Foundation.MoveWidget, AnyCAD.Foundation.RotateWidget, AnyCAD.Foundation.ScaleWidget , 以及 AnyCAD.Foundation.TransformWidget 重载.

◆ EndDrag()

virtual void AnyCAD.Foundation.DraggableWidget.EndDrag ( )
virtual

◆ GetPosition()

Vector3d AnyCAD.Foundation.DraggableWidget.GetPosition ( )

获取控件位置

返回
返回世界坐标位置

◆ OnMouseDown()

bool AnyCAD.Foundation.DraggableWidget.OnMouseDown ( ViewContext ctx,
InputEvent evt )

鼠标按下事件处理

参数
ctx视图上下文
evt输入事件
返回
true 表示事件已处理

◆ OnMouseMove()

bool AnyCAD.Foundation.DraggableWidget.OnMouseMove ( ViewContext ctx,
InputEvent evt )

鼠标移动事件处理

参数
ctx视图上下文
evt输入事件
返回
true 表示事件已处理

◆ OnMouseUp()

bool AnyCAD.Foundation.DraggableWidget.OnMouseUp ( ViewContext ctx,
InputEvent evt )

鼠标释放事件处理

参数
ctx视图上下文
evt输入事件
返回
true 表示事件已处理

◆ SetDragGrip()

virtual void AnyCAD.Foundation.DraggableWidget.SetDragGrip ( ulong id)
virtual

设置拖拽夹点

参数
id夹点ID

标记当前激活的控制手柄

AnyCAD.Foundation.MoveWidget, AnyCAD.Foundation.RotateWidget, AnyCAD.Foundation.ScaleWidget , 以及 AnyCAD.Foundation.TransformWidget 重载.