00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Cristin Barghiel 00008 * Side Effects Software Inc. 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: Domain pasting Library (C++) 00015 * 00016 * COMMENTS: Transformation frame with correction. 00017 * 00018 */ 00019 00020 #ifndef __GP_CorrectionFrame_h__ 00021 #define __GP_CorrectionFrame_h__ 00022 00023 #include "GP_API.h" 00024 #include <iostream.h> 00025 #include "GP_Xform.h" 00026 #include "GP_Frame.h" 00027 00028 class GP_FrameHierarchy; 00029 00030 00031 class GP_API GP_CorrectionFrame : public GP_Frame 00032 { 00033 friend class GP_FrameHierarchy; 00034 00035 public: 00036 // Class c-tors and d-tor. 00037 GP_CorrectionFrame(void); 00038 GP_CorrectionFrame(const GP_XformHandle &handle); 00039 GP_CorrectionFrame(const GP_Frame &frame, 00040 const GP_XformHandle &handle, int history); 00041 GP_CorrectionFrame(const GP_CorrectionFrame &frame); 00042 virtual ~GP_CorrectionFrame(void); 00043 00044 // Deep copy from source frame. Assume the frame is a correction frame. 00045 virtual void copyFrom(const GP_Frame &src); 00046 00047 // Change the transformation and reset the correction xform to identity: 00048 virtual void changeXform(const GP_XformHandle &handle); 00049 00050 // Query the history flag: 00051 int hasHistory(void) const { return myHistoryFlag; } 00052 00053 // Query or set the correction transformation: 00054 const GP_XformHandle &correction(void) const { return myCorrection; } 00055 00056 00057 protected: 00058 // Set the history flag: 00059 void eraseHistory (void) { myHistoryFlag = 0; } 00060 void createHistory(void) { myHistoryFlag = 1; } 00061 00062 // Set the correction transformation: 00063 void correction(const GP_XformHandle &xf) { myCorrection = xf; } 00064 00065 00066 private: 00067 GP_XformHandle myCorrection; // computed upon insertion in hierarchy 00068 int myHistoryFlag; // 1 if affected by parent xformation 00069 }; 00070 00071 #endif
1.5.9