#include
<MComputation.h>
An MComputation allows long computations to check for user interrupts. It is very simple to use. Create a new MComputation object and call the beginComputation method at the beginning of the computation and call the endComputation method when you finish. Then, during the computation, use the isInterruptRequested method to check if the user has requested that the computation terminate.
Example: (of a simple traversal)
MComputation computation; computation.beginComputation(); for (int i= 1; i<1000; i++) { Computation(); // Some expensive operation if (computation.isInterruptRequested()) break ; } computation.endComputation();
Public Member Functions |
|
MComputation () | |
virtual | ~MComputation () |
void | beginComputation () |
bool | isInterruptRequested () |
void | endComputation () |
MComputation::MComputation | ( | ) |
Constructor for MComputation. Instantiate an MComputation before entering a long computation that should be interruptible.
MComputation::~MComputation | ( | ) | [virtual] |
Class destructor
void MComputation::beginComputation | ( | ) |
Mark the beginning of a long computation. The application will begin looking for user interupts.
bool MComputation::isInterruptRequested | ( | ) |
Query whether a user-interrupt has occurred.
void MComputation::endComputation | ( | ) |
Mark the ending of a long computation. The application will stop looking for user interupts.
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |