HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_UndoModel.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SOP_UndoModel.h ( SOP Library, C++)
7  *
8  * COMMENTS: class to handle undos for hard and soft modelling
9  * changes
10  */
11 
12 #ifndef __SOP_UndoModel_h__
13 #define __SOP_UndoModel_h__
14 
15 #include "SOP_API.h"
16 #include <UT/UT_Undo.h>
17 #include <UT/UT_String.h>
18 
19 class SOP_SoftLockData;
20 class SOP_Node;
21 class SOP_SoftLockData;
22 class GU_Detail;
23 
25 {
26 public:
27  SOP_UndoModel();
28  virtual ~SOP_UndoModel();
29 
30  void init(unsigned char prev_lock,
31  unsigned char new_lock,
32  SOP_Node *sop,
33  SOP_SoftLockData *prev_slockdata = 0,
34  SOP_SoftLockData *new_slockdata = 0);
35 
36  virtual void undo();
37  virtual void redo();
38 
39  void setName(const char *name) { myName.harden(name); }
40  const char *getName() { return (const char *)myName; }
41 
42 protected:
43  typedef enum
44  {
46  SOPUNDOMODEL_REDO
47  } SOP_UndoModelOperation;
48 
49  int hasSopUndo() { return myHasSopUndo; }
50 
51  void doUndo(void *modeler);
52  void doRedo(void *modeler);
53 
54 private:
55  void loadForHardLock(SOP_UndoModelOperation operation,
56  void *modeler);
57  void loadForSoftLock(SOP_UndoModelOperation operation,
58  void *modeler);
59  void unlockSop(SOP_UndoModelOperation operation,
60  void *modeler);
61 
62  // verb helper method
63  void createSopSlockData( SOP_SoftLockData &loaded_diff,
64  SOP_Node *sop) const;
65 
66  int myOpId;
67 
68  UT_String myOldHardLockFileName;
69  UT_String myNewHardLockFileName;
70  UT_String mySoftLockFileName;
71 
72  unsigned char myPrevLock;
73  unsigned char myNewLock;
74 
75  int myHasSopUndo;
76 
77  UT_String myName;
78 };
79 #endif
virtual void redo()=0
virtual void undo()=0
const char * getName()
Definition: SOP_UndoModel.h:40
GLuint const GLchar * name
Definition: glcorearb.h:785
void setName(const char *name)
Definition: SOP_UndoModel.h:39
#define SOP_API
Definition: SOP_API.h:10