3ds Max C++ API Reference
JPLimitsRestore Class Reference

#include <interpik.h>

+ Inheritance diagram for JPLimitsRestore:

Public Member Functions

 JPLimitsRestore (JointParams *j)
 
void Restore (int isUndo)
 
void Redo ()
 
void EndHold ()
 
- Public Member Functions inherited from RestoreObj
 RestoreObj ()
 
virtual ~RestoreObj ()
 
virtual int Size ()
 
virtual MSTR Description ()
 
virtual INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Public Attributes

JointParamsjp
 
float umin [6]
 
float umax [6]
 
float uspring [6]
 
float rmin [6]
 
float rmax [6]
 
float rspring [6]
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

◆ JPLimitsRestore()

JPLimitsRestore ( JointParams j)
inline
391  {
392  jp = j;
393  for (int i=0; i<jp->dofs; i++) {
394  umin[i] = jp->min[i];
395  umax[i] = jp->max[i];
396  uspring[i] = jp->spring[i];
397  }
398  }
float umax[6]
Definition: interpik.h:388
float umin[6]
Definition: interpik.h:388
float uspring[6]
Definition: interpik.h:388
JointParams * jp
Definition: interpik.h:387
float * spring
Definition: interpik.h:142
int dofs
Definition: interpik.h:146
float * max
Definition: interpik.h:140
float * min
Definition: interpik.h:140

Member Function Documentation

◆ Restore()

void Restore ( int  isUndo)
inlinevirtual
Remarks
The developer implements this method to restore the state of the database to as it was when theHold.Put() was called with this restore object.

Regardless of the value of the isUndo parameter, the method must restore the state of the scene to the one it was in when theHold.Put() was called with this restore object.

RestoreObj::Restore and RestoreObj::Redo may be called several times in a row: these methods must protect against any problems that may arise because of this, such as trying to undo multiple times in a row what has been undone already.
Parameters
isUndoNonzero if Restore() is being called in response to the Undo command; otherwise zero. If isUndo is nonzero, the developer needs to save whatever data they need to allow the user to redo the operation.

Implements RestoreObj.

399  {
400  if (isUndo) {
401  for (int i=0; i<jp->dofs; i++) {
402  rmin[i] = jp->min[i];
403  rmax[i] = jp->max[i];
404  rspring[i] = jp->spring[i];
405  }
406  }
407  for (int i=0; i<jp->dofs; i++) {
408  jp->min[i] = umin[i];
409  jp->max[i] = umax[i];
410  jp->spring[i] = uspring[i];
411  }
412  }
float rspring[6]
Definition: interpik.h:389
float rmin[6]
Definition: interpik.h:389
float rmax[6]
Definition: interpik.h:389

◆ Redo()

void Redo ( )
inlinevirtual
Remarks
This method is called when the user selects the Redo command. The developer should restore the database to the state prior to the last Undo command.

Implements RestoreObj.

413  {
414  for (int i=0; i<jp->dofs; i++) {
415  jp->min[i] = rmin[i];
416  jp->max[i] = rmax[i];
417  jp->spring[i] = rspring[i];
418  }
419  }

◆ EndHold()

void EndHold ( )
inlinevirtual
Remarks
This method is called when theHold.Accept() or theHold.Cancel() is called. This means the restore object is no longer held, it was either tossed out or sent to the undo system. The developer may then call ClearAFlag(A_HELD) to indicate the restore object is no longer being held.

Reimplemented from RestoreObj.

420  {
421  jp->flags &= ~JP_HELD;
422  }
DWORD flags
Definition: interpik.h:145
#define JP_HELD
Definition: interpik.h:50

Member Data Documentation

◆ jp

◆ umin

float umin[6]

◆ umax

float umax[6]

◆ uspring

float uspring[6]

◆ rmin

float rmin[6]

◆ rmax

float rmax[6]

◆ rspring

float rspring[6]