7#ifndef PXR_IMAGING_GEOM_UTIL_CYLINDER_MESH_GENERATOR_H
8#define PXR_IMAGING_GEOM_UTIL_CYLINDER_MESH_GENERATOR_H
10#include "pxr/imaging/geomUtil/api.h"
11#include "pxr/imaging/geomUtil/meshGeneratorBase.h"
16PXR_NAMESPACE_OPEN_SCOPE
67 static constexpr size_t minNumRadial = 3;
70 static size_t ComputeNumPoints(
71 const size_t numRadial,
72 const bool closedSweep =
true);
74 static size_t ComputeNumNormals(
75 const size_t numRadial,
76 const bool closedSweep =
true)
79 return ComputeNumPoints(numRadial, closedSweep);
82 static TfToken GetNormalsInterpolation()
85 return GeomUtilInterpolationTokens->vertex;
90 const size_t numRadial,
91 const bool closedSweep =
true);
93 template<
typename PointIterType,
96 typename _EnableIfGfVec3Iterator<PointIterType>::type>
97 static void GeneratePoints(
99 const size_t numRadial,
100 const ScalarType radius,
101 const ScalarType height,
104 GeneratePoints(iter, numRadial,
110 template<
typename PointIterType,
113 typename _EnableIfGfVec3Iterator<PointIterType>::type>
114 static void GeneratePoints(
116 const size_t numRadial,
117 const ScalarType bottomRadius,
118 const ScalarType topRadius,
119 const ScalarType height,
122 constexpr ScalarType sweep = 360;
124 GeneratePoints(iter, numRadial,
125 bottomRadius, topRadius,
126 height, sweep, framePtr);
129 template<
typename PointIterType,
132 typename _EnableIfGfVec3Iterator<PointIterType>::type>
133 static void GeneratePoints(
135 const size_t numRadial,
136 const ScalarType bottomRadius,
137 const ScalarType topRadius,
138 const ScalarType height,
139 const ScalarType sweepDegrees,
143 typename std::iterator_traits<PointIterType>::value_type;
145 _GeneratePointsImpl(numRadial, bottomRadius, topRadius, height,
147 framePtr ? _PointWriter<PointType>(iter, framePtr)
148 : _PointWriter<PointType>(iter));
151 using GeomUtilMeshGeneratorBase::GeneratePoints;
153 template<
typename PointIterType,
156 typename _EnableIfGfVec3Iterator<PointIterType>::type>
157 static void GenerateNormals(
159 const size_t numRadial,
160 const ScalarType radius,
161 const ScalarType height,
164 GenerateNormals(iter, numRadial,
170 template<
typename PointIterType,
173 typename _EnableIfGfVec3Iterator<PointIterType>::type>
174 static void GenerateNormals(
176 const size_t numRadial,
177 const ScalarType bottomRadius,
178 const ScalarType topRadius,
179 const ScalarType height,
182 constexpr ScalarType sweep = 360;
183 GenerateNormals(iter, numRadial,
184 bottomRadius, topRadius,
185 height, sweep, framePtr);
188 template<
typename PointIterType,
191 typename _EnableIfGfVec3Iterator<PointIterType>::type>
192 static void GenerateNormals(
194 const size_t numRadial,
195 const ScalarType bottomRadius,
196 const ScalarType topRadius,
197 const ScalarType height,
198 const ScalarType sweepDegrees,
202 typename std::iterator_traits<PointIterType>::value_type;
204 _GenerateNormalsImpl(numRadial, bottomRadius, topRadius, height,
206 framePtr ? _PointWriter<PointType>(iter, framePtr)
207 : _PointWriter<PointType>(iter));
210 using GeomUtilMeshGeneratorBase::GenerateNormals;
214 template<
typename Po
intType>
215 static void _GeneratePointsImpl(
216 const size_t numRadial,
217 const typename PointType::ScalarType bottomRadius,
218 const typename PointType::ScalarType topRadius,
219 const typename PointType::ScalarType height,
220 const typename PointType::ScalarType sweepDegrees,
221 const _PointWriter<PointType>& ptWriter);
223 template<
typename Po
intType>
224 static void _GenerateNormalsImpl(
225 const size_t numRadial,
226 const typename PointType::ScalarType bottomRadius,
227 const typename PointType::ScalarType topRadius,
228 const typename PointType::ScalarType height,
229 const typename PointType::ScalarType sweep,
230 const _PointWriter<PointType>& ptWriter);
233PXR_NAMESPACE_CLOSE_SCOPE
This class provides an implementation for generating topology, point positions and surface normals on...
This class provides common implementation for the different mesh generator classes in GeomUtil.
Stores a 4x4 matrix of double elements.
Topology data for meshes.
Token for efficient comparison, assignment, and hashing of known strings.