渲染器。 更多...
#include <APIRenderer.h>
Public 成员函数 | |
void | SetViewType (const EnumStandardView &nType) |
EnumStandardView | GetViewType () const |
bool | Initialize (long hWnd, int width, int height, const SceneManager &sceneManager, bool bZUp) |
void | Destroy () |
int | Redraw () |
void | RequestDraw (int nHint) |
void | Resize (int x, int y, int cx, int cy) |
bool | Print (const String &fileName) |
RenderWindow | GetRenderWindow () const |
SceneManager | GetSceneManager () const |
CameraOperator | GetCameraOperator () const |
void | SetSkyBox (const String &strName) |
String | GetSkyBox () const |
void | SetStandardView (const EnumStandardView &viewType) |
void | LookAt (const Vector3 &pos, const Vector3 &target, const Vector3 &up) |
void | SetDisplayMode (int nMode) |
int | GetDisplayMode () const |
void | FitAll (const float &scale) |
void | FitBBox (const AABox &bbox, const float &scale) |
void | SetPickMode (int nMode) |
int | GetPickMode () const |
int | Highlight (int cx, int cy) |
int | Highlight (const Vector2 &startPt, const Vector2 &endPt) |
void | ClearHighlight () |
void | QueryHighlight (const SelectionQuery &context) const |
int | Select (bool clearOld) |
void | ClearSelection () |
void | QuerySelection (const SelectionQuery &context) const |
int | GetSnapFlags () const |
void | SetSnapFlags (int val) |
SnapNodeManager | GetSnapNodeManager () const |
Vector2 | WorldPoint2ScreenPoint (const Vector3 &point) const |
Vector3 | ScreenPoint2WorldPoint (const Vector2 &point) const |
Vector3 | ProjectOnWorkingPlane (const Vector2 &mousePos, const Vector3 &defaultPt) const |
Ray | ComputeScreenRay (int cx, int cy) const |
Ray | ComputeScreenRay (const Vector2 &pt) const |
void | ShowWorkingGrid (bool bShow) |
WorkingPlane | GetWorkingPlane () const |
SceneEnvironment | GetEnvironment () const |
void | SetCoordinateWidget (const SceneNode &node) |
void | RemoveWidgetNode (const ElementId &nId) |
void | AddWidgetNode (const SceneNode &node) |
渲染器。
与窗口绑定的渲染器。
void AnyCAD::API::Renderer::AddWidgetNode | ( | const SceneNode & | node | ) |
增加部件对象。
node | the widget node. |
void AnyCAD::API::Renderer::ClearHighlight | ( | ) |
清除预选高亮的模型。
void AnyCAD::API::Renderer::ClearSelection | ( | ) |
清楚选择集.
Ray AnyCAD::API::Renderer::ComputeScreenRay | ( | int | cx, |
int | cy | ||
) | const |
void AnyCAD::API::Renderer::Destroy | ( | ) |
销毁渲染器.
void AnyCAD::API::Renderer::FitAll | ( | const float & | scale | ) |
显示模型适用窗口,都能显示在窗口可见的区域。
scale | the scale. |
void AnyCAD::API::Renderer::FitBBox | ( | const AABox & | bbox, |
const float & | scale | ||
) |
使得指定的包围盒区域适应窗口。
bbox | the bound box to fit. @param scale the scale. |
CameraOperator AnyCAD::API::Renderer::GetCameraOperator | ( | ) | const |
获取相机操作器。
int AnyCAD::API::Renderer::GetDisplayMode | ( | ) | const |
获取显示模式。
SceneEnvironment AnyCAD::API::Renderer::GetEnvironment | ( | ) | const |
获取场景设置。
int AnyCAD::API::Renderer::GetPickMode | ( | ) | const |
获取拾取模式。
RenderWindow AnyCAD::API::Renderer::GetRenderWindow | ( | ) | const |
获取绘制的窗口。
SceneManager AnyCAD::API::Renderer::GetSceneManager | ( | ) | const |
获取场景管理器。
String AnyCAD::API::Renderer::GetSkyBox | ( | ) | const |
Get current skybox name
int AnyCAD::API::Renderer::GetSnapFlags | ( | ) | const |
Get the snap flags.
SnapNodeManager AnyCAD::API::Renderer::GetSnapNodeManager | ( | ) | const |
Get the snap able node manager.
EnumStandardView AnyCAD::API::Renderer::GetViewType | ( | ) | const |
Get the view type.
WorkingPlane AnyCAD::API::Renderer::GetWorkingPlane | ( | ) | const |
获取工作平面。
int AnyCAD::API::Renderer::Highlight | ( | int | cx, |
int | cy | ||
) |
预选在指定屏幕坐标位置下的模型,使之高亮显示。
cx | the x position |
cy | the y position |
预选在指定屏幕坐标区域下的模型,使之高亮显示。
startPt | the start position |
endPt | the end position |
bool AnyCAD::API::Renderer::Initialize | ( | long | hWnd, |
int | width, | ||
int | height, | ||
const SceneManager & | sceneManager, | ||
bool | bZUp | ||
) |
初始化. If sceneManager is NULL, Renderer will create it automatically.
hWnd | the window handle |
width | the view width |
height | the view height |
sceneManager | the shared scene manager. |
bZUp | true if z direction is (0,0,1), or it's (0,0,-1) |
void AnyCAD::API::Renderer::LookAt | ( | const Vector3 & | pos, |
const Vector3 & | target, | ||
const Vector3 & | up | ||
) |
设置相机的方向。
pos | the camera position |
target | the look at target |
up | the up direction of the camera. |
bool AnyCAD::API::Renderer::Print | ( | const String & | fileName | ) |
Print the scene as PDF.
fileName | the image file name. |
Vector3 AnyCAD::API::Renderer::ProjectOnWorkingPlane | ( | const Vector2 & | mousePos, |
const Vector3 & | defaultPt | ||
) | const |
把平面坐标投影的工作平面.
mousePos | the screen point. |
defaultPt | the point if failed to compute the world point. |
void AnyCAD::API::Renderer::QueryHighlight | ( | const SelectionQuery & | context | ) | const |
查询预选高亮的模型。
context | the query selection context. |
void AnyCAD::API::Renderer::QuerySelection | ( | const SelectionQuery & | context | ) | const |
查询选择集中的模型.
context | the query selection context. |
int AnyCAD::API::Renderer::Redraw | ( | ) |
重新绘制.
void AnyCAD::API::Renderer::RemoveWidgetNode | ( | const ElementId & | nId | ) |
移除部件对象.
void AnyCAD::API::Renderer::RequestDraw | ( | int | nHint | ) |
发起绘制的请求。
nHint | default is 1. by EnumRedrawHintType |
void AnyCAD::API::Renderer::Resize | ( | int | x, |
int | y, | ||
int | cx, | ||
int | cy | ||
) |
改变绘制区域的大小.
x | the start position x |
y | the start position y |
cx | the width of the view |
cy | the height of the view |
把屏幕坐标转换为世界坐标.
point | the screen point. |
int AnyCAD::API::Renderer::Select | ( | bool | clearOld | ) |
把预选高亮的模型设置为选择状态。
clearOld | if to clear the previous selection. |
void AnyCAD::API::Renderer::SetCoordinateWidget | ( | const SceneNode & | node | ) |
设置坐标轴显示对象。
node | the node. Remove the widget nodes. |
void AnyCAD::API::Renderer::SetDisplayMode | ( | int | nMode | ) |
设置显示模式,比如只显示面、只显示边、点等。
nMode | the display mode. by EnumDisplayStyle |
void AnyCAD::API::Renderer::SetPickMode | ( | int | nMode | ) |
设置拾取模式,比如只选择面、只选择边等。
nMode | the pick mode. By EnumRenderFlags |
void AnyCAD::API::Renderer::SetSkyBox | ( | const String & | strName | ) |
Set SkyBox by Name
strName | the skybox name |
void AnyCAD::API::Renderer::SetSnapFlags | ( | int | val | ) |
Set the snap flags.
val | the flags by EnumSnapFlags. |
void AnyCAD::API::Renderer::SetStandardView | ( | const EnumStandardView & | viewType | ) |
设置相机的方向。
viewType | by EnumStandardView |
void AnyCAD::API::Renderer::SetViewType | ( | const EnumStandardView & | nType | ) |
Set the view type.
nType | the EnumStandardView. |
void AnyCAD::API::Renderer::ShowWorkingGrid | ( | bool | bShow | ) |
显示或隐藏工作平面。
bShow | if to show the grid |
把世界坐标转换为屏幕坐标。
point | the world point. |