MSelectionInfo Class Reference
#include <MSelectionContext.h>
Class to allow access to the selection state information.
MSelectionInfo encapsulates the selection state information.
It is read-only and cannot be instantiated by plug-ins. During the hit test phase or the selection interpretation phase of Viewport 2.0 selection, an MSelectionInfo instance is passed to the following functions for plug-ins to query the current selection state information:
The MSelectionInfo instance is only valid inside these functions, thus plug-ins should not save its pointer.
bool singleSelection (MStatus *ReturnStatus=NULL) const
Determines if we want to select a single shape or component. More...
bool selectClosest (MStatus *ReturnStatus=NULL) const
Determines if we want to select the closest shape or component. More...
bool selectable (const MSelectionMask &mask, MStatus *ReturnStatus=NULL) const
Given the selection mask, determines if the shape is selectable. More...
bool selectableComponent (bool displayed, const MSelectionMask &mask, MStatus *ReturnStatus=NULL) const
Given the selection mask, determines if the component is selectable. More...
MStatus selectRect (unsigned int &x, unsigned int &y, unsigned int &width, unsigned int &height) const
Get the current selection rectangle dimensions. More...
bool isRay (MStatus *ReturnStatus=NULL) const
Get whether or not there is a selection ray. More...
MMatrix getAlignmentMatrix (MStatus *ReturnStatus=NULL) const
Returns the alignment matrix. More...
MStatus getLocalRay (MPoint &pnt, MVector &vec) const
Get the selection ray. More...
bool selectForHilite (const MSelectionMask &mask, MStatus *ReturnStatus=NULL) const
Given the selection mask, determines if this shape can be selected for the hilite list. More...
bool selectOnHilitedOnly (MStatus *ReturnStatus=NULL) const
Determines if components can only be selected if the shape is hilited. More...
bool singleSelection
(
MStatus *
ReturnStatus = NULL
)
const
Determines if we want to select a single shape or component.
Parameters
[out] ReturnStatus Status code.
Returns
true a single shape/component should be selected
false allow multiple shapes/components to be selected
Status Codes:
bool selectClosest
(
MStatus *
ReturnStatus = NULL
)
const
Determines if we want to select the closest shape or component.
Parameters
[out] ReturnStatus Status code.
Returns
true the closest shape/component should be selected
false any shape/component within the selection rectangle may be selected, not necessarily the closest
Status Codes:
Given the selection mask, determines if the shape is selectable.
Parameters
[in] mask selection mask
[out] ReturnStatus Status code.
Returns
true the shape is selectable
false the shape not is selectable
Status Codes:
bool selectableComponent
(
bool
displayed ,
const MSelectionMask &
mask ,
MStatus *
ReturnStatus = NULL
)
const
Given the selection mask, determines if the component is selectable.
Parameters
[in] displayed is the component displayed
[in] mask selection mask
[out] ReturnStatus Status code.
Returns
true the component is selectable
false the component not is selectable
Status Codes:
MStatus selectRect
(
unsigned int &
x ,
unsigned int &
y ,
unsigned int &
width ,
unsigned int &
height
)
const
Get the current selection rectangle dimensions.
Parameters
[out] x Lower left corner of the selection rectangle (x coordinate).
[out] y Lower left corner of the selection rectangle (y coordinate).
[out] width Width of the selection rectangle.
[out] height Height of the selection rectangle.
Returns Status code
Status Codes:
bool isRay
(
MStatus *
ReturnStatus = NULL
)
const
Get whether or not there is a selection ray.
This method is used to find ray object intersection.
Parameters
[out] ReturnStatus Status code.
Returns
true there is a selection ray
false there is no selection ray
Status Codes:
Returns the alignment matrix.
This method is used to find ray object intersection. If isRay() returns false, this will return the identity matrix.
This method maps the world space selection vector into the object space of the object. It then computes the matrix to transform the object so that the local space selection vector is aligned with the positive Z-axis.
Parameters
[out] ReturnStatus Status code.
Returns The alignment matrix
Status Codes:
Get the selection ray.
This method is used to find ray object intersection. If isRay() returns false, the starting point will be (0, 0, 0, 1) and the direction vector (0, 0, 0).
Parameters
[out] pnt ray starting point
[out] vec ray direction
Returns Status code
Status Codes:
Given the selection mask, determines if this shape can be selected for the hilite list.
Parameters
[in] mask the mask to test
[out] ReturnStatus Status code.
Returns
true can select for hilite
false can't select for hilite
Status Codes:
bool selectOnHilitedOnly
(
MStatus *
ReturnStatus = NULL
)
const
Determines if components can only be selected if the shape is hilited.
Parameters
[out] ReturnStatus Status code.
Returns
true can only select components if the shape is hilited
false components can be selected from both hilited and non-hilited shapes
Status Codes:
const char * className
(
)
static
Returns the name of this class.
Returns Name of this class.
The documentation for this class was generated from the following files:
MSelectionContext.h
MSelectionContext.cpp