Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

HUndoManager.h
1 // Copyright (c) Tech Soft 3D
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef _HUNDOMANAGER_H
11 #define _HUNDOMANAGER_H
12 
13 #ifdef H_PACK_8
14 #pragma pack(push)
15 #pragma pack(8)
16 #endif
17 
18 
19 #include "HTools.h"
20 #include "HEventListener.h"
21 
22 class HEventListener;
23 class HBaseView;
24 
25 
31 class MVO_API HUndoItem
32 {
33 public:
37  HUndoItem() { ; }
38  virtual ~HUndoItem() { ; }
39 
45  virtual void Undo(bool setupOnly = false) { UNREFERENCED(setupOnly); }
51  virtual void Redo(bool setupOnly = false) { UNREFERENCED(setupOnly); }
52 
56  virtual const char * GetName() { return "HUndoItem"; }
57 
58 };
59 
60 
64 class MVO_API HUndoItemCamera : public HUndoItem
65 {
66 public:
72  virtual ~HUndoItemCamera() { ; }
73 
80  virtual void Undo(bool setupOnly = false);
87  virtual void Redo(bool setupOnly = false);
88 
92  virtual HCamera * GetCamera() { return &m_Camera; }
93 
97  virtual const char * GetName() { return "HUndoItemCamera"; }
98 protected:
101 };
102 
103 
108 class MVO_API HUndoItemMatrix : public HUndoItem
109 {
110 public:
114  HUndoItemMatrix(HBaseView *view, int num_items, HC_KEY keys[], float matrices[]);
115  virtual ~HUndoItemMatrix();
116 
124  virtual void Undo(bool setupOnly = false);
131  virtual void Redo(bool setupOnly = false);
132 
136  virtual int GetCount() { return m_Count; }
137 
141  virtual HC_KEY * GetKey() { return m_SegmentKey; }
142  virtual void GetKey(HC_KEY keys[]);
143 
148  virtual float * GetMatrix() { return m_Matrix; }
149  virtual void GetMatrix(float m[]);
150 
154  virtual const char * GetName() { return "HUndoItemMatrix"; }
155 protected:
156  int m_Count;
157  float *m_Matrix;
160 };
161 
162 
163 
168 class MVO_API HUndoManager
169 {
170 public:
174  HUndoManager();
175  virtual ~HUndoManager();
176 
184  int Undo(int steps = 1, bool testOnly = false, bool setupOnly = false);
192  int Redo(int steps = 1, bool testOnly = false, bool setupOnly = false);
193 
200  void AddUndoItem(HUndoItem *item);
201 
205  void Flush();
206 
210  HUndoItem * Peek();
211 
215  void Reset(HBaseView *view);
216 
220  void BeginUndoItemIteration();
221 
227  HUndoItem *GetNextUndoItem();
228 
232  void EndUndoItemIteration();
233 
234 private:
235 
236  struct vdlist_s * m_pUndoItemList;
237  struct vdlist_cursor_s * m_CurrentItem;
238 };
239 
240 #ifdef H_PACK_8
241 #pragma pack(pop)
242 #endif
243 
244 #endif
245 
246 
247 
248 
Definition: HUndoManager.h:108
virtual const char * GetName()
Definition: HUndoManager.h:154
virtual void Undo(bool setupOnly=false)
Definition: HUndoManager.h:45
virtual float * GetMatrix()
Definition: HUndoManager.h:148
HBaseView * m_pView
Definition: HUndoManager.h:100
HCamera m_Camera
Definition: HUndoManager.h:99
HBaseView * m_pView
Definition: HUndoManager.h:159
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:537
HUndoItem()
Definition: HUndoManager.h:37
virtual const char * GetName()
Definition: HUndoManager.h:97
#define HC_KEY
The HEventListener class is the base class for all event types.
Definition: HEventListener.h:210
Definition: HUndoManager.h:64
virtual void Redo(bool setupOnly=false)
Definition: HUndoManager.h:51
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
int m_Count
Definition: HUndoManager.h:156
HC_KEY * m_SegmentKey
Definition: HUndoManager.h:158
virtual HC_KEY * GetKey()
Definition: HUndoManager.h:141
Definition: HUndoManager.h:31
Definition: HUndoManager.h:168
virtual const char * GetName()
Definition: HUndoManager.h:56
float * m_Matrix
Definition: HUndoManager.h:157
virtual HCamera * GetCamera()
Definition: HUndoManager.h:92
virtual int GetCount()
Definition: HUndoManager.h:136