pqOptions.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqOptions.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 
33 #ifndef pqOptions_h
34 #define pqOptions_h
35 
36 #include "pqCoreModule.h"
37 #include <QStringList>
38 #include <vtkPVOptions.h>
39 
46 {
47 public:
48  static pqOptions* New();
49  vtkTypeMacro(pqOptions, vtkPVOptions);
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
52  vtkGetStringMacro(BaselineDirectory);
53  vtkGetStringMacro(TestDirectory);
54  vtkGetStringMacro(DataDirectory);
55 
57 
60  // See Bug #5711
61  vtkGetStringMacro(StateFileName);
63 
64  vtkGetMacro(ExitAppWhenTestsDone, int);
65 
66  // Returns the test scripts as a list.
67  QStringList GetTestScripts();
68 
73  vtkGetStringMacro(ServerResourceName);
74 
75  vtkSetStringMacro(BaselineDirectory);
76  vtkSetStringMacro(TestDirectory);
77  vtkSetStringMacro(DataDirectory);
78 
79  int GetNumberOfTestScripts() { return this->TestScripts.size(); }
80  QString GetTestScript(int cc) { return this->TestScripts[cc].TestFile; }
81  QString GetTestBaseline(int cc) { return this->TestScripts[cc].TestBaseline; }
82  int GetTestImageThreshold(int cc) { return this->TestScripts[cc].ImageThreshold; }
83 
89  vtkSetMacro(CurrentImageThreshold, int);
90  vtkGetMacro(CurrentImageThreshold, int);
91 
92  // Description:
93  // These flags are used for testing multi-clients configurations.
94  vtkGetMacro(TestMaster, int);
95  vtkGetMacro(TestSlave, int);
96 
97  // Description:
98  // Using --script option, user can specify a python script to be run on
99  // startup. This have any effect only when ParaView is built with Python
100  // support.
101  vtkGetStringMacro(PythonScript);
102 
103  // DO NOT CALL. Public for internal callbacks.
104  int AddTestScript(const char*);
105  int SetLastTestBaseline(const char*);
106  int SetLastTestImageThreshold(int);
107 
108 protected:
109  pqOptions();
110  ~pqOptions() override;
111 
112  void Initialize() override;
113  int PostProcess(int argc, const char* const* argv) override;
114 
119  char* StateFileName; // loading state file(Bug #5711)
120 
127 
128  vtkSetStringMacro(PythonScript);
129  vtkSetStringMacro(ServerResourceName);
130  vtkSetStringMacro(StateFileName);
131 
132  struct TestInfo
133  {
134  QString TestFile;
135  QString TestBaseline;
138  : ImageThreshold(12)
139  {
140  }
141  };
142 
143  QList<TestInfo> TestScripts;
144 
145  // Description:
146  // This method is called when wrong argument is found. If it returns 0, then
147  // the parsing will fail.
148  int WrongArgument(const char* argument) override;
149 
150 private:
151  pqOptions(const pqOptions&);
152  void operator=(const pqOptions&);
153 };
154 
155 #endif // pqOptions_h
int DisableRegistry
Definition: pqOptions.h:122
char * DataDirectory
Definition: pqOptions.h:117
QList< TestInfo > TestScripts
Definition: pqOptions.h:143
QString TestBaseline
Definition: pqOptions.h:135
int ExitAppWhenTestsDone
Definition: pqOptions.h:121
int PostProcess(int argc, const char *const *argv) override
After parsing, process extra option dependencies.
char * StateFileName
Definition: pqOptions.h:119
char * TestDirectory
Definition: pqOptions.h:116
int TestMaster
Definition: pqOptions.h:124
void Initialize() override
Initialize arguments.
int TestSlave
Definition: pqOptions.h:125
char * ServerResourceName
Definition: pqOptions.h:118
void PrintSelf(ostream &os, vtkIndent indent) override
QString GetTestScript(int cc)
Definition: pqOptions.h:80
char * BaselineDirectory
Definition: pqOptions.h:115
char * PythonScript
Definition: pqOptions.h:126
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
int GetTestImageThreshold(int cc)
Definition: pqOptions.h:82
int CurrentImageThreshold
Definition: pqOptions.h:123
QString GetTestBaseline(int cc)
Definition: pqOptions.h:81
int GetNumberOfTestScripts()
Definition: pqOptions.h:79
ParaView options storage.
Definition: vtkPVOptions.h:37
Command line options for pqClient.
Definition: pqOptions.h:45
static vtkPVOptions * New()