Commit ba68a599 authored by Robert Maynard's avatar Robert Maynard

moving towards multiple algorithms

parent 840ca93d
PROJECT(AVTALGORITHMS)
SET(SOURCES
vtkAvtFileFormatAlgorithm.h
vtkAvtFileFormatAlgorithm.cxx
vtkAvtSTSDFileFormatAlgorithm.h
vtkAvtSTSDFileFormatAlgorithm.cxx
vtkAvtSTMDFileFormatAlgorithm.h
vtkAvtSTMDFileFormatAlgorithm.cxx
)
INCLUDE_DIRECTORIES(
......
......@@ -48,45 +48,34 @@ vtkAvtFileFormatAlgorithm::vtkAvtFileFormatAlgorithm()
this->SetNumberOfInputPorts(0);
this->SetNumberOfOutputPorts(1);
this->AvtReader = NULL;
this->ReaderMetaData = NULL;
this->AvtFile = NULL;
this->MetaData = NULL;
}
//-----------------------------------------------------------------------------
vtkAvtFileFormatAlgorithm::~vtkAvtFileFormatAlgorithm()
{
this->SetFileName(0);
if ( this->AvtReader )
if ( this->AvtFile )
{
delete this->AvtReader;
delete this->AvtFile;
}
if ( this->ReaderMetaData )
if ( this->MetaData )
{
delete this->ReaderMetaData;
delete this->MetaData;
}
}
//-----------------------------------------------------------------------------
int vtkAvtFileFormatAlgorithm::CanReadFile(const char *fname)
{
return 1;
}
//-----------------------------------------------------------------------------
int vtkAvtFileFormatAlgorithm::RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
if ( !this->ReaderMetaData )
{
//construct an AVT meta data, that we will allow the avt reader to populate
this->ReaderMetaData = new avtDatabaseMetaData( );
}
//get all the meta data the avt reader has
this->AvtReader->SetDatabaseMetaData( this->ReaderMetaData );
//now cycle through and convert all the meta data that was added to paraview framework
return 1;
}
......@@ -94,28 +83,6 @@ int vtkAvtFileFormatAlgorithm::RequestInformation(vtkInformation *request, vtkIn
//-----------------------------------------------------------------------------
int vtkAvtFileFormatAlgorithm::RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
/*if (!this->AvtReader )
{
return 0;
}
vtkInformation *outInfo = outputVector->GetInformationObject(0);
vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
stringVector names = this->ReaderMetaData->GetAllMeshNames();
size_t size = names.size();
if ( size == 1 )
{
vtkUnstructuredGrid *mesh = vtkUnstructuredGrid::SafeDownCast(
this->AvtReader->GetMesh( 0, names.at(0).c_str() ) );
if ( mesh )
{
output->ShallowCopy( mesh );
}
mesh->Delete();
}
*/
return 1;
}
......
......@@ -45,17 +45,45 @@ public:
static vtkAvtFileFormatAlgorithm *New();
vtkTypeMacro(vtkAvtFileFormatAlgorithm,vtkAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
int CanReadFile(const char* fname);
//ability for subclasses to set the file format to use
// Description:
// see vtkAlgorithm for details
virtual int ProcessRequest(vtkInformation*,
vtkInformationVector**,
vtkInformationVector*);
protected:
vtkAvtFileFormatAlgorithm();
~vtkAvtFileFormatAlgorithm();
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
// convenience method
virtual int RequestInformation(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
// Description:
// This is called by the superclass.
// This is the method you should override.
virtual int RequestData(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
// Description:
// This is called by the superclass.
// This is the method you should override.
virtual int RequestUpdateExtent(vtkInformation*,
vtkInformationVector**,
vtkInformationVector*);
// see algorithm for more info
virtual int FillOutputPortInformation(int port, vtkInformation* info);
virtual int FillInputPortInformation(int port, vtkInformation* info);
char *FileName;
//BTX
......
/*=========================================================================
Program: ParaView
Module: vtkSTMDAvtFileFormatAlgorithm.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
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 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL 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.
========================================================================*/
#include "vtkSTMDAvtFileFormatAlgorithm.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkMultiBlockDataSetAlgorithm.h"
#include "avtSTMDFileFormat.h"
#include "avtDatabaseMetaData.h"
vtkStandardNewMacro(vtkSTMDAvtFileFormatAlgorithm);
//-----------------------------------------------------------------------------
vtkSTMDAvtFileFormatAlgorithm::vtkSTMDAvtFileFormatAlgorithm()
{
this->FileName = 0;
this->SetNumberOfInputPorts(0);
this->SetNumberOfOutputPorts(1);
this->AvtFile = NULL;
this->MetaData = NULL;
}
//-----------------------------------------------------------------------------
vtkSTMDAvtFileFormatAlgorithm::~vtkSTMDAvtFileFormatAlgorithm()
{
this->SetFileName(0);
if ( this->AvtFile )
{
delete this->AvtFile;
}
if ( this->MetaData )
{
delete this->MetaData;
}
}
//-----------------------------------------------------------------------------
int vtkSTMDAvtFileFormatAlgorithm::CanReadFile(const char *fname)
{
return 1;
}
//-----------------------------------------------------------------------------
int vtkSTMDAvtFileFormatAlgorithm::RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
return 1;
}
//-----------------------------------------------------------------------------
int vtkSTMDAvtFileFormatAlgorithm::RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
return 1;
}
//-----------------------------------------------------------------------------
void vtkSTMDAvtFileFormatAlgorithm::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: ParaView
Module: vtkSTMDAvtFileFormatAlgorithm.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
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 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL 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.
========================================================================*/
#ifndef _vtkVisItReader_h
#define _vtkVisItReader_h
#include "vtkMultiBlockDataSetAlgorithm.h"
//BTX
class avtSTMDFileFormat;
class avtDatabaseMetaData;
//ETX
class VTK_EXPORT vtkSTMDAvtFileFormatAlgorithm : public vtkMultiBlockDataSetAlgorithm
{
public:
static vtkSTMDAvtFileFormatAlgorithm *New();
vtkTypeMacro(vtkSTMDAvtFileFormatAlgorithm,vtkMultiBlockDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
int CanReadFile(const char* fname);
protected:
vtkSTMDAvtFileFormatAlgorithm();
~vtkSTMDAvtFileFormatAlgorithm();
// convenience method
virtual int RequestInformation(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
// Description:
// This is called by the superclass.
// This is the method you should override.
virtual int RequestData(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
char *FileName;
//BTX
avtSTMDFileFormat *AvtFile;
avtDatabaseMetaData *MetaData;
//ETX
private:
vtkSTMDAvtFileFormatAlgorithm(const vtkSTMDAvtFileFormatAlgorithm&);
void operator = (const vtkSTMDAvtFileFormatAlgorithm&);
};
#endif
/*=========================================================================
Program: ParaView
Module: vtkSTSDAvtFileFormatAlgorithm.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
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 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL 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.
========================================================================*/
#include "vtkSTSDAvtFileFormatAlgorithm.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "avtFileFormat.h"
#include "avtDatabaseMetaData.h"
vtkStandardNewMacro(vtkSTSDAvtFileFormatAlgorithm);
//-----------------------------------------------------------------------------
vtkSTSDAvtFileFormatAlgorithm::vtkSTSDAvtFileFormatAlgorithm()
{
this->FileName = 0;
this->SetNumberOfInputPorts(0);
this->SetNumberOfOutputPorts(1);
this->AvtFile = NULL;
this->MetaData = NULL;
}
//-----------------------------------------------------------------------------
vtkSTSDAvtFileFormatAlgorithm::~vtkSTSDAvtFileFormatAlgorithm()
{
this->SetFileName(0);
if ( this->AvtFile )
{
delete this->AvtFile;
}
if ( this->MetaData )
{
delete this->MetaData;
}
}
//-----------------------------------------------------------------------------
int vtkSTSDAvtFileFormatAlgorithm::CanReadFile(const char *fname)
{
return 1;
}
//-----------------------------------------------------------------------------
int vtkSTSDAvtFileFormatAlgorithm::RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
return 1;
}
//-----------------------------------------------------------------------------
int vtkSTSDAvtFileFormatAlgorithm::RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
return 1;
}
//-----------------------------------------------------------------------------
void vtkSTSDAvtFileFormatAlgorithm::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: ParaView
Module: vtkSTSDAvtFileFormatAlgorithm.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
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 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL 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.
========================================================================*/
#ifndef _vtkVisItReader_h
#define _vtkVisItReader_h
#include "vtkDataSetAlgorithm.h"
//BTX
class avtFileFormat;
class avtDatabaseMetaData;
//ETX
class VTK_EXPORT vtkSTSDAvtFileFormatAlgorithm : public vtkDataSetAlgorithm
{
public:
static vtkSTSDAvtFileFormatAlgorithm *New();
vtkTypeMacro(vtkSTSDAvtFileFormatAlgorithm,vtkDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
int CanReadFile(const char* fname);
protected:
vtkSTSDAvtFileFormatAlgorithm();
~vtkSTSDAvtFileFormatAlgorithm();
// convenience method
virtual int RequestInformation(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
// Description:
// This is called by the superclass.
// This is the method you should override.
virtual int RequestData(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
char *FileName;
//BTX
avtFileFormat *AvtFile;
avtDatabaseMetaData *MetaData;
//ETX
private:
vtkSTSDAvtFileFormatAlgorithm(const vtkSTSDAvtFileFormatAlgorithm&);
void operator = (const vtkSTSDAvtFileFormatAlgorithm&);
};
#endif
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