JPLimitsRestore Class 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)
 

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...
 

Constructor & Destructor Documentation

JPLimitsRestore ( JointParams j)
inline
393  {
394  jp = j;
395  for (int i=0; i<jp->dofs; i++) {
396  umin[i] = jp->min[i];
397  umax[i] = jp->max[i];
398  uspring[i] = jp->spring[i];
399  }
400  }
float * min
Definition: interpik.h:142
float uspring[6]
Definition: interpik.h:390
float umin[6]
Definition: interpik.h:390
float umax[6]
Definition: interpik.h:390
float * max
Definition: interpik.h:142
float * spring
Definition: interpik.h:144
JointParams * jp
Definition: interpik.h:389
int dofs
Definition: interpik.h:148

Member Function Documentation

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.

401  {
402  if (isUndo) {
403  for (int i=0; i<jp->dofs; i++) {
404  rmin[i] = jp->min[i];
405  rmax[i] = jp->max[i];
406  rspring[i] = jp->spring[i];
407  }
408  }
409  for (int i=0; i<jp->dofs; i++) {
410  jp->min[i] = umin[i];
411  jp->max[i] = umax[i];
412  jp->spring[i] = uspring[i];
413  }
414  }
float * min
Definition: interpik.h:142
float uspring[6]
Definition: interpik.h:390
float rmax[6]
Definition: interpik.h:391
float umin[6]
Definition: interpik.h:390
float umax[6]
Definition: interpik.h:390
float * max
Definition: interpik.h:142
float rspring[6]
Definition: interpik.h:391
float * spring
Definition: interpik.h:144
JointParams * jp
Definition: interpik.h:389
int dofs
Definition: interpik.h:148
float rmin[6]
Definition: interpik.h:391
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.

415  {
416  for (int i=0; i<jp->dofs; i++) {
417  jp->min[i] = rmin[i];
418  jp->max[i] = rmax[i];
419  jp->spring[i] = rspring[i];
420  }
421  }
float * min
Definition: interpik.h:142
float rmax[6]
Definition: interpik.h:391
float * max
Definition: interpik.h:142
float rspring[6]
Definition: interpik.h:391
float * spring
Definition: interpik.h:144
JointParams * jp
Definition: interpik.h:389
int dofs
Definition: interpik.h:148
float rmin[6]
Definition: interpik.h:391
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.

422  {
423  jp->flags &= ~JP_HELD;
424  }
JointParams * jp
Definition: interpik.h:389
DWORD flags
Definition: interpik.h:147
#define JP_HELD
Definition: interpik.h:52

Member Data Documentation

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