Commit 211d260c authored by Alvaro Sanchez's avatar Alvaro Sanchez

Remove GetBounds(port) from vtkAbstractVolume.

Since vtkMultiVolume is only supported by vtkGPUVolumeRayCastMapper
currently. Fixes overloaded-virtual warnings and hides specific API.
parent f74184ab
......@@ -57,9 +57,6 @@ public:
double *GetBounds() VTK_SIZEHINT(6) override;
void GetBounds(double bounds[6]) override
{ this->vtkAbstractMapper3D::GetBounds(bounds); };
virtual double* GetBounds(const int /* port */)
{ return this->GetBounds(); };
//@}
//@{
......
......@@ -798,7 +798,7 @@ void vtkGPUVolumeRayCastMapper::RemovePortInternal(const int port)
this->Modified();
}
double* vtkGPUVolumeRayCastMapper::GetBounds(const int port)
double* vtkGPUVolumeRayCastMapper::GetBoundsFromPort(const int port)
{
this->CloneInputs();
......
......@@ -425,6 +425,8 @@ public:
vtkImageData* GetTransformedInput(const int port = 0);
double* GetBoundsFromPort(const int port) VTK_SIZEHINT(6);
protected:
vtkGPUVolumeRayCastMapper();
~vtkGPUVolumeRayCastMapper() override;
......@@ -503,12 +505,6 @@ protected:
* cell data (1).
*/
void SetCellFlag(int cellFlag);
double* GetBounds() VTK_SIZEHINT(6) override
{ return Superclass::GetBounds(); }
void GetBounds(double bounds[6]) override
{ Superclass::GetBounds(bounds); }
double* GetBounds(const int port) VTK_SIZEHINT(6) override;
void RemovePortInternal(const int port);
int LockSampleDistanceToInputSpacing;
......
......@@ -108,7 +108,15 @@ double* vtkMultiVolume::GetBounds()
// Transform to world coordinates (ensure the matrix is
// up-to-date).
const int port = item.first;
double* bnd = this->Mapper->GetBounds(port);
auto mapper = vtkGPUVolumeRayCastMapper::SafeDownCast(this->Mapper);
if (!mapper)
{
vtkErrorMacro(<< "vtkMultiVolume is currently only supported by"
" vtkGPUVolumeRayCastMapper.")
return this->Bounds;
}
double* bnd = mapper->GetBoundsFromPort(port);
vtkVolume* vol = item.second;
vol->ComputeMatrix();
auto rBoundsWorld = this->ComputeAABounds(bnd, vol->GetMatrix());
......@@ -213,9 +221,16 @@ std::array<double, 6> vtkMultiVolume::ComputeAABounds(double bounds[6],
return boundsWorld;
}
bool vtkMultiVolume::VolumesChanged() const
bool vtkMultiVolume::VolumesChanged()
{
auto mapper = vtkGPUVolumeRayCastMapper::SafeDownCast(this->Mapper);
if (!mapper)
{
vtkErrorMacro(<< "vtkMultiVolume is currently only supported by"
" vtkGPUVolumeRayCastMapper.")
return false;
}
for (auto& item : this->Volumes)
{
auto vol = item.second;
......
......@@ -161,7 +161,7 @@ protected:
* Checks for changes in the registered vtkVolume instances which could
* required the bounding-box to be recomputed.
*/
bool VolumesChanged() const;
bool VolumesChanged();
/**
* For a box defined by bounds in coordinate system X, compute its
......
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