HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GP_CorrectionFrame.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: Domain pasting Library (C++)
7  *
8  * COMMENTS: Transformation frame with correction.
9  *
10  */
11 
12 #ifndef __GP_CorrectionFrame_h__
13 #define __GP_CorrectionFrame_h__
14 
15 #include "GP_API.h"
16 #include "GP_Xform.h"
17 #include "GP_Frame.h"
18 
19 class GP_FrameHierarchy;
20 
21 
23 {
24  friend class GP_FrameHierarchy;
25 
26 public:
27  // Class c-tors and d-tor.
29  GP_CorrectionFrame(const GP_XformHandle &handle);
30  GP_CorrectionFrame(const GP_Frame &frame, const GP_XformHandle &handle,
31  int history);
32  GP_CorrectionFrame(const GP_CorrectionFrame &frame) = default;
33  ~GP_CorrectionFrame() override;
34 
35  // Deep copy from source frame. Assume the frame is a correction frame.
36  void copyFrom(const GP_Frame &src) override;
37 
38  // Change the transformation and reset the correction xform to identity:
39  void changeXform(const GP_XformHandle &handle) override;
40 
41  // Query the history flag:
42  int hasHistory() const { return myHistoryFlag; }
43 
44  // Query or set the correction transformation:
45  const GP_XformHandle &correction() const { return myCorrection; }
46 
47 
48 protected:
49  // Set the history flag:
50  void eraseHistory () { myHistoryFlag = 0; }
51  void createHistory() { myHistoryFlag = 1; }
52 
53  // Set the correction transformation:
54  void correction(const GP_XformHandle &xf) { myCorrection = xf; }
55 
56 
57 private:
58  GP_XformHandle myCorrection; // computed upon insertion in hierarchy
59  int myHistoryFlag; // 1 if affected by parent xformation
60 };
61 
62 #endif
#define GP_API
Definition: GP_API.h:10
GLenum src
Definition: glew.h:2410
const GP_XformHandle & correction() const
virtual void copyFrom(const GP_Frame &src)
virtual void changeXform(const GP_XformHandle &handle)
void correction(const GP_XformHandle &xf)