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 * Side Effects Software Inc 00008 * 123 Front Street West, Suite 1401 00009 * Toronto, Ontario 00010 * Canada M5J 2M2 00011 * 416-504-9876 00012 * 00013 * NAME: OP_PropagateData.h (OP Library, C++) 00014 * 00015 * COMMENTS: Helper class for OP_Node::propagateModification() 00016 */ 00017 00018 #ifndef __OP_PROPAGATEDATA_H__ 00019 #define __OP_PROPAGATEDATA_H__ 00020 00021 #include "OP_API.h" 00022 #include "OP_Value.h" 00023 #include <UT/UT_Algorithm.h> 00024 #include <UT/UT_Pair.h> 00025 00026 // This helper struct is needed for propagateModification(). It must be 00027 // initialized first with beginPropagateModification(). 00028 class OP_API OP_PropagateData 00029 { 00030 public: 00031 OP_PropagateData(OP_EventType reason) 00032 : myCounter(0) 00033 , myParmCycle() 00034 { 00035 myExprChange = isExprChangeEvent(reason); 00036 } 00037 00038 void setCounter(int counter) 00039 { myCounter = counter; } 00040 int getCounter() const 00041 { return myCounter; } 00042 00043 bool detectParmCycle(int node_id, int parm_idx) 00044 { return myParmCycle.detect(UT_IntPair(node_id, parm_idx)); } 00045 void resetParmCycle() 00046 { myParmCycle.reset(); } 00047 00048 void setExprChange(bool expr_change) 00049 { myExprChange = expr_change; } 00050 bool isExprChange() const 00051 { return myExprChange; } 00052 00053 static bool isExprChangeEvent(OP_EventType reason) 00054 { 00055 return (reason == OP_PARM_ANIMATED 00056 || reason == OP_PARM_CHANNELS); 00057 } 00058 00059 private: // non-implemented methods 00060 OP_PropagateData(); 00061 OP_PropagateData(const OP_PropagateData &); 00062 OP_PropagateData &operator =(const OP_PropagateData &); 00063 00064 private: // data 00065 long myCounter; // modification counter 00066 UT_CycleDetect<UT_IntPair> myParmCycle; // parm recursion check 00067 bool myExprChange:1; // a parm expr modification? 00068 }; 00069 00070 #endif // __OP_PROPAGATEDATA_H__
1.5.9