HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_RewireHelper.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: VOP_RewireHelper.C ( OPUI Library, C++)
7  *
8  * COMMENTS: This is a utility class to help maintain proper wirings in a VOP
9  * network when a VOP's inputs and outputs are moved around.
10  */
11 
12 #ifndef __VOP_RewireHelper__
13 #define __VOP_RewireHelper__
14 
15 #include "VOP_API.h"
16 #include <UT/UT_Array.h>
17 #include <UT/UT_ValArray.h>
18 #include <UT/UT_StringArray.h>
19 
20 class VOP_ScriptOperator;
21 class VOP_OperatorInfo;
22 class VOP_Node;
23 class VOP_SubnetOutput;
24 
25 
27 {
28 public:
31 
32  /// @{ Records and rewires all nodes of the given operator type.
33  void recordWires(VOP_ScriptOperator *op);
34  void rewire(VOP_ScriptOperator *op);
35  /// @}
36 
37  /// Rewire the node to reflect new inputs and outputs given in op info.
38  void updateAndRewireNode( VOP_Node *node, const VOP_OperatorInfo *op_info );
39 
40 private:
41  void recordOldNodeConnectorNamesAndWires( VOP_Node *node );
42  void doRewire(VOP_ScriptOperator *op);
43 
44  void recordInputWires(VOP_Node *op, VOP_Node *source);
45  void recordOutputWires(VOP_Node *op);
46  bool constructMappings(VOP_ScriptOperator *op);
47 
48  void disconnectVisitedHDAsAndSubOutputs();
49  void markSubOutputForWiring(VOP_SubnetOutput *sub_output);
50  void unmarkAllSubOutputsForWiring();
51 
52 private:
53  /// Forward declaration of nested helper classes.
54  class RewireInfo;
55  class Wire;
56 
57  VOP_RewireHelper::RewireInfo * myRewireInfo;
59  UT_ValArray<VOP_Node *> myVisitedHDAs;
60  UT_IntArray myVisitedSubOutputIDs;
61 };
62 
63 #endif
#define VOP_API
Definition: VOP_API.h:10
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803