VTK  9.7.1
vtkCylinderSource.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
24 #ifndef vtkCylinderSource_h
25 #define vtkCylinderSource_h
26 
27 #include "vtkFiltersSourcesModule.h" // For export macro
28 #include "vtkPolyDataAlgorithm.h"
29 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30 
31 #include "vtkCell.h" // Needed for VTK_CELL_SIZE
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 
35 // Forward declarations
36 class vtkFloatArray;
37 
38 class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkCylinderSource : public vtkPolyDataAlgorithm
39 {
40 public:
41  static vtkCylinderSource* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
49  vtkSetClampMacro(Height, double, 0.0, VTK_DOUBLE_MAX);
50  vtkGetMacro(Height, double);
52 
54 
57  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
58  vtkGetMacro(Radius, double);
60 
62 
65  vtkSetVector3Macro(Center, double);
66  vtkGetVectorMacro(Center, double, 3);
68 
70 
73  vtkSetClampMacro(Resolution, int, 3, VTK_CELL_SIZE);
74  vtkGetMacro(Resolution, int);
76 
78 
81  vtkSetMacro(Capping, vtkTypeBool);
82  vtkGetMacro(Capping, vtkTypeBool);
83  vtkBooleanMacro(Capping, vtkTypeBool);
85 
87 
93  vtkSetMacro(CapsuleCap, vtkTypeBool);
94  vtkGetMacro(CapsuleCap, vtkTypeBool);
95  vtkBooleanMacro(CapsuleCap, vtkTypeBool);
97 
99 
106  vtkSetMacro(LatLongTessellation, vtkTypeBool);
107  vtkGetMacro(LatLongTessellation, vtkTypeBool);
108  vtkBooleanMacro(LatLongTessellation, vtkTypeBool);
110 
112 
117  vtkSetMacro(OutputPointsPrecision, int);
118  vtkGetMacro(OutputPointsPrecision, int);
120 
121 protected:
122  vtkCylinderSource(int res = 6);
123  ~vtkCylinderSource() override = default;
124 
126 
127  int CreateHemisphere(vtkPoints* points, vtkFloatArray* normals, vtkFloatArray* tcooords,
128  vtkCellArray* newPolys, int startIdx = 0);
129 
130  double Height;
131  double Radius;
132  double Center[3];
138 
139 private:
140  vtkCylinderSource(const vtkCylinderSource&) = delete;
141  void operator=(const vtkCylinderSource&) = delete;
142 };
143 
144 VTK_ABI_NAMESPACE_END
145 #endif
generate a polygonal cylinder centered at the origin
#define VTK_DOUBLE_MAX
Definition: vtkType.h:202
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
#define VTK_CELL_SIZE
Definition: vtkCell.h:31
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkTypeBool LatLongTessellation
object to represent cell connectivity
Definition: vtkCellArray.h:177
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
represent and manipulate 3D points
Definition: vtkPoints.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.