Vp

  • LXi_VPSPACE_MODEL

  • LXi_VPSPACE_TEXTURE

  • LXi_VPSPACE_WORLD

  • LXi_VPSPACE_PREVIEW

  • LXi_VPSPACE_MODEL2D

  • LXi_VPSPACE_GRAPH

  • LXi_VPSPACE_SCHEMATIC

  • LXi_VP_AXIS_X

  • LXi_VP_AXIS_Y

  • LXi_VP_AXIS_Z

  • LXi_VP_AXIS_PERSP

  • LXi_VP_AXIS_UV

  • LXi_VP_CAM_LEFT

  • LXi_VP_CAM_RIGHT

  • LXi_VP_CAM_TOP

  • LXi_VP_CAM_BOTTOM

  • LXi_VP_CAM_FRONT

  • LXi_VP_CAM_BACK

  • LXi_VP_CAM_PERSP

ILxView3D

class ILxView3D

The application 3D and UV viewports are exposed as a list of ILxView3D objects. Clients will generally find a view in the list, then use the ILxView3D interface to get its specific properties.

Public Functions

LXtID4 Space(LXtObjectID self)

  • LxResult Bounds (self, x, y, w, h) Returns the upper left corner coordinates for the view, and its width and height in pixels.

int Axis(LXtObjectID self, int *cam, LXtVector axis)
LxResult Bounds(LXtObjectID self, int *x, int *y, int *w, int *h)
int Style(LXtObjectID self, int option)
double PixelSize(LXtObjectID self)
LxResult Center(LXtObjectID self, LXtVector center)
double EyeVector(LXtObjectID self, LXtVector pos, LXtVector dir)
LxResult Matrix(LXtObjectID self, LXtMatrix mat, int inverse)
LxResult Angles(LXtObjectID self, LXtVector hpb)
int WorkPlane(LXtObjectID self, LXtVector center)
LxResult To3D(LXtObjectID self, float x, float y, LXtVector pos, int flags)
LxResult To3DHit(LXtObjectID self, float x, float y, LXtVector pos, LXtVector nrm)
LxResult Backdrop(LXtObjectID self, void **item)

Background images in viewports a whole kettle of worms, enjoy.

  • LxResult Backdrop(self, item) Returns the ILxItem for the image used by the specified view. Naturally, this object must be released by the client when it is no longer needed. If there is no image, LXe_NOTFOUND will be returned.

  • const char *BackdropName(self) Returns the name of the image used by the specified view. If there is no image it will be null.

  • LxResult BackdropPlace(self, x, y, w, h) Returns the center position and dimensions of the backdrop image. If there is no image, LXe_NOTFOUND will be returned.

  • int BackdropAspect(self, asp) Returns the aspect ratio of the backdrop image, and whether the aspect is locked. If there is no image, LXe_NOTFOUND will be returned.

  • int BackdropOrient(self, ang) Returns the rotation and horizontal-flip state of the backdrop image. If there is no image, LXe_NOTFOUND will be returned.

  • int BackdropLook(self, brit, cont, trans) Returns the invert state and fills brightness, contrast, and transparency of the backdrop image. If there is no image, LXe_NOTFOUND will be returned.

  • int BackdropRender(self, res, blend) Returns the overlay state and fills resolution and pixel-blending of the backdrop image. If there is no image, LXe_NOTFOUND will be returned.

const char *BackdropName(LXtObjectID self)
LxResult BackdropPlace(LXtObjectID self, double *cx, double *cy, double *w, double *h)
int BackdropAspect(LXtObjectID self, double *asp)
int BackdropOrient(LXtObjectID self, double *ang)
int BackdropLook(LXtObjectID self, double *brit, double *cont, double *trns)
int BackdropRender(LXtObjectID self, int *resolution, int *blend)
int HitElement(LXtObjectID self, LXtID4 type, float x, float y, void **list)
double GridSize(LXtObjectID self)

  • double GridSize (self) Returns the current grid size of the view.

  • int FrameRate(self) Returns the frame rate of the view, meanng how quickly GL is drawing. This is identical to the results displayed in the viewport from the “glmeter” command.

double FrameRate(LXtObjectID self)
LxResult SetMatrix(LXtObjectID self, const LXtMatrix mat)
LxResult SetCenter(LXtObjectID self, const LXtVector vec)
LxResult SetScale(LXtObjectID self, double scl)
LxResult ItemShade(LXtObjectID self, LXtObjectID item, unsigned *shade)

These functions are to get item specific properties on the viewport. When “Enable Independent Drawing” is enabled on the viewport, they returns the properties from “Draw Options” on the item.

  • LxResult ItemShade (self, item, shade) Return the shading style (VPOPT_SHADE_XXX) of the given item.

  • LxResult ItemColor (self, item, color) Returns the basic wireframe color and alpha of the item.

  • LxResult ItemSelColor (self, item, color) Returns the wireframe color of the selected item. If the item is not selected, it returs basic wireframe color.

  • LxResult ItemWireOverlay (self, item, color, wireframe) Returns the wireframe overlay mode and the overlay color of the selected item.

LxResult ItemColor(LXtObjectID self, LXtObjectID item, LXtFVector4 color)
LxResult ItemSelColor(LXtObjectID self, LXtObjectID item, LXtFVector4 color)
LxResult ItemWireOverlay(LXtObjectID self, LXtObjectID item, LXtFVector4 color, unsigned *wireframe)
LxResult Deformers(LXtObjectID self)

  • LxResult Deformers (self) Returns LXe_TRUE if “Deformers” stat of the view is ON, otherwise it returns LXe_FALSE.

LxResult ItemIsVisible(LXtObjectID self, LXtObjectID item)

  • LxResult ItemIsVisible (self, item) Returns LXe_TRUE if the item is visible, otherwise it returns LXe_FALSE.

LxResult ToUVHit(LXtObjectID self, const char *name, float x, float y, unsigned layer, float *u, float *v)

  • LxResult ToUVHit(self, x, y, u, v) Sets the U and V for the ray hit for screen coordinate x,y. Return LXe_OK if there is a hit, LXe_NOTFOUND if there is no hit.

LxResult InvalidateSurface(LXtObjectID self, LXtObjectID item)

  • LxResult InvalidateSurface(self, item) Invalidate GL Draw Cache for an item.

  • LXi_VPOPT_OFF

  • LXi_VPOPT_ON

  • LXi_VPOPT_SHADE_WIRE

  • LXi_VPOPT_SHADE_SKCH

  • LXi_VPOPT_SHADE_VCLR

  • LXi_VPOPT_SHADE_SHAD

  • LXi_VPOPT_SHADE_TEXT

  • LXi_VPOPT_SHADE_REFL

  • LXi_VPOPT_SHADE_PRG1

  • LXi_VPOPT_SHADE_PRG2

  • LXi_VPOPT_WIRE_NONE

  • LXi_VPOPT_WIRE_COLR

  • LXi_VPOPT_WIRE_UNIF

  • LXi_VPOPT_VCLR_SEL

  • LXi_VPOPT_VCLR_WGT

  • LXi_VPOPT_VCLR_RGB

  • LXi_VPOPT_BACK_WIRE

  • LXi_VPOPT_BACK_FLAT

  • LXi_VPOPT_BACK_ACTV

  • LXi_VPTO3D_SNAP

  • LXi_VPTO3D_WORK


LXi_VPHIT_VERT

Raycasting to hit scene elements is facilitated at the viewport level and generalized to use any 2D position on the view. Often the view and the position will be taken from the mouse position.

  • int HitElement(self, type, x, y, list) Returns the number of elements of the requested type along the eye vector going through (x,y). The elements themselves are in the read-only array of pointers returned in list. Type should be one of the following

  • LXi_VPHIT_EDGE

  • LXi_VPHIT_POLY

  • LXi_VPHIT_ITEM


LXsPKG_DEFERRED_UPDATE

An item type can define a tag for a deferred update channel. This is an integer channel that will be tested to see if deferred updates should be done. Any non-zero int value enables deferred updates.

ILxGLViewport

class ILxGLViewport

The GLViewport object allows clients to get a fully domesticated GL viewport of their own. The object is not associated with any on-screen viewport and can be used with no nexus-native windows at all. Instead it represents GL state that can draw and react to input.

Public Functions

LxResult Initialize(LXtObjectID self, LXtObjectID client)

Initialize the new viewport object with the client interface.

LxResult SetSize(LXtObjectID self, unsigned w, unsigned h)

Set the size of the GL area.

LxResult Draw(LXtObjectID self)

Call this to draw the viewport. The GL context must be set correctly.

LxResult MouseEvent(LXtObjectID self, unsigned event)

Call this to process a mouse event.

LxResult SelectViewport(LXtObjectID self)

Select the viewport, allowing the various view3d.??? commands to target it.

LxResult DropDestination(LXtObjectID self, int x, int y, void **ppvObj)

When performing drag and drop, clients can get the drop destination for elements under the mouse. This will be a PreDest object that can be queried for information about the drop destination.

  • LXiGLMOUSE_EVENT_TERMINATE

  • LXiGLMOUSE_EVENT_NONE

  • LXiGLMOUSE_EVENT_ENTER

  • LXiGLMOUSE_EVENT_LEAVE

  • LXiGLMOUSE_EVENT_DOWN

  • LXiGLMOUSE_EVENT_MOVE

  • LXiGLMOUSE_EVENT_UP

  • LXiGLMOUSE_EVENT_WHEEL

  • LXiGLMOUSE_EVENT_MOD_KEY

ILxGLViewportClient

class ILxGLViewportClient

The client object allows the owner of the viewport to provide essential information to the GL viewport, and to handle invalidation.

Public Functions

LxResult Invalidate(LXtObjectID self)

This is called by the GL viewport when it needs to redraw.

LxResult MousePosition(LXtObjectID self, int *x, int *y)

Return the current mouse position.

LxResult MouseButton(LXtObjectID self, unsigned *button)

Return the current mouse button depressed.

LxResult TabletPressure(LXtObjectID self, double *press)

Return the current pressure for stylus devices.

LxResult TabletTilt(LXtObjectID self, double *tilt)

Return the current tilt for stylus devices.

LxResult MouseCount(LXtObjectID self, int *count)

Return the count associated with the last input event. If it was a mouse button, this is used to resolve double click (2) from single click (1). For the scroll wheel, this is the number of steps the wheel has turned since the last wheel event, with positive numbers for one direction and negative for the other.

  • LXiGLMOUSE_BUTTON_NONE

  • LXiGLMOUSE_BUTTON_LEFT

  • LXiGLMOUSE_BUTTON_RIGHT

  • LXiGLMOUSE_BUTTON_MIDDLE

ILxView3DportService

class ILxView3DportService

Public Functions

LxResult ScriptQuery(LXtObjectID self, void **ppvObj)

As with all globals, the first method gets the ILxScriptQueryID interface for the system.

  • ScriptQuery(self, sq)

int Count(LXtObjectID self)

The viewport service will provide access to a list of 3d and UV viewports referenced by index.

  • int Count(self) Returns the number of viewports

  • int Current(self) Returns the most recently selected viewport’s index

  • LxResult View(self, index, view) Returns an ILxView3D for viewport at index. Naturally the client is responsible for releasing the returned object.

  • int Mouse(self, x, y) Returns the index of the viewport currently under the mouse, or -1 if the mouse is not over a 3D view. The position relative to that view is fillde into x and y, if they are not NULL.

  • LxResult SetHitUVMap(self, name) Sets the UV vertex map used for hit testing by tools. If the name is NULL, then the hit vmap is cleared.

int Current(LXtObjectID self)
LxResult View(LXtObjectID self, int index, void **ppvObj)
int Mouse(LXtObjectID self, int *x, int *y)
LxResult SetHitUVMap(LXtObjectID self, const char *name)
int InvalidateOverrider(LXtObjectID self, LXtObjectID scene, const char *pkgName)
LxResult GLMaterial(LXtObjectID self, LXtObjectID bin, LXtObjectID item, LXtObjectID view, void **ppvObj)

This function allocates a GL material object (ILxGLMaterial) with given bin, item and view objects.

LxResult TriGroupToViewObject(LXtObjectID self, unsigned int type, LXtObjectID triGroup, void **ppvObj)

Converts a ILxTriangleGroup into an ILxViewObject.

LxResult ImageToGLImage(LXtObjectID self, LXtObjectID image, void **ppvObj)

Converts an ILxImage object into a ILxGLImage object for drawing.

LxResult AllocGLViewport(LXtObjectID self, void **ppvObj)

Allocate a GLViewport.

LxResult AddVirtualModel(LXtObjectID self, LXtObjectID vmodel)

Adds an ILxVirtualModel for drawing into GL viewports.

void RemoveVirtualModel(LXtObjectID self, LXtObjectID vmodel)

Removes an ILxVirtualModel from GL viewports so it stops being drawn. If the provided vmodel isn’t currently being drawn, the function will do nothing.

void UpdateVirtualModel(LXtObjectID self, LXtObjectID vmodel)

Updates drawing for the provided virtual model.

ILxSimulationListener

class ILxSimulationListener

This global listener can be used to track the state changes related to interactive simulation.

Public Functions

LxResult Start(LXtObjectID self, LXtObjectID channels)

These methods are called when the simulation mode starts and ends. The start event is passed a ChannelRead object for reading the outputs of the simulation.

LxResult End(LXtObjectID self)
LxResult Time(LXtObjectID self, double time)

Current time for the simulation is set here.

LxResult Invalidate(LXtObjectID self)

Any time the simulation has new results the listener clients are invalidated.