Commit aa5a0849 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri

Fix the vtkIOSegY header test

parent c03d5b80
......@@ -15,9 +15,10 @@
#include "vtkSegY2DReader.h"
#include <vtkInformation.h>
#include <vtkInformationVector.h>
#include <vtkObjectFactory.h>
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkSegYReader.h"
#include <chrono>
......@@ -28,12 +29,15 @@ vtkSegY2DReader::vtkSegY2DReader()
{
this->FileName = nullptr;
this->SetNumberOfInputPorts(0);
this->Reader = new vtkSegYReader();
}
//-----------------------------------------------------------------------------
vtkSegY2DReader::~vtkSegY2DReader()
{
this->SetFileName(nullptr);
delete this->Reader;
this->Reader = nullptr;
}
//-----------------------------------------------------------------------------
......@@ -51,11 +55,11 @@ int vtkSegY2DReader::RequestData(vtkInformation* vtkNotUsed(request),
return 0;
}
reader.LoadFromFile(FileName);
this->Reader->LoadFromFile(FileName);
std::chrono::time_point<std::chrono::system_clock> start, end;
start = std::chrono::system_clock::now();
vtkDebugMacro(<< "Exporting to poly data ...");
reader.ExportData2D(output);
this->Reader->ExportData2D(output);
end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
vtkDebugMacro(<< "Elapsed time: " << elapsed_seconds.count());
......
......@@ -13,16 +13,16 @@
=========================================================================*/
#ifndef __vtkSegY2DReader_h
#define __vtkSegY2DReader_h
#ifndef vtkSegY2DReader_h
#define vtkSegY2DReader_h
#include "vtkSegY2DReader.h"
#include "vtkSegYReader.h"
#include "vtkStructuredGridAlgorithm.h"
#include <vtkIOSegYModule.h> // For export macro
// Forward declarations
class vtkSegYReader;
class VTKIOSEGY_EXPORT vtkSegY2DReader : public vtkStructuredGridAlgorithm
{
public:
......@@ -32,11 +32,6 @@ public:
vtkSetStringMacro(FileName);
bool GetImageData(vtkImageData* imageData)
{
return reader.GetImageData(imageData);
}
vtkSegY2DReader();
~vtkSegY2DReader();
......@@ -47,11 +42,11 @@ protected:
private:
char* FileName;
vtkSegYReader reader;
vtkSegYReader* Reader;
private:
vtkSegY2DReader(const vtkSegY2DReader&) VTK_DELETE_FUNCTION;
void operator=(const vtkSegY2DReader&) VTK_DELETE_FUNCTION;
};
#endif // __vtkSegY2DReader_h
#endif // vtkSegY2DReader_h
......@@ -13,12 +13,13 @@
=========================================================================*/
#ifndef __vtkSegY3DReader_h
#define __vtkSegY3DReader_h
#ifndef vtkSegY3DReader_h
#define vtkSegY3DReader_h
#include "vtkImageAlgorithm.h"
#include "vtkSegYReader.h"
#include "vtkSmartPointer.h"
#include "vtkSegYReader.h" // For reader implementation
#include "vtkSmartPointer.h" // For smart pointer
#include <vtkIOSegYModule.h> // For export macro
......@@ -51,4 +52,4 @@ private:
void operator=(const vtkSegY3DReader&) VTK_DELETE_FUNCTION;
};
#endif // __vtkSegY3DReader_h
#endif // vtkSegY3DReader_h
......@@ -13,8 +13,8 @@
=========================================================================*/
#ifndef __vtkSegYBinaryHeaderBytesPositions_h
#define __vtkSegYBinaryHeaderBytesPositions_h
#ifndef vtkSegYBinaryHeaderBytesPositions_h
#define vtkSegYBinaryHeaderBytesPositions_h
class vtkSegYBinaryHeaderBytesPositions
{
......@@ -62,4 +62,5 @@ private:
}
};
#endif // __vtkSegYBinaryHeaderBytesPositions_h
#endif // vtkSegYBinaryHeaderBytesPositions_h
// VTK-HeaderTest-Exclude: vtkSegYBinaryHeaderBytesPositions.h
......@@ -13,8 +13,8 @@
=========================================================================*/
#ifndef __vtkSegYIOUtils_h
#define __vtkSegYIOUtils_h
#ifndef vtkSegYIOUtils_h
#define vtkSegYIOUtils_h
#include <fstream>
......@@ -44,4 +44,5 @@ private:
}
};
#endif //__vtkSegYIOUtils_h
#endif // vtkSegYIOUtils_h
// VTK-HeaderTest-Exclude: vtkSegYIOUtils.h
......@@ -13,8 +13,8 @@
=========================================================================*/
#ifndef __vtkSegYReader_h
#define __vtkSegYReader_h
#ifndef vtkSegYReader_h
#define vtkSegYReader_h
#include <fstream>
#include <string>
......@@ -49,4 +49,5 @@ private:
int SampleCountPerTrace;
};
#endif // __vtkSegYReader_h
#endif // vtkSegYReader_h
// VTK-HeaderTest-Exclude: vtkSegYReader.h
......@@ -13,8 +13,8 @@
=========================================================================*/
#ifndef __vtkSegYTraceHeaderBytesPositions_h
#define __vtkSegYTraceHeaderBytesPositions_h
#ifndef vtkSegYTraceHeaderBytesPositions_h
#define vtkSegYTraceHeaderBytesPositions_h
class vtkSegYTraceHeaderBytesPositions
{
......@@ -49,4 +49,5 @@ private:
}
};
#endif // __vtkSegYTraceHeaderBytesPositions_h
#endif // vtkSegYTraceHeaderBytesPositions_h
// VTK-HeaderTest-Exclude: vtkSegYTraceHeaderBytesPositions.h
......@@ -13,8 +13,8 @@
=========================================================================*/
#ifndef __vtkSegYTraceReader_h
#define __vtkSegYTraceReader_h
#ifndef vtkSegYTraceReader_h
#define vtkSegYTraceReader_h
#include <fstream>
#include <vector>
......@@ -53,4 +53,5 @@ public:
int GetTraceSize(int numSamples, int formatCode);
};
#endif // __vtkSegYTraceReader_h
#endif // vtkSegYTraceReader_h
// VTK-HeaderTest-Exclude: vtkSegYTraceReader.h
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment