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 <UT/UT_ValArray.h>
21 #include <UT/UT_VectorTypes.h>
22 #include "PRM_BatchParm.h"
23 
24 class PRM_Template;
25 class prm_BatchOpInfo;
26 
28 public:
29  PRM_BatchList();
30  ~PRM_BatchList();
31 
32  PRM_BatchParm *addParm(int index, const char *name, PRM_BatchType type,
33  int size, void *data=0);
34  PRM_BatchParm *addParm(PRM_Template *tplate, void *data=0);
35  PRM_BatchParm *addParm(const char *name, PRM_BatchType type,
36  int size, void *data=0)
37  {
38  return addParm(myParms.entries(), name, type, size, data);
39  }
40 
41  // Validate that there are parameter entries for each entry.
42  bool validate() const;
43 
44  // Clear the evaluated flags on all of the evaluation parameters
45  int entries() const { return myParms.entries(); }
46  PRM_BatchParm *operator()(int i) { return myParms(i); }
47 
48  // When an OP_Node evaluates a parameter list, it MUST call setEvaluator
49  // prior to setting the evaluated flags on any parameters. This is used to
50  // keep track of op interests.
51  // WARNING: There is no stack, so if another OP_Node is called to
52  // evaluate batch parameters, then the op-id will be set incorrectly
53  void setEvaluator(int opid);
54 
55  // Get a list of all the OP_Nodes which are used for evaluating this list
56  int getEvaluatingOps(UT_IntArray &list);
57 
58  // When a parameter is evaluated, please set the OP_Node's parameter
59  void setEvaluated(int batch_idx, int parmlist_idx);
60 
61  // Prior to evaluating the list, clear the evaluated status of all the
62  // parameters.
64  {
65  clearOpList();
66  for (int i = myParms.entries(); i-- > 0; )
67  myParms(i)->clearEvaluated();
68  }
70  {
71  for (int i = myParms.entries(); i-- > 0; )
72  myParms(i)->clearValueSet();
73  }
74 
75  void dump();
76 
77 private:
78  void clearOpList();
79 
82  int myEvaluatingOp;
83 };
84 
85 #endif
86 
int entries() const
Definition: PRM_BatchList.h:45
PRM_BatchParm * addParm(const char *name, PRM_BatchType type, int size, void *data=0)
Definition: PRM_BatchList.h:35
GLboolean * data
Definition: glcorearb.h:131
void clearEvaluated()
Definition: PRM_BatchList.h:63
void clearValueSet()
Definition: PRM_BatchList.h:69
GLuint const GLchar * name
Definition: glcorearb.h:786
GLsizeiptr size
Definition: glcorearb.h:664
PRM_BatchType
Definition: PRM_BatchParm.h:19
GLuint index
Definition: glcorearb.h:786
PRM_BatchParm * operator()(int i)
Definition: PRM_BatchList.h:46
type
Definition: core.h:1059
#define PRM_API
Definition: PRM_API.h:10
Definition: format.h:895