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 * Jonathan McGee 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: GDT Library. (Geo Delta) 00015 * 00016 * COMMENTS: A GDT_Transform contains a list of matrices that describe 00017 * the changes to the gdp's primitive transforms. 00018 * 00019 */ 00020 #ifndef __GDT_Transform_h__ 00021 #define __GDT_Transform_h__ 00022 00023 #include "GDT_API.h" 00024 #include <UT/UT_BitArray.h> 00025 #include <UT/UT_PtrArray.h> 00026 #include <UT/UT_Matrix3.h> 00027 00028 #include "GDT_Token.h" 00029 00030 class GB_PrimitiveGroup; 00031 class GDT_TokenList; 00032 00033 class GDT_API GDT_Transform : public GDT_Token 00034 { 00035 public: 00036 GDT_Transform(unsigned int size) : myUsedEntries(size) {} 00037 GDT_Transform(const GDT_Transform &other); 00038 00039 virtual ~GDT_Transform(); 00040 00041 virtual void applyDeltas(const GDT_TokenList &list, 00042 GEO_Detail &gdp, 00043 bool inverse=false) const; 00044 00045 void mergeTransformDeltas( 00046 const GDT_Transform &other, 00047 bool inverse = false); 00048 00049 // Zero all the deltas non-destructively 00050 virtual void zeroDeltas(); 00051 00052 // Begin/end a change to a point position 00053 void beginPrimitiveTransformChange( 00054 const UT_Matrix3 &mat); 00055 void endPrimitiveTransformChange( 00056 const UT_Matrix3 &endmat, 00057 unsigned int index); 00058 00059 virtual void resize(unsigned int size); 00060 00061 virtual unsigned int changed() const 00062 { return myUsedEntries.numBitsSet(); } 00063 virtual unsigned int entries() const 00064 { return myUsedEntries.getSize(); } 00065 00066 // bool takeSnapshot(const GEO_Detail &before_gdp, 00067 // const GEO_Detail &after_gdp, 00068 // const GB_PrimitiveGroup *grp=0); 00069 00070 // I/O Methods 00071 virtual int save(ostream &os, int binary = 0) const; 00072 virtual bool load(UT_IStream &is); 00073 00074 private: 00075 UT_Matrix3 mySavedMat; 00076 00077 UT_PtrArray<UT_Matrix3 *> myValues; 00078 UT_BitArray myUsedEntries; 00079 }; 00080 00081 #endif
1.5.9