File: QueryList.code

package info (click to toggle)
paraview 4.1.0%2Bdfsg%2B1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 278,136 kB
  • ctags: 340,527
  • sloc: cpp: 2,314,053; ansic: 817,139; python: 245,770; xml: 68,996; tcl: 48,285; fortran: 39,116; yacc: 5,713; java: 3,827; perl: 3,108; sh: 2,045; lex: 1,809; makefile: 935; asm: 471; pascal: 228
file content (242 lines) | stat: -rw-r--r-- 6,381 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
Function: AddQuery
Declaration: void AddQuery(const std::string &name, QueryType t, Groups g, WindowType w, int num_input, int allowedVars, QueryMode qMode, int numVars = 1);
Definition:
// ****************************************************************************
//  Method:  AddQuery
//
//  Purpose:
//    Adds a query to the query list.
//
//  Programmer:  Brad Whitlock
//  Creation:    Mon Sep 9 15:45:37 PST 2002
//
//  Modifications:
//
//    Hank Childs, Thu Oct  2 13:40:16 PDT 2003
//    Add number of inputs.
//
//    Kathleen Bonnell,  Tue Nov 18 08:20:36 PST 2003 
//    Set default window type based on query type. 
//
//    Kathleen Bonnell,  Sat Sep  4 11:41:18 PDT 2004 
//    Made all parameters required, added Groups. 
//
//    Kathleen Bonnell, Fri Sep 28 14:43:50 PDT 2007 
//    Aded 'canBePublic' which defaults to '1'. 
//
// ****************************************************************************
 
void
QueryList::AddQuery(const std::string &name, QueryType t, Groups g, WindowType w, int num_input, int allowedVars, QueryMode qMode, int num_vars)
{
    names.push_back(name);
    types.push_back((int)t);
    groups.push_back((int)g);
    numInputs.push_back(num_input);
    allowedVarTypes.push_back(allowedVars);
    queryMode.push_back(qMode);
    winType.push_back((int)w);
    numVars.push_back(num_vars);
    canBePublic.push_back(1);
}

Function: QueryExists
Declaration: bool QueryExists(const std::string &name, QueryType t);
Definition:
// ****************************************************************************
//  Method:  QueryExists
//
//  Purpose:
//    Checks if a query matches the passed parameters. 
//
//  Programmer:  Kathleen Bonnell 
//  Creation:    July 11, 2003 
//
// ****************************************************************************
 
bool
QueryList::QueryExists(const std::string &name, QueryType t)
{
    bool match = false;
    for (size_t i = 0; i < names.size(); i++)
    {
        if (name == names[i]) 
        {
            if (t == types[i])
            {
                match = true;
            }
            break;
        }
    }
    return match;
}

Function: NumberOfInputsForQuery
Declaration: int NumberOfInputsForQuery(const std::string &name);
Definition:
// ****************************************************************************
//  Method:  NumberOfInputsForQuery
//
//  Purpose:
//      Returns the number of inputs for a query.
//
//  Programmer:  Hank Childs
//  Creation:    October 2, 2003
//
// ****************************************************************************
 
int
QueryList::NumberOfInputsForQuery(const std::string &name)
{
    for (size_t i = 0; i < names.size(); i++)
    {
        if (name == names[i]) 
        {
            return numInputs[i];
        }
    }
    return -1;
}

Function: AllowedVarsForQuery
Declaration: int AllowedVarsForQuery(const std::string &name);
Definition:
// ****************************************************************************
//  Method:  AllowedVarsForQuery
//
//  Purpose:
//      Returns the number of inputs for a query.
//
//  Programmer:  Kathleen Bonnell 
//  Creation:    November 18, 2003 
//
// ****************************************************************************
 
int
QueryList::AllowedVarsForQuery(const std::string &name)
{
    for (size_t i = 0; i < names.size(); i++)
    {
        if (name == names[i]) 
        {
            return allowedVarTypes[i];
        }
    }
    return -1;
}

Function: TimeQueryAvailable
Declaration: bool TimeQueryAvailable(const std::string &name) ;
Definition:
// ****************************************************************************
//  Method:  TimeQueryAvailable
//
//  Purpose:
//    Checks if a query matches the passed parameters. 
//
//  Programmer:  Kathleen Bonnell 
//  Creation:    March 23, 2004 
//
// ****************************************************************************
 
bool
QueryList::TimeQueryAvailable(const std::string &name)
{
    bool canDoTime = false;
    for (size_t i = 0; i < names.size(); i++)
    {
        if (name == names[i]) 
        {
            canDoTime = (queryMode[i] != QueryList::QueryOnly);
            break;
        }
    }
    return canDoTime;
}

Function: GetWindowType
Declaration: int GetWindowType(const std::string &name) ;
Definition:
// ****************************************************************************
//  Method:  GetWindowType
//
//  Purpose:
//    Returns the window type for the named query. 
//
//  Programmer:  Kathleen Bonnell 
//  Creation:    March 15, 2005 
//
// ****************************************************************************
 
int
QueryList::GetWindowType(const std::string &name)
{
    int wt = -1; 
    for (size_t i = 0; i < names.size(); i++)
    {
        if (name == names[i]) 
        {
            wt = winType[i];
            break;
        }
    }
    return wt;
}

Function: NumberOfVarsForQuery
Declaration: int NumberOfVarsForQuery(const std::string &name);
Definition:
// ****************************************************************************
//  Method:  NumberOfVarsForQuery
//
//  Purpose:
//      Returns the number of variables required for a query.
//
//  Programmer:  Kathleen Bonnell 
//  Creation:    November 1, 2005 
//
// ****************************************************************************
 
int
QueryList::NumberOfVarsForQuery(const std::string &name)
{
    for (size_t i = 0; i < names.size(); i++)
    {
        if (name == names[i]) 
        {
            return numVars[i];
        }
    }
    return -1;
}

Function: RegularQueryAvailable
Declaration: bool RegularQueryAvailable(const std::string &name) ;
Definition:
// ****************************************************************************
//  Method:  RegularQueryAvailable
//
//  Purpose:
//    Checks if a regular query (non-time) matches the passed parameters. 
//
//  Programmer:  Kathleen Bonnell 
//  Creation:    November 9, 2005 
//
// ****************************************************************************
 
bool
QueryList::RegularQueryAvailable(const std::string &name)
{
    bool canDoRegular = false;
    for (size_t i = 0; i < names.size(); i++)
    {
        if (name == names[i]) 
        {
            canDoRegular = (queryMode[i] != QueryList::TimeOnly);
            break;
        }
    }
    return canDoRegular;
}