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 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: CV expressed in a diffuse coordinate system. 00015 * 00016 * COMMENTS: 00017 */ 00018 00019 00020 #ifndef __GEO_PasteVertex_h__ 00021 #define __GEO_PasteVertex_h__ 00022 00023 #include "GEO_API.h" 00024 #include <UT/UT_Vector3.h> 00025 #include <UT/UT_Matrix3.h> 00026 #include <GP/GP_Xform.h> 00027 00028 class GEO_PasteSurf; 00029 class GEO_Point; 00030 00031 00032 class GEO_API GEO_PasteVertex 00033 { 00034 public: 00035 // C-tor and destructor. 00036 GEO_PasteVertex(void) {} 00037 ~GEO_PasteVertex(void) {} 00038 00039 // Update the world value based on the current frame or vice-versa, 00040 // assuming everything else is unchanged: 00041 void updateWorldImage (void); 00042 void updateDisplacement(void); 00043 00044 // Update the frame origin and transformation by evaluating the base 00045 // surface at the given greville location. This method does not update 00046 // the world image as well. We assume worldgrev(row,col) is valid and 00047 // the base surface exists. 00048 void updateFrame(const GP_PointMatrix &worldgrev, 00049 int row, int col); 00050 00051 // Update the frame origin and transformation by evaluating the base 00052 // surface at the given greville location. This method does not update 00053 // the world image as well. We assume worldgrev(row,col) is valid and 00054 // the base surface exists. 00055 // Different from updateFrame() because it computes the tangent vectors 00056 // directly from the base surface, along its u and v flow lines. 00057 void updateIsoFrame(const GP_PointMatrix &gworld, 00058 int r, int c); 00059 00060 // Set the internal data. Certain updates might be required thereafter. 00061 // See the update methods in this class. 00062 void setDisplacement(const UT_Vector3 &v) 00063 { 00064 myDisplace = v; 00065 } 00066 void setFrame(const UT_Vector3 orig) 00067 { 00068 myFrameOrig = orig; 00069 myFrameMatx.identity(); 00070 myFrameInvm.identity(); 00071 myInverseOK = 1; 00072 } 00073 void setFrame(const UT_Vector3 orig,const UT_Matrix3 &matx) 00074 { 00075 myFrameOrig = orig; 00076 myFrameMatx = matx; 00077 myInverseOK = 0; 00078 } 00079 00080 void translateOrigin(const UT_Vector3 delta) 00081 { 00082 myFrameOrig += delta; 00083 } 00084 00085 void elevateDisplacement(float delta) 00086 { 00087 myDisplace.z() += delta; 00088 } 00089 void flipDisplacement() 00090 { 00091 myDisplace.z() = -myDisplace.z(); 00092 } 00093 00094 const UT_Vector3 &displacement(void) const { return myDisplace; } 00095 00096 // Get and set the external information: base surface and geo point: 00097 GEO_PasteSurf *baseSurface(void) const { return myBaseSurf; } 00098 void baseSurface(GEO_PasteSurf *s) { myBaseSurf = s; } 00099 00100 GEO_Point *point(void) const { return myPoint; } 00101 void point(GEO_Point &ppt, int update = 1) 00102 { 00103 myPoint = &ppt; 00104 if (update) updateDisplacement(); 00105 } 00106 00107 // Equality operator tests pointer equality of point and base surf. 00108 int operator==(const GEO_PasteVertex &vtx) const; 00109 00110 // Assignment operator overrides point and base surf pointers. 00111 GEO_PasteVertex &operator=(const GEO_PasteVertex &vtx); 00112 00113 00114 private: 00115 UT_Vector3 myDisplace; // the displacement from the greville 00116 00117 UT_Vector3 myFrameOrig; // origin in pasted space 00118 UT_Matrix3 myFrameMatx; // local frame on base surface 00119 UT_Matrix3 myFrameInvm; // inverse matrix 00120 char myInverseOK; // 1 if inverse matrix is valid 00121 00122 GEO_PasteSurf *myBaseSurf; // base surface for the pasted CV 00123 GEO_Point *myPoint; // image in object (world) space 00124 00125 // Take two domain points in world coordinates and return the second one 00126 // in the space of the domain. Return 0 if OK, else -1. 00127 int computeIncrement(const GP_Point &gcrt, 00128 GP_Point &gnext) const; 00129 }; 00130 00131 #endif 00132
1.5.9