17 #include "vtkDataArray.h"
18 #include "vtkDoubleArray.h"
19 #include "vtkFloatArray.h"
20 #include "vtkObjectFactory.h"
21 #include "vtkPointData.h"
22 #include "vtkPolyData.h"
32 this->DataRoot =
NULL;
33 this->TempRoot =
NULL;
36 if (!((argc == 0) || (argv == 0)))
38 this->DataRoot = this->GetDataRoot();
39 this->TempRoot = this->GetTempRoot();
43 char* vtkPVTestUtilities::GetDataRoot()
45 return this->GetCommandTailArgument(
"-D");
48 char* vtkPVTestUtilities::GetTempRoot()
50 return this->GetCommandTailArgument(
"-T");
53 char* vtkPVTestUtilities::GetCommandTailArgument(
const char* tag)
55 for (
int i = 1; i < this->Argc; ++i)
57 if (std::string(this->Argv[i]) == std::string(tag))
59 if ((i + 1) < this->Argc)
61 return this->Argv[i + 1];
84 char vtkPVTestUtilities::GetPathSep()
86 #if defined _WIN32 && !defined __CYGWIN__
88 #elif defined _WIN64 && !defined __CYGWIN__
98 char* vtkPVTestUtilities::GetFilePath(
const char* base,
const char*
name)
100 int baseLen =
static_cast<int>(strlen(base));
101 int nameLen =
static_cast<int>(strlen(
name));
102 int pathLen = baseLen + 1 + nameLen + 1;
103 char* filePath =
new char[pathLen];
105 for (; i < baseLen; ++i)
107 if (this->GetPathSep() ==
'\\' && base[i] ==
'/')
113 filePath[i] = base[i];
116 filePath[i] = this->GetPathSep();
118 for (
int j = 0; j < nameLen; ++j, ++i)
120 if (this->GetPathSep() ==
'\\' &&
name[j] ==
'/')
126 filePath[i] =
name[j];
135 this->Superclass::PrintSelf(os, indent);
137 os << indent <<
"argc=" << this->Argc <<
endl;
138 os << indent <<
"argv=" << this->Argv <<
endl;
141 os << indent <<
"DataRoot=" << this->DataRoot <<
endl;
145 os << indent <<
"TempRoot=" << this->TempRoot <<
endl;
void PrintSelf(ostream &os, vtkIndent indent) override
void Initialize(int argc, char **argv)
QTextStream & endl(QTextStream &stream)
vtkStandardNewMacro(vtkPVTestUtilities)