Logging.C 76.4 KB
Newer Older
hrchilds's avatar
hrchilds committed
1
2
/*****************************************************************************
*
brugger's avatar
   
brugger committed
3
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
hrchilds's avatar
hrchilds committed
4
* Produced at the Lawrence Livermore National Laboratory
brugger's avatar
   
brugger committed
5
* LLNL-CODE-400124
hrchilds's avatar
hrchilds committed
6
7
* All rights reserved.
*
brugger's avatar
   
brugger committed
8
* This file is  part of VisIt. For  details, see https://visit.llnl.gov/.  The
hrchilds's avatar
hrchilds committed
9
10
11
12
13
14
15
16
17
18
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution  and  use  in  source  and  binary  forms,  with  or  without
* modification, are permitted provided that the following conditions are met:
*
*  - Redistributions of  source code must  retain the above  copyright notice,
*    this list of conditions and the disclaimer below.
*  - Redistributions in binary form must reproduce the above copyright notice,
*    this  list of  conditions  and  the  disclaimer (as noted below)  in  the
brugger's avatar
   
brugger committed
19
20
21
*    documentation and/or other materials provided with the distribution.
*  - Neither the name of  the LLNS/LLNL nor the names of  its contributors may
*    be used to endorse or promote products derived from this software without
hrchilds's avatar
hrchilds committed
22
23
24
25
26
*    specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT  HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR  IMPLIED WARRANTIES, INCLUDING,  BUT NOT  LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND  FITNESS FOR A PARTICULAR  PURPOSE
brugger's avatar
   
brugger committed
27
28
29
* ARE  DISCLAIMED. IN  NO EVENT  SHALL LAWRENCE  LIVERMORE NATIONAL  SECURITY,
* LLC, THE  U.S.  DEPARTMENT OF  ENERGY  OR  CONTRIBUTORS BE  LIABLE  FOR  ANY
* DIRECT,  INDIRECT,   INCIDENTAL,   SPECIAL,   EXEMPLARY,  OR   CONSEQUENTIAL
hrchilds's avatar
hrchilds committed
30
31
32
33
34
35
36
37
* DAMAGES (INCLUDING, BUT NOT  LIMITED TO, PROCUREMENT OF  SUBSTITUTE GOODS OR
* SERVICES; LOSS OF  USE, DATA, OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER
* CAUSED  AND  ON  ANY  THEORY  OF  LIABILITY,  WHETHER  IN  CONTRACT,  STRICT
* LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING IN ANY  WAY
* OUT OF THE  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
whitlocb's avatar
whitlocb committed
38
#include <Python.h>
hrchilds's avatar
hrchilds committed
39

hrchilds's avatar
hrchilds committed
40
41
42
43
44
45
#include <ViewerProxy.h>
#include <ViewerRPC.h>
#include <PlotPluginManager.h>
#include <PlotPluginInfo.h>
#include <OperatorPluginManager.h>
#include <OperatorPluginInfo.h>
hrchilds's avatar
hrchilds committed
46
#include <DebugStream.h>
hrchilds's avatar
hrchilds committed
47
48
49
50
#include <snprintf.h>
#include <visit-config.h>

#include <PyAnnotationAttributes.h>
hrchilds's avatar
hrchilds committed
51
#include <PyConstructDDFAttributes.h>
hrchilds's avatar
hrchilds committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <PyExportDBAttributes.h>
#include <PyGlobalLineoutAttributes.h>
#include <PyHostProfile.h>
#include <PyInteractorAttributes.h>
#include <PyKeyframeAttributes.h>
#include <PyLightAttributes.h>
#include <PyMaterialAttributes.h>
#include <PyMeshManagementAttributes.h>
#include <PyPickAttributes.h>
#include <PyPrinterAttributes.h>
#include <PyProcessAttributes.h>
#include <PyRenderingAttributes.h>
#include <PySaveWindowAttributes.h>
#include <PySILRestriction.h>
#include <PyQueryOverTimeAttributes.h>
67
#include <PyViewAxisArrayAttributes.h>
hrchilds's avatar
hrchilds committed
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
#include <PyViewCurveAttributes.h>
#include <PyView2DAttributes.h>
#include <PyView3DAttributes.h>
#include <PyWindowInformation.h>

#include <avtSILRestriction.h>
#include <avtSILRestrictionTraverser.h>

#include <AnimationAttributes.h>
#include <Expression.h>
#include <ExpressionList.h>
#include <GlobalAttributes.h>
#include <LightAttributes.h>
#include <LightList.h>
#include <WindowInformation.h>

#define SLEN 5000

//
// Extern data
//
extern ViewerProxy *viewer;

//
// Static data
//
static std::string  macroString;
static bool         macroRecord = false;
static FILE        *logFile;
static bool         logging = false;
static int          logLevel = 0;

//
// Macro functions
//

void
Macro_SetString(const std::string &s)
{
    macroString = s;
}

const std::string &
Macro_GetString()
{
    return macroString;
}

void
Macro_SetRecord(bool val)
{
    macroRecord = val;
}

bool
Macro_GetRecord()
{
    return macroRecord;
}

//
// Log file functions
//

bool
LogFile_Open(const char *filename)
{
hrchilds's avatar
hrchilds committed
135
    logging = true;
hrchilds's avatar
hrchilds committed
136
    logFile = fopen(filename, "wb");
hrchilds's avatar
hrchilds committed
137
138
    if(logFile)
    {
139
140
        fprintf(logFile, "# Visit %s log file\n", VISIT_VERSION);
        fprintf(logFile, "ScriptVersion = \"%s\"\n", VISIT_VERSION);
hrchilds's avatar
hrchilds committed
141
142
143
144
145
        fprintf(logFile, "if ScriptVersion != Version():\n");
        fprintf(logFile, "    print \"This script is for VisIt %%s. "
                "It may not work with version %%s\" %% "
                "(ScriptVersion, Version())\n");
    }
hrchilds's avatar
hrchilds committed
146
147

    return logging;
hrchilds's avatar
hrchilds committed
148
149
150
151
152
153
154
155
156
157
158
159
}

void
LogFile_Close()
{
    if(logFile)
        fclose(logFile);
}

void
LogFile_SetEnabled(bool val)
{
hrchilds's avatar
hrchilds committed
160
    logging = val;
hrchilds's avatar
hrchilds committed
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
}

bool
LogFile_GetEnabled()
{
    return logging;
}

void
LogFile_IncreaseLevel()
{
    ++logLevel;
}

void
LogFile_DecreaseLevel()
{
    --logLevel;
    if(logLevel < 0)
       logLevel = 0;
}

void
LogFile_Write(const char *str)
{
    if(logging && logLevel == 0)
    {
        // Add the string to the macro string
        if(macroRecord)
            macroString += str;

        // Write to the log
hrchilds's avatar
hrchilds committed
193
194
        if(logFile != NULL)
            fprintf(logFile, "%s", str);
hrchilds's avatar
hrchilds committed
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
    }
}

// ****************************************************************************
//
// State Logging functions
//
// Purpose: The purpose of the log functions is to turn ViewerRPC information
//          into valid Python code for the VisIt module that can be logged or
//          recorded into a macro.
//
// Note:    The logging functions take ViewerRPC data, whose important fields,
//          vary depending on the RPC being executed, and use that data to
//          create the Python code returned in the "str" string. The exact
//          usage of the ViewerRPC fields for a given RPC must match the
//          usage in ViewerProxy.C in order for the logging functions to remain
//          accurate.
//
// Programmer: Brad Whitlock
// Creation:   Tue Jan 10 11:50:15 PDT 2006
//
hrchilds's avatar
hrchilds committed
216
217
218
219
// Modifications:
//   Brad Whitlock, Wed Mar 8 17:05:11 PST 2006
//   Added RedoView.
//
hrchilds's avatar
hrchilds committed
220
221
222
223
224
// ****************************************************************************

#define MSG_NOT_IMPLEMENTED 0
#define MSG_UNSUPPORTED     1

225
static std::string MESSAGE_COMMENT(const char *name, int reason)
hrchilds's avatar
hrchilds committed
226
{
227
228
    std::string s;

hrchilds's avatar
hrchilds committed
229
230
    if(reason == MSG_NOT_IMPLEMENTED)
    {
231
        s = (std::string("# Logging for ") + name) + " is not implemented yet.\n";
hrchilds's avatar
hrchilds committed
232
233
234
    }
    else if(reason == MSG_UNSUPPORTED)
    {
235
236
        s = (std::string("# The ") + name) + " RPC is not supported in the VisIt module "
                 "so it will not be logged.\n";
hrchilds's avatar
hrchilds committed
237
    }
238
    return s;
hrchilds's avatar
hrchilds committed
239
240
241
}


242
static std::string log_AddWindowRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
243
{
244
    return std::string("AddWindow()\n");
hrchilds's avatar
hrchilds committed
245
246
}

247
static std::string log_DeleteWindowRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
248
{
249
    return std::string("DeleteWindow()\n");
hrchilds's avatar
hrchilds committed
250
251
}

252
static std::string log_SetWindowLayoutRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
253
{
254
    char str[SLEN];
hrchilds's avatar
hrchilds committed
255
    SNPRINTF(str, SLEN, "SetWindowLayout(%d)\n", rpc->GetWindowLayout());
256
    return std::string(str);
hrchilds's avatar
hrchilds committed
257
258
}

259
static std::string log_SetActiveWindowRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
260
{
261
    char str[SLEN];
hrchilds's avatar
hrchilds committed
262
    SNPRINTF(str, SLEN, "SetActiveWindow(%d)\n", rpc->GetWindowId());
263
    return std::string(str);
hrchilds's avatar
hrchilds committed
264
265
}

266
static std::string log_ClearWindowRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
267
{
268
    return std::string("ClearWindow()\n");
hrchilds's avatar
hrchilds committed
269
270
}

271
static std::string log_ClearAllWindowsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
272
{
273
    return std::string("ClearAllWindows()\n");
hrchilds's avatar
hrchilds committed
274
275
}

276
static std::string log_OpenDatabaseRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
277
{
278
    char str[SLEN];
hrchilds's avatar
hrchilds committed
279
280
281
    SNPRINTF(str, SLEN, "OpenDatabase(\"%s\", %d)\n",
             rpc->GetDatabase().c_str(),
             rpc->GetIntArg1());
282
    return std::string(str);
hrchilds's avatar
hrchilds committed
283
284
}

285
static std::string log_CloseDatabaseRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
286
{
287
    char str[SLEN];
hrchilds's avatar
hrchilds committed
288
289
    SNPRINTF(str, SLEN, "OpenDatabase(\"%s\")\n",
             rpc->GetDatabase().c_str());
290
    return std::string(str);
hrchilds's avatar
hrchilds committed
291
292
}

293
static std::string log_ActivateDatabaseRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
294
{
295
    char str[SLEN];
hrchilds's avatar
hrchilds committed
296
297
    SNPRINTF(str, SLEN, "ActivateDatabase(\"%s\")\n",
             rpc->GetDatabase().c_str());
298
    return std::string(str);
hrchilds's avatar
hrchilds committed
299
300
}

301
static std::string log_CheckForNewStatesRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
302
{
303
    char str[SLEN];
hrchilds's avatar
hrchilds committed
304
305
    SNPRINTF(str, SLEN, "CheckForNewStates(\"%s\")\n",
             rpc->GetDatabase().c_str());
306
    return std::string(str);
hrchilds's avatar
hrchilds committed
307
308
}

309
static std::string log_CreateDatabaseCorrelationRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
310
{
311
312
313
314
315
316
317
318
319
320
321
322
323
    char str[SLEN];
    std::string s("CreateDatabaseCorrelation(\"");
    s += rpc->GetDatabase();
    s += "\",(";
    const stringVector &dbs = rpc->GetProgramOptions();
    for(unsigned int i = 0; i < dbs.size(); ++i)
    {
        s += dbs[i];
        if(i < dbs.size() - 1)
            s += ", ";
    }
    SNPRINTF(str, SLEN, "%s), %d)\n", s.c_str(), rpc->GetIntArg1());
    return std::string(str);     
hrchilds's avatar
hrchilds committed
324
325
}

326
static std::string log_AlterDatabaseCorrelationRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
327
{
328
     char str[SLEN];
hrchilds's avatar
hrchilds committed
329
330
331
332
     std::string s("AlterDatabaseCorrelation(\"");
     s += rpc->GetDatabase();
     s += "\",(";
     const stringVector &dbs = rpc->GetProgramOptions();
333
     for(unsigned int i = 0; i < dbs.size(); ++i)
hrchilds's avatar
hrchilds committed
334
335
336
337
338
339
     {
         s += dbs[i];
         if(i < dbs.size() - 1)
             s += ", ";
     }
     SNPRINTF(str, SLEN, "%s), %d)\n", s.c_str(), rpc->GetIntArg1());
340
     return std::string(str);
hrchilds's avatar
hrchilds committed
341
342
}

343
static std::string log_DeleteDatabaseCorrelationRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
344
{
345
    char str[SLEN];
hrchilds's avatar
hrchilds committed
346
347
    SNPRINTF(str, SLEN, "DeleteDatabaseCorrelation(\"%s\")\n", 
             rpc->GetDatabase().c_str());
348
    return std::string(str);
hrchilds's avatar
hrchilds committed
349
350
}

351
static std::string log_ReOpenDatabaseRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
352
{
353
    char str[SLEN];
hrchilds's avatar
hrchilds committed
354
355
356
    SNPRINTF(str, SLEN, "OpenDatabase(\"%s\", %d)\n",
             rpc->GetDatabase().c_str(),
             rpc->GetIntArg1());
357
    return std::string(str);
hrchilds's avatar
hrchilds committed
358
359
}

360
static std::string log_ReplaceDatabaseRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
361
{
362
    char str[SLEN];
hrchilds's avatar
hrchilds committed
363
364
365
    SNPRINTF(str, SLEN, "ReplaceDatabase(\"%s\", %d)\n",
             rpc->GetDatabase().c_str(),
             rpc->GetIntArg1());
366
    return std::string(str);
hrchilds's avatar
hrchilds committed
367
368
}

369
static std::string log_OverlayDatabaseRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
370
{
371
    char str[SLEN];
hrchilds's avatar
hrchilds committed
372
373
    SNPRINTF(str, SLEN, "OverlayDatabase(\"%s\")\n", 
             rpc->GetDatabase().c_str());
374
    return std::string(str);
hrchilds's avatar
hrchilds committed
375
376
}

377
static std::string log_OpenComponentHelper(ViewerRPC *rpc, const char *mName)
hrchilds's avatar
hrchilds committed
378
379
{
    const stringVector &argv = rpc->GetProgramOptions();
380
    char str[SLEN];
hrchilds's avatar
hrchilds committed
381
382
383
384
385
386
387
388
389
390
391
392
393
394

    if(argv.size() == 0)
    {
        SNPRINTF(str, SLEN, "%s(\"%s\")\n",
                 mName, rpc->GetProgramHost().c_str());
    }
    else if(argv.size() == 1)
    {
        SNPRINTF(str, SLEN, "%s(\"%s\", \"%s\")\n",
                mName, rpc->GetProgramHost().c_str(), argv[0].c_str());
    }
    else
    {
        std::string tmp("launchArguments = (");
395
        for(unsigned int i = 0; i < argv.size(); ++i)
hrchilds's avatar
hrchilds committed
396
397
398
399
400
401
402
403
404
405
406
        {
            tmp += "\"";
            tmp += argv[i];
            tmp += "\"";
            if(i < argv.size() - 1)
                tmp += ", ";
        }
        tmp += ")\n";
        SNPRINTF(str, SLEN, "%s%s(\"%s\", launchArguments)\n",
                 tmp.c_str(), mName, rpc->GetProgramHost().c_str());
    }
407
    return std::string(str);
hrchilds's avatar
hrchilds committed
408
409
}

410
static std::string log_OpenComputeEngineRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
411
{
412
    return log_OpenComponentHelper(rpc, "OpenComputeEngine");
hrchilds's avatar
hrchilds committed
413
414
}

415
static std::string log_OpenMDServerRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
416
{
417
    return log_OpenComponentHelper(rpc, "OpenMDServer");
hrchilds's avatar
hrchilds committed
418
419
}

420
static std::string log_CloseComputeEngineRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
421
{
422
    char str[SLEN];
hrchilds's avatar
hrchilds committed
423
424
425
    SNPRINTF(str, SLEN, "CloseComputeEngine(\"%s\", \"%s\")\n",
             rpc->GetProgramHost().c_str(),
             rpc->GetProgramSim().c_str());
426
    return std::string(str);
hrchilds's avatar
hrchilds committed
427
428
}

429
static std::string log_AnimationSetNFramesRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
430
{
431
    char str[SLEN];
hrchilds's avatar
hrchilds committed
432
    SNPRINTF(str, SLEN, "AnimationSetNFrames(%d)\n", rpc->GetNFrames());
433
    return std::string(str);
hrchilds's avatar
hrchilds committed
434
435
}

436
static std::string log_AnimationPlayRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
437
{
438
    return MESSAGE_COMMENT("AnimationPlay", MSG_UNSUPPORTED);
hrchilds's avatar
hrchilds committed
439
440
}

441
static std::string log_AnimationReversePlayRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
442
{
443
    return MESSAGE_COMMENT("AnimationReversePlay", MSG_UNSUPPORTED);
hrchilds's avatar
hrchilds committed
444
445
}

446
static std::string log_AnimationStopRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
447
{
448
    return MESSAGE_COMMENT("AnimationStop", MSG_UNSUPPORTED);
hrchilds's avatar
hrchilds committed
449
450
}

451
static std::string log_TimeSliderNextStateRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
452
{
453
    return std::string("TimeSliderNextState()\n");
hrchilds's avatar
hrchilds committed
454
455
}

456
static std::string log_TimeSliderPreviousStateRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
457
{
458
    return std::string("TimeSliderPreviousState()\n");
hrchilds's avatar
hrchilds committed
459
460
}

461
static std::string log_SetTimeSliderStateRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
462
{
463
    char str[SLEN];
hrchilds's avatar
hrchilds committed
464
    SNPRINTF(str, SLEN, "SetTimeSliderState(%d)\n", rpc->GetStateNumber());
465
    return std::string(str);
hrchilds's avatar
hrchilds committed
466
467
}

468
static std::string log_SetActiveTimeSliderRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
469
{
470
    char str[SLEN];
hrchilds's avatar
hrchilds committed
471
472
    SNPRINTF(str, SLEN, "SetActiveTimeSlider(\"%s\")\n",
             rpc->GetDatabase().c_str());
473
    return std::string(str);
hrchilds's avatar
hrchilds committed
474
475
}

476
static std::string log_AddPlotRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
477
{
478
    char str[SLEN];
hrchilds's avatar
hrchilds committed
479
    std::string plotName("?");
480
    PlotPluginManager *pluginManager = viewer->GetPlotPluginManager();
hrchilds's avatar
hrchilds committed
481
482
483
484
485
486
    std::string id(pluginManager->GetEnabledID(rpc->GetPlotType()));
    ScriptingPlotPluginInfo *info = pluginManager->
        GetScriptingPluginInfo(id);
    if(info != 0)
        plotName = info->GetName();
 
487
488
489
    int  inheritSILRestriction = viewer->GetViewerState()->GetGlobalAttributes()->GetNewPlotsInheritSILRestriction();
    int  applyOperator = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1: 0;
    SNPRINTF(str, SLEN, "AddPlot(\"%s\", \"%s\", %d, %d)\n",
hrchilds's avatar
hrchilds committed
490
             plotName.c_str(),
491
492
493
             rpc->GetVariable().c_str(),
             inheritSILRestriction,
             applyOperator);
494
    return std::string(str);
hrchilds's avatar
hrchilds committed
495
496
}

497
static std::string log_SetPlotFrameRangeRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
498
{
499
    char str[SLEN];
hrchilds's avatar
hrchilds committed
500
501
    SNPRINTF(str, SLEN, "SetPlotFrameRange(%d, %d, %d)\n", 
             rpc->GetIntArg1(), rpc->GetIntArg2(), rpc->GetIntArg3());
502
    return std::string(str);
hrchilds's avatar
hrchilds committed
503
504
}

505
static std::string log_DeletePlotKeyframeRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
506
{
507
    char str[SLEN];
hrchilds's avatar
hrchilds committed
508
509
    SNPRINTF(str, SLEN, "DeletePlotKeyframe(%d, %d)\n", 
             rpc->GetIntArg1(), rpc->GetIntArg2());
510
    return std::string(str);
hrchilds's avatar
hrchilds committed
511
512
}

513
static std::string log_MovePlotKeyframeRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
514
{
515
    char str[SLEN];
hrchilds's avatar
hrchilds committed
516
517
    SNPRINTF(str, SLEN, "MovePlotKeyframe(%d, %d, %d)\n", 
             rpc->GetIntArg1(), rpc->GetIntArg2(), rpc->GetIntArg3());
518
    return std::string(str);
hrchilds's avatar
hrchilds committed
519
520
}

521
static std::string log_DeleteActivePlotsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
522
{
523
    return std::string("DeleteActivePlots()\n");
hrchilds's avatar
hrchilds committed
524
525
}

526
static std::string log_HideActivePlotsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
527
{
528
    return std::string("HideActivePlots()\n");
hrchilds's avatar
hrchilds committed
529
530
}

531
static std::string log_DrawPlotsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
532
{
533
    return std::string("DrawPlots()\n");
hrchilds's avatar
hrchilds committed
534
535
}

536
static std::string log_DisableRedrawRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
537
{
538
    return std::string("DisableRedraw()\n");
hrchilds's avatar
hrchilds committed
539
540
}

541
static std::string log_RedrawRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
542
{
543
    return std::string("RedrawWindow()\n");
hrchilds's avatar
hrchilds committed
544
545
}

546
static std::string log_SetActivePlotsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
547
{
548
    char str[SLEN];
hrchilds's avatar
hrchilds committed
549
550
551
552
553
554
555
556
557
558
    int slen = SLEN;
    const intVector &ids = rpc->GetActivePlotIds();
    char *sptr = str;
    int L = SNPRINTF(sptr, slen, "SetActivePlots(");
    sptr += L, slen -= L;
    if(ids.size() > 1)
    {
        L = SNPRINTF(sptr, slen, "(");
        sptr += L, slen -= L;
    }
559
    for(unsigned int i = 0; i < ids.size(); ++i)
hrchilds's avatar
hrchilds committed
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
    {
        L = SNPRINTF(sptr, slen, "%d", ids[i]);
        sptr += L, slen -= L;
        if(i < ids.size() - 1)
        {
            L = SNPRINTF(sptr, slen, ", ");
            sptr += L, slen -= L;
        }
    }
    if(ids.size() > 1)
    {
        L = SNPRINTF(sptr, slen, ")");
        sptr += L, slen -= L;
    }
    SNPRINTF(sptr, slen, ")\n");
575
    return std::string(str);
hrchilds's avatar
hrchilds committed
576
577
}

578
static std::string log_ChangeActivePlotsVarRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
579
{
580
    char str[SLEN];
hrchilds's avatar
hrchilds committed
581
582
    SNPRINTF(str, SLEN, "ChangeActivePlotsVar(\"%s\")\n",
             rpc->GetVariable().c_str());
583
    return std::string(str);
hrchilds's avatar
hrchilds committed
584
585
}

586
static std::string log_AddOperatorRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
587
{
588
    char str[SLEN];
hrchilds's avatar
hrchilds committed
589
    std::string operatorName("?");
590
    OperatorPluginManager *pluginManager = viewer->GetOperatorPluginManager();
hrchilds's avatar
hrchilds committed
591
592
593
594
595
596
    std::string id(pluginManager->GetEnabledID(rpc->GetOperatorType()));
    ScriptingOperatorPluginInfo *info = pluginManager->
        GetScriptingPluginInfo(id);
    if(info != 0)
        operatorName = info->GetName();
 
597
598
599
600
    int applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1 : 0;
    SNPRINTF(str, SLEN, "AddOperator(\"%s\", %d)\n",
             operatorName.c_str(),
             applyAll);
601
    return std::string(str);
hrchilds's avatar
hrchilds committed
602
603
}

604
static std::string log_PromoteOperatorRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
605
{
606
    char str[SLEN];
hrchilds's avatar
hrchilds committed
607
    int applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1 : 0;
hrchilds's avatar
hrchilds committed
608
609
    SNPRINTF(str, SLEN, "PromoteOperator(%d, %d)\n", rpc->GetOperatorType(),
             applyAll);
610
    return std::string(str);
hrchilds's avatar
hrchilds committed
611
612
}

613
static std::string log_DemoteOperatorRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
614
{
615
    char str[SLEN];
hrchilds's avatar
hrchilds committed
616
    int applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1 : 0;
hrchilds's avatar
hrchilds committed
617
618
    SNPRINTF(str, SLEN, "DemoteOperator(%d, %d)\n", rpc->GetOperatorType(),
             applyAll);
619
    return std::string(str);
hrchilds's avatar
hrchilds committed
620
621
}

622
static std::string log_RemoveOperatorRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
623
{
624
    char str[SLEN];
hrchilds's avatar
hrchilds committed
625
    int applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1 : 0;
hrchilds's avatar
hrchilds committed
626
627
    SNPRINTF(str, SLEN, "RemoveOperator(%d, %d)\n", rpc->GetOperatorType(),
             applyAll);
628
    return std::string(str);
hrchilds's avatar
hrchilds committed
629
630
}

631
static std::string log_RemoveLastOperatorRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
632
{
633
    char str[SLEN];
hrchilds's avatar
hrchilds committed
634
    int applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1 : 0;
hrchilds's avatar
hrchilds committed
635
    SNPRINTF(str, SLEN, "RemoveLastOperator(%d)\n", applyAll);
636
    return std::string(str);
hrchilds's avatar
hrchilds committed
637
638
}

639
static std::string log_RemoveAllOperatorsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
640
{
641
    char str[SLEN];
hrchilds's avatar
hrchilds committed
642
    int applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1 : 0;
hrchilds's avatar
hrchilds committed
643
    SNPRINTF(str, SLEN, "RemoveAllOperators(%d)\n", applyAll);
644
    return std::string(str);
hrchilds's avatar
hrchilds committed
645
646
}

647
static std::string log_SaveWindowRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
648
649
650
{
    std::string s(PySaveWindowAttributes_GetLogString());
    s += "SetSaveWindowAttributes(SaveWindowAtts)\n";
651
    return s;
hrchilds's avatar
hrchilds committed
652
653
654
655
656
}

static void log_SetPlotOptionsHelper(ViewerRPC *rpc, std::string &atts, 
    std::string &plotName)
{
657
    PlotPluginManager *pluginManager = viewer->GetPlotPluginManager();
hrchilds's avatar
hrchilds committed
658
659
660
661
662
663
664
665
666
667
668
669
670
    std::string id(pluginManager->GetEnabledID(rpc->GetPlotType()));
    ScriptingPlotPluginInfo *info = pluginManager->
        GetScriptingPluginInfo(id);
    if(info != 0)
    {
        char *s = info->GetLogString();
        atts = s;
        delete [] s;
        plotName = info->GetName();
        plotName += "Atts";
    }
}

671
static std::string log_SetDefaultPlotOptionsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
672
673
674
675
676
677
{
    std::string atts(""), plotName("");
    log_SetPlotOptionsHelper(rpc, atts, plotName);
    atts += "SetDefaultPlotOptions(";
    atts += plotName;
    atts += ")\n";
678
    return atts;
hrchilds's avatar
hrchilds committed
679
680
}

681
static std::string log_SetPlotOptionsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
682
683
684
685
686
687
{
    std::string atts(""), plotName("");
    log_SetPlotOptionsHelper(rpc, atts, plotName);
    atts += "SetPlotOptions(";
    atts += plotName;
    atts += ")\n";
688
    return atts;
hrchilds's avatar
hrchilds committed
689
690
691
692
693
}

static void log_SetOperatorOptionsHelper(ViewerRPC *rpc, std::string &atts, 
    std::string &operatorName)
{
694
    OperatorPluginManager *pluginManager = viewer->GetOperatorPluginManager();
hrchilds's avatar
hrchilds committed
695
696
697
698
699
700
701
702
703
704
705
706
707
    std::string id(pluginManager->GetEnabledID(rpc->GetOperatorType()));
    ScriptingOperatorPluginInfo *info = pluginManager->
        GetScriptingPluginInfo(id);
    if(info != 0)
    {
        char *s = info->GetLogString();
        atts = s;
        delete [] s;
        operatorName = info->GetName();
        operatorName += "Atts";
    }
}

708
static std::string log_SetDefaultOperatorOptionsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
709
710
711
712
713
714
{
    std::string atts(""), operatorName("");
    log_SetOperatorOptionsHelper(rpc, atts, operatorName);
    atts += "SetDefaultOperatorOptions(";
    atts += operatorName;
    atts += ")\n";
715
    return atts;
hrchilds's avatar
hrchilds committed
716
717
}

718
static std::string log_SetOperatorOptionsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
719
720
{
    std::string atts(""), operatorName("");
721
    bool  applyOperator = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator();
hrchilds's avatar
hrchilds committed
722
723
724
    log_SetOperatorOptionsHelper(rpc, atts, operatorName);
    atts += "SetOperatorOptions(";
    atts += operatorName;
725
726
    atts += ", ";
    atts += (applyOperator ? "1" : "0");
hrchilds's avatar
hrchilds committed
727
    atts += ")\n";
728
    return atts;
hrchilds's avatar
hrchilds committed
729
730
}

731
static std::string log_AddInitializedOperatorRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
732
{
733
734
735
736
    std::string s;
    s = log_AddOperatorRPC(rpc);
    s += log_SetOperatorOptionsRPC(rpc);
    return s;
hrchilds's avatar
hrchilds committed
737
738
}

739
static std::string log_WriteConfigFileRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
740
{
741
    return std::string("WriteConfigFile()\n");
hrchilds's avatar
hrchilds committed
742
743
}

744
static std::string log_IconifyAllWindowsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
745
{
746
    return std::string("IconifyAllWindows()\n");
hrchilds's avatar
hrchilds committed
747
748
}

749
static std::string log_DeIconifyAllWindowsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
750
{
751
    return std::string("DeIconifyAllWindows()\n");
hrchilds's avatar
hrchilds committed
752
753
}

754
static std::string log_ShowAllWindowsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
755
{
756
    return std::string("ShowAllWindows()\n");
hrchilds's avatar
hrchilds committed
757
758
}

759
static std::string log_HideAllWindowsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
760
{
761
    return std::string("HideAllWindows()\n");
hrchilds's avatar
hrchilds committed
762
763
}

764
static std::string log_SetAnnotationAttributesRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
765
766
{
    std::string s(PyAnnotationAttributes_GetLogString());
767
768
    s += std::string("SetAnnotationAttributes(AnnotationAtts)\n");
    return s;
hrchilds's avatar
hrchilds committed
769
770
}

771
static std::string log_SetDefaultAnnotationAttributesRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
772
773
{
    std::string s(PyAnnotationAttributes_GetLogString());
774
775
    s += std::string("SetDefaultAnnotationAttributes(AnnotationAtts)\n");
    return s;
hrchilds's avatar
hrchilds committed
776
777
}

778
static std::string log_ResetAnnotationAttributesRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
779
{
780
    return MESSAGE_COMMENT("ResetAnnotationAttributes", MSG_UNSUPPORTED);
hrchilds's avatar
hrchilds committed
781
782
}

783
static std::string log_SetKeyframeAttributesRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
784
785
{
    std::string s(PyKeyframeAttributes_GetLogString());
786
787
    s += std::string("SetKeyframeAttributes(KeyframeAtts)\n");
    return s;
hrchilds's avatar
hrchilds committed
788
789
}

hrchilds's avatar
hrchilds committed
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
// ****************************************************************************
// Method: log_SetPlotSILRestrictionRPC
//
// Purpose: 
//   Logs changes to the SIL restriction.
//
// Programmer: Brad Whitlock
// Creation:   Wed Jan 11 09:55:18 PDT 2006
//
// Modifications:
//   Brad Whitlock, Wed Jan 11 09:55:42 PDT 2006
//   I removed a call to the SIL traverser's UsesAllData method because it
//   was causing a crash sometimes.
//
// ****************************************************************************

806
static std::string log_SetPlotSILRestrictionRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
807
808
809
810
811
812
813
814
815
816
817
{
    std::string s("silr = SILRestriction()\n");
    int nsets[2] = {0,0};
    avtSILRestriction_p restriction = viewer->GetPlotSILRestriction();
    avtSILRestrictionTraverser trav(restriction);
    int setid;
    for(setid = 0; setid < restriction->GetNumSets(); ++setid)
    {
        nsets[trav.UsesData(setid)?1:0]++;
    }

hrchilds's avatar
hrchilds committed
818
    if(nsets[1] == restriction->GetNumSets())
hrchilds's avatar
hrchilds committed
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
    {
        s += "silr.TurnOnAll()\n";
    }
    else if(nsets[0] < nsets[1])
    {
        // More sets were on so we'll turn them all on and then turn off sets
        // that were off.
        intVector sets;
        for(setid = 0; setid < restriction->GetNumSets(); ++setid)
        {
            if(restriction->GetSILSet(setid)->GetMapsOut().size() == 0 &&
               !trav.UsesData(setid))
            {
                sets.push_back(setid);
            }
        }

        if(sets.size() == 0)
        {
            s += "silr.TurnOffAll()\n";
        }
        else if(sets.size() == 1)
        {
            s += "silr.TurnOnAll()\n";
            char tmp[20];
            SNPRINTF(tmp, 20, "silr.TurnOffSet(%d)\n", sets[0]);
            s += tmp;
        }
        else
        {
            s += "silr.SuspendCorrectnessChecking()\n";
            s += "silr.TurnOnAll()\n";
            s += "for silSet in (";
852
            for(unsigned int i = 0; i < sets.size(); ++i)
hrchilds's avatar
hrchilds committed
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
            {
                char tmp[20];
                if(i < sets.size() - 1)
                    SNPRINTF(tmp, 20, "%d,", sets[i]);
                else
                    SNPRINTF(tmp, 20, "%d", sets[i]);
                s += tmp;
            }
            s += "):\n";
            s += "    silr.TurnOffSet(silSet)\n";
            s += "silr.EnableCorrectnessChecking()\n";
       }
    }
    else
    {
        // More sets were off so we'll turn them all off and then turn on sets
        // that were on.
        intVector sets;
        for(setid = 0; setid < restriction->GetNumSets(); ++setid)
        {
            if(restriction->GetSILSet(setid)->GetMapsOut().size() == 0 &&
               trav.UsesData(setid))
            {
                sets.push_back(setid);
            }
        }

        if(sets.size() == 0)
        {
            s += "silr.TurnOffAll()\n";
        }
        else if(sets.size() == 1)
        {
            s += "silr.TurnOffAll()\n";
            char tmp[20];
            SNPRINTF(tmp, 20, "silr.TurnOnSet(%d)\n", sets[0]);
            s += tmp;
        }
        else
        {
            s += "silr.SuspendCorrectnessChecking()\n";
            s += "silr.TurnOffAll()\n";
            s += "for silSet in (";
896
            for(unsigned int i = 0; i < sets.size(); ++i)
hrchilds's avatar
hrchilds committed
897
898
899
900
901
902
903
904
905
906
907
908
909
            {
                char tmp[20];
                if(i < sets.size() - 1)
                    SNPRINTF(tmp, 20, "%d,", sets[i]);
                else
                    SNPRINTF(tmp, 20, "%d", sets[i]);
                s += tmp;
            }
            s += "):\n";
            s += "    silr.TurnOnSet(silSet)\n";
            s += "silr.EnableCorrectnessChecking()\n";
        }
    }
910
911
912
913
    bool applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplySelection();
    s += "SetPlotSILRestriction(silr ,";
    s += (applyAll ? "1" : "0");
    s += ")\n";
914
    return s;
hrchilds's avatar
hrchilds committed
915
916
}

917
static std::string log_SetViewAxisArrayRPC(ViewerRPC *rpc)
918
919
{
    std::string s(PyViewAxisArrayAttributes_GetLogString());
920
921
    s += std::string("SetViewAxisArray(ViewAxisArrayAtts)\n");
    return s;
922
923
}

924
static std::string log_SetViewCurveRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
925
926
{
    std::string s(PyViewCurveAttributes_GetLogString());
927
928
    s += std::string("SetViewCurve(ViewCurveAtts)\n");
    return s;
hrchilds's avatar
hrchilds committed
929
930
}

931
static std::string log_SetView2DRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
932
933
{
    std::string s(PyView2DAttributes_GetLogString());
934
935
    s += std::string("SetView2D(View2DAtts)\n");
    return s;
hrchilds's avatar
hrchilds committed
936
937
}

938
static std::string log_SetView3DRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
939
940
{
    std::string s(PyView3DAttributes_GetLogString());
941
942
    s += std::string("SetView3D(View3DAtts)\n");
    return s;
hrchilds's avatar
hrchilds committed
943
944
}

945
static std::string log_ResetPlotOptionsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
946
947
{
    std::string plotName("?");
948
    PlotPluginManager *pluginManager = viewer->GetPlotPluginManager();
hrchilds's avatar
hrchilds committed
949
950
951
952
953
954
    std::string id(pluginManager->GetEnabledID(rpc->GetPlotType()));
    ScriptingPlotPluginInfo *info = pluginManager->
        GetScriptingPluginInfo(id);
    if(info != 0)
        plotName = info->GetName();
 
955
    return std::string("ResetPlotOptions(\"") + plotName + std::string("\")\n");
hrchilds's avatar
hrchilds committed
956
957
}

958
static std::string log_ResetOperatorOptionsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
959
960
{
    std::string operatorName("?");
961
    OperatorPluginManager *pluginManager = viewer->GetOperatorPluginManager();
hrchilds's avatar
hrchilds committed
962
963
964
965
966
967
    std::string id(pluginManager->GetEnabledID(rpc->GetOperatorType()));
    ScriptingOperatorPluginInfo *info = pluginManager->
        GetScriptingPluginInfo(id);
    if(info != 0)
        operatorName = info->GetName();
 
968
    int  applyAll = viewer->GetViewerState()->GetGlobalAttributes()->GetApplyOperator() ? 1: 0;
969
970
971
    char tmp[20];
    SNPRINTF(tmp, 20, "\", %d)\n", applyAll);
    return std::string("ResetOperatorOptions(\"") + operatorName + std::string(tmp);
hrchilds's avatar
hrchilds committed
972
973
}

974
static std::string log_SetAppearanceRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
975
{
976
    return MESSAGE_COMMENT("SetAppearance", MSG_UNSUPPORTED);
hrchilds's avatar
hrchilds committed
977
978
}

hrchilds's avatar
hrchilds committed
979
980
981
982
983
984
985
//*****************************************************************************
//  Modifications:
//    Kathleen Bonnell, Thu Aug  3 09:25:00 PDT 2006
//    Added CurveMeshVar
// 
//*****************************************************************************

986
static std::string log_ProcessExpressionsRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
987
988
{
    std::string exprList("");
989
    char str[SLEN];
hrchilds's avatar
hrchilds committed
990

hrchilds's avatar
hrchilds committed
991
    ExpressionList *list = viewer->GetViewerState()->GetExpressionList();
hrchilds's avatar
hrchilds committed
992
993
    for(int i = 0; i < list->GetNumExpressions(); ++i)
    {
hrchilds's avatar
hrchilds committed
994
        const Expression &expr = list->GetExpressions(i);
hrchilds's avatar
hrchilds committed
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
        if(expr.GetFromDB())
            continue;

        const char *fx = 0;
        if(expr.GetType() == Expression::ScalarMeshVar)
            fx = "DefineScalarExpression";
        else if(expr.GetType() == Expression::VectorMeshVar)
            fx = "DefineVectorExpression";
        else if(expr.GetType() == Expression::TensorMeshVar)
            fx = "DefineTensorExpression";
        else if(expr.GetType() == Expression::ArrayMeshVar)
            fx = "DefineArrayExpression";
hrchilds's avatar
hrchilds committed
1007
1008
        else if(expr.GetType() == Expression::CurveMeshVar)
            fx = "DefineCurveExpression";
hrchilds's avatar
hrchilds committed
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
        else if(expr.GetType() == Expression::Mesh)
            fx = "DefineMeshExpression";
        else if(expr.GetType() == Expression::Material)
            fx = "DefineMaterialExpression";
        else if(expr.GetType() == Expression::Species)
            fx = "DefineSpeciesExpression";
       
        if(fx != 0)
        {
            std::string def(expr.GetDefinition());
            if(def.size() > 0 && def[def.size()-1] == '\n')
                def = def.substr(0, def.size()-1);
            SNPRINTF(str, SLEN, "%s(\"%s\", \"%s\")\n", fx, expr.GetName().c_str(),
                     def.c_str());
            exprList += str;
        }
    }

1027
    return exprList;
hrchilds's avatar
hrchilds committed
1028
1029
}

hrchilds's avatar
hrchilds committed
1030
1031
1032
1033
1034
1035
1036
1037
//*****************************************************************************
//  Modifications:
//    Brad Whitlock, Tue May 8 10:52:04 PDT 2007
//    Fixed so the prefixes have dots.
// 
//*****************************************************************************


1038
static std::string log_SetLightListRPC(ViewerRPC *rpc)
hrchilds's avatar
hrchilds committed
1039
1040
{
    std::string s;
hrchilds's avatar
hrchilds committed
1041
    LightList *lightlist = viewer->GetViewerState()->GetLightList();
hrchilds's avatar
hrchilds committed
1042
1043
    for(int i = 0; i < lightlist->NumLights(); ++i)
    {
hrchilds's avatar
hrchilds committed
1044