00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GDT_Detail_h__
00022 #define __GDT_Detail_h__
00023
00024 #include "GDT_API.h"
00025 #include "GDT_PointList.h"
00026 #include "GDT_PrimitiveList.h"
00027 #include "GDT_VertexList.h"
00028 #include "GDT_CoordinateFrames.h"
00029 #include <GEO/GEO_Delta.h>
00030
00031 class UT_IStream;
00032 class GEO_Detail;
00033
00034 class GDT_API GDT_Detail : public GEO_Delta
00035 {
00036 public:
00037
00038 GDT_Detail() : myChangeType(GDT_CHANGE_NONE) {}
00039 GDT_Detail(const GDT_Detail &other);
00040 virtual ~GDT_Detail() {}
00041
00042
00043
00044
00045
00046
00047 void applyDeltas(GEO_Detail &gdp) const;
00048 void applyInverseDeltas(GEO_Detail &gdp) const;
00049
00050
00051
00052 virtual void applyScaledPointDelta(GEO_Detail &gdp, GEO_Point &pt,
00053 float scale) const;
00054 virtual void applyScaledVertexDelta(GEO_Detail &gdp,
00055 GEO_Primitive &prim,
00056 int vtxidx,
00057 float scale) const;
00058
00059 void applyScaledPointPosDeltas(GEO_Detail &gdp,
00060 float scale,
00061 const GB_PointGroup *ptgroup = 0) const;
00062
00063
00064 void mergeDeltas(const GDT_Detail &other);
00065 void mergeInverseDeltas(const GDT_Detail &other);
00066
00067
00068 GDT_PointList *getPointList() { return &myPointList; }
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 void zeroDeltas();
00084
00085
00086
00087
00088
00089
00090 void clearDeltas();
00091
00092
00093
00094
00095 void destroy();
00096
00097
00098 bool hasChange() const;
00099
00100
00101
00102
00103
00104
00105
00106 virtual void beginPointPositionChange(
00107 const GEO_Point &pt);
00108
00109 virtual void beginPointAttributeChange(
00110 const GEO_Point &pt);
00111
00112 virtual void beginPointListAttributeChange(
00113 const GEO_PointList &ptlist);
00114
00115 virtual void beginPrimitiveTransformChange(
00116 const GEO_Primitive &prim);
00117
00118 virtual void beginPrimitiveAttributeChange(
00119 const GEO_Primitive &prim);
00120
00121 virtual void beginVertexAttributeChange(
00122 const GEO_Primitive &prim,
00123 unsigned int linear_index_in_prim);
00124
00125
00126 void getOpPaths( UT_StringList &paths );
00127 void getOpPathsCopy( UT_PtrArray<char *> &paths );
00128 void setOpPaths( const UT_PtrArray<char *> &paths );
00129 int changeOpPaths( const char *old_name,
00130 const char *new_name );
00131 bool changeCaptureRegionRoot( const char *old_root,
00132 const char *new_root );
00133 void refreshCaptureFrameInfo( const GEO_Detail &gdp,
00134 GDT_CaptureRegionCB get_region,
00135 void *user_data );
00136 virtual void initCaptureWeightChange( const GEO_Detail &gdp );
00137 virtual void beginCaptureWeightChange( const GEO_Point &pt );
00138
00139 virtual void endChange();
00140
00141
00142
00143 virtual void updateVertexOffsets(const GEO_Detail &gdp);
00144
00145
00146
00147
00148 virtual void setPointAttribDict(
00149 const GEO_PointAttribDict &dict);
00150 virtual void setPrimAttribDict(
00151 const GEO_PrimAttribDict &dict);
00152 virtual void setVertexAttribDict(
00153 const GEO_VertexAttribDict &dict);
00154
00155
00156
00157
00158
00159
00160 virtual void refreshPointAttribDict(
00161 const GEO_PointAttribDict &dict);
00162 virtual void refreshPrimAttribDict(
00163 const GEO_PrimAttribDict &dict);
00164 virtual void refreshVertexAttribDict(
00165 const GEO_VertexAttribDict &dict);
00166
00167
00168
00169
00170 int save(ostream &os, int binary=0) const;
00171 bool load(UT_IStream &is);
00172 bool legacyLoad(UT_IStream &is);
00173
00174 void setCoordinateFrames(const GDT_CoordinateFrames *coords);
00175 const GDT_CoordinateFrames *getCoordinateFrames();
00176
00177 void createSymmetryDeltas(const GDT_Detail &input, GDT_SymmetryTransform *transform);
00178
00179 private:
00180
00181
00182 typedef enum {
00183 GDT_CHANGE_NONE,
00184 GDT_CHANGE_FAKE,
00185 GDT_CHANGE_POINT_POS,
00186 GDT_CHANGE_POINT_CAPTUREWEIGHT,
00187 GDT_CHANGE_POINT_ATTRIB,
00188 GDT_CHANGE_POINTLIST_ATTRIB,
00189 GDT_CHANGE_PRIM_TRANS,
00190 GDT_CHANGE_PRIM_ATTRIB,
00191 GDT_CHANGE_VERTEX_ATTRIB
00192 } GDT_CHANGE_TYPE;
00193
00194
00195 GDT_CHANGE_TYPE myChangeType;
00196 const GEO_Point *myChangePt;
00197 const GEO_PointList *myChangePtList;
00198 const GEO_Primitive *myChangePrim;
00199 unsigned int myChangeVertexIdx;
00200
00201 GDT_PointList myPointList;
00202 GDT_PrimitiveList myPrimList;
00203 GDT_VertexList myVertexList;
00204 };
00205
00206 #endif