-
Notifications
You must be signed in to change notification settings - Fork 4
/
vtkOneSheetedHyperboloidSource.h
141 lines (121 loc) · 4.91 KB
/
vtkOneSheetedHyperboloidSource.h
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
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOneSheetedHyperboloidSource.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.
=========================================================================*/
/**
* @class vtkOneSheetedHyperboloidSource
* @brief create a polygonal one-sheeted hyperboloid centered at the origin
*
* vtkOneSheetedHyperboloidSource creates a one-sheeted hyperboloid (represented by polygons) orientated along
* the z-axis and centered at the origin. The hyperboloid is a representation of the equation
* \f[
* \frac{x^2}{a^2} + \frac{y^2}{b^2} - \frac{z^2}{c^2} = 1
* \f]
* where \b a, \b b, and \b c parameterize its shape. These parameters are
* specified with the SetShapeParameters method. The representation is
* truncated at +/- \b ZMax.
* The resolution (polygonal discretization)
* in both the theta and z directions can be specified.
* By default, the surface tessellation of
* the sphere uses triangles; however you can set QuadrilateralTessellation to
* produce a tessellation using quadrilaterals.
* @warning
* A hyperboloid is not a closed surface, and this polygonal representation only
* covers the extent surrounding the origin. This vtkPolyDataAlgorithm does not
* compute the normals for the polygons. If they are needed, the
* vtkPolyDataNormals algorithm is a possibility.
*/
#ifndef vtkOneSheetedHyperboloidSource_h
#define vtkOneSheetedHyperboloidSource_h
#include "SignedTensorModule.h" // for export macro
#include "vtkPolyDataAlgorithm.h"
#define VTK_MAX_ONE_SHEETED_HYPERBOLOID_RESOLUTION 1024
class SIGNEDTENSOR_EXPORT vtkOneSheetedHyperboloidSource : public vtkPolyDataAlgorithm
{
public:
vtkTypeMacro(vtkOneSheetedHyperboloidSource,vtkPolyDataAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Construct one-sheeted hyperboloid with z_max=0.5 and
* shape parameters (a, b, and c) = 0.1.
* Default resolution is 8 in both theta and z directions. Theta ranges from
* (0, 360) and z from (-z_max, z_max).
*/
static vtkOneSheetedHyperboloidSource *New();
//@{
/**
* Set z_max of the hyperboloid. The hyperboloid extends from -z_max to
* z_max. Default is .5.
*/
vtkSetClampMacro(ZMax,double,0.0,VTK_DOUBLE_MAX);
vtkGetMacro(ZMax,double);
//@}
//@{
/**
* Set the shape parameters for the hyperboloid If
* \$\frac{x^2}{a^2} + \frac{y^2}{b^2} - \frac{z^2}{c^2} = 1\$f is the equation of
* the hyperboloid, then ShapeParameters[0] = a, ShapeParameters[1] = b, nad
* ShapeParameters[2] = c. Default is 0.32126,0.32126,0.32126 such that with
* a z_max of 0.5, the surface area approximately equals the surface area of a
* sphere with radius 0.5.
*/
vtkSetVector3Macro(ShapeParameters,double);
vtkGetVectorMacro(ShapeParameters,double,3);
//@}
//@{
/**
* Set the center of the sphere. Default is 0,0,0.
*/
vtkSetVector3Macro(Center,double);
vtkGetVectorMacro(Center,double,3);
//@}
//@{
/**
* Set the number of points in the rotational direction.
*/
vtkSetClampMacro(ThetaResolution,int,3,VTK_MAX_ONE_SHEETED_HYPERBOLOID_RESOLUTION);
vtkGetMacro(ThetaResolution,int);
//@}
//@{
/**
* Set the number of points in the Z direction (ranging
* from -ZMax to ZMax).
*/
vtkSetClampMacro(ZResolution,int,3,VTK_MAX_ONE_SHEETED_HYPERBOLOID_RESOLUTION);
vtkGetMacro(ZResolution,int);
//@}
//@{
/**
* Cause the sphere to be tessellated with edges along the latitude
* and longitude lines. If off, triangles are generated at non-polar
* regions, which results in edges that are not parallel to latitude and
* longitude lines. If on, quadrilaterals are generated everywhere
* except at the poles. This can be useful for generating a wireframe
* sphere with natural latitude and longitude lines.
*/
vtkSetMacro(QuadrilateralTessellation,int);
vtkGetMacro(QuadrilateralTessellation,int);
vtkBooleanMacro(QuadrilateralTessellation,int);
//@}
protected:
vtkOneSheetedHyperboloidSource(int res=8);
~vtkOneSheetedHyperboloidSource() {}
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
double ZMax;
double ShapeParameters[3];
double Center[3];
int ThetaResolution;
int ZResolution;
int QuadrilateralTessellation;
private:
vtkOneSheetedHyperboloidSource(const vtkOneSheetedHyperboloidSource&) VTK_DELETE_FUNCTION;
void operator=(const vtkOneSheetedHyperboloidSource&) VTK_DELETE_FUNCTION;
};
#endif