|
AnyCAD Rapid API 2026
Help you to create a better world!
|
渲染视图的基类 更多...
Public 成员函数 | |||
| Viewer (global::System.IntPtr cPtr, bool cMemoryOwn) | |||
| 仅供内部使用 | |||
| void | Dispose () | ||
| uint | GetUuid () | ||
| uint | GetWidth () | ||
| uint | GetHeight () | ||
| float | GetZoomFactor () | ||
| void | SetZoomFactor (float val) | ||
| float | GetFPS () | ||
| void | SetFPS (float val) | ||
| bool | GetViewMode2D () | ||
| void | SetViewMode2D (bool val) | ||
| CameraDriver | GetCameraDriver () | ||
| void | SetCameraDriver (CameraDriver val) | ||
| bool | GetCursorUpdatable () | ||
| void | SetCursorUpdatable (bool val) | ||
| virtual void | Destroy () | ||
| 内部方法。释放资源 | |||
| void | Clear () | ||
| 清空场景 | |||
| void | SetDocument (Document doc) | ||
| 设置关联的文档 | |||
| Document | GetDocument () | ||
| 获取文档对象 | |||
| void | SetViewId (ObjectId viewId) | ||
| 设置View的Id | |||
| ObjectId | GetViewId () | ||
| 获取View的ID | |||
| void | PushEditMode (string name, Editor editor) | ||
| 设置编辑模式, editor作为默认的编辑器 | |||
| bool | PopEditMode () | ||
| EditMode出栈。 | |||
| void | InternalPushEditor (Editor editor, bool bClearOld) | ||
| 内部方法,禁止调用 | |||
| Editor | GetEditor () | ||
| 得到Editor | |||
| void | ClearEditor () | ||
| 清空设置的编辑器。 | |||
| virtual float | GetTimeTicks () | ||
| 获取时间间隔 | |||
| virtual void | OnTime (float timeTick) | ||
| 时间事件处理。 | |||
| virtual void | Run (GuiRenderer gui) | ||
| 以模态运行。循环执行,直至程序退出。仅在独立窗口模式下调用 | |||
| virtual bool | ProcessEvent (GuiRenderer gui) | ||
| 处理消息。。仅在独立窗口模式下调用 | |||
| EnumRedrawResult | Redraw (float timeTick, bool force) | ||
| 绘制画面 | |||
| EnumRedrawResult | Redraw (float timeTick) | ||
| 绘制画面 | |||
| void | RequestUpdate (EnumUpdateFlags flag) | ||
| 请求更新视图 | |||
| ViewContext | GetContext () | ||
| 获取视图上下文。 | |||
| RenderSettings | GetRenderSettings () | ||
| 获取渲染器设置 | |||
| void | ZoomToExtend (float ratio) | ||
| 缩放视图适应窗口 | |||
| void | ZoomToExtend () | ||
| 缩放视图适应窗口 | |||
| void | ZoomToBox (AABox bbox, float ratio) | ||
| 缩放到指定的包围盒 | |||
| void | ZoomToBox (AABox bbox) | ||
| 缩放到指定的包围盒 | |||
| virtual ScreenShot | CreateScreenShot () | ||
| 创建屏幕截图 | |||
| void | SetBackgroundColor (Vector4 clr) | ||
| 设置背景颜色 | |||
| void | SetBackground (Background background) | ||
| 设置背景对象。 | |||
| Background | GetBackground () | ||
| 获取当前的背景对象 | |||
| void | SetCoordinateGrid (CoordinateGridWidget grid) | ||
| 设置工作轴网 | |||
| CoordinateGridWidget | GetCoordinateGrid () | ||
| 获取轴网组件 | |||
| void | ShowCoordinateGrid (bool bShow) | ||
| 设置轴网可见性 | |||
| void | SetWorkingPlane (GAx2 ax) | ||
| 设置工作平面坐标系 | |||
| GAx2 | GetWorkingPlane () | ||
| 获取工作平面坐标系 | |||
| Vector3 | ScreenPointToWorldPoint (uint x, uint y, float z) | ||
| 屏幕坐标转换成三维世界坐标 | |||
| Vector3 | WorldPointToSceenPoint (Vector3 pt) | ||
| 三维世界坐标转换成二维的屏幕坐标 | |||
| Ray | WindowPointToRay (uint x, uint y) | ||
| 窗口的坐标转换成射线 | |||
| void | SetStandardView (EnumStandardView view, bool bAnimation) | ||
| 以标准视角设置相机方向 | |||
| void | SetStandardView (EnumStandardView view) | ||
| 以标准视角设置相机方向 | |||
| void | LookAt (Vector3 target, Vector3 dir, Vector3 up, bool bAnimation) | ||
| 设置相机方向 | |||
| void | ReloadSettings () | ||
| virtual void | OnResized (uint width, uint height) | ||
| 窗口大小变化后调用. | |||
| void | OnDocumentChanged (DocumentEventArgs args) | ||
| 文档有更新时调用 | |||
| void | OnMouseDown (InputEvent evt) | ||
| 处理鼠标按下消息 | |||
| void | OnMouseUp (InputEvent evt) | ||
| 处理鼠标松开消息 | |||
| void | OnMouseMove (InputEvent evt) | ||
| 处理鼠标移动消息 | |||
| void | OnMultiTouch (MultiTouchEvent evt) | ||
| void | OnBeginMultiTouch (MultiTouchEvent evt) | ||
| void | OnEndMultiTouch (MultiTouchEvent evt) | ||
| void | OnMouseWheel (InputEvent evt, int delta) | ||
| |||
| void | OnKeyDown (InputEvent evt) | ||
| 处理键盘按下消息 | |||
| void | OnKeyUp (InputEvent evt) | ||
| 处理键盘松开消息 | |||
| void | OnInput (ParameterDict parameters) | ||
| 处理用户输入消息 | |||
| bool | OnEditorAction (string name, ParameterDict parameters) | ||
| 执行Editor的动作 | |||
| virtual void | ResizeWindow (uint width, uint height) | ||
| 设置窗口大小 | |||
| virtual void | InstallEventHandlers () | ||
| 内部方法。设置事件处理器 | |||
| virtual FloatList | ReadDepthBuffer (uint posX, uint posY, uint width, uint height) | ||
| 内部方法 | |||
| virtual bool | WndProc (long hWnd, int msg, ulong wparam, long lparam) | ||
| 内部方法 | |||
| virtual void | OnDeviceLost (long hParent) | ||
| 内部方法 | |||
| void | SetCursor (Cursor cursor) | ||
| 设置自定义光标 | |||
静态 Public 成员函数 | |
| static void | SetZoomFacotr (float zoomOut, float zoomIn) |
渲染视图的基类
三维渲染视图 Group: Rendering
|
virtual |
创建屏幕截图
| Background AnyCAD.Foundation.Viewer.GetBackground | ( | ) |
获取当前的背景对象
| ViewContext AnyCAD.Foundation.Viewer.GetContext | ( | ) |
获取视图上下文。
| CoordinateGridWidget AnyCAD.Foundation.Viewer.GetCoordinateGrid | ( | ) |
获取轴网组件
| Document AnyCAD.Foundation.Viewer.GetDocument | ( | ) |
获取文档对象
| Editor AnyCAD.Foundation.Viewer.GetEditor | ( | ) |
得到Editor
| RenderSettings AnyCAD.Foundation.Viewer.GetRenderSettings | ( | ) |
获取渲染器设置
|
virtual |
获取时间间隔
| ObjectId AnyCAD.Foundation.Viewer.GetViewId | ( | ) |
获取View的ID
| GAx2 AnyCAD.Foundation.Viewer.GetWorkingPlane | ( | ) |
获取工作平面坐标系
| void AnyCAD.Foundation.Viewer.InternalPushEditor | ( | Editor | editor, |
| bool | bClearOld ) |
内部方法,禁止调用
| editor | 编辑器 |
| bClearOld | 是否清空 |
设置相机方向
| target | 目标位置 |
| dir | 方向 |
| up | Z朝向 |
| bAnimation | 是否启用动画方式 |
|
virtual |
内部方法
| hParent |
| void AnyCAD.Foundation.Viewer.OnDocumentChanged | ( | DocumentEventArgs | args | ) |
文档有更新时调用
| args | Document事件参数 |
| bool AnyCAD.Foundation.Viewer.OnEditorAction | ( | string | name, |
| ParameterDict | parameters ) |
执行Editor的动作
| name | 名称 |
| parameters | 参数 |
| void AnyCAD.Foundation.Viewer.OnInput | ( | ParameterDict | parameters | ) |
处理用户输入消息
| parameters | 参数 |
| void AnyCAD.Foundation.Viewer.OnKeyDown | ( | InputEvent | evt | ) |
处理键盘按下消息
| evt | 参数 |
| void AnyCAD.Foundation.Viewer.OnKeyUp | ( | InputEvent | evt | ) |
处理键盘松开消息
| evt | 参数 |
| void AnyCAD.Foundation.Viewer.OnMouseDown | ( | InputEvent | evt | ) |
处理鼠标按下消息
| evt | 参数 |
| void AnyCAD.Foundation.Viewer.OnMouseMove | ( | InputEvent | evt | ) |
处理鼠标移动消息
| evt | 参数 |
| void AnyCAD.Foundation.Viewer.OnMouseUp | ( | InputEvent | evt | ) |
处理鼠标松开消息
| evt | 参数 |
|
virtual |
窗口大小变化后调用.
| width | 窗口宽度 |
| height | 窗口高度 |
|
virtual |
时间事件处理。
| timeTick |
|
virtual |
处理消息。。仅在独立窗口模式下调用
| gui | 界面外挂,可为null。 |
| void AnyCAD.Foundation.Viewer.PushEditMode | ( | string | name, |
| Editor | editor ) |
设置编辑模式, editor作为默认的编辑器
| name | 名称 |
| editor | EditMode对象 |
|
virtual |
内部方法
| posX | |
| posY | |
| width | |
| height |
| EnumRedrawResult AnyCAD.Foundation.Viewer.Redraw | ( | float | timeTick | ) |
绘制画面
| timeTick | 时间间隔 |
| EnumRedrawResult AnyCAD.Foundation.Viewer.Redraw | ( | float | timeTick, |
| bool | force ) |
绘制画面
| timeTick | 时间间隔 |
| void AnyCAD.Foundation.Viewer.RequestUpdate | ( | EnumUpdateFlags | flag | ) |
请求更新视图
| flag | 更新标记 |
|
virtual |
设置窗口大小
| width | 宽度 |
| height | 高度 |
|
virtual |
以模态运行。循环执行,直至程序退出。仅在独立窗口模式下调用
| gui | 界面外挂,可为null。 |
| Vector3 AnyCAD.Foundation.Viewer.ScreenPointToWorldPoint | ( | uint | x, |
| uint | y, | ||
| float | z ) |
屏幕坐标转换成三维世界坐标
| x | 鼠标的x坐标,相对窗口 |
| y | 鼠标的y坐标,相对窗口 |
| z | 深度。取值范围[0, 1] |
| void AnyCAD.Foundation.Viewer.SetBackground | ( | Background | background | ) |
设置背景对象。
| background | 对象 |
| void AnyCAD.Foundation.Viewer.SetBackgroundColor | ( | Vector4 | clr | ) |
设置背景颜色
| clr | 颜色 |
| void AnyCAD.Foundation.Viewer.SetCoordinateGrid | ( | CoordinateGridWidget | grid | ) |
设置工作轴网
| grid | 轴网对象 |
| void AnyCAD.Foundation.Viewer.SetCursor | ( | Cursor | cursor | ) |
设置自定义光标
| cursor |
| void AnyCAD.Foundation.Viewer.SetDocument | ( | Document | doc | ) |
设置关联的文档
| doc | 文档对象 |
| void AnyCAD.Foundation.Viewer.SetStandardView | ( | EnumStandardView | view | ) |
以标准视角设置相机方向
| view | 标准视角 |
| void AnyCAD.Foundation.Viewer.SetStandardView | ( | EnumStandardView | view, |
| bool | bAnimation ) |
以标准视角设置相机方向
| view | 标准视角 |
| bAnimation | 是否动画 |
| void AnyCAD.Foundation.Viewer.SetViewId | ( | ObjectId | viewId | ) |
设置View的Id
| viewId | ID |
| void AnyCAD.Foundation.Viewer.SetWorkingPlane | ( | GAx2 | ax | ) |
设置工作平面坐标系
| ax | 坐标系 |
| void AnyCAD.Foundation.Viewer.ShowCoordinateGrid | ( | bool | bShow | ) |
设置轴网可见性
| bShow |
| Ray AnyCAD.Foundation.Viewer.WindowPointToRay | ( | uint | x, |
| uint | y ) |
窗口的坐标转换成射线
| x | X坐标 |
| y | Y坐标 |
|
virtual |
内部方法
| hWnd | |
| msg | |
| wparam | |
| lparam |
三维世界坐标转换成二维的屏幕坐标
| pt | 世界坐标 |
| void AnyCAD.Foundation.Viewer.ZoomToBox | ( | AABox | bbox | ) |
缩放到指定的包围盒
| bbox | 包围盒 |
| void AnyCAD.Foundation.Viewer.ZoomToBox | ( | AABox | bbox, |
| float | ratio ) |
缩放到指定的包围盒
| bbox | 包围盒 |
| ratio | 比例。1.2为默认比例 |
| void AnyCAD.Foundation.Viewer.ZoomToExtend | ( | float | ratio | ) |
缩放视图适应窗口
| ratio | 比例。1.2为默认比例 |