/usr/include/vtk-5.10/vtkPointsProjectedHull.h is in libvtk5-dev 5.10.1+dfsg-2.1build1.
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 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 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkPointsProjectedHull.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.
=========================================================================*/
/*----------------------------------------------------------------------------
Copyright (c) Sandia Corporation
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
// .NAME vtkPointsProjectedHull - the convex hull of the orthogonal
// projection of the vtkPoints in the 3 coordinate directions
// .SECTION Description
// a subclass of vtkPoints, it maintains the counter clockwise
// convex hull of the points (projected orthogonally in the
// three coordinate directions) and has a method to
// test for intersection of that hull with an axis aligned
// rectangle. This is used for intersection tests of 3D volumes.
#ifndef __vtkPointsProjectedHull_h
#define __vtkPointsProjectedHull_h
#include "vtkPoints.h"
class VTK_FILTERING_EXPORT vtkPointsProjectedHull : public vtkPoints
{
vtkTypeMacro(vtkPointsProjectedHull, vtkPoints);
public:
void PrintSelf(ostream& os, vtkIndent indent);
static vtkPointsProjectedHull *New();
// Description: Project the box R along the positive X axis and
// determine whether the resulting rectangle intersects the
// convex hull of the projection of the points along that axis.
int RectangleIntersectionX(vtkPoints *R);
// Description: Determine whether the given rectangle intersects
// the convex hull of the projection of the points along the
// positive X-axis.
int RectangleIntersectionX(float ymin, float ymax, float zmin, float zmax);
int RectangleIntersectionX(double ymin, double ymax, double zmin, double zmax);
// Description: Determine if a rectangle intersects the convex hull
// of the parallel projection along the Y axis of the points
int RectangleIntersectionY(vtkPoints *R);
// Description: Determine whether the given rectangle intersects
// the convex hull of the projection of the points along the
// positive Y-axis.
int RectangleIntersectionY(float zmin, float zmax, float xmin, float xmax);
int RectangleIntersectionY(double zmin, double zmax, double xmin, double xmax);
// Description: Determine if a rectangle intersects the convex hull
// of the parallel projection along the Z axis of the points
int RectangleIntersectionZ(vtkPoints *R);
// Description: Determine whether the given rectangle intersects
// the convex hull of the projection of the points along the
// positive Z-axis.
int RectangleIntersectionZ(float xmin, float xmax, float ymin, float ymax);
int RectangleIntersectionZ(double xmin, double xmax, double ymin, double ymax);
// Description:
// Returns the coordinates (y,z) of the points in the convex hull
// of the projection of the points down the positive x-axis. pts has
// storage for len*2 values.
int GetCCWHullX(float *pts, int len);
int GetCCWHullX(double *pts, int len);
// Description:
// Returns the coordinates (z, x) of the points in the convex hull
// of the projection of the points down the positive y-axis. pts has
// storage for len*2 values.
int GetCCWHullY(float *pts, int len);
int GetCCWHullY(double *pts, int len);
// Description:
// Returns the coordinates (x, y) of the points in the convex hull
// of the projection of the points down the positive z-axis. pts has
// storage for len*2 values.
int GetCCWHullZ(float *pts, int len);
int GetCCWHullZ(double *pts, int len);
// Description:
// Returns the number of points in the convex hull of the projection
// of the points down the positive x-axis
int GetSizeCCWHullX();
// Description:
// Returns the number of points in the convex hull of the projection
// of the points down the positive y-axis
int GetSizeCCWHullY();
// Description:
// Returns the number of points in the convex hull of the projection
// of the points down the positive z-axis
int GetSizeCCWHullZ();
void Initialize();
void Reset(){this->Initialize();}
// Description:
// Forces recalculation of convex hulls, use this if
// you delete/add points
void Update();
protected:
vtkPointsProjectedHull();
~vtkPointsProjectedHull();
private:
int RectangleIntersection(double hmin, double hmax,
double vmin, double vmax, int direction);
int GrahamScanAlgorithm(int direction);
void GetPoints();
int RectangleBoundingBoxIntersection(double hmin, double hmax,
double vmin, double vmax, int direction);
int RectangleOutside(double hmin, double hmax,
double vmin, double vmax, int direction);
int RectangleOutside1DPolygon(double hmin, double hmax,
double vmin, double vmax, int dir);
void InitFlags();
void ClearAllocations();
static int RemoveExtras(double *pts, int n);
static double Distance(double *p1, double *p2);
static int PositionInHull(double *base, double *top, double *pt);
static int OutsideLine(double hmin, double hmax,
double vmin, double vmax, double *p0, double *p1, double *insidePt);
static int OutsideHorizontalLine(double vmin, double vmax,
double *p0, double *p1, double *insidePt);
static int OutsideVerticalLine(double hmin, double hmax, double *p0,
double *p1, double *insidePt);
double *Pts;
int Npts;
vtkTimeStamp PtsTime;
double *CCWHull[3];
float HullBBox[3][4];
int HullSize[3];
vtkTimeStamp HullTime[3];
vtkPointsProjectedHull(const vtkPointsProjectedHull&); // Not implemented
void operator=(const vtkPointsProjectedHull&); // Not implemented
};
#endif
|