Commit 4445ca1b authored by Allison Vacanti's avatar Allison Vacanti

Fully remove the deprecated vtkHyperOctree class.

vtkHyperTreeGrid is the replacement for this class.
parent 4c390679
......@@ -99,7 +99,6 @@ unassignedVariable:Rendering/Core/vtkCamera.cxx
duplicateExpression:Common/Math/Testing/Cxx/TestPolynomialSolversUnivariate.cxx
knownConditionTrueFalse:Common/Core/Testing/Cxx/UnitTestMath.cxx
knownConditionTrueFalse:GUISupport/Qt/QVTKWidget.cxx
knownConditionTrueFalse:IO/XML/Testing/Cxx/TestHyperOctreeIO.cxx
knownConditionTrueFalse:Rendering/OpenGL/vtkXGPUInfoList.cxx
knownConditionTrueFalse:Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
knownConditionTrueFalse:Rendering/OpenGL2/vtkOpenGLShaderCache.cxx
......
......@@ -30,8 +30,7 @@ vtkArrayRange::vtkArrayRange() :
}
vtkArrayRange::vtkArrayRange(CoordinateT begin, CoordinateT end) :
Begin(begin),
End(std::max(begin, end))
Begin(begin), End(std::max(begin, end))
{
}
......
......@@ -221,14 +221,6 @@ set(Module_SRCS
vtkUniformGridAMRDataIterator.cxx
)
if (NOT VTK_LEGACY_REMOVE)
list(APPEND Module_SRCS
vtkHyperOctree.cxx
vtkHyperOctreeCursor.cxx
vtkHyperOctreePointsGrabber.cxx
)
endif()
set(${vtk-module}_HDRS
vtkAngularPeriodicDataArray.h
vtkArrayListTemplate.h
......
......@@ -28,9 +28,6 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkOverlappingAMR.h"
#include "vtkNonOverlappingAMR.h"
#if !defined(VTK_LEGACY_REMOVE)
#include "vtkHyperOctree.h"
#endif // LEGACY remove
#include "vtkHyperTreeGrid.h"
#include "vtkImageData.h"
#include "vtkMultiBlockDataSet.h"
......@@ -215,12 +212,6 @@ vtkDataObject* vtkDataObjectTypes::NewDataObject(const char* type)
{
return vtkNonOverlappingAMR::New();
}
#if !defined(VTK_LEGACY_REMOVE)
else if(strcmp(type, "vtkHyperOctree") == 0)
{
return vtkHyperOctree::New();
}
#endif // LEGACY remove
else if(strcmp(type, "vtkHyperTreeGrid") == 0)
{
return vtkHyperTreeGrid::New();
......
......@@ -136,9 +136,9 @@ void vtkDataSetCellIterator::SetDataSet(vtkDataSet *ds)
{
SetArrayType(htg, this->Points);
}
else if (ds->IsA("vtkImageData") || ds->IsA("vtkHyperOctree"))
else if (ds->IsA("vtkImageData"))
{
// ImageData and HyperOctree Origin and Spacing are doubles so
// ImageData Origin and Spacing are doubles so
// the data type for this should also be double
this->Points->SetDataType(VTK_DOUBLE);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperOctreeCursor.cxx
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 "vtkHyperOctreeCursor.h"
//-----------------------------------------------------------------------------
// Constructor.
vtkHyperOctreeCursor::vtkHyperOctreeCursor()
{
VTK_LEGACY_BODY(vtkHyperOctreeCursor, "VTK 8.1");
}
//-----------------------------------------------------------------------------
vtkHyperOctreeCursor::~vtkHyperOctreeCursor()
{
}
//-----------------------------------------------------------------------------
void vtkHyperOctreeCursor::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperOctreeCursor.h
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.
=========================================================================*/
/**
* @class vtkHyperOctreeCursor
* @brief Objects that can traverse hyperoctree nodes.
*
* Objects that can traverse hyperoctree nodes. It is an abstract class.
* Cursors are created by the hyperoctree.
* @sa
* vtkDataObject vtkFieldData vtkHyperOctreeAlgorithm
*/
#ifndef vtkHyperOctreeCursor_h
#define vtkHyperOctreeCursor_h
#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkObject.h"
#if !defined(VTK_LEGACY_REMOVE)
enum
{
VTK_OCTREE_CHILD_ZMIN_YMIN_XMIN=0,
VTK_OCTREE_CHILD_ZMIN_YMIN_XMAX,
VTK_OCTREE_CHILD_ZMIN_YMAX_XMIN,
VTK_OCTREE_CHILD_ZMIN_YMAX_XMAX,
VTK_OCTREE_CHILD_ZMAX_YMIN_XMIN,
VTK_OCTREE_CHILD_ZMAX_YMIN_XMAX,
VTK_OCTREE_CHILD_ZMAX_YMAX_XMIN,
VTK_OCTREE_CHILD_ZMAX_YMAX_XMAX
};
const int VTK_QUADTREE_CHILD_SW=VTK_OCTREE_CHILD_ZMIN_YMIN_XMIN;
const int VTK_QUADTREE_CHILD_SE=VTK_OCTREE_CHILD_ZMIN_YMIN_XMAX;
const int VTK_QUADTREE_CHILD_NW=VTK_OCTREE_CHILD_ZMIN_YMAX_XMIN;
const int VTK_QUADTREE_CHILD_NE=VTK_OCTREE_CHILD_ZMIN_YMAX_XMAX;
const int VTK_BINARY_TREE_CHILD_LEFT=VTK_QUADTREE_CHILD_SW;
const int VTK_BINARY_TREE_CHILD_RIGHT=VTK_QUADTREE_CHILD_SE;
class VTKCOMMONDATAMODEL_EXPORT vtkHyperOctreeCursor : public vtkObject
{
public:
vtkTypeMacro(vtkHyperOctreeCursor,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Return the index of the current leaf in the data arrays.
* \pre is_leaf: CurrentIsLeaf()
*/
virtual int GetLeafId()=0;
/**
* Is the node pointed by the cursor a leaf?
*/
virtual int CurrentIsLeaf()=0;
/**
* Is the node pointed by the cursor the root?
*/
virtual int CurrentIsRoot()=0;
/**
* Return the level of the node pointed by the cursor.
* \post positive_result: result>=0
*/
virtual int GetCurrentLevel()=0;
/**
* Return the child number of the current node relative to its parent.
* \pre not_root: !CurrentIsRoot().
* \post valid_range: result>=0 && result<GetNumberOfChildren()
*/
virtual int GetChildIndex()=0;
// Are the children of the current node all leaves?
// This query can be called also on a leaf node.
// \post compatible: result implies !CurrentIsLeaf()
virtual int CurrentIsTerminalNode()=0;
/**
* Move the cursor the root node.
* \pre can be root
* \post is_root: CurrentIsRoot()
*/
virtual void ToRoot()=0;
/**
* Move the cursor to the parent of the current node.
* \pre not_root: !CurrentIsRoot()
*/
virtual void ToParent()=0;
/**
* Move the cursor to child `child' of the current node.
* \pre not_leaf: !CurrentIsLeaf()
* \pre valid_child: child>=0 && child<this->GetNumberOfChildren()
*/
virtual void ToChild(int child)=0;
/**
* Move the cursor to the same node pointed by `other'.
* \pre other_exists: other!=0
* \pre same_hyperoctree: this->SameTree(other);
* \post equal: this->IsEqual(other)
*/
virtual void ToSameNode(vtkHyperOctreeCursor *other)=0;
/**
* Is `this' equal to `other'?
* \pre other_exists: other!=0
* \pre same_hyperoctree: this->SameTree(other);
*/
virtual int IsEqual(vtkHyperOctreeCursor *other)=0;
/**
* Create a copy of `this'.
* \post results_exists:result!=0
* \post same_tree: result->SameTree(this)
*/
virtual vtkHyperOctreeCursor *Clone()=0;
/**
* Are `this' and `other' pointing on the same hyperoctree?
* \pre other_exists: other!=0
*/
virtual int SameTree(vtkHyperOctreeCursor *other)=0;
/**
* Return the index in dimension `d', as if the node was a cell of a
* uniform grid of 1<<GetCurrentLevel() cells in each dimension.
* \pre valid_range: d>=0 && d<GetDimension()
* \post valid_result: result>=0 && result<(1<<GetCurrentLevel())
*/
virtual int GetIndex(int d)=0;
/**
* Return the number of children for each node of the tree.
* \post positive_number: result>0
*/
virtual int GetNumberOfChildren()=0;
/**
* Return the dimension of the tree.
* \post positive_result: result>0
*/
virtual int GetDimension()=0;
/**
* Move to the node described by its indices in each dimension and
* at a given level. If there is actually a node or a leaf at this
* location, Found() returns true. Otherwise, Found() returns false and the
* cursor moves to the closest parent of the query. It can be the root in the
* worst case.
* \pre indices_exists: indices!=0
* \pre valid_size: sizeof(indices)==GetDimension()
* \pre valid_level: level>=0
*/
virtual void MoveToNode(int *indices,
int level)=0;
/**
* Did the last call to MoveToNode succeed?
*/
virtual int Found()=0;
protected:
// Constructor.
vtkHyperOctreeCursor();
~vtkHyperOctreeCursor() override;
private:
vtkHyperOctreeCursor(const vtkHyperOctreeCursor&) = delete;
void operator=(const vtkHyperOctreeCursor&) = delete;
};
#endif // LEGACY remove
#endif
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperOctreePointsGrabber.cxx
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 "vtkHyperOctreePointsGrabber.h"
#include <cassert>
//-----------------------------------------------------------------------------
// Default constructor.
vtkHyperOctreePointsGrabber::vtkHyperOctreePointsGrabber()
{
VTK_LEGACY_BODY(vtkHyperOctreePointsGrabber, "VTK 8.1");
this->Dimension=3;
}
//-----------------------------------------------------------------------------
// Destructor.
vtkHyperOctreePointsGrabber::~vtkHyperOctreePointsGrabber()
{
}
//-----------------------------------------------------------------------------
// Description:
// Return the dimension of the hyperoctree.
// \post valid_result: (result==2 || result==3)
int vtkHyperOctreePointsGrabber::GetDimension()
{
assert("post: valid_dim" && (this->Dimension==3 || this->Dimension==2));
return this->Dimension;
}
//-----------------------------------------------------------------------------
void vtkHyperOctreePointsGrabber::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperOctreePointsGrabber.h
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.
=========================================================================*/
/**
* @class vtkHyperOctreePointsGrabber
* @brief An object used by filters to
* store points computed on face or edge of an hyperoctant. It is an
* abstract class. vtkClipHyperOctree and vtkHyperOctreeCutter use
* vtkHyperOctreeClipCutPointsGrabber
* vtkHyperOctreeContourFilter use an internal one:
* vtkHyperOctreeContourFilterPointsGrabber.
*
* @sa
* vtkHyperOctree, vtkHyperOctreeClipCutPointsGrabber,
* vtkClipHyperOctree, vtkHyperOctreeCutter
*/
#ifndef vtkHyperOctreePointsGrabber_h
#define vtkHyperOctreePointsGrabber_h
#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkObject.h"
#if !defined(VTK_LEGACY_REMOVE)
class VTKCOMMONDATAMODEL_EXPORT vtkHyperOctreePointsGrabber : public vtkObject
{
public:
vtkTypeMacro(vtkHyperOctreePointsGrabber,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Return the dimension of the hyperoctree.
* \post valid_result: (result==2 || result==3)
*/
int GetDimension();
/**
* Set the dimension of the hyperoctree.
* \pre valid_dim: (dim==2 || dim==3)
* \post is_set: GetDimension()==dim
*/
virtual void SetDimension(int dim)=0;
/**
* Initialize the points insertion scheme.
* Actually, it is just a trick to initialize the IdSet from the filter.
* The IdSet class cannot be shared with the filter because it is a Pimpl.
* It is used by clip,cut and contour filters to build the points
* that lie on an hyperoctant.
* \pre only_in_3d: GetDimension()==3
*/
virtual void InitPointInsertion()=0;
/**
* Insert a point, assuming the point is unique and does not require a
* locator. Tt does not mean it does not use a locator. It just mean that
* some implementation may skip the use of a locator.
*/
virtual void InsertPoint(vtkIdType ptId,
double pt[3],
double pcoords[3],
int ijk[3])=0;
/**
* Insert a point using a locator.
*/
virtual void InsertPointWithMerge(vtkIdType ptId,
double pt[3],
double pcoords[3],
int ijk[3])=0;
/**
* Insert a point in the quadtree case.
*/
virtual void InsertPoint2D(double pt[3],
int ijk[3])=0;
protected:
// Constructor with default bounds (0,1, 0,1, 0,1).
vtkHyperOctreePointsGrabber();
~vtkHyperOctreePointsGrabber() override;
int Dimension;
private:
vtkHyperOctreePointsGrabber(const vtkHyperOctreePointsGrabber&) = delete;
void operator=(const vtkHyperOctreePointsGrabber&) = delete;
};
#endif // LEGACY remove
#endif
......@@ -63,11 +63,4 @@ SET(Module_SRCS
vtkNonOverlappingAMRAlgorithm.cxx
)
if (NOT VTK_LEGACY_REMOVE)
list(APPEND Module_SRCS
vtkHyperOctreeAlgorithm.cxx
)
endif()
vtk_module_library(vtkCommonExecutionModel ${Module_SRCS})
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperOctreeAlgorithm.cxx
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 "vtkHyperOctreeAlgorithm.h"
#include "vtkCommand.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkHyperOctree.h"
#include "vtkStreamingDemandDrivenPipeline.h"
//----------------------------------------------------------------------------
vtkHyperOctreeAlgorithm::vtkHyperOctreeAlgorithm()
{
VTK_LEGACY_BODY(vtkHyperOctreeAlgorithm, "VTK 8.1");
// by default assume filters have one input and one output
// subclasses that deviate should modify this setting
this->SetNumberOfInputPorts(1);
this->SetNumberOfOutputPorts(1);
}
//----------------------------------------------------------------------------
vtkHyperOctreeAlgorithm::~vtkHyperOctreeAlgorithm()
{
}
//----------------------------------------------------------------------------
void vtkHyperOctreeAlgorithm::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
vtkHyperOctree* vtkHyperOctreeAlgorithm::GetOutput()
{
return this->GetOutput(0);
}
//----------------------------------------------------------------------------
vtkHyperOctree* vtkHyperOctreeAlgorithm::GetOutput(int port)
{
return vtkHyperOctree::SafeDownCast(this->GetOutputDataObject(port));
}
//----------------------------------------------------------------------------
void vtkHyperOctreeAlgorithm::SetOutput(vtkDataObject* d)
{
this->GetExecutive()->SetOutputData(0, d);
}
//----------------------------------------------------------------------------
vtkDataObject* vtkHyperOctreeAlgorithm::GetInput()
{
return this->GetInput(0);
}
//----------------------------------------------------------------------------
vtkDataObject* vtkHyperOctreeAlgorithm::GetInput(int port)
{
if (this->GetNumberOfInputConnections(port) < 1)
{
return nullptr;
}
return this->GetExecutive()->GetInputData(port, 0);
}
//----------------------------------------------------------------------------
vtkHyperOctree* vtkHyperOctreeAlgorithm::GetHyperOctreeInput(int port)
{
return vtkHyperOctree::SafeDownCast(this->GetInput(port));
}
//----------------------------------------------------------------------------
int vtkHyperOctreeAlgorithm::ProcessRequest(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
// generate the data
if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA()))
{
return this->RequestData(request, inputVector, outputVector);
}
if(request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
{
return this->RequestUpdateExtent(request, inputVector, outputVector);
}
// execute information
if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION()))
{
return this->RequestInformation(request, inputVector, outputVector);
}
return this->Superclass::ProcessRequest(request, inputVector, outputVector);
}
//----------------------------------------------------------------------------
int vtkHyperOctreeAlgorithm::FillOutputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
// now add our info
info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkHyperOctree");
return 1;
}
//----------------------------------------------------------------------------
int vtkHyperOctreeAlgorithm::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkHyperOctree");
return 1;
}
//----------------------------------------------------------------------------
int vtkHyperOctreeAlgorithm::RequestInformation(
vtkInformation* vtkNotUsed(request),
vtkInformationVector** vtkNotUsed(inputVector),
vtkInformationVector* vtkNotUsed(outputVector))
{
// do nothing let subclasses handle it
return 1;
}
//----------------------------------------------------------------------------
int vtkHyperOctreeAlgorithm::RequestUpdateExtent(
vtkInformation* vtkNotUsed(request),
vtkInformationVector** inputVector,
vtkInformationVector* vtkNotUsed(outputVector))
{
int numInputPorts = this->GetNumberOfInputPorts();
for (int i=0; i<numInputPorts; i++)
{
int numInputConnections = this->GetNumberOfInputConnections(i);
for (int j=0; j<numInputConnections; j++)
{
vtkInformation* inputInfo = inputVector[i]->GetInformationObject(j);
inputInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);
}
}
return 1;
}
//----------------------------------------------------------------------------
// This is the superclasses style of Execute method. Convert it into
// an imaging style Execute method.
int vtkHyperOctreeAlgorithm::RequestData(
vtkInformation* vtkNotUsed( request ),
vtkInformationVector** vtkNotUsed( inputVector ),
vtkInformationVector* vtkNotUsed( outputVector ) )
{
return 0;
}
//----------------------------------------------------------------------------
void vtkHyperOctreeAlgorithm::SetInputData(vtkDataObject* input)
{
this->SetInputData(0, input);
}
//----------------------------------------------------------------------------
void vtkHyperOctreeAlgorithm::SetInputData(int index, vtkDataObject* input)
{
this->SetInputDataInternal(index, input);
}
//----------------------------------------------------------------------------
void vtkHyperOctreeAlgorithm::AddInputData(vtkDataObject* input)
{
this->AddInputData(0, input);
}
//----------------------------------------------------------------------------
void vtkHyperOctreeAlgorithm::AddInputData(int index, vtkDataObject* input)
{
this->AddInputDataInternal(index, input);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperOctreeAlgorithm.h
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.
=========================================================================*/
/**
* @class vtkHyperOctreeAlgorithm
* @brief Superclass for algorithms that produce only octree as output
*
*
* vtkOctreeAlgorithm is a convenience class to make writing algorithms
* easier. It is also designed to help transition old algorithms to the new
* pipeline architecture. There are some assumptions and defaults made by this
* class you should be aware of. This class defaults such that your filter
* will have one input port and one output port. If that is not the case
* simply change it with SetNumberOfInputPorts etc. See this classes
* constructor for the default. This class also provides a FillInputPortInfo
* method that by default says that all inputs will be HyperOctree. If that
* isn't the case then please override this method in your subclass.
*/
#ifndef vtkHyperOctreeAlgorithm_h
#define vtkHyperOctreeAlgorithm_h
#include "vtkCommonExecutionModelModule.h" // For export macro
#include "vtkAlgorithm.h"
#include "vtkHyperOctree.h" // makes things a bit easier
#if !defined(VTK_LEGACY_REMOVE)
class vtkDataSet;
class vtkHyperOctree;
class VTKCOMMONEXECUTIONMODEL_EXPORT vtkHyperOctreeAlgorithm : public vtkAlgorithm
{
public:
vtkTypeMacro(vtkHyperOctreeAlgorithm,vtkAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) override;
//@{
/**
* Get the output data object for a port on this algorithm.
*/
vtkHyperOctree *GetOutput();
vtkHyperOctree *GetOutput(int);