7#ifndef PXR_IMAGING_GEOM_UTIL_CONE_MESH_GENERATOR_H
8#define PXR_IMAGING_GEOM_UTIL_CONE_MESH_GENERATOR_H
10#include "pxr/imaging/geomUtil/api.h"
11#include "pxr/imaging/geomUtil/meshGeneratorBase.h"
16PXR_NAMESPACE_OPEN_SCOPE
63 static constexpr size_t minNumRadial = 3;
66 static size_t ComputeNumPoints(
67 const size_t numRadial,
68 const bool closedSweep =
true);
70 static size_t ComputeNumNormals(
71 const size_t numRadial,
72 const bool closedSweep =
true)
75 return ComputeNumPoints(numRadial, closedSweep);
78 static TfToken GetNormalsInterpolation()
81 return GeomUtilInterpolationTokens->vertex;
86 const size_t numRadial,
87 const bool closedSweep =
true);
89 template<
typename PointIterType,
92 typename _EnableIfGfVec3Iterator<PointIterType>::type>
93 static void GeneratePoints(
95 const size_t numRadial,
96 const ScalarType radius,
97 const ScalarType height,
100 constexpr ScalarType sweep = 360;
101 GeneratePoints(iter, numRadial, radius, height, sweep, framePtr);
104 template<
typename PointIterType,
107 typename _EnableIfGfVec3Iterator<PointIterType>::type>
108 static void GeneratePoints(
110 const size_t numRadial,
111 const ScalarType radius,
112 const ScalarType height,
113 const ScalarType sweepDegrees,
117 typename std::iterator_traits<PointIterType>::value_type;
119 _GeneratePointsImpl(numRadial, radius, height, sweepDegrees,
120 framePtr ? _PointWriter<PointType>(iter, framePtr)
121 : _PointWriter<PointType>(iter));
124 using GeomUtilMeshGeneratorBase::GeneratePoints;
126 template<
typename PointIterType,
129 typename _EnableIfGfVec3Iterator<PointIterType>::type>
130 static void GenerateNormals(
132 const size_t numRadial,
133 const ScalarType radius,
134 const ScalarType height,
137 constexpr ScalarType sweep = 360;
138 GenerateNormals(iter, numRadial, radius, height, sweep, framePtr);
141 template<
typename PointIterType,
144 typename _EnableIfGfVec3Iterator<PointIterType>::type>
145 static void GenerateNormals(
147 const size_t numRadial,
148 const ScalarType radius,
149 const ScalarType height,
150 const ScalarType sweepDegrees,
154 typename std::iterator_traits<PointIterType>::value_type;
156 _GenerateNormalsImpl(numRadial, radius, height, sweepDegrees,
157 framePtr ? _PointWriter<PointType>(iter, framePtr)
158 : _PointWriter<PointType>(iter));
161 using GeomUtilMeshGeneratorBase::GenerateNormals;
165 template<
typename Po
intType>
166 static void _GeneratePointsImpl(
167 const size_t numRadial,
168 const typename PointType::ScalarType radius,
169 const typename PointType::ScalarType height,
170 const typename PointType::ScalarType sweepDegrees,
171 const _PointWriter<PointType>& ptWriter);
173 template<
typename Po
intType>
174 static void _GenerateNormalsImpl(
175 const size_t numRadial,
176 const typename PointType::ScalarType radius,
177 const typename PointType::ScalarType height,
178 const typename PointType::ScalarType sweepDegrees,
179 const _PointWriter<PointType>& ptWriter);
182PXR_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.