VTK  9.3.20240418
vtkPath.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
34 #ifndef vtkPath_h
35 #define vtkPath_h
36 
37 #include "vtkCommonDataModelModule.h" // For export macro
38 #include "vtkPointSet.h"
39 
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkIntArray;
42 
43 class VTKCOMMONDATAMODEL_EXPORT vtkPath : public vtkPointSet
44 {
45 public:
46  static vtkPath* New();
47 
48  vtkTypeMacro(vtkPath, vtkPointSet);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
54  int GetDataObjectType() override { return VTK_PATH; }
55 
71  {
72  MOVE_TO = 0,
75  CUBIC_CURVE
76  };
77 
79 
82  void InsertNextPoint(float pts[3], int code);
83  void InsertNextPoint(double pts[3], int code);
84  void InsertNextPoint(double x, double y, double z, int code);
86 
88 
94 
98  vtkIdType GetNumberOfCells() override { return 0; }
99  using vtkDataSet::GetCell;
100  vtkCell* GetCell(vtkIdType) override { return nullptr; }
101  void GetCell(vtkIdType, vtkGenericCell*) override;
102  int GetCellType(vtkIdType) override { return 0; }
103 
107  void GetCellPoints(vtkIdType, vtkIdList* ptIds) override;
108 
112  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
113 
117  int GetMaxCellSize() override { return 0; }
118 
123  int GetMaxSpatialDimension() override { return 0; }
124 
129  void Allocate(vtkIdType size = 1000, int extSize = 1000);
130 
135  void Reset();
136 
138 
142  static vtkPath* GetData(vtkInformationVector* v, int i = 0);
144 
145 protected:
147  ~vtkPath() override;
148 
149 private:
150  vtkPath(const vtkPath&) = delete;
151  void operator=(const vtkPath&) = delete;
152 };
153 
154 VTK_ABI_NAMESPACE_END
155 #endif
abstract class to specify cell behavior
Definition: vtkCell.h:130
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:133
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:144
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:44
vtkIdType GetNumberOfCells() override
vtkPath doesn't use cells.
Definition: vtkPath.h:98
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkPath.h:54
vtkCell * GetCell(vtkIdType) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
Definition: vtkPath.h:100
~vtkPath() override
static vtkPath * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
void SetCodes(vtkIntArray *)
Set/Get the array of control point codes:
void GetCellPoints(vtkIdType, vtkIdList *ptIds) override
vtkPath doesn't use cells, this method just clears ptIds.
void Reset()
Begin inserting data all over again.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Allocate(vtkIdType size=1000, int extSize=1000)
Method allocates initial storage for points.
int GetMaxSpatialDimension() override
Get the maximum spatial dimensionality of the data which is the maximum dimension of all cells.
Definition: vtkPath.h:123
void GetCell(vtkIdType, vtkGenericCell *) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
static vtkPath * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkIntArray * GetCodes()
Set/Get the array of control point codes:
static vtkPath * New()
void InsertNextPoint(double x, double y, double z, int code)
Insert the next control point in the path.
ControlPointType
Enumeration of recognized control point types:
Definition: vtkPath.h:71
@ LINE_TO
Definition: vtkPath.h:73
@ CONIC_CURVE
Definition: vtkPath.h:74
void InsertNextPoint(double pts[3], int code)
Insert the next control point in the path.
int GetMaxCellSize() override
Return the maximum cell size in this poly data.
Definition: vtkPath.h:117
void InsertNextPoint(float pts[3], int code)
Insert the next control point in the path.
int GetCellType(vtkIdType) override
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.
Definition: vtkPath.h:102
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
vtkPath doesn't use cells, this method just clears cellIds.
concrete class for storing a set of points
Definition: vtkPointSet.h:98
@ info
Definition: vtkX3D.h:376
@ size
Definition: vtkX3D.h:253
int vtkIdType
Definition: vtkType.h:315
#define VTK_PATH
Definition: vtkType.h:100