HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DS_Creator.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: DS_Creator.h ( vexds Library, C++)
7  *
8  * COMMENTS: Writes dialog scripts according to the parameter
9  * information obtained from a DS_ParmReader object
10  */
11 
12 #ifndef __DS_Creator__
13 #define __DS_Creator__
14 
15 #include "PRM_API.h"
16 #include "DS_ParmReader.h"
17 #include <UT/UT_NonCopyable.h>
18 #include <UT/UT_String.h>
19 #include <UT/UT_StringArray.h>
20 #include <iosfwd>
21 
22 class DS_SelectorBinding;
23 
24 #define DS_DEFNAME "DScreator"
25 #define DS_DEFDIR "."
26 
28 {
29 public:
31  const char *appName = DS_DEFNAME );
32  virtual ~DS_Creator();
33 
35 
36  int openOutput( std::ostream &os );
37  int closeOutput();
38 
39  int prepareToWriteOutput();
40  int writeOutput();
41 
42  void setParmDSOverride(const char *parm_ds)
43  { myParmDSOverride.harden(parm_ds); }
44 
45  static void setUseOldGrouping(bool useold);
46  static bool getUseOldGrouping();
47 
48  /// Returns an indentation string for the given indent level.
49  ///
50  /// The string is kept in a static buffer, which has the advantage of
51  /// automatically caching it, but you are thus meant to call getIndent
52  /// pretty much every time you want to indent something
53  static const char *getIndent(int level);
54 
55  static const char *theToolboxLabels[];
56 
57  static void dumpParm(const DS_ParmInfo *pi);
58 
59 protected:
60  void writeUnboundSelectors(DS_SelectorList &selectors);
61  void writeReservedSelectors(DS_SelectorList &selectors);
62  void writeReservedHandles(DS_HandleList &handles);
63  void writeBoundHandles(DS_HandleList &handles);
64  void writeMetaInfo();
65  void writeParms() const;
66  virtual void writeContextSpecific();
67  virtual int writeInfo();
68  virtual void writeHeader(const char *appname, const char *script);
69  virtual void writeTrailer(const char *appname, const char *script);
70 
71  static void startGroup(std::ostream &os, int &id, const char *name);
72  static void printParm(std::ostream &os, const DS_ParmInfo *pi);
73 
74  static void printHelp( std::ostream &os, const char *help );
75  static void printInfo( std::ostream &os, const char *info );
76 
79  std::ostream *myOS;
81 
83  static bool theUseOldGrouping;
84 };
85 
86 #endif
UT_String myParmDSOverride
Definition: DS_Creator.h:80
DS_ParmReader & myPR
Definition: DS_Creator.h:77
#define DS_DEFNAME
Definition: DS_Creator.h:24
GLint level
Definition: glcorearb.h:108
std::string help(const App *app, const Error &e)
Printout the full help string on error (if this fn is set, the old default for CLI11) ...
Definition: CLI11.h:8978
static bool theUseOldGrouping
Definition: DS_Creator.h:83
UT_String myAppName
Definition: DS_Creator.h:78
static UT_StringArray theGroupStack
Definition: DS_Creator.h:82
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint const GLchar * name
Definition: glcorearb.h:786
std::ostream * myOS
Definition: DS_Creator.h:79
__hostdev__ constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: NanoVDB.h:976
void setParmDSOverride(const char *parm_ds)
Definition: DS_Creator.h:42
#define PRM_API
Definition: PRM_API.h:10