MPxRepresentation Class Reference

+ この参照ページは、次の概要トピックと関連付けられています。

#include <MPxRepresentation.h>

Class Description

Abstract base class for user defined representations.

MPxRepresentation is an abstract base class that can be used to provide an interface and services for user defined representations.

Representations are owned by a scene assembly node (see MPxAssembly). A scene assembly node will activate one of its representations; representations must therefore support activate and inactivate operations.

This class can be used to implement new kinds of representations within Maya that behave in a similar manner to the representations included in the scene assembly reference Maya plugin, which uses MPxRepresentation as a base class for its representations.

Note that use of this class to implement representations is not mandatory: it provides an interface that is convenient for dealing consistently with representations, as well as an inactivate() implementation that is widely useful (clear out the assembly). Also note that MPxRepresentation is not associated with a corresponding Maya DAG or DG node.

For use of scene assembly nodes, see function set MFnAssembly.

+ Examples:

Public Member Functions

virtual ~MPxRepresentation ()
 Class destructor.
 
virtual bool activate ()=0
 Activate this representation. More...
 
virtual bool inactivate ()
 Inactivate this representation. More...
 
virtual MString getType () const =0
 Return the representation type string. More...
 
MString getName () const
 Returns the name of the representation. More...
 
virtual bool canApplyEdits () const
 Determines whether this representation can apply tracked edits to its data. More...
 

Protected Member Functions

 MPxRepresentation (MPxAssembly *assembly, const MString &name)
 Class constructor, to be called by concrete derived classes. More...
 
MPxAssemblygetAssembly () const
 USE _getAssembly() IN SCRIPT. More...
 

Constructor & Destructor Documentation

MPxRepresentation ( MPxAssembly assembly,
const MString name 
)
protected

Class constructor, to be called by concrete derived classes.

The representation does not own the assembly node given as argument; rather, it is the assembly node that owns the representation (and therefore destroys it).

Parameters
[in]assemblyThe assembly node which owns this representation.
[in]nameThe name of this representation.

Member Function Documentation

bool activate ( )
pure virtual

Activate this representation.

Returns
true if the activation succeeded, false otherwise.
+ Examples:
bool inactivate ( )
virtual

Inactivate this representation.

Implementation in this class is to clear out the assembly. Inactivation will fail and return false if the name of the currently-active representation doesn't match the name of this representation.

Returns
true if the inactivation succeeded, false otherwise.
MString getType ( ) const
pure virtual

Return the representation type string.

Returns
Representation type.
+ Examples:
MString getName ( ) const

Returns the name of the representation.

Returns
Representation name.
bool canApplyEdits ( ) const
virtual

Determines whether this representation can apply tracked edits to its data.

Implementation in this class returns false.

Returns
true if the representation can apply tracked edits, false otherwise.
+ Examples:
MPxAssembly * getAssembly ( ) const
protected

USE _getAssembly() IN SCRIPT.

Returns the assembly which owns this representation.

Note: in Python scripts, use MPxRepresentation._getAssembly() instead.

Returns
Representation's assembly node.

The documentation for this class was generated from the following files:
  • MPxRepresentation.h
  • MPxRepresentation.cpp