AnyCAD Rapid API 2023
Help you to create a better world!
Viewer Class Reference

Public Member Functions

EditMode GetEditMode ()
 
long GetWidth ()
 
long GetHeight ()
 
float GetZoomFactor ()
 
void SetZoomFactor (float val)
 
void Destroy ()
 
void SetDocument (Document doc)
 
Document GetDocument ()
 
void SetEditMode (EditMode editor)
 
void PushEditor (Editor editor, boolean bClearOld)
 
void ClearEditor ()
 
float GetTimeTicks ()
 
void OnTime (float timeTick)
 
void Run (GuiRenderer gui)
 
int Redraw (float timeTick)
 
void NewFrame (float timeTick)
 
void RequestUpdate (EnumUpdateFlags flag)
 
ViewContext GetContext ()
 
void ZoomToExtend ()
 
ScreenShot CreateScreenShot ()
 
void SetBackgroundColor (Vector4 clr)
 
void SetBackground (Background background)
 
Background GetBackground ()
 
void SetCoordinateGrid (CoordinateGridWidget grid)
 
CoordinateGridWidget GetCoordinateGrid ()
 
void ShowCoordinateGrid (boolean bShow)
 
void SetCoordinateWidget (EnumViewCoordinateType type)
 
void SetCoordinateWidgetPosition (short position)
 
void SetCoordinateWidgetText (String textX, String textY, String textZ)
 
Vector3 ScreenPointToWorldPoint (long x, long y, float z)
 
Vector3 WorldPointToSceenPoint (Vector3 pt)
 
Ray WindowPointToRay (long x, long y)
 
void SetStandardView (EnumStandardView view, boolean bAnimation)
 
void SetStandardView (EnumStandardView view)
 
void OnResized (long width, long height)
 
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 ResizeWindow (long width, long height)
 
FloatList ReadDepthBuffer (long posX, long posY, long width, long height)
 

Static Public Member Functions

static void SetZoomFacotr (float zoomOut, float zoomIn)
 

Detailed Description

<> The basic Viewer

Member Function Documentation

◆ OnMouseWheel()

void Viewer.OnMouseWheel ( InputEvent  evt,
int  delta 
)
Parameters
delta> 0 scroll up, < 0 scroll down

◆ OnResized()

void Viewer.OnResized ( long  width,
long  height 
)

Called when the window size is changed.

Parameters
widththe width
heightthe height

◆ Redraw()

int Viewer.Redraw ( float  timeTick)

Redraw the scene

Parameters
timeTick
Returns
0 if no drawing needed.

◆ SetCoordinateWidgetPosition()

void Viewer.SetCoordinateWidgetPosition ( short  position)

Set the position of the coordinate widget

Parameters
positionthe position index. [0, 1, 2, 3]