Commit f404a0e2 authored by George Zagaris's avatar George Zagaris
Browse files

Merge branch 'AMR-Refactoring' of...

Merge branch 'AMR-Refactoring' of kwsource.kitwarein.com:~gzagaris/vtk/gzagaris-vtk into AMR-Refactoring
parents 8b13eb81 6724dc6f
......@@ -16,25 +16,39 @@
#include "vtkAMRParticles.h"
#include "vtkAMRParticleType.h"
#include "vtkObjectFactory.h"
#include "vtkPoints.h"
#include "vtkPointData.h"
#include <cassert>
vtkStandardNewMacro(vtkAMRParticles);
vtkAMRParticles::vtkAMRParticles()
{
this->Points = vtkPoints::New();
this->Points->SetDataTypeToDouble();
this->ParticleData = vtkPointData::New();
this->ParticleType = VTK_GENERIC_PARTICLE;
}
//------------------------------------------------------------------------------
vtkAMRParticles::~vtkAMRParticles()
{
// TODO Auto-generated destructor stub
if( this->Points != NULL )
this->Points->Delete();
if( this->ParticleData != NULL )
this->ParticleData->Delete();
this->Points = NULL;
this->ParticleData = NULL;
}
//------------------------------------------------------------------------------
void vtkAMRParticles::PrintSelf( std::ostream &os, vtkIndent indent )
{
this->Superclass::Print( os, indent );
this->Superclass::PrintSelf( os, indent );
}
//------------------------------------------------------------------------------
......@@ -60,7 +74,7 @@ void vtkAMRParticles::SetParticle( const vtkIdType idx, double x[3] )
//------------------------------------------------------------------------------
void vtkAMRParticles::SetParticle( const vtkIdType idx,
double &x, double &y, double &z )
const double x, const double y, const double z )
{
assert( "pre: particle index out-of-bounds" &&
(idx>=0) && (idx<this->GetNumberOfParticles()) );
......@@ -89,3 +103,9 @@ void vtkAMRParticles::GetParticle(
y = this->Points->GetPoint( idx )[ 1 ];
z = this->Points->GetPoint( idx )[ 2 ];
}
//------------------------------------------------------------------------------
vtkPointData* vtkAMRParticles::GetParticleData()
{
return( this->ParticleData );
}
......@@ -15,7 +15,7 @@
// .NAME vtkAMRParticles.h -- Object to store AMR particles.
//
// .SECTION Description
// A concrete instance of vtkPointSet that provides functionality
// A concrete instance of vtkObject that provides functionality
// for storing and accessing particles.
//
// .SECTION See Also
......@@ -28,12 +28,13 @@
class vtkIndent;
class vtkPointData;
class vtkPoints;
class vtkAMRParticles : public vtkPointSet
class vtkAMRParticles : public vtkObject
{
public:
static vtkAMRParticles* New();
vtkTypeMacro( vtkAMRParticles, vtkPointSet );
vtkTypeMacro( vtkAMRParticles, vtkObject );
void PrintSelf( std::ostream &os, vtkIndent indent );
// Description:
......@@ -46,13 +47,13 @@ class vtkAMRParticles : public vtkPointSet
void SetNumberOfParticles( vtkIdType N );
// Description:
//
// Sets the particle corresponding to index idx.
void SetParticle(const vtkIdType idx, double x[3] );
void SetParticle(const vtkIdType idx,
const double x, const double y, const double z );
// Description:
//
// Gets the particles at index idx.
void GetParticle(const vtkIdType idx, double x[3] );
void GetParticle(const vtkIdType idx, double &x, double &y, double &z );
......@@ -69,6 +70,8 @@ class vtkAMRParticles : public vtkPointSet
virtual ~vtkAMRParticles();
int ParticleType;
vtkPoints *Points;
vtkPointData *ParticleData;
private:
vtkAMRParticles( const vtkAMRParticles& ); // Not implemented
void operator=( const vtkAMRParticles& ); // Not implemented
......
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