00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __SOP_GDT_h__
00021 #define __SOP_GDT_h__
00022
00023 #include "SOP_API.h"
00024 #include <GDT/GDT_Detail.h>
00025 #include "SOP_Node.h"
00026 #include "SOP_UndoGDT.h"
00027
00028 class PRM_MenuEntry;
00029
00030 #define SOP_GDT_GRP_IDX 0
00031
00032 class SOP_API SOP_GDT : public SOP_Node
00033 {
00034 friend class SOP_UndoGDT;
00035 friend class SOP_UndoGDTOpDepend;
00036 friend class MSS_EditState;
00037
00038 public:
00039 SOP_GDT(OP_Network *net, const char *name, OP_Operator *entry);
00040 virtual ~SOP_GDT();
00041
00042 const UT_String & getUndoLabel() { return myNewOpLabel; }
00043
00044
00045
00046
00047 virtual void beginNewOperation();
00048
00049
00050
00051
00052 virtual void clearAllDeltas(float t);
00053
00054 GDT_Detail *getPermanentDelta() { return myPermanentDelta; }
00055
00056 protected:
00057 virtual const char *inputLabel(unsigned idx) const;
00058
00059
00060
00061
00062
00063
00064 virtual bool matchesUndo(const char *undoname) const;
00065
00066
00067
00068
00069 virtual OP_ERROR save(ostream &os, const OP_SaveFlags &flags,
00070 const char *pathPrefix);
00071 virtual bool load(UT_IStream &is, const char *extension,
00072 const char *path=0);
00073
00074
00075 OP_ERROR updateInputGroups(OP_Context &context,
00076 bool changed_input, bool changed_group);
00077
00078
00079 void updateCookSelection(
00080 bool changed_input, bool changed_group);
00081
00082
00083
00084 virtual void getSelString(UT_String &str)
00085 { evalString(str, SOP_GDT_GRP_IDX, 0, 0.0f); }
00086
00087
00088 bool checkChangedSource(unsigned idx, OP_Context &ctx);
00089
00090 virtual void rollbackCurrentDelta();
00091 virtual void applyPermanentDelta();
00092
00093
00094 static int applyStatic(void *, int idx,
00095 float t, const PRM_Template *);
00096
00097 virtual void applyAndClearCurrentDelta();
00098
00099
00100 static int clearallStatic(void *, int idx,
00101 float t, const PRM_Template *);
00102
00103
00104
00105
00106
00107 GDT_Detail *myPermanentDelta;
00108 GDT_Detail *myCurrentDelta;
00109
00110 bool myCookedFlag;
00111 bool myNotifyCacheFlag;
00112
00113
00114 GU_DetailGroupPair myDetailGroupPair;
00115 const GB_BaseGroup *myGroup;
00116
00117 private:
00118
00119
00120 UT_String myNewOpLabel;
00121
00122
00123 void undoDeltas(const GDT_Detail &geodelta,
00124 SOP_UndoGDTType undotype);
00125 void redoDeltas(const GDT_Detail &geodelta,
00126 SOP_UndoGDTType redotype);
00127 };
00128
00129 #endif