00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __OP_Node_h__
00020 #define __OP_Node_h__
00021
00022 #include "OP_API.h"
00023 #include <iostream.h>
00024 #include <SYS/SYS_AtomicInt.h>
00025 #include <SYS/SYS_Math.h>
00026 #include <UT/UT_Algorithm.h>
00027 #include <UT/UT_Color.h>
00028 #include <UT/UT_Error.h>
00029 #include <UT/UT_String.h>
00030 #include <UT/UT_IntArray.h>
00031 #include <UT/UT_RefArray.h>
00032 #include <UT/UT_PtrArray.h>
00033 #include <UT/UT_BitArray.h>
00034 #include <UT/UT_Vector3.h>
00035 #include <UT/UT_PathSearch.h>
00036 #include <UT/UT_TokenString.h>
00037 #include <UT/UT_XformOrder.h>
00038 #include <UT/UT_Options.h>
00039 #include <IMG/IMG_Raster.h>
00040 #include "OP_DataTypes.h"
00041 #include "OP_Error.h"
00042 #include "OP_ExtraInput.h"
00043 #include "OP_Lock.h"
00044 #include "OP_Parameters.h"
00045 #include "OP_NodeFlags.h"
00046 #include "OP_NetworkBoxItemFlags.h"
00047 #include "OP_Version.h"
00048 #include "OP_Context.h"
00049 #include "OP_Cache.h"
00050 #include "OP_Dependency.h"
00051 #include "OP_NetworkBoxItem.h"
00052 #include "OP_BundleReferences.h"
00053 #include "OP_OTLLicenseType.h"
00054 #include "OP_PropagateData.h"
00055 #include "OP_TaskState.h"
00056
00057 #include <UT/UT_VectorTypes.h>
00058
00059 class UT_Ramp;
00060 class UT_WorkArgs;
00061 class UT_WorkBuffer;
00062 class UT_StringArray;
00063 class UT_InfoTree;
00064 class UT_Undo;
00065 class UT_BoundingBox;
00066 class PY_CompiledCode;
00067 class PY_Result;
00068 class DD_Source;
00069 class DD_ChoiceList;
00070 class CL_Clip;
00071 class CL_Track;
00072 class EV_SYMBOL;
00073 class CMD_Args;
00074 class PRM_BatchList;
00075 class PRM_Parm;
00076 class PRM_RefId;
00077 class OP_Operator;
00078 class OP_OutputCodeParms;
00079 class OP_InputIndirect;
00080 class OP_ParmInterest;
00081 class OP_Input;
00082 class OP_Node;
00083 class OP_Network;
00084 class OP_Group;
00085 class OP_Bundle;
00086 class OP_PreDefRules;
00087 class OP_GalleryEntry;
00088 class OP_SaveFlags;
00089 class OP_GlobContext;
00090 class DOP_Parent;
00091 class VOP_CodeGenerator;
00092 class VOP_ScriptMaterialCodeMapper;
00093
00094
00095 typedef UT_PtrArray<const CL_Track *> CL_TrackListC;
00096 typedef UT_PtrArray<OP_Node *> OP_NodeList;
00097
00098 typedef int (*OP_EditCallback)(void *data, OP_Node *src,
00099 CL_Track *track, float t, float value);
00100
00101
00102 typedef UT_CycleDetect<OP_Node *> OP_NodeCycleDetect;
00103 struct OP_NodeParmRef
00104 {
00105 OP_NodeParmRef(const OP_Node *eval_node = 0,
00106 const PRM_Parm *parm_ref = 0,
00107 int vi = -1)
00108 : myEvalNode(eval_node)
00109 , myParmRef(parm_ref)
00110 , myVectorIndex(vi)
00111 {
00112 }
00113
00114 bool operator==(const OP_NodeParmRef &other)
00115 {
00116 return (myEvalNode == other.myEvalNode
00117 && myParmRef == other.myParmRef
00118 && myVectorIndex == other.myVectorIndex);
00119 }
00120
00121 const OP_Node * myEvalNode;
00122 const PRM_Parm * myParmRef;
00123 int myVectorIndex;
00124 };
00125 typedef UT_CycleDetect<OP_NodeParmRef> OP_NodeParmRefCycle;
00126
00127
00128 typedef UT_LockedRawPtr<OP_ExtraInputList, OP_Lock>
00129 OP_LockedExtraInputs;
00130 typedef UT_LockedRawPtr<const OP_ExtraInputList, OP_Lock>
00131 OP_LockedConstExtraInputs;
00132 typedef UT_LockedRawPtr<OP_NodeList, OP_Lock>
00133 OP_LockedNodeList;
00134 typedef UT_LockedRawPtr<const OP_NodeList, OP_Lock>
00135 OP_LockedConstNodeList;
00136
00137
00138 #define OPREF_PREFIX "op:"
00139 #define OPREF_PREFIX_LEN 3
00140
00141
00142
00143
00144
00145
00146 #define OP_INVALID_NODE_ID -999
00147
00148
00149 #define INVALID_TABLE_NAME "Node"
00150 #define OBJ_TABLE_NAME "Object"
00151 #define SOP_TABLE_NAME "Sop"
00152 #define POPNET_TABLE_NAME "Particle"
00153 #define POP_TABLE_NAME "Pop"
00154 #define CHOPNET_TABLE_NAME "ChopNet"
00155 #define CHOP_TABLE_NAME "Chop"
00156 #define ROP_TABLE_NAME "Driver"
00157 #define SHOP_TABLE_NAME "Shop"
00158 #define COP2_TABLE_NAME "Cop2"
00159 #define COPNET_TABLE_NAME "CopNet"
00160 #define VOP_TABLE_NAME "Vop"
00161 #define VOPNET_TABLE_NAME "VopNet"
00162 #define DOP_TABLE_NAME "Dop"
00163
00164
00165 #define MGR_TABLE_NAME "Manager"
00166 #define DIR_TABLE_NAME "Director"
00167
00168
00169
00170 #define INVALID_SCRIPT_NAME "node"
00171 #define OBJ_SCRIPT_NAME "obj"
00172 #define SOP_SCRIPT_NAME "sop"
00173 #define POPNET_SCRIPT_NAME "part"
00174 #define POP_SCRIPT_NAME "pop"
00175 #define CHOPNET_SCRIPT_NAME "ch"
00176 #define CHOP_SCRIPT_NAME "chop"
00177 #define ROP_SCRIPT_NAME "out"
00178 #define SHOP_SCRIPT_NAME "shop"
00179 #define COPNET_SCRIPT_NAME "img"
00180 #define COP2_SCRIPT_NAME "cop2"
00181 #define VOP_SCRIPT_NAME "vop"
00182 #define VOPNET_SCRIPT_NAME "vex"
00183 #define DOP_SCRIPT_NAME "dop"
00184
00185
00186 #define MGR_SCRIPT_NAME "mgr"
00187 #define DIR_SCRIPT_NAME "dir"
00188
00189
00190 #define INVALID_OPTYPE_NAME "NODE"
00191 #define OBJ_OPTYPE_NAME "OBJ"
00192 #define SOP_OPTYPE_NAME "SOP"
00193 #define POPNET_OPTYPE_NAME "PART"
00194 #define POP_OPTYPE_NAME "POP"
00195 #define CHOPNET_OPTYPE_NAME "CHOPNET"
00196 #define CHOP_OPTYPE_NAME "CHOP"
00197 #define ROP_OPTYPE_NAME "ROP"
00198 #define SHOP_OPTYPE_NAME "SHOP"
00199 #define COP2_OPTYPE_NAME "COP2"
00200 #define COPNET_OPTYPE_NAME "IMG"
00201 #define VOP_OPTYPE_NAME "VOP"
00202 #define VOPNET_OPTYPE_NAME "VOPNET"
00203 #define DOP_OPTYPE_NAME "DOP"
00204
00205
00206
00207
00208
00209 #define MGR_OPTYPE_NAME "MGR"
00210 #define DIR_OPTYPE_NAME "DIR"
00211
00212 #define OP_DEFAULT_COLOR_R 0.8F
00213 #define OP_DEFAULT_COLOR_G 0.8F
00214 #define OP_DEFAULT_COLOR_B 0.8F
00215 #define OP_DEFAULT_COLOR UT_RGB, \
00216 OP_DEFAULT_COLOR_R, \
00217 OP_DEFAULT_COLOR_G, \
00218 OP_DEFAULT_COLOR_B
00219
00220 enum OP_OpTypeId
00221 {
00222 INVALID_OPTYPE_ID = -1,
00223 OBJ_OPTYPE_ID = 0,
00224 SOP_OPTYPE_ID,
00225 POPNET_OPTYPE_ID,
00226 POP_OPTYPE_ID,
00227 CHOPNET_OPTYPE_ID,
00228 CHOP_OPTYPE_ID,
00229 ROP_OPTYPE_ID,
00230 SHOP_OPTYPE_ID,
00231 COP2_OPTYPE_ID,
00232 COPNET_OPTYPE_ID,
00233 VOP_OPTYPE_ID,
00234 VOPNET_OPTYPE_ID,
00235 DOP_OPTYPE_ID,
00236 MGR_OPTYPE_ID,
00237 DIR_OPTYPE_ID,
00238 NUM_MANAGERS
00239 };
00240
00241
00242
00243
00244 #define VOP_OUTPUT_NODE_NAME "output"
00245 #define VOP_SUBNET_OUTPUT_NODE_NAME "suboutput"
00246 #define VOP_SUBNET_INPUT_NODE_NAME "subinput"
00247
00248
00249
00250 #define SHOP_MANAGEMENT_OPTYPE "shopnet"
00251 #define POP_MANAGEMENT_OPTYPE "popnet"
00252 #define COP2_MANAGEMENT_OPTYPE "cop2net"
00253 #define ROP_MANAGEMENT_OPTYPE "ropnet"
00254 #define CHOP_MANAGEMENT_OPTYPE "chopnet"
00255 #define SOP_MANAGEMENT_OPTYPE "sopnet"
00256 #define OBJ_MANAGEMENT_OPTYPE "objnet"
00257 #define VOP_MANAGEMENT_OPTYPE "vopnet"
00258 #define DOP_MANAGEMENT_OPTYPE "dopnet"
00259
00260
00261
00262
00263
00264 class OP_API OP_TypeInfo
00265 {
00266 public:
00267 OP_OpTypeId myOptypeId;
00268 const char *myOptypeName;
00269 const char *myTableName;
00270 const char *myScriptDir;
00271 };
00272
00273
00274
00275
00276
00277
00278
00279 class OP_API opParmData
00280 {
00281 public:
00282 float myValue;
00283 UT_String myLabel;
00284 OP_Node *myNode;
00285 int myIndex;
00286 int mySubIndex;
00287
00288 int operator==(const opParmData &v) const
00289 {
00290 return (myValue == v.myValue &&
00291 myLabel == v.myLabel &&
00292 myNode == v.myNode &&
00293 myIndex == v.myIndex &&
00294 mySubIndex == v.mySubIndex
00295 );
00296 }
00297 };
00298
00299
00300
00301 class OBJ_Node;
00302 class SOP_Node;
00303 class POP_Node;
00304 class POPNET_Node;
00305 class CHOPNET_Node;
00306 class CHOP_Node;
00307 class COP2_Node;
00308 class COPNET_Node;
00309 class ROP_Node;
00310 class SHOP_Node;
00311 class VOP_Node;
00312 class VOPNET_Node;
00313 class DOP_Node;
00314
00315 #define INSTANTIATE_FINDNODE_FUNCTIONS(PREFIX) \
00316 PREFIX##_Node *find##PREFIX##Node(const char *path) const \
00317 { \
00318 OP_Node *node; \
00319 \
00320 node = findNode(path); \
00321 if (node) return node->castTo##PREFIX##Node(); \
00322 return 0; \
00323 }
00324 #define INSTANTIATE_CASTNODE_FUNCTIONS(PREFIX) \
00325 PREFIX##_Node *castTo##PREFIX##Node() const \
00326 { \
00327 \
00328 \
00329 \
00330 UT_ASSERT(this); \
00331 if (!this) return 0; \
00332 if (getOpTypeID() == PREFIX##_OPTYPE_ID) \
00333 { \
00334 return (PREFIX##_Node *) this; \
00335 } \
00336 return 0; \
00337 }
00338
00339
00340 #define INSTANTIATE_FOR_ALL_NODE_TYPES(MACRO_FUNC) \
00341 MACRO_FUNC(OBJ) \
00342 MACRO_FUNC(SOP) \
00343 MACRO_FUNC(POPNET) \
00344 MACRO_FUNC(POP) \
00345 MACRO_FUNC(CHOPNET) \
00346 MACRO_FUNC(CHOP) \
00347 MACRO_FUNC(ROP) \
00348 MACRO_FUNC(SHOP) \
00349 MACRO_FUNC(COP2) \
00350 MACRO_FUNC(COPNET) \
00351 MACRO_FUNC(VOP) \
00352 MACRO_FUNC(VOPNET) \
00353 MACRO_FUNC(DOP)
00354
00355 class OP_API OP_Node : public OP_Parameters, public OP_NetworkBoxItem
00356 {
00357 public:
00358
00359 static const OP_TypeInfo *getOpInfoFromOpTypeID(OP_OpTypeId opid);
00360 static const OP_TypeInfo *getOpInfoFromOpTypeName(const char *name);
00361 static const OP_TypeInfo *getOpInfoFromTableName(const char *name);
00362 static const OP_TypeInfo *getOpInfoFromScriptDir(const char *dir);
00363
00364 OP_Network *getParent() const { return myParent; }
00365
00366
00367
00368
00369 virtual OP_Network *getParentNetwork() const;
00370
00371
00372
00373 bool getIsContainedBy(const OP_Node *testparent) const;
00374
00375
00376 const UT_String &getNetName() const;
00377
00378
00379
00380
00381 virtual OP_OpTypeId getOpTypeID() const = 0;
00382
00383
00384
00385
00386
00387 virtual const char *getOpType() const = 0;
00388
00389 virtual OP_ItemType getItemType() const;
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399 INSTANTIATE_FOR_ALL_NODE_TYPES(INSTANTIATE_FINDNODE_FUNCTIONS)
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410 INSTANTIATE_FOR_ALL_NODE_TYPES(INSTANTIATE_CASTNODE_FUNCTIONS)
00411
00412
00413
00414 const UT_String &getDelScript(void) const { return myDelScript; }
00415
00416
00417
00418 bool setDelScript(const char *str);
00419
00420
00421
00422 const UT_String &getComment(void) const { return myComment; }
00423 bool setComment(const char *str);
00424
00425
00426
00427
00428
00429
00430
00431 virtual const UT_Color *getColor() const { return &myColor; }
00432 virtual bool setColor(const UT_Color &col);
00433
00434
00435
00436
00437
00438
00439 virtual void setXY(fpreal x, fpreal y);
00440 virtual fpreal getX() const { return myPosX; }
00441 virtual fpreal getY() const { return myPosY; }
00442 virtual fpreal getW() const;
00443 virtual fpreal getH() const;
00444
00445
00446
00447
00448
00449 bool setXYWithBoundsChecks(fpreal x, fpreal y);
00450
00451 void pickRequest(int shift);
00452
00453
00454 static int isValidOpName(const char *s,
00455 bool allow_rel_paths = false,
00456 bool ignore_node_names_env_var = false);
00457 static int isValidOpPath(const char *s);
00458 static bool forceValidOpName(UT_String &name);
00459
00460
00461
00462
00463 virtual int findString(const char *str, bool fullword,
00464 bool usewildcards) const;
00465 virtual int changeString(const char *from, const char *to,
00466 bool fullword);
00467
00468
00469
00470 virtual int getNchildren() const;
00471 virtual OP_Node *getChild(const char *name, int *hint=0) const;
00472 virtual OP_Node *getChild(int index) const;
00473 void getPickedChildren(OP_NodeList &picked,
00474 bool include_hidden=false) const;
00475 void getAllChildren(OP_NodeList &children) const;
00476 virtual OP_Node *matchChild(const char *pattern, OP_Node *prevmatch=0,
00477 const char *optype=0,
00478 int casesensitive = 0) const;
00479 virtual OP_Node *matchChildBackwards(const char *pattern,
00480 OP_Node *prevmatch=0,
00481 const char *optype=0,
00482 int casesensitive = 0) const;
00483 virtual OP_Network *createProxyRefNode( const char *path );
00484
00485
00486 static OP_Node *lookupNode(int unique_id, bool include_proxy=false)
00487 {
00488 if( unique_id >= 0 && unique_id <= theUniqueId
00489 && theUniqueNodes[unique_id] )
00490 {
00491 if( include_proxy || !theUniqueNodes[unique_id]
00492 ->isProxyRefNode() )
00493 return theUniqueNodes[unique_id];
00494 }
00495 return 0;
00496 }
00497
00498 static void getAllNodes(OP_NodeList &nodes);
00499
00500 int getUniqueId() const
00501 { return myUniqueId; }
00502
00503
00504
00505
00506 bool expandGroupPattern(const char *pattern,
00507 UT_String &result,
00508 bool expandToFullPaths = false);
00509
00510
00511
00512 bool patternContainsBundle(const char *pattern,
00513 const OP_Bundle *bundle) const;
00514 bool patternContainsGroup(const char *pattern,
00515 const OP_Group *group) const;
00516
00517 virtual int isManager() const;
00518
00519
00520
00521 virtual int isManagementNode() const;
00522
00523
00524
00525
00526 bool isEffectivelyAManagementNode() const;
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536 virtual int isSubNetwork(bool includemanagementops) const;
00537 virtual int isNetwork() const;
00538 virtual int isInSubNetwork() const;
00539
00540 bool isProxyRefNode() const
00541 { return myIsProxyRefNode; }
00542 void setProxyRefNode(bool f)
00543 { myIsProxyRefNode = f; }
00544
00545
00546
00547
00548 int isNetworkWithKids() const;
00549
00550 virtual int isVex() const;
00551
00552
00553
00554
00555
00556 OP_Bundle * getParmBundle(const char* parm_name, int vector_index,
00557 UT_String &pattern, OP_Network *creator,
00558 const char *filter);
00559 void markBundleRefsAsUnused();
00560 void cleanUnusedBundleRefs();
00561 void cleanAllBundleRefs();
00562
00563
00564
00565
00566
00567
00568 virtual bool bundleChanged(const OP_Bundle *bundle);
00569
00570
00571 void touchBundleParm(const char *name);
00572 void touchBundleParm(int parm_index);
00573
00574
00575 virtual int getDandROpsEqual() { return 1; }
00576
00577
00578 virtual int updateDandROpsEqual(int = 1) { return 1; }
00579
00580 int isAncestor(const OP_Node *node,
00581 int checkextra=1) const;
00582
00583
00584
00585 const char *getInfoText(OP_Context &context, int verbose,
00586 int max_separator_length = -1);
00587
00588 virtual void getNodeSpecificInfoText(OP_Context &context,
00589 int verbose,
00590 UT_WorkBuffer &text);
00591
00592
00593 OP_Node *findNode(const char *path) const;
00594
00595
00596
00597
00598 OP_Node *findSubNode(const char *path) const;
00599
00600
00601
00602 virtual OP_NetworkBox *findNetworkBox(const char * )
00603 { return NULL; }
00604
00605
00606
00607 virtual OP_PostIt* findPostItNote(const char * )
00608 { return NULL; }
00609
00610
00611
00612
00613 virtual OP_NetworkBoxItem *findItem(const char *const_path,
00614 OP_ItemTypeMask item_type =
00615 OP_ITEMTYPE_ALL);
00616
00617
00618
00619
00620
00621
00622 SOP_Node *getSOPNode(const char *path, int addextra = 0) const;
00623
00624
00625 COP2_Node *getCOP2Node(const char *path, int addextra = 0) const;
00626
00627
00628 POP_Node *getPOPNode(const char *path, int addextra = 0) const;
00629
00630
00631 DOP_Node *getDOPNode(const char *path, int addextra = 0) const;
00632 ROP_Node *getROPNode(const char *path, int addextra = 0) const;
00633
00634
00635 virtual void getFullPath(UT_String &str) const;
00636
00637
00638 virtual void getPathWithSubnet(UT_String &str) const;
00639
00640
00641 void getRelativePathTo(const OP_Node *base_node,
00642 UT_String &result) const;
00643
00644
00645
00646
00647
00648 void completePath(const char *prefixpath,
00649 UT_String &completepath) const;
00650
00651 virtual CH_Channel *getTrackChannel(const char *name);
00652
00653 virtual bool findParmFromTrack(float t, const char *trackname,
00654 OP_NodeParmRefCycle &cycle,
00655 OP_Node *&node,
00656 PRM_Parm *&parm, int &vecidx);
00657
00658
00659
00660
00661 virtual void evaluateBatchParms(PRM_BatchList &list, double now);
00662
00663
00664
00665
00666
00667 void globNodes(const char *pat, UT_String *expand,
00668 UT_PtrArray<OP_Node *> *list=0,
00669 OP_GlobContext *context = 0,
00670 const char *prefix = " ");
00671
00672 CH_Channel *findChannel(const char *path);
00673 void globChannels(const char *, UT_String &expand,
00674 OP_GlobContext *context = 0,
00675 const char *prefix = " ") const;
00676
00677 void globChannels(const char *pattern,
00678 CH_ChannelList &clist,
00679 OP_GlobContext *context = 0,
00680 OP_Node *dependent = 0);
00681
00682 void globChanRefs(const char *pattern,
00683 CH_ChannelRefList &list,
00684 OP_GlobContext *context = 0,
00685 OP_Node *dependent = 0);
00686
00687 int globParms(const char *pattern, float t,
00688 UT_RefArray<opParmData> &list,
00689 OP_GlobContext *context = 0,
00690 OP_Node *dependent = 0,
00691 int calc_value = 1);
00692
00693
00694 void globNodeParms(const char *pattern, float t,
00695 UT_RefArray<opParmData> &list,
00696 OP_GlobContext *context,
00697 OP_Node *dependent,
00698 int calc_value,
00699 bool animated_only);
00700
00701
00702 void globNodeChannels(const char *pattern,
00703 CH_ChannelList &list,
00704 OP_GlobContext *context,
00705 int *parm_start = NULL,
00706 UT_IntArray *parm_indices = NULL
00707 ) const;
00708
00709
00710 void globNodeChanRefs(const char *pattern,
00711 CH_ChannelRefList &list,
00712 OP_GlobContext *context,
00713 int *parm_start = NULL,
00714 UT_IntArray *parm_indices = NULL
00715 ) const;
00716
00717
00718
00719
00720 virtual void globNetworkBoxes(const char *pat, UT_String *expand,
00721 UT_PtrArray<OP_NetworkBox *> *list=0,
00722 OP_GlobContext *glob_context = 0,
00723 const char *prefix = " ");
00724
00725 virtual void globPostIts(const char *pat, UT_String *expand,
00726 UT_PtrArray<OP_PostIt *> *list=0,
00727 OP_GlobContext *glob_context = 0,
00728 const char *prefix = " ");
00729
00730
00731 int getAllChannels(CH_ChannelList &list, int scoped=0);
00732
00733
00734
00735 virtual void opChanged(OP_EventType reason, void *data=0);
00736
00737
00738
00739 virtual bool opShouldHandleChange(OP_EventType reason);
00740
00741
00742
00743
00744 virtual void referencedParmChanged(int pi);
00745
00746
00747
00748
00749
00750 virtual void forceRecook(bool evensmartcache = true);
00751
00752
00753
00754
00755
00756 virtual void reloadExternalFiles();
00757
00758
00759
00760
00761
00762 virtual unsigned needToCook(OP_Context &context, bool queryonly=false);
00763
00764
00765
00766
00767
00768 virtual bool cook(OP_Context &context);
00769
00770
00771
00772 bool parallelCook(OP_Context &context);
00773
00774
00775 static bool parallelCook(OP_Context &context,
00776 const OP_NodeList &nodes);
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789 OP_CookLock & getCookLock() { return myCookLock; }
00790 bool lockForCooking(OP_CookLock::Scope &scope);
00791
00792
00793 OP_TaskState & taskState() { return myTaskState; }
00794 const OP_TaskState & taskState() const { return myTaskState; }
00795
00796
00797
00798
00799 virtual OP_ERROR pubCookInputGroups(OP_Context &context, int alone = 0);
00800
00801 void bumpVersionParm() { myVersionParms++; }
00802 int cookParmsModified() const
00803 { return myVersionParms != myVersionCache; }
00804
00805
00806
00807
00808
00809
00810 virtual int getDataClass() const;
00811
00812
00813
00814 virtual void getXformOrder(UT_XformOrder &xord, CH_Channel *chp);
00815
00816
00817
00818 virtual OP_DATA_TYPE getCookedDataType() const = 0;
00819 virtual void *getCookedData(OP_Context &);
00820 virtual void deleteCookedData() = 0;
00821
00822
00823
00824 virtual bool hasCookedData(OP_Context &);
00825
00826 virtual int saveCookedData(ostream &os, OP_Context &,
00827 int binary = 0) = 0;
00828 virtual bool loadCookedData(UT_IStream &is, const char *path=0);
00829 virtual int saveCookedData(const char *filename, OP_Context &) = 0;
00830
00831
00832
00833 virtual int getRelativeTransform(OP_Node &to, UT_Matrix4 &xform,
00834 OP_Context &context);
00835 virtual int getRelativeTransform(OP_Node &to, UT_DMatrix4 &xform,
00836 OP_Context &context);
00837
00838 virtual int getRelativeCaptureTransform(OP_Node &to,
00839 UT_Matrix4 &xform,
00840 OP_Context &context);
00841 virtual int getRelativeCaptureTransform(OP_Node &to,
00842 UT_DMatrix4 &xform,
00843 OP_Context &context);
00844 virtual void getRotations(float, float &, float &, float &);
00845
00846
00847
00848 virtual int getWorldTransform(UT_DMatrix4 &xform, OP_Context &);
00849 virtual int getIWorldTransform(UT_DMatrix4 &xform, OP_Context &);
00850
00851
00852 int getWorldTransform(UT_Matrix4 &xform, OP_Context &);
00853 int getIWorldTransform(UT_Matrix4 &xform, OP_Context &);
00854
00855
00856
00857 void addTransformError(const OP_Node &node,
00858 const char *label=0) const;
00859
00860
00861
00862 virtual bool getBoundingBox(UT_BoundingBox &box, OP_Context &);
00863
00864
00865
00866 virtual const char *getInternalOpTable() const
00867 { return INVALID_TABLE_NAME; }
00868 virtual OP_Operator *getInternalOperator() const
00869 { return 0; }
00870
00871
00872 virtual void stashCaptureAngles(float time);
00873
00874 virtual const char *inputLabel(unsigned idx) const;
00875 virtual const char *outputLabel(unsigned idx) const;
00876
00877
00878
00879 virtual const char *inputConnectorLabel(unsigned idx);
00880
00881
00882 virtual int isRefInput(unsigned ) const { return 0; }
00883
00884
00885
00886
00887
00888 bool hasRefOutputs(bool recurse_on_implicits = false) const;
00889
00890
00891
00892 virtual int getAuxInput() const;
00893
00894
00895
00896
00897
00898
00899
00900 int setLock(int state, int saveundo = 1);
00901 int getSoftLock() const {return flags().getSoftLocked();}
00902 int getHardLock() const {return flags().getHardLocked();}
00903 int getLock() const {return flags().getLocked(); }
00904
00905
00906
00907
00908
00909 int getNetworkLock(bool relaxedlockcheck = false,
00910 const OP_Node *inputNode = NULL) const;
00911
00912
00913 virtual int setModelLock(int on_off,
00914 void *modeler = 0,
00915 int allow_softlock_promotion=0,
00916 UT_Undo *undo = 0);
00917 int getModelLock() const;
00918
00919
00920
00921
00922 int setUnload(int on_off);
00923 int getUnload() const;
00924
00925
00926 virtual bool isLoaded() const { return true; }
00927
00928
00929
00930
00931 virtual bool unloadData();
00932
00933
00934 void takeActivateFlag(uchar flag, bool enable=true,
00935 bool send_flag_event=true);
00936 void takeDeactivateFlag(uchar flag)
00937 { takeActivateFlag(flag, false); }
00938 bool takeIsActiveFlag(uchar flag) const;
00939 void setHasTakeData(int onoff);
00940
00941 bool canAccessFlag(unsigned mask, uchar flag) const;
00942
00943
00944
00945
00946
00947
00948 virtual int setPicked(int on_off,
00949 bool propagate_parent_event = true);
00950
00951
00952
00953
00954
00955 int setEditPicked(int on_off,
00956 bool propagate_parent_event = true);
00957
00958 void setAutoscope(bool on_off) { myAutoscope = on_off; }
00959 bool isAutoscope() { return myAutoscope; }
00960
00961 int setCurrent(int on_off);
00962 int setExpose(int on_off);
00963 int setBypass(int on_off);
00964 int setTemplate(int on_off);
00965 int setFootprint(int on_off);
00966 int setXray(int on_off);
00967 int setDisplay(int on_off);
00968 int setRender(int on_off);
00969 int setHighlight(int on_off);
00970 int setModified(int on_off);
00971 int setSaveBypass(int on_off);
00972 int setSaveData(int on_off);
00973
00974 virtual int setPickable(int on_off);
00975 virtual int setAudio(int on_off);
00976 virtual int setExport(int on_off);
00977 virtual int setDebug(int on_off);
00978
00979
00980
00981
00982 void userSetTemplate(bool onoff);
00983
00984
00985
00986
00987 void userSetSelectableTemplate(bool onoff);
00988
00989
00990
00991 virtual int setFlag(char tag, int on_off);
00992 virtual int getFlag(char tag) const;
00993
00994 virtual int getPicked() const {return flags().getPicked(); }
00995 virtual int getEditPicked() const
00996 { return flags().getEditPicked(); }
00997 int getCurrent() const;
00998 int getDisplay() const {return flags().getDisplay(); }
00999 int getRender() const {return flags().getRender(); }
01000 int getHighlight()const {return flags().getHighlight();}
01001 int getBypass() const {return flags().getBypass(); }
01002 int getTemplate() const {return flags().getTemplate(); }
01003 int getFootprint() const {return flags().getFootprint(); }
01004 int getXray() const {return flags().getXray(); }
01005 int getExpose() const {return flags().getExpose(); }
01006 int getModified() const {return flags().getModified(); }
01007 int getSaveBypass() const{return flags().getSaveBypass(); }
01008 int getSaveData() const {return flags().getSaveData(); }
01009 virtual int getHasTakeData() const
01010 { return flags().getHasTakeData(); }
01011 virtual int getPickable();
01012 virtual int getAudio() const;
01013 virtual int getExport() const;
01014 virtual int getDebug() const;
01015 OP_Node *getPickableSelfOrParent();
01016
01017
01018 virtual void setExtraFlag(char, int) {}
01019
01020
01021
01022
01023
01024 virtual void setExtraFlags(int axis);
01025
01026
01027
01028
01029 int setCompress(int on_off);
01030 int getCompress() const;
01031
01032
01033
01034 void setCurrentAndPicked();
01035
01036
01037
01038
01039
01040
01041
01042 virtual bool setVisible(int onoff);
01043 virtual bool getVisible() const;
01044
01045
01046
01047
01048 virtual const OP_NodeFlags &flags() const
01049 { return static_cast<const OP_NodeFlags &>(OP_NetworkBoxItem::flags()); }
01050 virtual OP_NodeFlags &flags()
01051 { return static_cast<OP_NodeFlags &>(OP_NetworkBoxItem::flags()); }
01052
01053 virtual void getSaveFlagsString(UT_String &cmd,
01054 const char *flags,
01055 bool save_to_hip) const;
01056 virtual void getPreParmSaveFlagsString( UT_String &cmd ) const;
01057 virtual void getPostParmSaveFlagsString( UT_String &cmd ) const;
01058
01059 int hasOpInterest(void *data, OP_EventMethod m) const
01060 { return myEventValue.hasOpInterest(data, m); }
01061 void addOpInterest(void *data, OP_EventMethod m)
01062 { myEventValue.addOpInterest(data, m); }
01063 void removeOpInterest(void *data, OP_EventMethod m)
01064 { myEventValue.removeOpInterest(data, m); }
01065 int isBeingDeleted() const
01066 { return myBeingDeleted; }
01067 void setNodeBeingDeleted(int beingdeleted);
01068
01069
01070
01071
01072
01073
01074
01075
01076 static void repositionOpsMaxY(OP_NodeList &ops,
01077 UT_PtrArray<OP_NetworkBox *> &netboxes,
01078 float x, float y);
01079
01080
01081 virtual unsigned minInputs() const;
01082
01083
01084 virtual unsigned maxInputs() const;
01085
01086
01087
01088 virtual unsigned getNumVisibleInputs() const;
01089
01090
01091
01092
01093
01094 virtual unsigned orderedInputs() const;
01095
01096
01097
01098 virtual unsigned maxOutputs() const;
01099
01100
01101
01102 virtual unsigned getNumVisibleOutputs() const;
01103
01104
01105 bool hasUnorderedInputs() const;
01106
01107
01108
01109 virtual unsigned nInputs() const { return myInputs.entries(); }
01110
01111
01112
01113 unsigned nConnectedInputs() const;
01114
01115 unsigned getActiveInputIndex() const
01116 { return myActiveInputIndex; }
01117 void setActiveInputIndex(unsigned idx);
01118
01119
01120 OP_Node *getInput(unsigned idx, bool mark_used=false) const;
01121
01122
01123
01124 int getConnectedInputIndex(int startAt = -1) const;
01125
01126
01127 int getNthConnectedInput(int n) const;
01128
01129
01130
01131 virtual void getParallelInputs(OP_Context &context,
01132 OP_NodeList &nodes) const;
01133
01134
01135 virtual OP_ERROR setInput(unsigned idx, OP_Node *op,
01136 unsigned outputIdx = 0);
01137
01138
01139 virtual OP_ERROR setIndirectInput(unsigned idx,
01140 OP_InputIndirect *input);
01141
01142
01143 virtual OP_ERROR setInputReference(unsigned idx, const char *label,
01144 int keeppos, unsigned outputIdx = 0);
01145
01146
01147
01148 int whichInputIs(const OP_Node *who) const;
01149
01150
01151 int whichInputIs(const OP_InputIndirect *who) const;
01152
01153
01154 int whichInputIs(const OP_InputIndirect *whoi, int cnt) const;
01155
01156
01157
01158
01159 OP_LockedExtraInputs
01160 getLockedExtraInputs()
01161 {
01162 return OP_LockedExtraInputs(myExtraInputsList, myExtraInputsLock);
01163 }
01164 OP_LockedConstExtraInputs
01165 getLockedExtraInputs() const
01166 {
01167 return OP_LockedConstExtraInputs(myExtraInputsList, myExtraInputsLock);
01168 }
01169 void getExtraInputsCopy(OP_SimpleExtraInputArray &extra_inputs) const
01170 {
01171 OP_Lock::Scope lock(myExtraInputsLock);
01172
01173 for (int i = 0; i < myExtraInputsList.entries(); i++)
01174 {
01175 extra_inputs.append(
01176 OP_SimpleExtraInput(myExtraInputsList(i)->getNode(),
01177 myExtraInputsList(i)->getInterestType()));
01178 }
01179 }
01180 void getExtraInputNodes(OP_NodeList &extras) const
01181 {
01182 OP_Lock::Scope lock(myExtraInputsLock);
01183
01184 for (int i = 0; i < myExtraInputsList.entries(); i++)
01185 extras.append(myExtraInputsList.getExtraInput(i));
01186 }
01187
01188
01189
01190
01191 int whichOutputIs(OP_Node* target_node, int input_on_target_node);
01192
01193
01194
01195
01196 int whichInputIs(OP_Node* source_node, int counter);
01197
01198
01199 void consolidateInputs();
01200 virtual void clearUnreferencedInputs();
01201 virtual OP_Input *getInputReference(unsigned idx, int grow=1);
01202 virtual OP_Input *getInputReferenceConst(unsigned idx) const;
01203 virtual int doDeleteRewire() const { return 1; }
01204
01205
01206
01207 virtual void moveInput(int srcidx, int dstidx,
01208 bool forcesubnet = false);
01209 OP_ERROR insertInput(unsigned idx, OP_Node *op,
01210 unsigned outputIdx);
01211 OP_ERROR insertIndirectInput(unsigned idx,
01212 OP_InputIndirect *input);
01213
01214
01215
01216
01217
01218 virtual void addExtraInput(OP_Node *op, OP_InterestType type);
01219
01220
01221
01222 static void addExprOpDependency(const char *arg_str,
01223 const PRM_RefId &ref_id,
01224 OP_InterestType interest_type);
01225 static void addExprOpDependency1From2(const char *arg_str1,
01226 const char *arg_str2,
01227 const PRM_RefId &ref_id,
01228 OP_InterestType interest_type);
01229 static void addExprOpParmDependency(const char *arg_str,
01230 const PRM_RefId &ref_id,
01231 OP_InterestType interest_type);
01232
01233 static void changeExprOpRef(const char *arg_str,
01234 char *&new_arg,
01235 const char *new_fullpath,
01236 const char *old_fullpath,
01237 const char *old_cwd);
01238
01239 static void changeExprOpRef1From2(const char *arg_str1,
01240 const char *arg_str2,
01241 char *&new_arg1,
01242 char *&new_arg2,
01243 const char *new_fullpath,
01244 const char *old_fullpath,
01245 const char *old_cwd);
01246
01247 static void changeExprOpParmRef(const char *arg_str,
01248 char *&new_arg,
01249 const char *new_fullpath,
01250 const char *old_fullpath,
01251 const char *old_cwd,
01252 const char *chan_name,
01253 const char *old_chan_name);
01254
01255 void addGenericOpNameReference( const UT_String &oppath );
01256 void addGenericOpNameReference( const PRM_RefId &ref_id,
01257 OP_Node *node );
01258
01259 static void moveAndUpdateDependencies(
01260 const OP_NodeList &src_nodes,
01261 const OP_NodeList &dest_nodes );
01262
01263 static void updateChannelPtrs( CH_CollectionList &parents );
01264
01265
01266
01267
01268 virtual void rebuildParmDependency( int parm_index );
01269
01270
01271 virtual void clearParmDependency( int parm_index );
01272
01273 void decrementOpReference(int node_id);
01274
01275 virtual void dumpDependencies();
01276 void dumpOpDependents(OP_Node *ref, int brief, ostream &os);
01277 int countReferences(int op_id);
01278
01279 void getExistingOpReferences(OP_NodeList &refs,
01280 bool recurse);
01281
01282 void getExistingOpDependents(OP_NodeList &deps,
01283 bool recurse);
01284 UT_RefArray<OP_Dependency> &getOpDependents() { return myOpDependents; }
01285
01286
01287 void getParmsThatReference(const char *channame,
01288 UT_PtrArray<PRM_Parm *> &parms,
01289 UT_IntArray &parmsubidxs);
01290
01291 virtual void inputConnectChanged(int which);
01292
01293
01294
01295
01296 unsigned nOutputs(int outputIdx = -1) const;
01297
01298 OP_Node *getOutput(unsigned idx, int outputIdx = -1);
01299
01300 const OP_Node *getOutput(unsigned idx, int outputIdx = -1) const;
01301
01302
01303
01304 OP_LockedNodeList
01305 getLockedExtraOutputs()
01306 {
01307 return OP_LockedNodeList(myExtraOutputsList, myExtraOutputsLock);
01308 }
01309 OP_LockedConstNodeList
01310 getLockedExtraOutputs() const
01311 {
01312 return OP_LockedConstNodeList(myExtraOutputsList, myExtraOutputsLock);
01313 }
01314
01315
01316
01317 void getNonSubnetOutputs( OP_NodeList &nodes ) const;
01318
01319
01320
01321 OP_Node *getOutputTowardsNode( const OP_Node *target );
01322
01323
01324
01325
01326 void fillInfoTree(UT_InfoTree &tree, float time);
01327
01328
01329
01330
01331 virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree,float time);
01332
01333
01334
01335
01336
01337
01338 virtual const char *getDefaultSelectedInfoTreeBranchName() const;
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354 virtual OP_ERROR lockInput(unsigned idx, OP_Context &context);
01355 virtual void unlockInput(unsigned idx);
01356 virtual OP_ERROR lockInputs(OP_Context &context);
01357 virtual void unlockInputs(void);
01358
01359
01360
01361
01362 int getCookCount(void) const { return myCookCount; }
01363 void triggerOutputChanged();
01364 void triggerUIChanged();
01365
01366
01367 virtual int cookedInputIndex() const { return -1; }
01368
01369 bool setMinimumCacheSize(int min_size);
01370
01371 OP_VERSION getVersionParms() const { return myVersionParms; }
01372
01373
01374
01375 virtual bool handleTimeChange(double ) { return false; }
01376
01377
01378
01379 bool isTimeDependent(OP_Context &context);
01380
01381 static int getGlobbedNodes(OP_Node *cwd, UT_String &holder,
01382 const char *pattern, UT_WorkArgs &argv,
01383 OP_GlobContext *context);
01384
01385 static int getGlobbedNetworkBoxes(OP_Node *cwd, UT_String &holder,
01386 const char *pattern, UT_WorkArgs &argv,
01387 OP_GlobContext *context);
01388
01389 static int getGlobbedPostIts(OP_Node *cwd, UT_String &holder,
01390 const char *pattern, UT_WorkArgs &argv,
01391 OP_GlobContext *context);
01392
01393
01394
01395
01396
01397 virtual bool runCreateScript();
01398
01399
01400 void updateParmsToMatchCurrentUnits();
01401
01402
01403
01404 virtual void matchOTLDefinition();
01405
01406
01407 virtual void unmatchOTLDefinition();
01408
01409
01410
01411 const UT_String &getSyncErrors() const
01412 { return mySyncErrors; }
01413
01414 OP_ERROR getSyncErrorLevel() const
01415 { return mySyncErrorLevel; }
01416
01417
01418 int getMatchesOTLDefinition() const;
01419
01420
01421 static void propagateMatchOTLDefinitionToAncestors(OP_Node *node,
01422 bool sync_flag);
01423
01424
01425
01426 int getCanDeviateFromOTLDefinition() const;
01427 void setAllChildAssetPermissions(int permission);
01428
01429
01430 bool getIsEditableAssetSubNode() const;
01431
01432
01433 void turnOffAllChildExports(void);
01434
01435
01436 bool haveLicenseToAccessContents() const;
01437 bool haveLicenseToAccessParentContents() const;
01438 bool haveAncestorWithoutFullLicense(bool ignore_self) const;
01439 OP_OTLLicenseType getLicense() const;
01440
01441 OP_Node *getFirstExecLicenseOnlyAncestor(
01442 bool ignore_self = true) const;
01443
01444 OP_Node *getLastExecLicenseOnlyAncestor(
01445 bool ignore_self = true) const;
01446
01447
01448 void saveWires(ostream &os, const char *name,
01449 int dogeneral = 0);
01450 void saveOutputWires(ostream &os, const char *name,
01451 int dogeneral = 0);
01452 virtual void saveIntrinsicCommand(ostream &os, const char *name);
01453
01454
01455 virtual OP_ERROR saveCommand(ostream &os,
01456 const char *name,
01457 int valuesOnly,
01458 int defaultstoo,
01459 int docreate,
01460 int doparms,
01461 int doflags,
01462 int dowires,
01463 int dowiresout,
01464 int frames,
01465 int dogeneral,
01466 int dochblock,
01467 float x,
01468 float y,
01469 const char *netboxname,
01470 int dospareparms);
01471
01472
01473
01474
01475
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486 void saveParameterFlags(ostream &os, const char *name,
01487 const char *command,
01488 bool (PRM_Parm::*flag_method)(int) const,
01489 bool defaultstoo, bool reverse,
01490 UT_RefArray<opParmData> *parm_array);
01491
01492 void saveUserDataCommand(
01493 ostream &os, const char *node_name);
01494
01495 enum RampError
01496 {
01497 RAMP_ERR_SUCCESS,
01498 RAMP_ERR_NOT_FOUND,
01499 RAMP_ERR_FIRST_OR_LAST_KEY
01500 };
01501 virtual RampError rampCommand(bool remove, float pos, float rgba[4]);
01502 RampError rampCommand(bool remove, float pos, float rgba[4],
01503 UT_Ramp &ramp);
01504
01505 virtual bool loadRamp(UT_IStream &is, const char *path=0);
01506
01507 bool loadRamp(UT_IStream &is, UT_Ramp &ramp,
01508 const char *path=0);
01509 OP_ERROR saveRamp(ostream &os, UT_Ramp &ramp,
01510 const char *name = 0, int command = 0);
01511
01512 bool getUserData(const char *key, std::string &result);
01513 void setUserData(const char *key, const std::string &data);
01514 bool hasUserData(const char *key);
01515 bool deleteUserData(const char *key);
01516 const UT_Options &userData() const { return myUserData; }
01517 bool loadUserData(UT_IStream &is, const char *path=NULL);
01518 OP_ERROR saveUserData(ostream &os, const char *path);
01519
01520 bool loadExtraInputs(UT_IStream &is, const char *path=0);
01521
01522 void saveOverrides(ostream &os);
01523 void saveOverrides(ostream &os, OP_Node *root,
01524 const UT_String &rootpath,
01525 bool &added);
01526 void saveChildOverrides(ostream &os, OP_Node *root,
01527 const UT_String &rootpath,
01528 bool &added);
01529 bool loadOverride(UT_IStream &is);
01530 virtual UT_ErrorSeverity
01531 prmCookOverrides(float t, int thread,
01532 const char *parm_name, int vec_idx);
01533 virtual bool isParmPendingOverride(const char *parm_name,
01534 int vec_idx) const;
01535 OP_ERROR cookOverrides(OP_Context &c);
01536
01537 virtual void removeOverrideDestination(OP_Node * ) {}
01538 virtual void removeOverrideDestination(OP_Node * ,
01539 int ) {}
01540
01541
01542 virtual void executeCommand(const char *command,
01543 ostream *out,
01544 ostream *err) const;
01545 virtual void pushAsPwdAndRunPython(
01546 PY_CompiledCode &compiled_code,
01547 PY_Result::Type desired_result_type,
01548 PY_Result &result,
01549 PY_EvaluationContext *context=NULL) const;
01550
01551 OP_ERROR executeHscriptScript(UT_String &script, float now);
01552 OP_ERROR executePythonScript(UT_String &script, float now);
01553
01554 void addPythonNodeError(const PY_Result &py_result);
01555
01556 void saveInputs(ostream &os);
01557 bool loadInputs(UT_IStream &is, const char *path=0);
01558
01559 void checkInputs();
01560
01561
01562
01563
01564 virtual void saveDialogScriptExtraInfo(ostream &os);
01565
01566
01567 virtual void createGalleryEntry(OP_GalleryEntry &entry);
01568
01569
01570
01571
01572
01573
01574
01575 void evalOpPathString(UT_String &val, int pi, int vi,
01576 float t, int &op_id, float &op_time,
01577 int expanded = 1);
01578 void evalOpPathString(UT_String &val, const char *pn,
01579 int &pi, int vi, float t,
01580 int &op_id, float &op_time, int expanded=1);
01581 static int findOpFramePair(const char *path, int &op_id,
01582 float &frame);
01583
01584
01585 static void buildXformOrder(int trs, int xyz,
01586 UT_XformOrder &order);
01587
01588
01589 static UT_XformOrder::rstOrder getMainOrder( int trs );
01590
01591
01592 static int getMainOrderMenuIndex(UT_XformOrder::rstOrder order);
01593
01594 static UT_XformOrder::xyzOrder getRotOrder( int xyz );
01595
01596
01597 static int getRotOrderMenuIndex(UT_XformOrder::xyzOrder order);
01598
01599 static UT_Vector3 getXformPivot(int trs,
01600 float tx, float ty, float tz,
01601 float px, float py, float pz);
01602 static UT_Vector3 getPivotParmValue(int trs,
01603 float tx, float ty, float tz,
01604 float px, float py, float pz);
01605 static void buildXform(int trs, int xyz,
01606 float tx, float ty, float tz,
01607 float rx, float ry, float rz,
01608 float sx, float sy, float sz,
01609 float px, float py, float pz,
01610 UT_Matrix4 &mat);
01611 static void buildXform(int trs, int xyz,
01612 float tx, float ty, float tz,
01613 float rx, float ry, float rz,
01614 float sx, float sy, float sz,
01615 float px, float py, float pz,
01616 UT_DMatrix4 &mat);
01617 static void buildXform(int trs, int xyz,
01618 float tx, float ty, float tz,
01619 float rx, float ry, float rz,
01620 float sx, float sy, float sz,
01621 float s_xy, float s_xz, float s_yz,
01622 float px, float py, float pz,
01623 UT_Matrix4 &mat);
01624 static void buildXform(int trs, int xyz,
01625 float tx, float ty, float tz,
01626 float rx, float ry, float rz,
01627 float sx, float sy, float sz,
01628 float s_xy, float s_xz, float s_yz,
01629 float px, float py, float pz,
01630 UT_DMatrix4 &mat);
01631 static void buildXform(int trs,
01632 float tx, float ty, float rz,
01633 float sx, float sy, float px, float py,
01634 UT_Matrix3 &mat);
01635 static void buildXform(int trs,
01636 float tx, float ty, float rz,
01637 float sx, float sy, float px, float py,
01638 UT_DMatrix3 &mat);
01639 static void buildXform(int trs,
01640 float tx, float ty, float rz,
01641 float sx, float sy, float s_xy,
01642 float px, float py,
01643 UT_Matrix3 &mat);
01644 static void buildXform(int trs,
01645 float tx, float ty, float rz,
01646 float sx, float sy, float s_xy,
01647 float px, float py,
01648 UT_DMatrix3 &mat);
01649
01650 virtual int getTranslateParmIndex();
01651
01652
01653
01654 void resolveInputReferences();
01655
01656 static void clearAllPendingUndoFlags();
01657
01658 virtual void clearUndoFlags();
01659 virtual void setAnyUndoFlag();
01660 void saveForUndoInput();
01661
01662 void blockModify(int on_off, int propagate = 1);
01663 int isBlockModify(void) const;
01664 virtual void propagateEndBlockModify();
01665
01666 int getNParmInterests() const
01667 { return myParmInterestCount; }
01668 const OP_ParmInterest *getParmInterest(int index) const
01669 {
01670 return (index < myParmInterestCount)
01671 ? myParmInterests(index) : 0;
01672 }
01673
01674
01675
01676
01677
01678
01679 void addParmInterest(OP_Node *src, int srcindex,
01680 int dstindex);
01681 void dumpParmInterests() const;
01682
01683
01684 virtual const CL_Clip *getClip(OP_Context *context = 0);
01685
01686
01687
01688 void getMotionEffectsNetworkPath(UT_String &path);
01689
01690
01691 float getCookDuration() const;
01692 const char *getCookDurationString() const;
01693
01694
01695 virtual int getNetOverviewColor( UT_Color &color );
01696
01697
01698 virtual UT_Ramp *getRamp();
01699
01700 virtual int isCookingRender() const { return 0; }
01701 virtual void setCookingRender(int val);
01702
01703 virtual void clearInterrupted();
01704 int wasInterrupted() const { return flags().interrupted; }
01705
01706
01707
01708
01709 void setRenameConflict()
01710 { myRenameConflict = 1; }
01711 void setRunningCreateScript(int onoff);
01712
01713
01714 virtual int outputCode(OP_OutputCodeParms &, OP_Context &);
01715
01716 virtual float getTimeTransform(int input, float t);
01717 virtual void getInputRes(int input, float t,
01718 const OP_Context &context,
01719 OP_Context &input_context);
01720
01721
01722 static void setIndentLevel(int numspaces);
01723 static void writeIndent(ostream &os, int indent);
01724 static void writeSpaces(ostream &os, int spaces);
01725 static void writeFileHeader(ostream &os, const char *filename,
01726 const char *prefix);
01727
01728 UT_TokenString & getHashCode(OP_Context &context, int group_mask =1);
01729 virtual UT_TokenString & getParmHashCode(OP_Context &context,
01730 int group_mask = 1);
01731
01732 virtual int getNumInputsToHash();
01733 virtual OP_Node *getInputToHash(int i);
01734
01735 void clearHashCodeFlags();
01736 bool isHashCodeBuilt() const { return myBuiltHashCode;}
01737 void builtHashCode(bool b = true) { myBuiltHashCode = b; }
01738 void buildInputHashCode(UT_TokenString &string,
01739 OP_Context &context,
01740 int group_mask,
01741 int level);
01742
01743
01744 void setCreatorState(const char *s)
01745 { myCreatorState.harden(s); }
01746 const UT_String &getCreatorState() const { return myCreatorState; }
01747 void builtExplicitly(int yn) { myBuiltExplicitly = yn; }
01748 int wasBuiltExplicitly() const{ return myBuiltExplicitly; }
01749
01750 bool matchesState(const char *state) const;
01751
01752
01753
01754 virtual void changeParmTemplate(PRM_Template *new_template);
01755
01756 void ensureInputsAndOutputsAreValid();
01757
01758
01759
01760 void connectToInputNode(OP_Node &inputnode, int input_idx,
01761 int branch_off=0);
01762
01763
01764 virtual int editCallback(CL_Track *track, float t,
01765 float newValue);
01766
01767
01768 static OP_EditCallback getEditCallback(void *&data);
01769 static void setEditCallback(OP_EditCallback func,
01770 void *data);
01771
01772
01773
01774
01775
01776 static void buildQuadricXform(UT_Matrix4 &mat,
01777 float tx, float ty, float tz,
01778 float sx, float sy, float sz,
01779 char axis = 'y');
01780
01781 static void buildQuadricXform(UT_DMatrix4 &mat,
01782 float tx, float ty, float tz,
01783 float sx, float sy, float sz,
01784 char axis = 'y');
01785
01786 static int buildOpMenu(OP_Network *net, PRM_Name *theMenu,
01787 int theMenuSize, int (*doAdd)(OP_Node *) = 0,
01788 int startItem = 0, PRM_Parm *parm = 0,
01789 int showSubnets = 1, int expandSubnets = 1,
01790 bool recurse = false);
01791
01792
01793
01794
01795 static void buildPreDefRulesMenu(PRM_Name *menu,
01796 OP_PreDefRules &pdr);
01797
01798
01799
01800
01801
01802 virtual const CH_LocalVariable *resolveVariable(const char *name);
01803 virtual const CH_LocalVariable *resolveExtraVariableForSyntaxHighlight(
01804 const char *name);
01805
01806
01807 static int getNameSerialIndex();
01808
01809
01810 virtual void setMapping(int idx, int type, const char *label = 0);
01811 virtual int getMapping(int idx, const char *&label) const;
01812
01813
01814 virtual int acceptDragDrop(DD_Source &src, const char *label);
01815 virtual int testDragDrop(DD_Source &src);
01816 virtual void getDragDropChoice(DD_Source &src, DD_ChoiceList &c);
01817
01818
01819 bool hasComment() const;
01820 bool hasParmsNotAtFactoryDefault() const;
01821 bool hasAnimatedParms() const;
01822 bool hasChopOverriddenParms() const;
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834
01835
01836
01837
01838 bool traverseInputs(bool (*callback)(OP_Node &, void *),
01839 void *data,
01840 bool follow_subnets,
01841 bool follow_ref_inputs,
01842 bool follow_extra_inputs,
01843 OP_InterestType extra_interest_mask =
01844 OP_INTEREST_ALL);
01845 bool traverseInputs(bool (*callback)(const OP_Node &, void*),
01846 void *data,
01847 bool follow_subnets,
01848 bool follow_ref_inputs,
01849 bool follow_extra_inputs,
01850 OP_InterestType extra_interest_mask =
01851 OP_INTEREST_ALL) const;
01852
01853
01854
01855
01856 bool traverseChildren(bool (*callback)(OP_Node &, void*),
01857 void *data,
01858 bool recurse_into_subnets);
01859
01860
01861
01862 virtual bool usesFootprint() const { return false; }
01863
01864 void getExternalReferences(UT_StringArray &reflist,
01865 UT_StringArray *nodelist = 0,
01866 bool from_children_too = true,
01867 bool collapse = false,
01868 bool check_missing = false,
01869 bool show_missing_only = false);
01870 virtual bool getSaveWithVopnets();
01871 virtual void runDelScript();
01872
01873
01874 virtual void preDelete() { }
01875
01876
01877
01878 virtual DOP_Parent *castToDOPParent() { return 0; }
01879 virtual const DOP_Parent *castToDOPParent() const { return 0; }
01880
01881
01882
01883
01884 virtual VOP_CodeGenerator *getVopCodeGenerator() { return 0; }
01885
01886
01887
01888
01889
01890
01891
01892
01893 virtual bool getScriptMaterialInfo( UT_String & mat_info,
01894 VOP_ScriptMaterialCodeMapper * mapper )
01895 { return false; }
01896
01897
01898
01899
01900
01901 virtual const char *getOTLSubType() { return 0; }
01902
01903
01904
01905 bool setChannelAlias(PRM_Parm &parm, int subindex,
01906 const char *alias_name);
01907
01908 void disconnectAllInputsOutputs(bool keepSelected,
01909 bool forceDisconnectOutputs = false);
01910
01911 void disconnectAllInputs(void);
01912 void disconnectAllOutputs(void);
01913
01914
01915 virtual void notifyParmRenameDependents(
01916 const UT_String &chan_name,
01917 const UT_String &old_chan_name );
01918
01919 void writeChannel(CH_Channel *channel, ostream &os,
01920 const char *name, bool frames);
01921 void writeAllChannels(ostream &os, const char *name,
01922 bool frames, bool dochblock,
01923 bool dospareparms);
01924
01925
01926
01927
01928 virtual bool triggerParmCallback(PRM_Parm *parmptr, float now,
01929 int value, void *data);
01930
01931 virtual int64 getMemUsage(UT_Bool onlythis) const;
01932 int64 getExtraInputMemUsage() const;
01933 static void printOpMemoryUsageStats(ostream &os);
01934
01935
01936
01937
01938
01939 virtual void unscopeChannels(bool recurse);
01940
01941
01942
01943
01944 virtual void setChannelScope(const char *pattern,
01945 OP_ScopeOp scope_op,
01946 const OP_ScopeOptions &scope_opts);
01947
01948
01949
01950 virtual const UT_String &getItemName() const { return getName(); }
01951
01952
01953 virtual bool changeSpareParms(UT_IStream &istream,
01954 UT_String &errors);
01955
01956
01957 virtual void spareParmRemoved(const char *parmname);
01958
01959
01960
01961 virtual PRM_ParmList *createObsoleteParmList();
01962 virtual void resolveAndDeleteObsoleteParmList(
01963 PRM_ParmList *&obsolete_parms);
01964
01965
01966
01967
01968
01969
01970
01971 bool setGlobalFloatParam(const char *param,
01972 float value,
01973 bool *warned);
01974 bool setGlobalStringParam(const char *param,
01975 const char *strvalue,
01976 bool *warned);
01977
01978
01979
01980
01981 void beginPropagateModification(OP_PropagateData *data = 0);
01982 void endPropagateModification();
01983
01984
01985 virtual void getActiveOperatorsDefinedByOTL(
01986 UT_HashTable &active_operators) const;
01987
01988
01989
01990
01991
01992 static bool getDoingBulkNotification();
01993
01994
01995
01996
01997 virtual bool hasDifferentMultiInputs() const;
01998
01999
02000 virtual bool canCreateNewOpType() const;
02001 static bool createNewOpType
02002 (OP_Node *node,
02003 UT_String &errors,
02004 const char *typeName=NULL,
02005 const char *typeLabel=NULL,
02006 const char *otlFile=NULL,
02007 const char *metaSource=NULL,
02008 const char *comment=NULL,
02009 const char *version=NULL,
02010 const char *newName=NULL,
02011 int minimumInputs=-1,
02012 int maximumInputs=-1,
02013 bool ignoreExternalReferences=false,
02014 bool compressContents=false,
02015 bool force=false,
02016 int *newNodeId=NULL);
02017
02018
02019 virtual UT_String *getMaterialIconFilename() { return 0; }
02020 virtual void setMaterialIconFilename(const char * ) {}
02021 virtual IMG_Raster *getMaterialIconImage() { return 0; }
02022 virtual bool getMaterialIconAllowRegenerateFlag() { return true; }
02023 virtual void setMaterialIconAllowRegenerateFlag(bool) {}
02024
02025
02026 static const char *OP_INFO_SEPARATOR_STRING;
02027
02028
02029
02030
02031
02032 static void setSmallMode();
02033
02034 static bool getSmallMode();
02035
02036
02037
02038
02039
02040 static void startBulkNotifications(
02041 const OP_NodeList &changed);
02042 static void endBulkNotifications(
02043 const OP_NodeList &changed);
02044
02045
02046 static void setNodeButtonWidthFlagMult(int new_mult);
02047
02048
02049
02050
02051
02052 virtual bool willAutoconvertInputType(int input_idx);
02053
02054 bool isDependentOn(OP_Node* other_node, PRM_Parm* parm);
02055
02056
02057
02058 void setExposeRecursive(bool expose, bool do_inputs, int level = 0);
02059
02060
02061
02062 virtual bool getIsVisible(int idx);
02063
02064
02065
02066 bool verifyTemplatesWithParameters() const;
02067
02068 protected:
02069 OP_Node(OP_Network *parent, const char *name, OP_Operator *entry);
02070 virtual ~OP_Node();
02071
02072 void setNewParent( OP_Network *new_parent );
02073
02074 static void bumpNameSerialIndex();
02075
02076
02077
02078 virtual void clearAndDestroy(void);
02079
02080
02081 virtual void clearCache();
02082
02083
02084
02085
02086
02087
02088
02089 virtual OP_ERROR cookMe(OP_Context &context) = 0;
02090
02091
02092
02093
02094
02095 virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input) = 0;
02096
02097
02098
02099
02100 virtual void doOverridePreCook() { }
02101 virtual void doOverridePostCook() { }
02102
02103
02104
02105
02106 int getSourceCount(void) const;
02107 virtual int bumpSourceCount(int d);
02108
02109
02110
02111 virtual OP_ERROR cookInputGroups(OP_Context &context, int alone = 0);
02112
02113
02114
02115
02116
02117
02118 virtual int deleteNodeData(void *);
02119 virtual void *copyNodeData(void *);
02120
02121
02122 virtual OP_ERROR saveIntrinsic(ostream &os, const OP_SaveFlags &flags);
02123 virtual OP_ERROR save(ostream &os, const OP_SaveFlags &flags,
02124 const char *path_prefix = "");
02125
02126 bool loadIntrinsic(UT_IStream &is, const char *path=0);
02127 virtual bool loadPacket(UT_IStream &is, short class_id,
02128 short sig, const char *path=0);
02129 virtual bool loadPacket(UT_IStream &is, const char *token,
02130 const char *path=0);
02131 virtual bool load(UT_IStream &is, const char *ext="",
02132 const char *path=0);
02133
02134
02135 virtual void loadStart();
02136 virtual void loadFinished();
02137
02138
02139
02140 void loadContentsSection();
02141
02142
02143
02144 virtual bool syncContents(UT_IStream &is);
02145
02146
02147 void setMatchesOTLDefinition(int matches);
02148
02149 virtual const char *getFileExtension(int binary) const = 0;
02150 virtual const char *getDataFileExtension(int binary) const;
02151
02152
02153
02154 const char *inputLabelNum(unsigned idx) const;
02155 const char *outputLabelNum(unsigned idx) const;
02156
02157
02158
02159 virtual void checkTimeDependencies( int do_parms=1,
02160 int do_inputs=1,
02161 int do_extras=1 );
02162 unsigned isInput(unsigned idx)
02163 { return idx < myInputs.entries(); }
02164
02165
02166 void sendEvent(OP_EventType type, void *data=0);
02167
02168
02169
02170 int haveSeenDataModification(long modification_id);
02171
02172
02173
02174
02175
02176
02177
02178
02179
02180 virtual int propagateModification(OP_Node *by_whom,
02181 OP_EventType reason,
02182 int parm_index,
02183 OP_PropagateData &prop_data);
02184 virtual void propagateParmChange(OP_Node *node,
02185 OP_PropagateData &prop_data,
02186 bool &data_changed);
02187 void propagateParmChangeFromSource(OP_Node *source,
02188 OP_PropagateData &data);
02189
02190 OP_VERSION getVersionCache();
02191 void setVersionCache(OP_VERSION);
02192
02193
02194
02195 OP_Cache * getCookCache() { return &myCache; }
02196
02197
02198 static void deleteDataCallback(void *, void *);
02199 static void *copyDataCallback(void *, void *);
02200
02201 static void cmd_locate(CMD_Args &);
02202
02203 virtual void saveFlagsForUndo();
02204 void saveForUndoLayout();
02205 void saveForUndoColor();
02206
02207 static void saveForUndoDelete(OP_NodeList &nodes);
02208
02209
02210 void clearDependency(bool include_parm);
02211 void clearExtraInputs();
02212 void clearParmInterests()
02213 {
02214 myParmInterestCount = 0;
02215 mySelfParmInterestCount = 0;
02216 mySelfParmDataInterest = false;
02217 }
02218
02219
02220
02221 virtual void cloneFromProxyRefNode( OP_Network *proxy );
02222
02223 virtual OP_Network * cloneToProxyRefNode();
02224 void stealDependents( OP_Node *other );
02225
02226 int hasOpDependents()
02227 { return myOpDependents.entries(); }
02228 virtual int hasProxyRefNodes() const
02229 { return 0; }
02230 virtual void moveProxyRefNodes( OP_Network * ) { }
02231 void clearOpReferences();
02232 virtual void rebuildOpDependents( bool proxy_only );
02233
02234
02235 virtual int removeOpDependent(
02236 int op_id, const PRM_RefId &ref_id,
02237 OP_InterestType mask = OP_INTEREST_ALL );
02238 virtual int removeOpDependent(
02239 int op_id, OP_InterestType mask = OP_INTEREST_ALL );
02240
02241
02242
02243
02244
02245 virtual void buildOpDependencies();
02246 virtual void checkChannelDependencies( CH_Channel *ch,
02247 CH_CHANGE_TYPE reason );
02248
02249 void notifyOpDependents( OP_InterestType interest,
02250 bool recurse );
02251 virtual void moveDependencies( OP_Node *from_node );
02252
02253
02254
02255
02256
02257 void notifyRenameDependents( const UT_String &full_from );
02258 virtual void notifyRenameDependents( const UT_String &full_from,
02259 OP_NodeList &cook_nodes );
02260
02261
02262
02263
02264
02265 void notifyRenameReferences( const UT_String &full_from );
02266 virtual void notifyRenameReferences( const UT_String &full_from,
02267 OP_NodeList &cook_nodes );
02268 void notifyExtraNameOutputs( const char *old_name );
02269
02270
02271 virtual void handleOpDependency( int referenced_op_id,
02272 const OP_Dependency &op_dep,
02273 OP_InterestType interest_type,
02274 bool &need_cook,
02275 const char *old_fullpath,
02276 const char *old_cwd,
02277 const char *old_chan_name );
02278 virtual void buildParmDependency( int parm_index );
02279
02280 void addOpNameReference(
02281 const PRM_RefId &ref_id, const UT_String &op_path,
02282 OP_InterestType type );
02283
02284 void addChannelNameReference(
02285 const PRM_RefId &ref_id, const UT_String &op_path,
02286 const UT_String &chan_name, OP_InterestType type );
02287
02288 OP_Node *getNodeOrCreateProxy(const UT_String &op_path);
02289
02290 void addOpReference( const PRM_RefId &ref_id, OP_Node *node,
02291 const PRM_RefId &source_ref_id,
02292 OP_InterestType type );
02293
02294
02295
02296
02297
02298
02299
02300
02301
02302
02303
02304
02305
02306
02307
02308 bool changeOpPathRef( UT_String &value_str,
02309 const char *new_fullpath,
02310 const char *old_fullpath,
02311 const char *old_cwd,
02312 const char *new_cwd );
02313
02314
02315
02316 static bool getStringParmOpPath(
02317 PRM_Parm &parm, int vi, UT_String &oppath,
02318 int thread );
02319 void handleStringParmOpPathDependency(
02320 int parm_index, int vi,
02321 const char *new_fullpath,
02322 const char *old_fullpath, const char *old_cwd );
02323
02324
02325
02326 virtual void nodeDeleted(OP_Node *op, int propagate=1);
02327
02328 void startCookTimer(const OP_Context &context);
02329 void stopCookTimer(const OP_Context &context);
02330
02331 virtual const char *getCookTimerLabel(const OP_Context &context) const;
02332
02333
02334 virtual void permissionError(const char *chname = 0);
02335
02336
02337 void addInputError(unsigned input_idx);
02338
02339
02340
02341
02342
02343 virtual bool isInputConnectedInsideSubnet(int input_idx) const;
02344
02345
02346 virtual void nodeUnlocked() { ; }
02347
02348
02349 virtual void setUniqueId(int id);
02350 void changeOpDependentUniqueId( int old_id, int new_id );
02351 void changeOpReferenceUniqueId( int old_id, int new_id );
02352 virtual void clearUniqueId();
02353
02354 void setAllowBuildDependencies( int yesno )
02355 { myAllowBuildDependencies = yesno; }
02356 int allowBuildDependencies() const
02357 { return myAllowBuildDependencies; }
02358
02359
02360
02361 void evaluateAllParms(double t);
02362
02363
02364
02365
02366 virtual void getMyExternalReferences(UT_StringArray &reflist,
02367 UT_StringArray *nodelist =0,
02368 bool collapse = false,
02369 bool check_missing = false,
02370 bool show_missing_only=false);
02371
02372 void getExternalFiles(UT_StringArray &files,
02373 const char *stringparm,
02374 int framestart, int frameend,
02375 bool collapse,
02376 bool check_missing,
02377 bool show_only_missing,
02378 UT_KnownPath path);
02379
02380
02381 virtual bool canDestroyNode();
02382
02383
02384
02385
02386
02387
02388 static bool canDestroyNodes(OP_Network *src_net,
02389 OP_NodeList *nodes);
02390
02391
02392
02393
02394
02395 virtual bool cookedDataUsesAllParameters() const
02396 { return false; }
02397
02398
02399 virtual bool cookedDataNeedsErrors() const
02400 { return false; }
02401
02402
02403
02404 bool getIsRunningInCreateScript() const;
02405
02406
02407
02408
02409
02410 virtual void refreshRepresentativeNode(OP_Node &changed_child);
02411
02412
02413
02414 void appendExportingChopToCook( int id );
02415
02416
02417
02418 void convertOpdefToAbsolutePath(UT_String &str) const;
02419
02420 bool isCookedTime(double t) const
02421 { return SYSequalZero(t - myCookTime); }
02422
02423
02424 UT_TokenString myHashCode;
02425 UT_TokenString myParmHashCode;
02426 int myLastGroupMask;
02427 OP_VERSION myHashVersion;
02428 float myHashTime;
02429 int myParmLastGroupMask;
02430 OP_VERSION myParmHashVersion;
02431 float myParmHashTime;
02432 UT_String mySyncErrors;
02433 OP_ERROR mySyncErrorLevel;
02434 int mySyncDepth;
02435
02436
02437
02438
02439
02440
02441
02442 static fpreal getFlagWidth();
02443
02444
02445 static fpreal getNodeHeight();
02446
02447
02448
02449 static fpreal getNodeButtonWidth();
02450
02451
02452
02453 static fpreal getConnectorHeight();
02454
02455 static bool theSmallMode;
02456
02457
02458
02459 void deleteInput(int idx);
02460
02461
02462 void updateErrorSeverity();
02463
02464
02465 virtual void onInputAllocated(OP_Input* new_input, int index) { }
02466
02467 private:
02468 #ifdef INTEL_COMPILER
02469 OP_Node(const OP_Node& );
02470 #endif
02471
02472 void createCollection( OP_Operator *entry );
02473
02474
02475
02476 OP_ERROR saveIntrinsicError();
02477 OP_ERROR saveError();
02478 OP_ERROR saveGroupMemberships(ostream &os,
02479 const OP_SaveFlags &flags,
02480 const char *path_prefix);
02481 bool loadGroupMemberships(UT_IStream &is,const char*path=0);
02482
02483
02484 OP_ERROR saveNetworkBox(ostream &os,
02485 const OP_SaveFlags &flags,
02486 const char *path_prefix);
02487
02488
02489 bool loadNetworkBox(UT_IStream &is, const char *path=0);
02490
02491 bool loadNodeFlags(UT_IStream &is, const char *path);
02492
02493 void saveForUndoComment();
02494 void saveForUndoDelScript();
02495
02496 UT_BitArray &getGroups() { return myGroups; }
02497 const UT_BitArray &getGroups() const { return myGroups; }
02498
02499 bool setOutput(OP_Node *node, int outputIdx);
02500 bool delOutput(OP_Node *node, int outputIdx);
02501
02502 void setInterrupted();
02503
02504 void setExtraOutput(OP_Node *);
02505 void delExtraOutput(OP_Node *);
02506 int hasExtraInput(const OP_Node *match_node,
02507 OP_InterestType type);
02508
02509 int findAncestor(const OP_Node *node) const;
02510 int findDataAncestor(const OP_Node *node) const;
02511 void clearRecursionBit() const;
02512
02513 void initializeExpressions() const;
02514 void clearInputs();
02515
02516
02517
02518
02519 void removeOpReference(
02520 const PRM_RefId &ref_id,
02521 OP_InterestType mask = OP_INTEREST_ALL );
02522 void removeOpReference(
02523 const PRM_RefId &ref_id,
02524 int op_id,
02525 OP_InterestType mask = OP_INTEREST_ALL );
02526
02527 int addOpDependent( int op_id,
02528 const PRM_RefId &source_ref,
02529 const PRM_RefId &ref_id,
02530 OP_InterestType type );
02531
02532 void updateRenameDependent( OP_Node *dependent,
02533 const char *old_cwd,
02534 OP_NodeList &cook_nodes );
02535
02536 void buildScriptOpDependencies();
02537 void changeScriptOpRef( const char *new_fullpath,
02538 const char *old_path,
02539 const char *old_cwd );
02540 static void changeScriptCB( UT_String &str,
02541 const char *token_start,
02542 const char *&ch, void *userdata );
02543
02544
02545
02546
02547
02548
02549
02550
02551
02552
02553
02554
02555
02556
02557 bool findTimeInterests(OP_Context &context, OP_Node *node,
02558 bool update_cook,
02559 OP_NodeCycleDetect &cycle,
02560 OP_NodeList *interests = NULL);
02561
02562
02563 bool attemptPrefixMatch(const OP_NetworkBoxItem *item,
02564 char *childpref, int childpreflen,
02565 UT_String &maxprefix) const;
02566
02567
02568 void findUsedDataInterests(OP_NodeList &nodes, OP_Node *op);
02569 void propagateSelfParmInterest(int src_index,
02570 const UT_HashTable &dag,
02571 bool expr_change,
02572 UT_BitArray &visited,
02573 bool &data_changed);
02574
02575
02576
02577 bool internalSetGlobalParam(const char *param,
02578 int setreturned,
02579 bool *warned);
02580
02581 int internalSetPicked(int on_off,
02582 bool propagate_parent_event,
02583 bool edit);
02584
02585 OP_ERROR internalCookInput(OP_Context &context, int input_idx,
02586 OP_Node &input_node);
02587
02588
02589
02590 void skipUntilClosingBrace(UT_IStream &is);
02591
02592 private:
02593 OP_Cache myCache;
02594
02595 OP_ERROR myLastErrorSeverity;
02596 OP_Network *myParent;
02597 UT_PtrArray<OP_Input *> myInputs;
02598 mutable UT_BitArray myUsedInputs;
02599 OP_ExtraInputList myExtraInputsList;
02600 mutable OP_Lock myExtraInputsLock;
02601 UT_RefArray<OP_NodeList> myOutputs;
02602 OP_NodeList myExtraOutputsList;
02603 mutable OP_Lock myExtraOutputsLock;
02604 UT_PtrArray<OP_ParmInterest *> myParmInterests;
02605 int myParmInterestCount;
02606 int mySelfParmInterestCount;
02607 UT_String myComment;
02608 UT_String myDelScript;
02609 UT_String myCreatorState;
02610 UT_Color myColor;
02611 UT_BitArray myGroups;
02612 OP_Value myEventValue;
02613 double myCookTime;
02614 fpreal myPosX;
02615 fpreal myPosY;
02616 long myCookCount;
02617 SYS_AtomicInt32 mySourceCount;
02618 int myBlockModify;
02619 int myUniqueId;
02620 unsigned myActiveInputIndex;
02621 OP_VERSION myVersionParms;
02622
02623 OP_VERSION myVersionCache;
02624
02625 bool myAutoscope;
02626
02627
02628
02629 long myLastDataModification;
02630
02631
02632
02633 float myCookDuration;
02634 unsigned int myRenameConflict : 1,
02635 myCookedForRender : 1,
02636 myModifyWaiting : 1,
02637 myBuiltExplicitly : 1,
02638 myAllowBuildDependencies : 1,
02639 myBeingDeleted : 1,
02640 myRunningCreateScript : 1,
02641 myRunningDelScript : 1,
02642 myAlreadyRunDelScript : 1,
02643 myMatchesOTLDefinition : 1,
02644 myLoadCookedDataError : 1,
02645 myBuiltHashCode : 1,
02646 myIsProxyRefNode : 1,
02647 mySelfParmDataInterest : 1;
02648
02649 mutable bool myStartedTraverseInputs;
02650 mutable bool myRecursionFlag;
02651
02652
02653 static long theModificationCounter;
02654
02655 static int thePropagateLevel;
02656
02657 static UT_IntArray theChopExportsToCook;
02658
02659
02660 UT_RefArray<OP_Reference> myOpReferences;
02661
02662 UT_RefArray<OP_Dependency> myOpDependents;
02663
02664
02665 OP_BundleReferences myBundleRefs;
02666
02667
02668 mutable OP_CookLock myCookLock;
02669 OP_TaskState myTaskState;
02670
02671
02672
02673 UT_Options myUserData;
02674
02675 static int myNumSpaces;
02676
02677 static int myNodeButtonWidthFlagMult;
02678
02679
02680 static OP_EditCallback theEditCallback;
02681 static void *theEditCallbackData;
02682
02683
02684 static int makeUniqueId(OP_Node *node);
02685
02686 static int theUniqueId;
02687 static int theUniqueSize;
02688 static OP_Node **theUniqueNodes;
02689 static bool theDoingBulkNotification;
02690
02691 friend class OP_Network;
02692 friend class OP_Group;
02693 friend class OP_Input;
02694 friend class OP_ExtraInput;
02695 friend class OP_InputIndirect;
02696 friend class OP_UndoDelete;
02697 friend class OP_UndoInput;
02698 friend class OP_UndoCreate;
02699 friend class OP_UndoSpareParm;
02700 };
02701
02702
02703
02704 OP_API OP_Node * OPgetNodeFromChannel( const CH_Channel *chp );
02705
02706 #define CAST_INSTANTIATE(PREFIX) \
02707 inline static PREFIX##_Node *CAST_##PREFIX##NODE(OP_Node *op) \
02708 { \
02709 return ((op) ? (op)->castTo##PREFIX##Node() : 0); \
02710 } \
02711 \
02712 inline static const PREFIX##_Node *CAST_##PREFIX##NODE(const OP_Node *op) \
02713 { \
02714 return ((op) ? (op)->castTo##PREFIX##Node() : 0); \
02715 } \
02716
02717
02718
02719
02720
02721
02722 INSTANTIATE_FOR_ALL_NODE_TYPES(CAST_INSTANTIATE)
02723
02724
02725 #undef CAST_INSTANTIATE
02726
02727
02728 #undef INSTANTIATE_FINDNODE_FUNCTIONS
02729 #undef INSTANTIATE_CASTNODE_FUNCTIONS
02730 #undef INSTANTIATE_FOR_ALL_NODE_TYPES
02731
02732 #endif