HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  { }
105  { }
106 
107  void setTime(fpreal time)
108  { myTime = time; }
109  fpreal getTime() const
110  { return myTime; }
111 
112  void setVerbose(bool verbose)
113  { myVerbose = verbose; }
114  bool getVerbose() const
115  { return myVerbose; }
116 
117  void setDebug(bool debug)
118  { myDebug = debug; }
119  bool getDebug() const
120  { return myDebug; }
121 
122 private:
123  fpreal myTime;
124  bool myVerbose;
125  bool myDebug;
126 };
127 
128 #endif
void setDebug(bool debug)
const GLdouble * v
Definition: glcorearb.h:836
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)
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:419
bool getForceCook() const
bool getVerbose() const
int getSeparatorLength() const
void setSeparatorLength(int v)
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:107
double fpreal
Definition: SYS_Types.h:263
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
fpreal getTime() const
#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