pqCoreConfiguration.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqCoreConfiguration_h
5 #define pqCoreConfiguration_h
6 
7 #include "pqCoreModule.h" // for exports
8 #include <QObject>
9 #include <QVector>
10 #include <string>
11 #include <vector>
12 
13 class vtkCLIOptions;
14 
25 class PQCORE_EXPORT pqCoreConfiguration : public QObject
26 {
27  Q_OBJECT
28 public:
32  static pqCoreConfiguration* instance();
33 
37  const std::string& stateFileName() const { return this->StateFileName; }
38 
42  const std::vector<std::string>& dataFileNames() const { return this->DataFileNames; }
43 
47  const std::string& pythonScript() const { return this->PythonScript; }
48 
53  const std::string& baselineDirectory() const { return this->BaselineDirectory; }
54 
59  const std::string& testDirectory() const { return this->TestDirectory; }
60 
65  const std::string& dataDirectory() const { return this->DataDirectory; }
66 
68 
71  int testScriptCount() const { return this->TestScripts.size(); }
72  const std::string& testScript(int index) const { return this->TestScripts.at(index).FileName; }
73  const std::string& testBaseline(int index) const { return this->TestScripts.at(index).Baseline; }
74  int testThreshold(int index) const { return this->TestScripts.at(index).Threshold; }
76 
81  bool exitApplicationWhenTestsDone() const { return this->ExitAppWhenTestsDone; }
82 
87  int catalystLivePort() const { return this->CatalystLivePort; }
88 
93  bool populateOptions(vtkCLIOptions* options);
94 
96 
99  void setActiveTestIndex(int index) { this->ActiveTestIndex = index; }
100  const std::string& testScript() const { return this->testScript(this->ActiveTestIndex); }
101  const std::string& testBaseline() const { return this->testBaseline(this->ActiveTestIndex); }
102  int testThreshold() const { return this->testThreshold(this->ActiveTestIndex); }
104 
106 
109  bool testMaster() const { return this->TestMaster; }
110  bool testSlave() const { return this->TestSlave; }
112 
113 protected:
115  ~pqCoreConfiguration() override;
116 
118  // not entirely sure why this is being done, but I'll let it be fore now.
119  // pqPVApplicationCore uses this.
120  friend class pqPVApplicationCore;
121  void addDataFile(const std::string& data) { this->DataFileNames.push_back(data); }
123 
124 private:
125  Q_DISABLE_COPY(pqCoreConfiguration);
126 
127  std::string StateFileName;
128  std::vector<std::string> DataFileNames;
129  std::vector<std::string> PositionalFileNames;
130  std::string PythonScript;
131  std::string BaselineDirectory;
132  std::string TestDirectory;
133  std::string DataDirectory;
134  bool ExitAppWhenTestsDone;
135  int ActiveTestIndex = 0;
136  int CatalystLivePort = -1;
137  bool TestMaster = false;
138  bool TestSlave = false;
139 
140  struct TestScriptInfo
141  {
142  std::string FileName;
143  std::string Baseline;
144  int Threshold = 12;
145  };
146  QVector<TestScriptInfo> TestScripts;
147 };
148 
149 #endif
const std::string & testBaseline(int index) const
Returns information about tests scripts.
void setActiveTestIndex(int index)
A little bit of hack to activate a particular test script.
int catalystLivePort() const
When specified, ParaView will attempt to connect a Catalyst Live session at the given port...
const std::string & testScript(int index) const
Returns information about tests scripts.
bool testSlave() const
Collaboration testing related flags.
const std::vector< std::string > & dataFileNames() const
Returns data file to load on startup, if any.
int testScriptCount() const
Returns information about tests scripts.
const std::string & testDirectory() const
Returns directory where to output test results and temporary files, if any else an empty string is re...
const std::string & testBaseline() const
A little bit of hack to activate a particular test script.
const std::string & baselineDirectory() const
Returns directory where to output test results and temporary files, if any else an empty string is re...
command line options manager
Definition: vtkCLIOptions.h:46
bool exitApplicationWhenTestsDone() const
Returns true if the application should exit after test playback is complete.
int testThreshold(int index) const
Returns information about tests scripts.
int Threshold(vtkDataSet *input, vtkUnstructuredGrid *output, vtkDataArray *field, double lower, double upper)
const std::string & testScript() const
A little bit of hack to activate a particular test script.
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
const std::string & pythonScript() const
Returns the Python script to load on startup, if any.
bool testMaster() const
Collaboration testing related flags.
const std::string & stateFileName() const
Returns state file to load on startup, if any.
int testThreshold() const
A little bit of hack to activate a particular test script.
pqPVApplicationCore is the application code used by ParaView-based applications that use more of Para...
runtime configuration options for ParaView Qt client
void addDataFile(const std::string &data)
const std::string & dataDirectory() const
Returns directory containing test data files, if any, else an empty string is returned.