HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VOP_OutputInfoManager.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 Library (C++)
7 *
8 * COMMENTS:
9 *
10 */
11 
12 #ifndef __VOP_OutputInfoManager_h__
13 #define __VOP_OutputInfoManager_h__
14 
15 #include "VOP_API.h"
16 #include "VOP_OutputInfo.h"
17 #include "VOP_Types.h"
18 #include <iosfwd>
19 
20 #define VOP_OUTPUT_VALUE_NAME "value"
21 
22 class OP_Context;
23 class VOP_Node;
24 class UT_InfoTree;
25 class UT_IStream;
26 
28 {
29 public:
32 
33  void setParentNode(VOP_Node* parent_node);
34  void clear(void);
35 
36  /// To avoid hundreds of errors and warnings (a few per VOP node) in older
37  /// versions of Houdini, we only save the override info if it is being
38  /// used. This function returns true if the infos need to be saved,
39  /// false otherwise.
40  bool getNeedToSave(void);
41 
42  void setNormalOutputMode(const char* output_name, EOutputModeType mode);
43  void setBypassedOutputMode(const char* output_name, EOutputModeType mode);
44  UT_Options* getDebugValuePtr(const char* output_name);
45  UT_Options* getBypassValuePtr(const char* output_name);
46  EOutputModeType getDebugOutputMode(const char* output_name);
47  EOutputModeType getBypassOutputMode(const char* output_name);
48  int findCorrespondingInputIndex(const char* output_name,
49  bool is_in_debug_mode, bool is_in_bypass_mode);
50  void findCorrespondingInputName(const char* output_name,
51  bool is_in_debug_mode, bool is_in_bypass_mode, UT_String& str_out);
52  const char* getDebugCorrespondingInputName(const char* output_name);
53  const char* getBypassCorrespondingInputName(const char* output_name);
54  void setDebugCorrespondingInputName(const char* output_name, const char* input_name);
55  void setBypassCorrespondingInputName(const char* output_name, const char* input_name);
56 
57  void setUseDefaultValue(const char* output_name, bool val);
58  bool getUseDefaultValue(const char* output_name);
59 
60  void appendOutputOverrideCode(UT_String& str_code);
61  bool areAllOverridden(void);
62  bool getIsOverriden(const char* output_name);
63 
64  static VOP_Type getConnectorType(VOP_Node* node, int connector_idx, bool is_output = true);
65  static VOP_Type getConnectorType(VOP_Node* node, const char* connector_name, bool is_output = true);
66 
67  void update(void);
68 
69  bool save(std::ostream &os, bool is_binary);
70  bool load(UT_IStream &is);
71 
72  void appendInfoText(bool verbose, UT_WorkBuffer &text);
73  void appendInfoTree(bool verbose, UT_InfoTree &tree);
74  bool doesInfoExist(const char* output_name);
75 
76 private:
77  /// Private because the manager is responsible for setting everything.
78  VOP_OutputInfo* getOutputInfo(const char* output_name, bool do_allocate);
79  void getZeroValueString(VOP_OutputInfo* output_info, UT_String& str_out);
80 
81  VOP_Node* myParentNode;
82  TOutputInfosMap myOutputInfos;
83 };
84 
85 #endif
std::map< std::string, VOP_OutputInfo * > TOutputInfosMap
#define VOP_API
Definition: VOP_API.h:10
EOutputModeType
GLenum mode
Definition: glcorearb.h:98
A map of string to various well defined value types.
Definition: UT_Options.h:42
GLuint GLfloat * val
Definition: glcorearb.h:1607
VOP_Type
Definition: VOP_Types.h:24