Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUndoManager.h
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: de63395c20b49bc1e3780d23a08a8740abff1ff3 $
13 //
14 
15 
16 #ifndef _HUNDOMANAGER_H
17 #define _HUNDOMANAGER_H
18 
19 #ifdef H_PACK_8
20 #pragma pack(push)
21 #pragma pack(8)
22 #endif
23 
24 
25 #include "HTools.h"
26 #include "HEventListener.h"
27 
28 class HEventListener;
29 class HBaseView;
30 
31 
37 class MVO_API HUndoItem
38 {
39 public:
43  HUndoItem() { ; }
44  virtual ~HUndoItem() { ; };
45 
51  virtual void Undo(bool setuponly = false) { ; };
57  virtual void Redo(bool setuponly = false) { ; };
58 
62  virtual const char * GetName() { return "HUndoItem"; };
63 
64 };
65 
66 
70 class MVO_API HUndoItemCamera : public HUndoItem
71 {
72 public:
78  virtual ~HUndoItemCamera() { ; };
79 
86  virtual void Undo(bool setuponly = false);
93  virtual void Redo(bool setuponly = false);
94 
98  virtual HCamera * GetCamera() { return &m_Camera; };
99 
103  virtual const char * GetName() { return "HUndoItemCamera"; };
104 protected:
105  HCamera m_Camera;
107 };
108 
109 
114 class MVO_API HUndoItemMatrix : public HUndoItem
115 {
116 public:
120  HUndoItemMatrix(HBaseView *view, int num_items, HC_KEY *keys, float *matrices);
121  virtual ~HUndoItemMatrix();
122 
130  virtual void Undo(bool setuponly = false);
137  virtual void Redo(bool setuponly = false);
138 
142  virtual int GetCount() { return m_Count; };
143 
147  virtual HC_KEY * GetKey() { return m_SegmentKey; };
148  virtual void GetKey(HC_KEY *keys);
149 
154  virtual float * GetMatrix() { return m_Matrix; };
155  virtual void GetMatrix(float *m);
156 
160  virtual const char * GetName() { return "HUndoItemMatrix"; };
161 protected:
162  int m_Count;
163  float *m_Matrix;
166 };
167 
168 
169 
174 class MVO_API HUndoManager
175 {
176 public:
180  HUndoManager();
181  virtual ~HUndoManager();
182 
190  int Undo(int steps = 1, bool testOnly = false, bool setuponly = false);
198  int Redo(int steps = 1, bool testOnly = false, bool setuponly = false);
199 
206  void AddUndoItem(HUndoItem *item);
207 
211  void Flush();
212 
216  HUndoItem * Peek();
217 
221  void Reset(HBaseView *view);
222 
226  void BeginUndoItemIteration();
227 
233  HUndoItem *GetNextUndoItem();
234 
238  void EndUndoItemIteration();
239 
240 
241 private:
242 
243 
244  struct vlist_s * m_pUndoItemList;
246  HUndoItem * m_pCurrentItem;
247  HUndoItem * m_pFirstItem;
248  HUndoItem * m_pLastItem;
249  HUndoItem * m_pTempUndoItem;
250 
251 };
252 
253 #ifdef H_PACK_8
254 #pragma pack(pop)
255 #endif
256 
257 #endif
258 
259 
260 
261 
Definition: HUndoManager.h:114
virtual float * GetMatrix()
Definition: HUndoManager.h:154
HBaseView * m_pView
Definition: HUndoManager.h:106
HBaseView * m_pView
Definition: HUndoManager.h:165
#define HC_KEY
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:543
HUndoItem()
Definition: HUndoManager.h:43
virtual void Redo(bool setuponly=false)
Definition: HUndoManager.h:57
The HEventListener class is the base class for all event types.
Definition: HEventListener.h:199
Definition: HUndoManager.h:70
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:337
virtual void Undo(bool setuponly=false)
Definition: HUndoManager.h:51
HC_KEY * m_SegmentKey
Definition: HUndoManager.h:164
virtual HC_KEY * GetKey()
Definition: HUndoManager.h:147
Definition: HUndoManager.h:37
Definition: HUndoManager.h:174
virtual const char * GetName()
Definition: HUndoManager.h:62
float * m_Matrix
Definition: HUndoManager.h:163
virtual HCamera * GetCamera()
Definition: HUndoManager.h:98
virtual int GetCount()
Definition: HUndoManager.h:142