HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_NodeInfoParms.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: OP_NodeInfoParms.h ( OP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __OP_NodeInfoParms__
12 #define __OP_NodeInfoParms__
13 
14 #include "OP_API.h"
15 #include <UT/UT_WorkBuffer.h>
16 
17 /// Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
19 {
20 public:
21  explicit OP_NodeInfoParms()
22  : myText(),
23  myVerbose(false),
24  myForceCook(true),
25  mySeparatorLength(-1)
26  { }
28  { }
29 
30  /// Clear the text
31  void clearText()
32  { myText.clear(); }
33 
34  /// The text buffer in which to write the information
36  { return myText; }
37 
38  /// Append a string to the text buffer.
39  void append(const char *string)
40  { myText.append(string); }
41 
42  /// Append text to the buffer. If you have a single string to
43  /// append, to avoid printf errors in the string text, please use: @code
44  /// append("%s", string);
45  /// @endcode
46  int appendSprintf(const char *format, ...)
48 
49  /// Append a section separator
50  void appendSeparator();
51 
52  /// Return the separator string token (which is replaced in
53  /// @c replaceSeparators()).
54  static const char *getSeparatorToken();
55 
56  /// Append "not cooked"
57  void appendNotCooked(const char *node_type = "Node");
58 
59  /// @{
60  /// Verbose info
61  void setVerbose(bool v)
62  { myVerbose = v; }
63  bool getVerbose() const
64  { return myVerbose; }
65  /// @}
66 
67  /// @{
68  /// Force cook
69  void setForceCook(bool v)
70  { myForceCook = v; }
71  bool getForceCook() const
72  { return myForceCook; }
73  /// @}
74 
75  /// @{
76  /// Separator length
78  { mySeparatorLength = v; }
79  int getSeparatorLength() const
80  { return mySeparatorLength; }
81  /// @}
82 
83  /// Make a separator line (prefixed and suffixed with newlines).
84  /// The separator will be a line of '-' which matches the line length of
85  /// the longest line in the text (or getSeparatorLength() if the lines are
86  /// too long).
87  void replaceSeparators(char dash='_');
88 
89 private:
90  UT_WorkBuffer myText;
91  int mySeparatorLength;
92  bool myVerbose;
93  bool myForceCook;
94 };
95 
96 /// Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
98 {
99 public:
101  : myTime(time),
102  myVerbose(false),
103  myDebug(false),
104  myForceCook(false),
105  myOutputIndex(0)
106  { }
108  { }
109 
111  { myTime = time; }
112  fpreal getTime() const
113  { return myTime; }
114 
115  void setVerbose(bool verbose)
116  { myVerbose = verbose; }
117  bool getVerbose() const
118  { return myVerbose; }
119 
120  void setDebug(bool debug)
121  { myDebug = debug; }
122  bool getDebug() const
123  { return myDebug; }
124 
125  void setForceCook(bool force_cook)
126  { myForceCook = force_cook; }
127  bool getForceCook() const
128  { return myForceCook; }
129 
130  void setOutputIndex(int idx)
131  { myOutputIndex = idx; }
132  int getOutputIndex() const
133  { return myOutputIndex; }
134 
135 private:
136  fpreal myTime;
137  bool myVerbose;
138  bool myDebug;
139  bool myForceCook;
140  int myOutputIndex;
141 };
142 
143 #endif
void setDebug(bool debug)
bool getForceCook() const
Definition: Node.h:52
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:837
void clearText()
Clear the text.
void setVerbose(bool verbose)
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
OP_NodeInfoTreeParms(fpreal time)
void setTime(fpreal time)
void setOutputIndex(int idx)
void setForceCook(bool force_cook)
UT_WorkBuffer & getText()
The text buffer in which to write the information.
#define SYS_PRINTF_CHECK_ATTRIBUTE(string_index, first_to_check)
Definition: SYS_Types.h:447
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
int getOutputIndex() const
bool getForceCook() const
bool getVerbose() const
int getSeparatorLength() const
void setSeparatorLength(int v)
OIIO_API void debug(string_view str)
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
fpreal getTime() const
fpreal64 fpreal
Definition: SYS_Types.h:277
#define OP_API
Definition: OP_API.h:10
void setForceCook(bool v)
void append(const char *string)
Append a string to the text buffer.
bool getVerbose() const