You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
3.3 KiB
102 lines
3.3 KiB
2 years ago
|
/*=========================================================================
|
||
|
|
||
|
Program: Visualization Toolkit
|
||
|
Module: $RCSfile: vtkStructuredPointsToStructuredPointsFilter.cxx,v $
|
||
|
|
||
|
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
||
|
All rights reserved.
|
||
|
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
||
|
|
||
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||
|
PURPOSE. See the above copyright notice for more information.
|
||
|
|
||
|
=========================================================================*/
|
||
|
#include "vtkStructuredPointsToStructuredPointsFilter.h"
|
||
|
|
||
|
#include "vtkImageData.h"
|
||
|
#include "vtkInformation.h"
|
||
|
#include "vtkStructuredPoints.h"
|
||
|
|
||
|
vtkCxxRevisionMacro(vtkStructuredPointsToStructuredPointsFilter, "$Revision: 1.32 $");
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
vtkStructuredPointsToStructuredPointsFilter::vtkStructuredPointsToStructuredPointsFilter()
|
||
|
{
|
||
|
this->NumberOfRequiredInputs = 1;
|
||
|
this->SetNumberOfInputPorts(1);
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
vtkStructuredPointsToStructuredPointsFilter::~vtkStructuredPointsToStructuredPointsFilter()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
// Specify the input data or filter.
|
||
|
void vtkStructuredPointsToStructuredPointsFilter::SetInput(
|
||
|
vtkImageData *input)
|
||
|
{
|
||
|
this->vtkProcessObject::SetNthInput(0, input);
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
// Specify the input data or filter.
|
||
|
vtkImageData *vtkStructuredPointsToStructuredPointsFilter::GetInput()
|
||
|
{
|
||
|
if (this->NumberOfInputs < 1)
|
||
|
{
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
return (vtkStructuredPoints *)(this->Inputs[0]);
|
||
|
}
|
||
|
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
// Copy WholeExtent, Spacing and Origin.
|
||
|
void vtkStructuredPointsToStructuredPointsFilter::ExecuteInformation()
|
||
|
{
|
||
|
vtkImageData *input = this->GetInput();
|
||
|
vtkStructuredPoints *output = this->GetOutput();
|
||
|
|
||
|
if (output == NULL || input == NULL)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
output->SetWholeExtent(input->GetWholeExtent());
|
||
|
output->SetSpacing(input->GetSpacing());
|
||
|
output->SetOrigin(input->GetOrigin());
|
||
|
}
|
||
|
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
void vtkStructuredPointsToStructuredPointsFilter::ComputeInputUpdateExtents(
|
||
|
vtkDataObject *output)
|
||
|
{
|
||
|
this->vtkStructuredPointsSource::ComputeInputUpdateExtents(output);
|
||
|
|
||
|
// assume that we cannot handle more than the requested extent.
|
||
|
this->GetInput()->RequestExactExtentOn();
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
int
|
||
|
vtkStructuredPointsToStructuredPointsFilter
|
||
|
::FillInputPortInformation(int port, vtkInformation* info)
|
||
|
{
|
||
|
if(!this->Superclass::FillInputPortInformation(port, info))
|
||
|
{
|
||
|
return 0;
|
||
|
}
|
||
|
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData");
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------------------
|
||
|
void vtkStructuredPointsToStructuredPointsFilter::PrintSelf(ostream& os, vtkIndent indent)
|
||
|
{
|
||
|
this->Superclass::PrintSelf(os,indent);
|
||
|
}
|