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  myOutputIndex(0)
105  { }
107  { }
108 
110  { myTime = time; }
111  fpreal getTime() const
112  { return myTime; }
113 
114  void setVerbose(bool verbose)
115  { myVerbose = verbose; }
116  bool getVerbose() const
117  { return myVerbose; }
118 
119  void setDebug(bool debug)
120  { myDebug = debug; }
121  bool getDebug() const
122  { return myDebug; }
123 
124  void setOutputIndex(int idx)
125  { myOutputIndex = idx; }
126  int getOutputIndex() const
127  { return myOutputIndex; }
128 
129 private:
130  fpreal myTime;
131  bool myVerbose;
132  bool myDebug;
133  int myOutputIndex;
134 };
135 
136 #endif
void setDebug(bool debug)
GT_API const UT_StringHolder time
void clearText()
Clear the text.
void setVerbose(bool verbose)
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1254
OP_NodeInfoTreeParms(fpreal time)
const GLdouble * v
Definition: glew.h:1391
void setTime(fpreal time)
void setOutputIndex(int idx)
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:433
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.
#define const
Definition: zconf.h:214
bool getVerbose() const