1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperTreeCursor.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 vtkHyperTreeCursor
* @brief Objects for depth-first traversal HyperTrees.
*
*
* Objects that can perform depth-first traversal of HyperTrees.
* This is an abstract class.
* Cursors are created by the HyperTree implementation.
*
* @sa
* vtkObject vtkHyperTree vtkHyperTreeGrid
*
* @par Thanks:
* This class was written by Philippe Pebay, Joachim Pouderoux, and Charles Law, Kitware 2013
* This class was modified by Guenole Harel and Jacques-Bernard Lekien 2014
* This class was revised by Philippe Pebay, 2016
* This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
*/
#ifndef vtkHyperTreeCursor_h
#define vtkHyperTreeCursor_h
#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
#include "vtkObject.h"
VTK_ABI_NAMESPACE_BEGIN
class vtkHyperTree;
class VTK_DEPRECATED_IN_9_2_0(
"Use other Hyper Tree Grid cursors instead.") VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeCursor
: public vtkObject
{
public:
vtkTypeMacro(vtkHyperTreeCursor, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Set the HyperTree to which the cursor is pointing.
*/
virtual void SetTree(vtkHyperTree*) = 0;
/**
* Return the HyperTree to which the cursor is pointing.
*/
virtual vtkHyperTree* GetTree() = 0;
/**
* Return the index of the current vertex in the tree.
*/
virtual vtkIdType GetVertexId() = 0;
/**
* Is the cursor pointing to a leaf?
*/
virtual bool IsLeaf() = 0;
/**
* Is the cursor at tree root?
*/
virtual bool IsRoot() = 0;
/**
* Return the level of the vertex pointed by the cursor.
* \post positive_result: result>=0
*/
virtual unsigned int GetLevel() = 0;
/**
* Return the child number of the current vertex relative to its parent.
* \pre not_root: !IsRoot().
* \post valid_range: result>=0 && result<GetNumberOfChildren()
*/
virtual int GetChildIndex() = 0;
/**
* Move the cursor to the root vertex.
* \pre can be root
* \post is_root: IsRoot()
*/
virtual void ToRoot() = 0;
/**
* Move the cursor to the parent of the current vertex.
* \pre not_root: !IsRoot()
*/
virtual void ToParent() = 0;
/**
* Move the cursor to child `child' of the current vertex.
* \pre not_leaf: !IsLeaf()
* \pre valid_child: child>=0 && child<this->GetNumberOfChildren()
*/
virtual void ToChild(int child) = 0;
/**
* Move the cursor to the same vertex pointed by `other'.
* \pre other_exists: other!=0
* \pre same_hypertree: this->SameTree(other);
* \post equal: this->IsEqual(other)
*/
virtual void ToSameVertex(vtkHyperTreeCursor* other) = 0;
/**
* Is `this' equal to `other'?
* \pre other_exists: other!=0
* \pre same_hypertree: this->SameTree(other);
*/
virtual bool IsEqual(vtkHyperTreeCursor* other) = 0;
/**
* Create a copy of `this'.
* \post results_exists:result!=0
* \post same_tree: result->SameTree(this)
*/
virtual vtkHyperTreeCursor* Clone() = 0;
/**
* Are `this' and `other' pointing on the same hypertree?
* \pre other_exists: other!=0
*/
virtual int SameTree(vtkHyperTreeCursor* other) = 0;
/**
* Return the number of children for each node (non-vertex leaf) 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;
protected:
// Constructor
vtkHyperTreeCursor();
~vtkHyperTreeCursor() override;
private:
vtkHyperTreeCursor(const vtkHyperTreeCursor&) = delete;
void operator=(const vtkHyperTreeCursor&) = delete;
};
VTK_ABI_NAMESPACE_END
#endif
// VTK-HeaderTest-Exclude: vtkHyperTreeCursor.h
|