1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkPolyVertex.h
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /**
16  * @class   vtkPolyVertex
17  * @brief   cell represents a set of 0D vertices
18  *
19  * vtkPolyVertex is a concrete implementation of vtkCell to represent a
20  * set of 3D vertices.
21  */
22 
23 #ifndef vtkPolyVertex_h
24 #define vtkPolyVertex_h
25 
26 #include "vtkCell.h"
27 #include "vtkCommonDataModelModule.h" // For export macro
28 
29 class vtkVertex;
30 class vtkIncrementalPointLocator;
31 
32 class VTKCOMMONDATAMODEL_EXPORT vtkPolyVertex : public vtkCell
33 {
34 public:
35   static vtkPolyVertex* New();
36   vtkTypeMacro(vtkPolyVertex, vtkCell);
37   void PrintSelf(ostream& os, vtkIndent indent) override;
38 
39   ///@{
40   /**
41    * See the vtkCell API for descriptions of these methods.
42    */
GetCellType()43   int GetCellType() override { return VTK_POLY_VERTEX; }
GetCellDimension()44   int GetCellDimension() override { return 0; }
GetNumberOfEdges()45   int GetNumberOfEdges() override { return 0; }
GetNumberOfFaces()46   int GetNumberOfFaces() override { return 0; }
GetEdge(int vtkNotUsed (edgeId))47   vtkCell* GetEdge(int vtkNotUsed(edgeId)) override { return nullptr; }
GetFace(int vtkNotUsed (faceId))48   vtkCell* GetFace(int vtkNotUsed(faceId)) override { return nullptr; }
49   int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
50   void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
51     vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
52     vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
53   void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
54     vtkCellArray* verts, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
55     vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
56   int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
57     double& dist2, double weights[]) override;
58   void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
59   int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
60     double pcoords[3], int& subId) override;
61   int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
62   void Derivatives(
63     int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
IsPrimaryCell()64   int IsPrimaryCell() override { return 0; }
65   ///@}
66 
67   /**
68    * Return the center of the point cloud in parametric coordinates.
69    */
70   int GetParametricCenter(double pcoords[3]) override;
71 
72 protected:
73   vtkPolyVertex();
74   ~vtkPolyVertex() override;
75 
76   vtkVertex* Vertex;
77 
78 private:
79   vtkPolyVertex(const vtkPolyVertex&) = delete;
80   void operator=(const vtkPolyVertex&) = delete;
81 };
82 
83 #endif
84