View Operations

xResetView

Resets all transformations.

void xResetView()

xFitView

Zooms in/out to fit current scene in the viewer window.

void xFitView()

xSetCamera

Set the current camera(view position) for the given parameters.

bool xSetCamera( float fPosX, float fPosY, float fPosZ, float fDirX, float fDirY, float fDirZ, float fUpX, float fUpY, float fUpZ, float fFOVy, float fAspect, float fNear, float fFar)

return

Returns True, if successful.

fPosX

Camera X position.

fPosY

Camera Y position.

fPosZ

Camera Z position.

fDirX

Camera X direction.

fDirY

Camera Y direction.

fDirZ

Camera Z direction.

fUpX

Camera X up vector direction.

fUpY

Camera Y up vector direction.

fUpZ

Camera Z up vector direction.

fFOVy

Camera Field of View in degrees.

fAspect

Camera aspect ratio.

fNear

The distance of near clip plane from the camera.

fFar

The distance of far clip plane from the camera.

xSetPerspectiveCamera

Sets the viewer window’s projection mode.

void xSetPerspectiveCamera(bool bPerspective)

bPerspective

Set True for Perspective projection and False for Orthographic projection.

xSetCoordSystem

Sets the coordinate system.

short xSetCoordSystem ( short iNewCoordSystem)

return

Returns previously set coordinate system.

iNewCoordSystem

New coordinate system value. Valid range 0 to 2.

0 for XY
1 for XZ
2 for YZ

xSetFeatureEdges

Sets feature edge’s display info.

void xSetFeatureEdges(bool bShowEdges, bool bDetachGeoNEdges, short iEdgeColorR, short iEdgeColorG, short iEdgeColorB, short iEdgeLineSize)

bShowEdges

Set True to show feature edges.

bDetachGeoNEdges

Set True to detach feature edge’s visibility from its part visibility.

iEdgeColorR

RGB color red value of the feature edge. Range 0 to 255.

iEdgeColorG

RGB color green value of the feature edge. Range 0 to 255.

iEdgeColorB

RGB color blue value of the feature edge. Range 0 to 255.

iEdgeLineSize

The line thickness of the edge. The valid range is 1 to 5.

xShowAxis

Sets display state for axis.

void xShowAxis (bool bShowAxis)

bShowAxis

Set True to display, False to hide.

xIsAxisVisible

Gets display state of the axis.

bool xIsAxisVisible ()

return

Returns True, if displayed. False if hidden.

xShowOrigin

Sets display state for the origin.

void xShowOrigin (bool bShow, ushort iScalePercentage)

bShow

Set True to show, False to hide.

iScalePercentage

Scale size with respect to the bounding box of the scene. Range 0 to 100.

xIsOriginVisible

Gets display state of the origin.

bool xIsOriginVisible()

return

Returns True, if displayed.

xShowFrameRate

Sets display state for scene frame rate statistics.

void xShowFrameRate(bool bShowFrameRate)

bShowFrameRate

Set True to display, False to hide.

xIsFrameRateVisible

Gets display state of scene frame rate statistics.

bool xIsFrameRateVisible()

return

Returns True, if displayed. False if hidden.

pxGetCamera

Gets current camera view info.

List<float> pxGetCamera()

return

Returns array of size 13. Order:

0  - XPos
1  - YPos
2  - ZPos
3  - XDir
4  - YDir
5  - ZDir
6  - XUp
7  - YUp
8  - ZUp
9  - FOVy
10 - AspectRatio
11 - NearClip
12 - FarClip

xGetPerpectiveCamera

Gets current projection mode.

bool xGetPerpectiveCamera()

return

Returns True for Perspective and False for Orthographic projections.

pxGetCoordSystems

Gets coordinate systems types list.

List<String> pxGetCoordSystems()

return

Returns array of size 3 containing names of the coordinate system used. "XY", "YZ" and "ZX"

xGetCurCoordSystemIndex

Gets the index of the current coordinate system applied.

int xGetCurCoordSystemIndex()

return

Returns current coordinate system mode. Range 0-2:

0 - XY
1 - XZ
2 - YZ

xZoomScreenRect

Viewer zooms in the screen window defined by normalized screen position and size. Rectangle position (x,y) and size (dx, dy) values are in the range (0,1).

bool xZoomScreenRect(float x, float y, float dx, float dy)

return

Returns True, if the scene is zoomed successfully according to the normalized screen rectangle.

x

Normalized X coordinate (0-1).

y

Normalized Y coordinate (0-1).

dx

Normalized user window width (0-1).

dy

Normalized user window height (0-1).

xCreateUserCoordinateSystem

Creates New User Coordinate system

bool xCreateUserCoordinateSystem (String coordinateSystemName, int systemType, float cx, float cy, float cz, float ax,float ay, float az, float fDegree)

return

Returns False, if failed.

Returns True, if successful.

coordinateSystemName

New Coordinate System Name.

systemType

0 - Rectangular (Cartesian)
1 - Cylindrical
2 - Spherical

cx, cy, cz

Origin of the new coordinate system.

ax, ay, az

Axis of rotation.

fDegree

The angle of rotation in degrees.

xCreateUserCoordinateSystemEx

Creates New User Coordinate system.

bool xCreateUserCoordinateSystem (String coordinateSystemName, int systemType, float cx, float cy, float cz, float ax,float ay, float az, float bx,float by, float bz, bool bPoints)

return

Returns False, if failed.

Returns True, if successful.

coordinateSystemName

New Coordinate System Name.

systemType

0 - Rectangular (Cartesian)
1 - Cylindrical
2 - Spherical

cx, cy, cz

Origin of the new coordinate system.

ax, ay, az

X-axis vector.

bx, by, bz

Y-axis vector.

bPoints

  • If True:

    (ax, ay, az) is considered as a point in the model, X-axis will be derived.

    (bx, by, bz) is considered as a point in the model defining XY Plane, and Y-axis will be derived.

  • If False,

    (ax, ay, az) is considered as X-axis.

    (bx, by, bz) is considered as Y-axis.

xShowUserCoordinateSystem

Sets visibility to the user-defined coordinate system by its name.

bool xShowUserCoordinateSystem(String sSystemName, bool bShow)

return

Returns True, if successful.

sSystemName

Name of User Coordinate System.

bShow

Show/Hide flag

xDeleteUserCoordinateSystem

Deletes user-defined coordinate system by its name. An empty name will delete all user-defined coordinate systems.

bool xDeleteUserCoordinateSystem (String sSystemName)

return

Returns True, if named user coordinate system is deleted successfully.

Returns False otherwise.

sSystemName

Name of User Coordinate System.

xFitWindowView

The user defines a window by providing two normalized corner positions. This function fits the model into the window without changing orientation.

bool xFitWindowView (float scrX1, float scrY1, float scrX2, float scrY2)

return

Returns True, if successful.

scrX1

Screen Left value of user window (0 to 1).

0 - viewer left position
1 - viewer right position

scrY1

Screen Bottom most value of the user window (0 to 1).

0 - viewer bottom position
1 - viewer top position

scrX2

Screen Right value of user window (0 to 1).

0 - viewer left position
1 - viewer right position

scrY2

Screen Bottom most value of the user window (0 to 1).

0 - viewer bottom position
1 - viewer top position

xZoomToSphere

Zooms to the bounding sphere defined by center and radius.

bool xZoomToSphere(float x, float y, float z, float radius)

return

Returns True, if succeed.

Returns False, if failed.

x, y, z

Center of bounding sphere.

radius

The radius of the sphere.

pxGetViewBoundBox

Gets bounding box size based on viewing direction. i.e. horizontal length, vertical height and depth.

List<float> pxGetViewBoundBox()

return

Returns an array of size 3 (length, height and depth units of scene in world coordinate system).

retArray[0] = length of bounding box; (horizontal)
retArray[1] = hight of bounding box; (vertical)
retArray[2] = depth of bounding box.(viewing depth)
../../_images/60af6f412489ea9f50aa28860af2dd0f.png

pxGetViewBoundScreenRect

Gets normalsized screen coordinates of viewing bound rectangle. User can include legend, probe labels and annotations.

List<float> pxGetViewBoundScreenRect(bool bCAELegend, bool bProbeLabels, bool bAnnotations)

return

Returns an array of size 4. All values are normalized screen coordinates between 0 and 1.

retArray[0] = x position of rectangle
retArray[1] = y position of rectangle
retArray[2] = width of rectangle
retArray[3] = height of rectangle

bCAELegend

Set True to include CAE legend.

Set False to exclude from the rectangle.

bProbeLabels

Set True to include all visible proble labels.

Set False to exclude from the rectangle.

bAnnotations

Set True to include all visible annotations.

Set False to exclude from the rectangle;

pxGetNormalizedScreenPt

Gets normalized screen points(in 2D: 0 to 1) for a given world coordinate system(WCS) 3D point.

List<float> pxGetNormalizedScreenPt(float x, float y, float z)

return

Returns array of size 2. If values are not in range of 0 to 1, the WCS point is out of screen.

x, y, z

Position in WCS.

xSetAxisPosition

Sets axis triad position with respect to given relative screen coordinates fX, fY.

bool xSetAxisPosition(float fX, float fY)

return

Returns True, if success.

Returns False, if failed.

fX

X coordinate relative to viewport left.

fY

Y coordinate relative to viewport top.

pxGetAxisPosition

Gets axis triad position in width and height relative to viewport left and top respective.

List<float> pxGetAxisPosition()

return

Returns True if success.

Returns False if failed.

fX

X coordinate relative to viewport left.

fY

Y coordinate relative to viewport left.

pxGetTwoNodeCoordSys

Constructs a new coordinates system from vertices of iNode1, iNode2 and averaged vertex normal of these nodes.

List<float> pxGetTwoNodeCoordSys(String sModel, int iNode1, int iNode2)

return

Returns an empty array if failed.

Returns an array of 12 float values if success.

(Array[0],Array[1],Array[2])    refers to Origin of CoordSys
(Array[3],Array[4],Array[5])    refers to X axis unit vector
(Array[6],Array[7],Array[8])    refers to Y axis unit vector
(Array[9],Array[10],Array[11])  refers to Z axis unit vector

sModel

CAE Model Name.

iNode1, iNode2

Node IDs.

xTranslateCamera

Translates the application camera in the given direction.

bool xTranslateCamera(vector<float> translation, bool bRelativeToScreen)

return

Returns True if successfully sets the translation to the camera.

translation

Translation vector of size 3.

bRelativeToScreen

True – translation with respect to camera (viewing) coordinate system.

False – translation with respect to scene global cartesian coordinate system.

xRotateCamera

Rotates the application camera with given angle(degrees) and direction about rotation center.

bool xRotateCamera(vector<float> axis, float fDegrees, vector<float> rotation_center, bool bRelativeToScreen)

return

Returns True if successfully sets the translation to the camera.

axis

Axis of rotation - vector of size 3.

fDegrees

Angle of rotation in degrees.

rotation_center

Optional to set rotation center. Existing rotation center will be considered if this vector is empty.

bRelativeToScreen

True – translation with respect to camera (viewing) coordinate system.

False – translation with respect to scene global cartesian coordinate system.

xCreateCoordinateSystem

Creates a new coordinate system based on the user input data.

bool xCreateCoordinateSystem(String sUserCoordSysName, int systemType, vector<float> points, int iCoordDefType)

return

Returns True if successfully cr coordianate system.

Returns False if failed.

sUserCoordSysName

Name of the coordinate system.

systemType

0 – Cartesian Coordinate System
1 – Cylindrical Coordinate System
2 – Spherical Coordinate System

points

array of real values with size 7 to 9

iCoordDefType

Size of array

0

9 (3* point(3))

1

9 origin(3), x-axis(3), y-axis(3)

2

7 origin(3), axis of rotation(3), angle(1)

3

9 (3* point(3))

iCoordDefType

0 – origin, X axis, XY plane
1 – origin, X axis, Y axis
2 – origin, axis of rotation, angle in degrees
3 – circular points

xGetFeatureEdgeCreaseAngle

Gets the crease angle in degrees used in Feature Edges computation.

float xGetFeatureEdgeCreaseAngle()

return

Returns crease angle used in degrees.

xSetFeatureEdgeCreaseAngle

Gets the crease angle in degrees used in Feature Edges computation.

bool xSetFeatureEdgeCreaseAngle(float fDegrees)

return

Returns True if successfully crease angle is set.

Returns False otherwise.

fDegrees

Crease Angle in degrees.

xSetRotationCenter

Sets camera rotation center.

bool xSetRotationCenter(vector<float> centerCoords)

return

Returns True if succeeds.

Returns False otherwise.

centerCoords

X, Y, Z coordinates of rotation center.

xSetStandardView

Sets orientation to camera. Orientation is derived from the given direction and upVector.

bool xSetStandardView(List <float> viewDir, List <float> upVector)

return

Returns True if succeeds.

Returns False otherwise.

viewDir

Direction vector for camera. List of 3 values.

upVector

Up vector for camera. List of 3 values.

xSeek

Sets camera focus to a specified part or sub assembly.

int xSeek(String sModel, String sAssembly, int iNodeType)

return

Returns 1 if successful, 0 when failed.

sModel

Model name

sAssembly

Sub assembly or part name

iNodeType

Assembly node type.

0 indicates sAssembly as sub assembly name.

1 indicates as sAssembly part name.

xDisplayContainer

Allows user to display basic primitives to understand the problems well. Users can define parameters for box,sphere and cylinder.

bool xDisplayContainer(List<float> points, int iContainerType)

return

Returns True if succeeds

Returns False otherwise.

points

List of points that defines the container type.

(x1,y1,z1,x2,y2,z2,…..xn,yn,zn)

iContainerType

0 - Box (Axis Aligned Box)

1 - Sphere

2 - Cylinder.

Note:
Box - 6 values
p1 - first 3 values
p2 - second 3 values
p1 and p2 defines the extreme points of the axis aligned bounding box.

Box - 4 values
center - first three values.
offset - last value;
p1 = center - offset
p2 = center + offset

Sphere - 4 values
center - first 3 values
radius - last value

Sphere - 6 values
p1 - first 3 values
p2 - second 3 values;
center = mid point of p1p2

Cylinder - 7 values
p1 - first 3 values
p2 - second 3 values;
radius = last value;

xClearAllContainers

Clears all containers from display.

bool xClearAllContainers()

returns

Returns False if there is any issue in clearing.

Returns True otherwise.

xGetFeatureEdgeVisibility

Gets the information that feature edges is applied or not.

bool xGetFeatureEdgeVisibility()

return

Returns True if feature edges is applied and displayed.

Returns False if not displayed.

pxGetFeatureEdgeUserColor

Gets the feature edge user color.

List<float> pxGetFeatureEdgeUserColor()

return

Returns an array of size 3, if succeeds.

array[0]=red component value (0 to 1)

array[1]=green component value (0 to 1)

array[2]=blue component value (0 to 1)

Returns an empty array if failed.

xSetFeatureEdgeUserColor

Sets the feature edge user color.

bool xSetFeatureEdgeUserColor(List<float> colour)

return

Returns True if succeeds.

Returns False otherwise

colour

Array of size 3 should be defined.

array[0]=red component value (0 to 1)

array[1]=green component value (0 to 1)

array[2]=blue component value (0 to 1)