Callisto function reference  5.2
Visualisation

Macros

#define CAL_BOTTOMLEFT   3
 
#define CAL_BOTTOMRIGHT   2
 
#define CAL_TOPLEFT   0
 
#define CAL_TOPRIGHT   1
 

Functions

int CAL_ClearCameraStates (int viewID)
 
int CAL_CreateOverlay (int *overlayID, int viewID, int xPos, int yPos, int xDim, int yDim, int referencePos=CAL_TOPLEFT, int nrLines=1, bool background=true)
 
int CAL_DestroyOverlay (int overlayID)
 
int CAL_GetCameraLookAt (int viewID, CAL_scalar *x, CAL_scalar *y, CAL_scalar *z)
 
int CAL_GetCameraPosition (int viewID, CAL_scalar *x, CAL_scalar *y, CAL_scalar *z)
 
int CAL_GetCameraRoll (int viewID, CAL_scalar *roll)
 
int CAL_HideView (int viewID)
 
int CAL_ResumeVisualisation ()
 
int CAL_ScreenCapture (int viewID, char *fileName)
 
int CAL_SetBackgroundColor (int viewID, CAL_scalar red, CAL_scalar green, CAL_scalar blue)
 
int CAL_SetCameraLookAt (int viewID, CAL_scalar x, CAL_scalar y, CAL_scalar z, CAL_scalar time=-1)
 
int CAL_SetCameraOptions (int viewID, long options)
 
int CAL_SetCameraPosition (int viewID, CAL_scalar x, CAL_scalar y, CAL_scalar z, CAL_scalar time=-1)
 
int CAL_SetCameraRoll (int viewID, CAL_scalar roll, CAL_scalar time=-1)
 
int CAL_SetCameraState (int viewID, CAL_scalar pos[3], CAL_scalar lookAt[3], CAL_scalar up[3], CAL_scalar time=-1)
 
int CAL_SetLightOptions (long options)
 
int CAL_SetOverlayTextLine (int overlayID, int lineNr, char *text, float charHeight=10.f, float red=1.0f, float green=1.0f, float blue=1.0f, float alpha=1.0f)
 
int CAL_SetOverlayVisibility (int overlayID, bool visibility)
 
int CAL_SetViewFogDistance (CAL_scalar dist)
 
int CAL_SetViewGridSize (int viewID, CAL_scalar size)
 
int CAL_SetViewNavigationSpeed (int viewID, CAL_scalar dist)
 
int CAL_SetViewNearClippingDistance (int viewID, CAL_scalar dist)
 
int CAL_SetViewOptions (int viewID, long options)
 
int CAL_ShowView (int viewID, char *caption="", bool maximized=false)
 
int CAL_SuspendVisualisation ()
 
int CAL_TileViews ()
 

Detailed Description

Macro Definition Documentation

#define CAL_BOTTOMLEFT   3

Used for overlays: glue overlay to bottom left of visualisation window.

#define CAL_BOTTOMRIGHT   2

Used for overlays: glue overlay to bottom right of visualisation window.

#define CAL_TOPLEFT   0

Used for overlays: glue overlay to top left of visualisation window.

#define CAL_TOPRIGHT   1

Used for overlays: glue overlay to top right of visualisation window.

Function Documentation

int CAL_ClearCameraStates ( int  viewID)

Deletes all defined camera animations and set camera to default position.

Parameters
viewIDThe ID of the view.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_CreateOverlay ( int *  overlayID,
int  viewID,
int  xPos,
int  yPos,
int  xDim,
int  yDim,
int  referencePos = CAL_TOPLEFT,
int  nrLines = 1,
bool  background = true 
)

Create an overlay. An overlay is a box that appears at at a static position in the visualisation window. It can be used to display user defined information. An example of an overlay is the status overlay.

Parameters
overlayIDThe ID of the overlay.
viewIDThe ID of the view the overlay should appear in.
xPosThe x coordinate of the screen position the overlay should appear.
yPosThe y coordinate of the screen position the overlay should appear.
xDimThe width of the overlay.
yDimThe height of the overlay.
referencePosThe reference from which xPos and yPos are calculated. The value can be CAL_TOPLEFT, CAL_TOPRIGHT, CAL_BOTTOMRIGHT or CAL_BOTTOMLEFT.
nrLinesThe number of lines the overlay consists of.
backgroundShows a partially transparent background behind the text.
int CAL_DestroyOverlay ( int  overlayID)

Destroy an overlay.

Parameters
overlayIDThe ID of the overlay that needs to be destroyed.
int CAL_GetCameraLookAt ( int  viewID,
CAL_scalar x,
CAL_scalar y,
CAL_scalar z 
)

Gets the position the camera looks at. The look at position is also the navigation center.

Parameters
viewIDThe ID of the view.
xThe x position of the look at point.
yThe y position of the look at point.
zThe z position of the look at point.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_GetCameraPosition ( int  viewID,
CAL_scalar x,
CAL_scalar y,
CAL_scalar z 
)

Gets the position of the camera.

Parameters
viewIDThe ID of the view.
xThe x position of the camera.
yThe y position of the camera.
zThe z position of the camera.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_GetCameraRoll ( int  viewID,
CAL_scalar roll 
)

Gets the rotation of the camera around the axis defined by position and look at point.

Parameters
viewIDThe ID of the view.
rollThe roll of the camera around the axis. A value of 0 means the up-vector is parallel with the y-axis.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_HideView ( int  viewID)

Hides a view. Every view has its own unique ID. There are at most 4 views (0..3). 0 being the main view. This view cannot be switched on/off.

Parameters
viewIDThe ID of the view.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ResumeVisualisation ( )

This function resumes the visualisation after CAL_SuspendVisualisation.

Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ScreenCapture ( int  viewID,
char *  fileName 
)

Saves the content of a view in .bmp format to disk.

Parameters
viewIDThe ID of the view to save, set to 0 if you don't know what this is.
fileNameThe file name of the .bmp.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetBackgroundColor ( int  viewID,
CAL_scalar  red,
CAL_scalar  green,
CAL_scalar  blue 
)

Sets the background color of the visualisation window.

Parameters
viewIDThe ID of the view get the view parameters from, set to 0 if you don't know what this is.
redThe red component of the color (0...1).
greenThe green component of the color (0...1).
blueThe blue component of the color (0...1).
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetCameraLookAt ( int  viewID,
CAL_scalar  x,
CAL_scalar  y,
CAL_scalar  z,
CAL_scalar  time = -1 
)

Sets the position the camera looks at. The look at position is also the center of navigation for the mouse.

Parameters
viewIDThe ID of the view.
xThe x position of the look at point.
yThe y position of the look at point.
zThe z position of the look at point.
timeThe time the camera should look at the position. This is used to define camera motions, do not use if you want a fixed camera.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetCameraOptions ( int  viewID,
long  options 
)

Set options for the camera of a specific view.

Parameters
viewIDThe ID of the view.
optionsThe option you want to change. Multiple parameters can be changed at once by using the | operator. Legal values can be found here.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetCameraPosition ( int  viewID,
CAL_scalar  x,
CAL_scalar  y,
CAL_scalar  z,
CAL_scalar  time = -1 
)

Sets the position of the camera.

Parameters
viewIDThe ID of the view.
xThe x position of the camera.
yThe y position of the camera.
zThe z position of the camera.
timeThe time the camera should be at the position. This is used to define camera motions, do not use if you want a fixed camera.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetCameraRoll ( int  viewID,
CAL_scalar  roll,
CAL_scalar  time = -1 
)

Sets the rotation of the camera around the axis defined by position and look at point. When using the CAL_SetCamera functions, the camera orientation is always parallel to the XZ plane, except when you define a roll (in that case, the camera rotates about its directional axis). When looking straight down (e.g. parallel with the y-axis) there are infinitely many camera orientations that are parallel to the XZ plane. In that case, the camera right vector is equal to the x-axis (and the up vector equal to the –z-axis).

Parameters
viewIDThe ID of the view.
rollThe roll of the camera around the axis. A value of 0 means the up-vector is parallel with the y-axis.
timeThe time the camera should be at the specified roll. This is used to define camera motions, do not use if you want a fixed camera.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetCameraState ( int  viewID,
CAL_scalar  pos[3],
CAL_scalar  lookAt[3],
CAL_scalar  up[3],
CAL_scalar  time = -1 
)

Alternative method to set camera state by providing position lookAt point and up vector. The angle between the vector formed by pos-lookAt and up should be 90 degrees, if not an CAL_ILLEGALVALUE is thrown.

Parameters
viewIDThe ID of the view.
posThe position of the camera.
lookAtThe point the camera looks at (is directed to).
upThe camera up vector.
timeThe time the camera should be at the specified roll. This is used to define camera motions, do not use if you want a fixed camera.
int CAL_SetLightOptions ( long  options)

Change light related parameters. These are view independent.

Parameters
optionsThe option you want to change. Multiple parameters can be changed at once by using the | operator. Legal values can be found here.
int CAL_SetOverlayTextLine ( int  overlayID,
int  lineNr,
char *  text,
float  charHeight = 10.f,
float  red = 1.0f,
float  green = 1.0f,
float  blue = 1.0f,
float  alpha = 1.0f 
)

Change the overlay text.

Parameters
overlayIDThe ID of the overlay.
lineNrThe number of the line to change, the first line has number 1.
textThe line of text.
charHeightThe character height of the text.
redThe red component of the text color (0...1).
greenThe green component of the text color (0...1).
blueThe blue component of the text color (0...1).
alphaThe alpha value of the text color (0...1), 0 is fully transparant, 1 is fully opaque. Default is 1.
textAn array of text lines. The length of the array should be equal as the number of lines used in CAL_CreateOverlay.
int CAL_SetOverlayVisibility ( int  overlayID,
bool  visibility 
)

Change the visibility of an overlay.

Parameters
overlayIDThe ID of the overlay.
visibilityBoolean indicating visibility.
int CAL_SetViewFogDistance ( CAL_scalar  dist)

Set the fog distance. This value is inpendent of the view.

Parameters
distThe new fog distance.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetViewGridSize ( int  viewID,
CAL_scalar  size 
)

Set size of major grid lines.

Parameters
viewIDThe ID of the view.
sizeThe distance between the major grid lines
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetViewNavigationSpeed ( int  viewID,
CAL_scalar  dist 
)

Set the navigation speed. This is the speed with the keyboard navigation and middle mouse button work. Be sure to use CAL_SetViewOptions to set the CAL_MANUALNAVSPEED first!

Parameters
viewIDThe ID of the view.
distThe new navigation speed.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetViewNearClippingDistance ( int  viewID,
CAL_scalar  dist 
)

Set the near clipping distance.

Parameters
viewIDThe ID of the view.
distThe new near clipping distance, legal values are between 0 and 100.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetViewOptions ( int  viewID,
long  options 
)

Change the current view parameters.

Parameters
viewIDThe ID of the view.
optionsThe option you want to change. Multiple parameters can be changed at once by using the | operator. Legal values can be found here.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_ShowView ( int  viewID,
char *  caption = "",
bool  maximized = false 
)

Shows a view. Every view has its own unique ID. There are at most 4 views (0..3). 0 being the main view. This view cannot be switched on/off.

Parameters
viewIDThe ID of the view.
captionThe caption of the window of the view, default is no caption.
maximizedMaximizes the view window.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SuspendVisualisation ( )

This function stops the visualisation until CAL_ResumeVisualisation is called. This function can be used to temporarily stop visualisation, for example when you need all processor power to do some calculations.

Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_TileViews ( )

Tiles the visible views.

Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.