HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PRM_BatchList.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: PRM_BatchList.h ( PRM Library, C++)
7  *
8  * COMMENTS: Definition of a list of parameters for evaluation. Instead of
9  * evaluating each parameter individually, the parameters are
10  * evaluated in batch mode.
11  *
12  * This class specifies the list of parameters to evaluate.
13  * Similar to the PRM_Template (which defines the parameters).
14  */
15 
16 #ifndef __PRM_BatchList__
17 #define __PRM_BatchList__
18 
19 #include "PRM_API.h"
20 #include "PRM_BatchParm.h"
21 #include <UT/UT_NonCopyable.h>
22 #include <UT/UT_ValArray.h>
23 #include <UT/UT_VectorTypes.h>
24 
25 class PRM_Template;
26 class prm_BatchOpInfo;
27 
29 {
30 public:
31  PRM_BatchList();
32  ~PRM_BatchList();
33 
35 
36  PRM_BatchParm *addParm(int index, const char *name, PRM_BatchType type,
37  int size, void *data=0);
38  PRM_BatchParm *addParm(PRM_Template *tplate, void *data=0);
39  PRM_BatchParm *addParm(const char *name, PRM_BatchType type,
40  int size, void *data=0)
41  {
42  return addParm(myParms.entries(), name, type, size, data);
43  }
44 
45  // Validate that there are parameter entries for each entry.
46  bool validate() const;
47 
48  // Clear the evaluated flags on all of the evaluation parameters
49  int entries() const { return myParms.entries(); }
50  PRM_BatchParm *operator()(int i) { return myParms(i); }
51 
52  // When an OP_Node evaluates a parameter list, it MUST call setEvaluator
53  // prior to setting the evaluated flags on any parameters. This is used to
54  // keep track of op interests.
55  // WARNING: There is no stack, so if another OP_Node is called to
56  // evaluate batch parameters, then the op-id will be set incorrectly
57  void setEvaluator(int opid);
58 
59  // Get a list of all the OP_Nodes which are used for evaluating this list
60  int getEvaluatingOps(UT_IntArray &list);
61 
62  // When a parameter is evaluated, please set the OP_Node's parameter
63  void setEvaluated(int batch_idx, int parmlist_idx);
64 
65  // Prior to evaluating the list, clear the evaluated status of all the
66  // parameters.
68  {
69  clearOpList();
70  for (int i = myParms.entries(); i-- > 0; )
71  myParms(i)->clearEvaluated();
72  }
74  {
75  for (int i = myParms.entries(); i-- > 0; )
76  myParms(i)->clearValueSet();
77  }
78 
79  void dump();
80 
81 private:
82  void clearOpList();
83 
86  int myEvaluatingOp;
87 };
88 
89 #endif
90 
type
Definition: core.h:556
int entries() const
Definition: PRM_BatchList.h:49
PRM_BatchParm * addParm(const char *name, PRM_BatchType type, int size, void *data=0)
Definition: PRM_BatchList.h:39
GLboolean * data
Definition: glcorearb.h:131
void clearEvaluated()
Definition: PRM_BatchList.h:67
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
void clearValueSet()
Definition: PRM_BatchList.h:73
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint const GLchar * name
Definition: glcorearb.h:786
GLsizeiptr size
Definition: glcorearb.h:664
PRM_BatchType
Definition: PRM_BatchParm.h:20
GLuint index
Definition: glcorearb.h:786
PRM_BatchParm * operator()(int i)
Definition: PRM_BatchList.h:50
#define PRM_API
Definition: PRM_API.h:10
Definition: format.h:1821