TabletManager Class Reference

TabletManager Class Referenceabstract

#include <ITabletInterface.h>

Class Description

Remarks
The TabletManager provides a convenient centralized interface for working with pressure-sensitive graphics tablets in 3ds Max. Plugins register a TabletCallback object that receives notifications whenever a user interacts with a graphics tablet. For example code showing the use of the TabletManager, see maxsdk/samples/PainterInterface

Public Types

enum  PointerType { unknown = 0, pen, cursor, eraser }
 

Public Member Functions

virtual CoreExport bool RegisterTabletCallback (TabletCallback *callback)=0
 
virtual CoreExport bool UnregisterTabletCallback (TabletCallback *callback)=0
 
virtual CoreExport bool GetPenDown ()=0
 
virtual CoreExport float GetPressure ()=0
 
virtual CoreExport float GetRotation ()=0
 
virtual CoreExport float GetTangentialPressure ()=0
 
virtual CoreExport int GetX ()=0
 
virtual CoreExport int GetY ()=0
 
virtual CoreExport int GetZ ()=0
 
virtual CoreExport int GetXTilt ()=0
 
virtual CoreExport int GetYTilt ()=0
 
virtual CoreExport PointerType GetPointerType ()=0
 

Member Enumeration Documentation

Remarks
Indicates the pointer (stylus) type in use. Returned by the GetPointerType method.
Enumerator
unknown 
pen 
cursor 
eraser 
35  {
36  unknown = 0,
37  pen,
38  cursor,
39  eraser
40  };
Definition: ITabletInterface.h:36
Definition: ITabletInterface.h:37
Definition: ITabletInterface.h:39
Definition: ITabletInterface.h:38

Member Function Documentation

virtual CoreExport bool RegisterTabletCallback ( TabletCallback callback)
pure virtual
Remarks
This method is called to register a TabletCallback object. This object's Event method will be called whenever a connected graphics tablet sends an event message. The user of the tablet can then call the various TabletManager methods to access the tablet stylus position, pressure, tilt, etc.
Parameters
callback- The TabletCallback object that will receive the event updates
Returns
true if the callback was registered, false otherwise
virtual CoreExport bool UnregisterTabletCallback ( TabletCallback callback)
pure virtual
Remarks
This method is called to unregister a TabletCallback object previously registered via RegisterTabletCallback.
Parameters
callback- The TabletCallback object that will be unregistered
Returns
true if the callback was unregistered, false otherwise
virtual CoreExport bool GetPenDown ( )
pure virtual
Remarks
This method returns whether or not the tablet pen is touching the tablet surface.
Returns
true if the stylus is touching the tablet surface, false otherwise
virtual CoreExport float GetPressure ( )
pure virtual
Remarks
This method returns the pressure with which the tablet stylus is touching the tablet surface. Range is 0.0 - 1.0.
Returns
The stylus pressure, range 0.0 - 1.0
virtual CoreExport float GetRotation ( )
pure virtual
Remarks
This method returns the rotation angle of the tablet stylus, if the stylus supports rotation angle output. Returns the rotation of the current tool in degrees, where zero means the tip of the stylus is pointing towards the top of the tablet, a positive value means it's turned to the right, and a negative value means it's turned to the left. If the device does not support rotation, this value is always 0.0.
Returns
The stylus rotation angle
virtual CoreExport float GetTangentialPressure ( )
pure virtual
Remarks
This method returns the tangential pressure for the device, if it is supported. This is typically given by a finger wheel on an airbrush tool. The range is from -1.0 to 1.0. 0.0 indicates a neutral position. If the device does not support tangential pressure, this value is always 0.0.
Returns
The stylus tangential pressure
virtual CoreExport int GetX ( )
pure virtual
Remarks
This method returns the x position of the device.
Returns
The x position
virtual CoreExport int GetY ( )
pure virtual
Remarks
This method returns the y position of the device.
Returns
The y position
virtual CoreExport int GetZ ( )
pure virtual
Remarks
This method returns the z position of the device. Typically this is represented by a wheel on a 4D Mouse. If the device does not support a Z-axis, this value is always zero.
Returns
The z position
virtual CoreExport int GetXTilt ( )
pure virtual
Remarks
This method returns the angle between the device (a pen, for example) and the perpendicular in the direction of the x axis. Positive values are towards the tablet's physical right. The angle is in the range -60 to +60 degrees.
Returns
The x tilt
virtual CoreExport int GetYTilt ( )
pure virtual
Remarks
This method returns the angle between the device (a pen, for example) and the perpendicular in the direction of the y axis. Positive values are towards the tablet's physical right. The angle is in the range -60 to +60 degrees.
Returns
The y tilt
virtual CoreExport PointerType GetPointerType ( )
pure virtual
Remarks
This method returns the type of stylus or pointing device that generated the event.
See also
PointerType
Returns
The pointer type