Public Member Functions | Static Public Member Functions

MSelectInfo Class Reference

This reference page is linked to from the following overview topics: Selection.


Search for all occurrences

Detailed Description

Selection state information used in MPxSurfaceShapeUI::select.

MSelectInfo is used with user defined shape selection and is passed as an argument to the MPxSurfaceShapeUI::select method. This class encapsulates all the selection state information for selected objects.

Examples:

apiMeshShapeUI.cpp, apiMeshShapeUI.h, apiSimpleShapeUI.cpp, apiSimpleShapeUI.h, and quadricShape.cpp.

#include <MSelectInfo.h>

Inheritance diagram for MSelectInfo:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MSelectInfo ()
 Constructor.
 MSelectInfo (const MSelectInfo &in)
 Copy constructor.
 ~MSelectInfo ()
 Destructor.
M3dView view ()
 Returns the view that the current selection is taking place in.
bool singleSelection () const
 This method determines if we want to select a single object.
bool selectClosest () const
 Determines if we want to select the closest object.
bool selectable (MSelectionMask &mask) const
 Given the selection mask, this method determines if the object is selectable.
bool selectableComponent (bool displayed, MSelectionMask &mask) const
 Given the selection mask, this method determines if the component is selectable.
void selectRect (unsigned int &x, unsigned int &y, unsigned int &width, unsigned int &height) const
 Get the current selection rectangle dimensions.
bool isRay () const
 Is there a selection ray.
MMatrix getAlignmentMatrix () const
 Returns the alignment matrix.
void getLocalRay (MPoint &, MVector &) const
 Get the selection ray.
bool selectForHilite (const MSelectionMask &) const
 Give the selection mask, can this object be selected for the hilite list.
bool selectOnHilitedOnly () const
 This means that you can only select components if the object is hilited.
int highestPriority () const
 Returns the highest selection priority value.
void setHighestPriority (int)
 Sets the highest selection priority value.
void addSelection (const MSelectionList &item, const MPoint &point, MSelectionList &list, MPointArray &points, const MSelectionMask &mask, bool isComponent)
 Adds components or objects to the active selection list.
bool setSnapPoint (const MPoint &point)
 When a snapping operation is being performed the shape's overridden MPxSurfaceShapeUI::snap() method can call this method to set the point to be snapped to.
MDagPath selectPath () const
 Returns a path to the item that is being selected.

Static Public Member Functions

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

Constructor & Destructor Documentation

MSelectInfo ( const MSelectInfo other)

Copy constructor.

Parameters:
[in]otherobject to copy

Member Function Documentation

M3dView view ( )

Returns the view that the current selection is taking place in.

Returns:
The view
bool singleSelection ( ) const

This method determines if we want to select a single object.

Returns:
  • true a single object should be selected
  • false do not want to select a single object
bool selectClosest ( ) const

Determines if we want to select the closest object.

Returns:
  • true the closest object should be selected
  • false do not want to select the closest object
bool selectable ( MSelectionMask mask) const

Given the selection mask, this method determines if the object is selectable.

Parameters:
[in]maskselection mask
Returns:
  • true the object is selectable
  • false the object not is selectable
bool selectableComponent ( bool  displayed,
MSelectionMask mask 
) const

Given the selection mask, this method determines if the component is selectable.

Parameters:
[in]displayedis the component displayed
[in]maskselection mask
Returns:
  • true the component is selectable
  • false the component not is selectable
void selectRect ( unsigned int &  x,
unsigned int &  y,
unsigned int &  width,
unsigned int &  height 
) const

Get the current selection rectangle dimensions.

Parameters:
[out]xLower left corner of the selection rectangle (x coordinate).
[out]yLower left corner of the selection rectangle (y coordinate).
[out]widthWidth of the selection rectangle.
[out]heightHeight of the selection rectangle.
bool isRay ( ) const

Is there a selection ray.

This method isused to find ray object intersection.

Returns:
  • true there is a selection ray
  • false there is no selection ray
MMatrix getAlignmentMatrix ( ) const

Returns the alignment matrix.

This method is used to find ray object intersection.

Returns:
The alignment matrix
void getLocalRay ( MPoint pnt,
MVector vec 
) const

Get the selection ray.

This method isused to find ray object intersection.

Parameters:
[out]pntray starting point
[out]vecray direction
bool selectForHilite ( const MSelectionMask mask) const

Give the selection mask, can this object be selected for the hilite list.

Parameters:
[in]maskthe mask to test
Returns:
  • true can select for hilite
  • false can't select for hilite
bool selectOnHilitedOnly ( ) const

This means that you can only select components if the object is hilited.

Returns:
  • true can only select components if object is hilited
  • false can select components for non-hilited object
int highestPriority ( ) const

Returns the highest selection priority value.

Returns:
The priority value
void setHighestPriority ( int  value)

Sets the highest selection priority value.

Parameters:
[in]valuethe priority value
void addSelection ( const MSelectionList item,
const MPoint point,
MSelectionList list,
MPointArray points,
const MSelectionMask mask,
bool  isComponent 
)

Adds components or objects to the active selection list.

For an example of how this is used please refer to the method definition apiMeshShapeUI::select() in the devkit example code apiMeshShape.cpp.

Parameters:
[in]itemThe component or object to add to the list
[in]pointThe world space point representing the selected object. This is used during single-click selection when the click overlaps multiple objects in order to determine which point is closest to the camera.
[out]listThe selection list to add the item(s) to
[out]pointsA copy of the points of all currently selected components in the list (if components are selected)
[in]maskMask used to determine selection priority
[in]isComponentIndicates whether item to be added is an object or a component
bool setSnapPoint ( const MPoint point)

When a snapping operation is being performed the shape's overridden MPxSurfaceShapeUI::snap() method can call this method to set the point to be snapped to.

If setSnapPoint() is called multiple times then the point passed in which is nearest to the current cursor location will be used. So the shape can either compute the snap point itself and call setSnapPoint() once or it can make a series of calls and let setSnapPoint() determine the closest of those for itself.

Remarks:
The point must be given in world space coordinates..
Parameters:
[in]pointThe point to be snapped to
Returns:
  • true the point is closer
  • false the point isn't closest
MDagPath selectPath ( ) const

Returns a path to the item that is being selected.

Returns:
A path to the item being selected
const char * className ( ) [static]

Returns the name of this class.

Returns:
Name of this class.

Reimplemented from MDrawInfo.


MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo
MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo MSelectInfo