Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ParaView
VisItBridge
Commits
ba68a599
Commit
ba68a599
authored
May 26, 2010
by
Robert Maynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving towards multiple algorithms
parent
840ca93d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
388 additions
and
45 deletions
+388
-45
AvtAlgorithms/CMakeLists.txt
AvtAlgorithms/CMakeLists.txt
+4
-2
AvtAlgorithms/vtkAvtFileFormatAlgorithm.cxx
AvtAlgorithms/vtkAvtFileFormatAlgorithm.cxx
+7
-40
AvtAlgorithms/vtkAvtFileFormatAlgorithm.h
AvtAlgorithms/vtkAvtFileFormatAlgorithm.h
+31
-3
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.cxx
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.cxx
+93
-0
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.h
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.h
+80
-0
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.cxx
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.cxx
+93
-0
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.h
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.h
+80
-0
No files found.
AvtAlgorithms/CMakeLists.txt
View file @
ba68a599
PROJECT
(
AVTALGORITHMS
)
SET
(
SOURCES
vtkAvtFileFormatAlgorithm.h
vtkAvtFileFormatAlgorithm.cxx
vtkAvtSTSDFileFormatAlgorithm.h
vtkAvtSTSDFileFormatAlgorithm.cxx
vtkAvtSTMDFileFormatAlgorithm.h
vtkAvtSTMDFileFormatAlgorithm.cxx
)
INCLUDE_DIRECTORIES
(
...
...
AvtAlgorithms/vtkAvtFileFormatAlgorithm.cxx
View file @
ba68a599
...
...
@@ -48,45 +48,34 @@ vtkAvtFileFormatAlgorithm::vtkAvtFileFormatAlgorithm()
this
->
SetNumberOfInputPorts
(
0
);
this
->
SetNumberOfOutputPorts
(
1
);
this
->
Avt
Reader
=
NULL
;
this
->
Reader
MetaData
=
NULL
;
this
->
Avt
File
=
NULL
;
this
->
MetaData
=
NULL
;
}
//-----------------------------------------------------------------------------
vtkAvtFileFormatAlgorithm
::~
vtkAvtFileFormatAlgorithm
()
{
this
->
SetFileName
(
0
);
if
(
this
->
Avt
Reader
)
if
(
this
->
Avt
File
)
{
delete
this
->
Avt
Reader
;
delete
this
->
Avt
File
;
}
if
(
this
->
Reader
MetaData
)
if
(
this
->
MetaData
)
{
delete
this
->
Reader
MetaData
;
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
;
}
...
...
AvtAlgorithms/vtkAvtFileFormatAlgorithm.h
View file @
ba68a599
...
...
@@ -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
...
...
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.cxx
0 → 100644
View file @
ba68a599
/*=========================================================================
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
);
}
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.h
0 → 100644
View file @
ba68a599
/*=========================================================================
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
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.cxx
0 → 100644
View file @
ba68a599
/*=========================================================================
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
);
}
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.h
0 → 100644
View file @
ba68a599
/*=========================================================================
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment