/usr/include/paraview/vtkKdTreeGenerator.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /*=========================================================================
Program: ParaView
Module: vtkKdTreeGenerator.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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.
=========================================================================*/
// .NAME vtkKdTreeGenerator - creates a vtkPKdTree using the partitioning
// information provided by a vtkExtentTranslator.
// generates the KdTree
// .SECTION Description
// vtkKdTreeGenerator is used to generate a KdTree using the partitioning
// information garnered from a vtkExtentTranslator (or subclass). Since we need
// spatial bounds for the KdTree, we assume that structured data corresponding
// to the vtkExtentTranslator is an ImageData with the provided spacing and
// origin.
// The algorithm used can be summarized as under:
// \li Inputs: * Extent Translator, * Number of Pieces
// \li Determine the bounds for every piece/region using the extent translator.
// \li Given a set of pieces (number of pieces > 1), we iteratively determine
// the plane along which the the pieces can be split into two
// non-intersecting non-empty groups.
// \li If number of pieces in a set of regions = 1, then we create a leaf node
// representing that region.
// \li If number of pieces > 1, a new non-leaf node is creates with children
// as the subtree generated by repeating the same process on the
// two non-intersecting, non-empty groups of pieces.
//
// vtkKdTreeGenerator also needs to determine the assignment of regions to
// the processors. Since vtkPKdTree assigns Ids to the leaf nodes in inorder,
// we can determine the assignment by assigning temporary ids to all
// leaf nodes indication the piece number they represent and simply
// traversing the tree in inorder, and recording only the leaf
// IDs.
#ifndef vtkKdTreeGenerator_h
#define vtkKdTreeGenerator_h
#include "vtkObject.h"
#include "vtkPVVTKExtensionsRenderingModule.h" // needed for export macro
class vtkDataObject;
class vtkExtentTranslator;
class vtkInformation;
class vtkKdNode;
class vtkKdTreeGeneratorVector;
class vtkPKdTree;
class VTKPVVTKEXTENSIONSRENDERING_EXPORT vtkKdTreeGenerator : public vtkObject
{
public:
static vtkKdTreeGenerator* New();
vtkTypeMacro(vtkKdTreeGenerator, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get/Set the kdtree which is updated in BuildTree.
void SetKdTree(vtkPKdTree*);
vtkGetObjectMacro(KdTree, vtkPKdTree);
// Description:
// Get/Set the number of pieces.
vtkSetMacro(NumberOfPieces, int);
vtkGetMacro(NumberOfPieces, int);
// Description:
// Builds the KdTree using the partitioning of the data.
bool BuildTree(vtkExtentTranslator* translator, const int extents[6],
const double origin[3], const double spacing[4]);
protected:
vtkKdTreeGenerator();
~vtkKdTreeGenerator();
// Description:
// Get/Set the extent translator.
void SetExtentTranslator(vtkExtentTranslator*);
vtkGetObjectMacro(ExtentTranslator, vtkExtentTranslator);
// Description:
// Get/Set the whole extent of the data.
vtkSetVector6Macro(WholeExtent, int);
vtkGetVector6Macro(WholeExtent, int);
// Description:
vtkSetVector3Macro(Origin, double);
vtkSetVector3Macro(Spacing, double);
// Description:
// Obtains information from the extent translator about the partitioning of
// the input dataset among processes.
void FormRegions();
int FormTree(vtkKdNode* parent, vtkKdTreeGeneratorVector& regions_ids);
int CanPartition(int division_point, int dimension,
vtkKdTreeGeneratorVector& ids,
vtkKdTreeGeneratorVector& left, vtkKdTreeGeneratorVector& right);
// Converts extents to bounds in the kdtree.
bool ConvertToBounds(vtkKdNode* node);
vtkPKdTree* KdTree;
vtkExtentTranslator* ExtentTranslator;
double Origin[3];
double Spacing[3];
int WholeExtent[6];
int NumberOfPieces;
int *Regions;
private:
vtkKdTreeGenerator(const vtkKdTreeGenerator&); // Not implemented.
void operator=(const vtkKdTreeGenerator&); // Not implemented.
};
#endif
|