Handles

  • LXfVDRAW_MASK

  • LXfVDRAW_FILL

  • LXfVDRAW_DASH

  • LXfVDRAW_CUSTOM0

  • LXfVDRAW_CUSTOM1

  • LXfVDRAW_CUSTOM2

  • LXfVDRAW_CUSTOM3

  • LXfVDRAW_AXARROW

ILxShapeDraw

class ILxShapeDraw

Public Functions

void Circle(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, double rad, int axis, int flags)

  • Circle This method draws a circle defined by the ‘rad’ argument, centered at ‘pos’.

  • Ellipse This method is just a circle with a radius vector whose element along the axis is ignored.

  • Pill This method is a rectangle with rounded corners defined by the ‘rad’ argument, centered at ‘pos’. If the radius of the corners is too large compared with the height or width of the rectangle then it will be adjusted.

  • Bone The bone is a double pyramid.

  • Arc This method draws a section of a circle between angles given by start and end.

  • Plane This method draws a wireframe plane defined by the size vector and the axis at centered ‘pos’.

  • Ellipsoid This method draws a wireframe ellipsoid defined by the radius vector at centered ‘pos’.

  • Cube This method draws a wireframe cube defined by by the size vector and the axis at centered ‘pos’.

  • CubeFill This method draws a cube with filled faces.

  • BoxShape This method draws a wireframe box by by the size vector with filled faces.

  • Pyramid This method draws a wireframe pyramid defined by by the size vector and the axis at centered ‘pos’.

  • PyramidShape This method draws a wireframe pyramid with filled faces.

  • Rhombus This method draws a wireframe rhombus defined by by the size vector and the axis at centered ‘pos’.

  • RhombusShape This method draws a wireframe rhombus with filled faces.

  • Cone This method draws a wireframe cone defined by by the radius, the height and the axis at centered ‘pos’.

  • ConeShape This method draws a wireframe cone with filled faces.

  • Cylinder This method draws a wireframe cylinder defined by by the radius, the height and the axis at centered ‘pos’.

  • CylinderShape This method draws a wireframe cylinder with filled faces.

  • SphereShape This method draws a wireframe sphere by the radius and the axis at centered ‘pos’ with filled faces.

  • CircleShape This method draws a wireframe circle by the radius and the axis at centered ‘pos’ with filled faces.

  • PlaneShape This method draws a wireframe plane with filled faces.

  • RadialMap

  • RadialRays These methods renders a greyscale image map of radius values vs theta and phi spherical coordinates.

  • Link This method draws a line from ‘posS’ to ‘posE’ with point at the ends. If ‘solid’ is false, a dashed line is drawn.

  • BBox This method draws a wireframe lines of bounding box at each corners defined by ‘size’ at the origin.

  • Arrow This method draws a arrow defined along the axis, centered at ‘pos’.

  • Axis This method draws a set of three arrows along the principal axes.

  • Star This method draws a star shape defined in the radius, centered at ‘pos’.

  • Cross This method draws a cross defined by the radius, centered at ‘pos’.

  • Line This method draws a line in the virtual model space from ‘v0’ to ‘v1’.

  • CSeg This method draws a line in the virtual model space centered at cen and extending in both directions along offset. If in screen space, draw relative.

  • PlaneIndicator This method draws a plane indicator defined by the radius and the axis, centered at ‘pos’.

  • CrossHair This method draws a screen-space crosshairs style reticle. The size is approximately in grid units.

  • PreciseHandle This method draws cross lines defined by ‘the size vectors, centered at ‘pos’ along axes.

void Ellipse(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, const LXtVector rad, int axis, int flags)
void Pill(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, double width, double height, double rad, int axis, int flags)
void Bone(LXtObjectID self, const LXtVector col, double rlen, int active)
void Arc(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, double rad, double start, double end, int axis, int flags)
void Plane(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector size, int axis, int flags)
void Ellipsoid(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, const LXtVector rad, int flags)
void Cube(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector size, int flags)
void CubeFill(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, const LXtVector size, int flags)
void BoxShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, const LXtVector size, int flags)
void Pyramid(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector size, int axis, int flags)
void PyramidShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, const LXtVector size, int axis, int flags)
void Rhombus(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector size, int axis, int flags)
void RhombusShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, const LXtVector size, int axis, int flags)
void Cone(LXtObjectID self, const LXtVector col, const LXtVector pos, double rad, double height, int axis, int flags)
void ConeShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, double radius, double height, int axis, int flags)
void Cylinder(LXtObjectID self, const LXtVector col, const LXtVector pos, double rad, double height, int axis, int flags)
void CylinderShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, double radius, double height, int axis, int flags)
void SphereShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, double radius, int axis, int flags)
void CircleShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, double radius, int axis, int flags)
void PlaneShape(LXtObjectID self, const LXtVector colW, const LXtVector colF, const LXtVector pos, const LXtVector size, int axis, int flags)
void RadialMap(LXtObjectID self, LXtObjectID image, const LXtVector col, const LXtVector cen, double size, int sel, int flags)
void RadialRays(LXtObjectID self, LXtObjectID image, const LXtVector col, const LXtVector cen, double size, int sel, int flags)
void Link(LXtObjectID self, const LXtVector col, const LXtVector posS, const LXtVector posE, int solid, int flags)
void BBox(LXtObjectID self, const LXtVector col, double size, int flags)
void Arrow(LXtObjectID self, const LXtVector col, const LXtVector pos, double size, int axis, int flags)
void Axis(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector size, int flags)
void Star(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector rad, int flags)
void Cross(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector rad, int flags)
void Line(LXtObjectID self, const LXtVector v0, const LXtVector v1, const LXtVector col, double alpha, int flags)
void CSeg(LXtObjectID self, const LXtVector cen, const LXtVector offset, double screen, const LXtVector col, int flags)
void PlaneIndicator(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, double rad, int axis, int flags)
void CrossHair(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, int flags)
void PreciseHandle(LXtObjectID self, const LXtVector col, double alpha, const LXtVector pos, const LXtVector size, int flags)
void Ruler(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtMatrix xfrm, double len, int axis, int flags)
void Distance(LXtObjectID self, const LXtVector col, const LXtVector pos, double dist, int axis, int flags)
void Dimension(LXtObjectID self, const LXtVector col, const LXtVector A, const LXtVector B, const char *format, int top, int flags)
void Grid(LXtObjectID self, const LXtVector col, const LXtVector pos, const LXtVector siz, int divX, int divY, int divZ, int axis, int flags)
  • LXi_THANDf_SMALL

  • LXi_THANDf_HOT

  • LXi_THANDf_HIT

  • LXi_THANDf_CONST

  • LXi_THANDf_GHOST

  • LXi_THANDf_FLIP

  • LXi_THANDf_DISABLE

  • LXi_THANDf_AXES

  • LXi_THANDf_AXIS_X

  • LXi_THANDf_AXIS_Y

  • LXi_THANDf_AXIS_Z

  • LXi_THANDv_AXIS

  • LXi_THANDv_MASK

ILxHandleDraw

class ILxHandleDraw

The following methods provide methods to draw the standard tool handles.

Public Functions

void Handle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int part, int flags)

All the 3D handles take a ‘mat’ argument, if a local space transformation is known for an item or selection then the matrix can be passed to these functions. The directions to draw the handle will then be taken directly from the matrix. If this argument is NULL then the handles will be drawn in world/model space.

  • Handle This method draws the most basic type of tool handle, a filled box. It will be drawn in the color specified by the user for handles. If the matrix is NULL, it will be ignored.

  • AxisHandle This method is similar to the generic box handle above but has a line of length ‘len’ drawn from ‘pos’ in the direction of the specified axis. The box handle itself is drawn at the end of the line and will be color coded to the axis it represents.

  • MoveHandle This method draws axis arrows to indicate the direction of the handle constraint. The length of the arrow is determined by user settings for handle size and the color by the axis it represents.

  • RotateHandle

  • RotateMouseHandle Rotation handles are rings drawn on the plane specified by the ‘pos’ and ‘axis’ arguments. To help to make their orientation clearer the rings can be drawn with ‘back face’ removal by setting the ‘facing’ argument. The rings are color coded to the axis. The two angle arguments, if set, will draw a semi-transparent pie segment to indicate an angle on the plane, to disable this set both angle arguments to the same value.

  • ScaleHandle Scale handles are similar to the axis handles but have a solid axis line and an optional ‘offset’ argument. This provides the ability to draw a semi-transparent box along the axis to indicate the delta move of the handle, set the offset to zero to disable this. Turn off ‘line’ if you do not need the axis line.

  • CrossHandle For handles requiring precise placement the following function will draw a set of cross-hairs at the specified position. They will be drawn in the color set by the user for handles.

  • PointHandle The point handle is a single point rendered as a flat square. It is recommended for handles which directly control vertices and will be drawn in the color specified by the user for handles.

  • XHandle This alternative cross-hairs design is used to target things (curve points) for destruction.

  • PlaneHandle This method draws the planar handles used for the move and scale tools.

  • LineHandleHilight This method draws a line in the given direction to indicate that the handle is being used with a linear constraint.

  • PlaneHandleHilight For handles being used with planar constraints the following function will draw a disc style indicator on the plane specified by the ‘norm’ argument.

void AxisHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, double len, int flags)
void MoveHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, int flags)
void RotateHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, double sAngle, double eAngle, int facing, int flags)
void RotateMouseHandle(LXtObjectID self, const LXtVector center, const LXtVector pos, const LXtMatrix mat, int axis, int part, int flags)
void ScaleHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, double offset, int line, int flags)
void CrossHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int part, int flags)
void PointHandle(LXtObjectID self, const LXtVector pos, int part, int flags)
void XHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int part, int flags)
void PlaneHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, int flags)
void LineHandleHilight(LXtObjectID self, const LXtVector pos, const LXtVector dir, int part, int flags)
void PlaneHandleHilight(LXtObjectID self, const LXtVector pos, const LXtVector norm, int part, int flags)

ILxHandleDraw1

class ILxHandleDraw1

This interface was retired in Modo 11.1 for bug 55147.

Public Functions

void Handle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int part, int flags)
void AxisHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, double len, int flags)
void MoveHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, int flags)
void RotateHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, double sAngle, double eAngle, int facing, int flags)
void RotateMouseHandle(LXtObjectID self, const LXtVector center, const LXtVector pos, const LXtMatrix mat, int axis, int part, int flags)
void ScaleHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, double offset, int line, int flags)
void CrossHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int part, int flags)
void PointHandle(LXtObjectID self, const LXtVector pos, int part, int flags)
void XHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int part, int flags)
void PlaneHandle(LXtObjectID self, const LXtVector pos, const LXtMatrix mat, int axis, int part, int flags)
void LineHandleHilight(LXtObjectID self, const LXtVector pos, const LXtVector dir, int part, int flags)
void PlaneHandleHilight(LXtObjectID self, const LXtVector pos, const LXtVector norm, int part, int flags)

ILxEventTranslatePacket

class ILxEventTranslatePacket

This interface was retired in modo 701, and was replaced with an updated one that adds a few more methods.

Public Functions

int ToModel(LXtObjectID self, LXtObjectID toolVector, LXtVector pos, LXtVector axis)

The event translation interface performs the translation of ‘raw’ 2D input events to ‘cooked’ 3D events. Because this translation will vary depending on the type of tool, and its current attributes, it must be handled by an object packet whose methods are called by tools as needed. Constraint modifier tools can participate in tool input by replacing this object with one of their own (possibly calling the original object methods and modifying their results).

  • ToModel This function will convert the raw event data in the tool vectors LXpToolEvent packet into a model-space 3D position in the ‘pos’ argument. It returns the index of the primary axis chosen for the event, and fills ‘axis’. While the axis vector may not be on a principal plane, the index returned must be in 0-2, representing the nearest principal direction to the axis vector. Some Snapping-type modifiers may return this value snapped to some position, and generate zero deltas on moves.

  • ToModelLine This method does the 2D-to-3D conversion with the added constraint that the result position must lie on the model-space line passing through ‘center’ in the (normalized) direction ‘dir’.

  • ToModelPlane This method does the 2D-to-3D conversion with the constraint that the result position will lie in the model-space plane containing the point ‘center’ and perpendicular to ‘normal’.

void ToModelLine(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector dir, LXtVector pos)
void ToModelPlane(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector normal, LXtVector pos)
void ModelDelta(LXtObjectID self, LXtObjectID toolVector, const LXtVector handle, LXtVector delta)

Converting mouse moves to 3D delta vectors requires some information beyond that used for simple position conversion. Specifically, the deltas will be based on an existing handle position which may be independent of the constraining line or plane.

  • ModelDelta This function calculates the 3D position offset from the mouse-down position. If ‘handle’ is not NULL, the implicit constraint plane will be centered at the level of handle. Otherwise the quantized view center is used. To compute a full handle position it is important to use the sum of this delta and the original ToModel position, since some snapping-type modifiers will generate zero deltas for locked moves.

  • ModelLineDelta This function calculates a 3D delta constrained to the line given, from the 2D mouse input.

  • ModelPlaneDelta This function calculates a 3D delta constrained to the line given, from the 2D mouse input.

void ModelLineDelta(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector dir, const LXtVector handle, LXtVector delta)
void ModelPlaneDelta(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector normal, const LXtVector handle, LXtVector delta)
void HitHandle(LXtObjectID self, LXtObjectID toolVector, const LXtVector handle)

Many input events are organized by the client to maintain the handle state and position through the down-move-up mouse input cycle. These methods will also take this approach, hopefully sparing tool makers some duplicated effort.

  • HitHandle The client establishes the handle that will be manipulated with this function, usually during the mouse down event.

  • GetNewPosition This function lets the client find the handle position on mouse move events.

void GetNewPosition(LXtObjectID self, LXtObjectID toolVector, LXtVector pos)
void SetLinearConstraint(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector dir)
void SetPlanarConstraint(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector normal)
int GetConstraint(LXtObjectID self, LXtObjectID toolVector, LXtVector center, LXtVector vector)
void SetSnapRange(LXtObjectID self, double inner, double outer)
void ScreenToRay(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtVector pos, LXtVector dir)

  • ScreenToRay This method converts any given screen coordinates into ray vectors (pos and dir).

void AddGuide(LXtObjectID self, LXtObjectID guide, void *client)

Handling snapping and constraining within event translation allows tools to offer layered, context-aware ‘guides’ to the user. Event translation coordinates multiple snapping/constraining options added by multiple tools in the tool pipe.

  • AddGuide This method allows event translation clients to add dynamic constraints to the ET system. The guide is an ILxEventGuide object.

  • RemoveGuide This method removes the guide previously added by a client. It returns 0 if the guide was not present.

int RemoveGuide(LXtObjectID self, LXtObjectID guide, void *client)
void SetLinearSnapConstraint(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector dir)

  • SetLinearSnapConstraint This is same as SetLinearConstraint except linear snapping. Linear snapping is available along the given vector.

  • SetPlaneSnapConstraint This is same as SetPlaneConstraint except linear snapping. Linear snapping is available along the given vector.

int SnapPosition(LXtObjectID self, LXtObjectID toolVector, const LXtVector pos, LXtVector snapPos)
void SetPlanarSnapConstraint(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector dir)

LXi_EVTRAN_CONSTRAIN_NONE

The active handle can be constrained to move along client-defined lines or planes. Removing all constraints requires reinitializing the handle with HitHandle().

  • SetLinearConstraint Constrain handle to the line passing through ‘center’ and along direction ‘dir’.

  • SetPlanarConstraint Constrain handle to the plane passing through ‘center’ and perpendicular to ‘normal’.

  • GetConstraint This function returns the current constraint by filling ‘center’ and ‘vector’ with the center and the normal(/direction) of the planar(/linear) constraint. It returns one of the following types:

  • LXi_EVTRAN_CONSTRAIN_LINE

  • LXi_EVTRAN_CONSTRAIN_PLANE

  • LXm_EVTRAN_CONSTRAIN_AXIS

  • LXm_EVTRAN_CONSTRAIN_SNAP

  • LXf_EVTRAN_CONSTRAIN_SNAP_LINE

  • LXf_EVTRAN_CONSTRAIN_SNAP_PLANE

  • LXf_EVTRAN_SNAPS

  • LXf_EVTRAN_NOSNAP

  • LXf_EVTRAN_NOQUANT

  • LXf_EVTRAN_NOCONST

  • LXf_EVTRAN_UNSNAPPED

ILxEventTranslatePacket1

class ILxEventTranslatePacket1

This interface was retired in modo 701, and was replaced with an updated one that adds a few more methods.

Public Functions

int ToModel(LXtObjectID self, LXtObjectID toolVector, LXtVector pos, LXtVector axis)
void ToModelLine(LXtObjectID self, LXtObjectID toolVector, LXtVector center, LXtVector dir, LXtVector pos)
void ToModelPlane(LXtObjectID self, LXtObjectID toolVector, LXtVector center, LXtVector normal, LXtVector pos)
void ModelDelta(LXtObjectID self, LXtObjectID toolVector, const LXtVector handle, LXtVector delta)
void ModelLineDelta(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector dir, const LXtVector handle, LXtVector delta)
void ModelPlaneDelta(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector normal, const LXtVector handle, LXtVector delta)
void HitHandle(LXtObjectID self, LXtObjectID toolVector, LXtVector handle)
void GetNewPosition(LXtObjectID self, LXtObjectID toolVector, LXtVector pos)
void SetLinearConstraint(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector dir)
void SetPlanarConstraint(LXtObjectID self, LXtObjectID toolVector, const LXtVector center, const LXtVector normal)
int GetConstraint(LXtObjectID self, LXtObjectID toolVector, LXtVector center, LXtVector vector)
void SetSnapRange(LXtObjectID self, double inner, double outer)
void ScreenToRay(LXtObjectID self, LXtObjectID toolVector, float x, float y, LXtVector pos, LXtVector dir)
void AddGuide(LXtObjectID self, LXtObjectID guide, void *client)
int RemoveGuide(LXtObjectID self, LXtObjectID guide, void *client)
  • LXf_GUIDE_LINE

  • LXf_GUIDE_PLANE

  • LXf_GUIDE_POINT

  • LXf_GUIDE_SNAP

  • LXf_GUIDE_SNAP_NONE

  • LXf_GUIDE_SNAP_AXIS_X

  • LXf_GUIDE_SNAP_AXIS_Y

  • LXf_GUIDE_SNAP_AXIS_Z

  • LXf_GUIDE_SNAP_ALLAXES

  • LXi_GUIDE_OFF

  • LXi_GUIDE_SUGGEST

  • LXi_GUIDE_CHOSEN

  • LXi_GUIDE_FLAGS_NONE

  • LXi_GUIDE_FLAGS_ALWAYS

ILxEventGuide

class ILxEventGuide

Public Functions

int Limits(LXtObjectID self, double inner, double outer)
int Proximity(LXtObjectID self, LXtObjectID toolVector, LXtVector pos, double *dist, int *priority, void *element)
int SetDrawState(LXtObjectID self, int flags)
void SetFlags(LXtObjectID self, int flags)
int Flags(LXtObjectID self)
  • LXsP_TOOL_EVENTTRANS

ILxGeoConstraintPacket

class ILxGeoConstraintPacket

Public Functions

LxResult PointConstrain(LXtObjectID self, LXtVector pos, const LXtVector delta)

  • PointConstrain This method moves this given position to a constrained position.

  • VectorConstrain This method This would add delta to pos unless it hit a constraint along that vector which would clamp the magnitude of delta.

  • Flags This returns the current flags. Now GEOCONS_POINT or GEOCONS_VECTOR is available.

  • ModeMaskSet The effector tool would specify the mode which it uses as a mask.

LxResult VectorConstrain(LXtObjectID self, LXtVector pos, const LXtVector delta)
int Flags(LXtObjectID self)
void ModeMaskSet(LXtObjectID self, int mask)
  • LXf_GEOCONS_POINT

  • LXf_GEOCONS_VECTOR

  • LXi_AREALIGHT_SHAPE_RECTANGLE