Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes

MPxClientDeviceNode Class Reference

This reference page is linked to from the following overview topics: Autodesk Maya 2013.


Search for all occurrences

Detailed Description

Base class for client device creation.

MPxClientDeviceNode is an extension of MPxThreadedDevice node, and is intended for creating maya devices that act as clients. An example of this will be a Maya device that listens for animation data that is sent from another application.

See MPxThreadedDevice node for details on how to use the memory queue system

Plug-ins should create the MPxClientDeviceNode with a kCustomClient parameter.

This class contains the serverName and deviceName attributes. If these attributes are changed, the node will restart the thread so that processing will continue with the new settings.

NOTE: This class relies on the idle event queue to perform the node attribute updating. As a result, it will not work in Maya batch mode.

#include <MPxClientDeviceNode.h>

Inheritance diagram for MPxClientDeviceNode:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ClientType { kUser, kInternal }
 

Defines the type client server.

More...

Public Member Functions

 MPxClientDeviceNode (ClientType typ=kUser)
 Constructor.
virtual ~MPxClientDeviceNode ()
 Class destructor.
virtual MPxNode::Type type () const
 Returns the type of node that this is.
ClientType clientType ()
 Returns the client type of this node.
virtual void threadHandler (const char *serverName, const char *deviceName)
 This method should be overridden in user defined nodes rather than the parameterless version that exists in the base class.

Static Public Member Functions

static const char * className ()
 Returns the name of this class.

Static Public Attributes

static MObject serverName
 Server.
static MObject deviceName
 Device.

Member Enumeration Documentation

enum ClientType

Defines the type client server.

Enumerator:
kUser 

Custom client implemented in a plug-in.

kInternal 

Autodesk specific.


Constructor & Destructor Documentation

Constructor.

The constructor should never call any methods from MPxNode or make any calls that require the existence of the MObject associated with the user defined node. The postConstructor method should be used to do any initialization of this kind.

For example, the postConstructor method would be used to call: setRefreshOutputAttributes()

Parameters:
[in]typespecify what type of client will be implemented

Member Function Documentation

MPxNode::Type type ( ) const [virtual]

Returns the type of node that this is.

This is used to differentiate user defined nodes that are derived off different MPx base classes.

It is not necessary to override this method.

Returns:
Type of the node

Reimplemented from MPxThreadedDeviceNode.

Returns the client type of this node.

Returns:
Client type of the node
void threadHandler ( const char *  serverName,
const char *  deviceName 
) [virtual]

This method should be overridden in user defined nodes rather than the parameterless version that exists in the base class.

Thread management( creation/destruction/shutdown ) will be handled by Maya. This method will be called when the thread has been created. In a typical implementation, the thread handler will implement a loop for reading information from an external device.

Parameters:
[in]serverNamecurrent server name
[in]deviceNamecurrent device name
const char * className ( ) [static]

Returns the name of this class.

Returns:
The name of this class.

Reimplemented from MPxThreadedDeviceNode.


MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode
MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode MPxClientDeviceNode