24#ifndef PXR_IMAGING_GEOM_UTIL_MESH_GENERATOR_BASE_H
25#define PXR_IMAGING_GEOM_UTIL_MESH_GENERATOR_BASE_H
27#include "pxr/imaging/geomUtil/api.h"
38PXR_NAMESPACE_OPEN_SCOPE
89 template<
typename IterType>
90 struct _IsGfVec3Iterator
92 using PointType =
typename std::iterator_traits<IterType>::value_type;
93 static constexpr bool value =
94 std::is_same<PointType, GfVec3f>::value ||
95 std::is_same<PointType, GfVec3d>::value;
98 template<
typename IterType>
99 struct _EnableIfGfVec3Iterator
100 :
public std::enable_if<_IsGfVec3Iterator<IterType>::value, void>
103 template<
typename IterType>
104 struct _EnableIfNotGfVec3Iterator
105 :
public std::enable_if<!_IsGfVec3Iterator<IterType>::value, void>
121 template<
typename Po
intType>
124 template<
class IterType>
127 : _writeFnPtr(&_PointWriter<PointType>::_WritePoint<IterType>)
128 , _untypedIterPtr(
static_cast<void*
>(&iter))
131 template<
class IterType>
136 &_PointWriter<PointType>::_TransformAndWritePoint<IterType>)
137 , _untypedIterPtr(
static_cast<void*
>(&iter))
138 , _framePtr(framePtr)
142 const PointType& pt)
const
144 (this->*_writeFnPtr)(pt);
148 template<
class IterType>
150 const PointType& pt)
const
152 IterType& iter = *
static_cast<IterType*
>(_untypedIterPtr);
157 template<
class IterType>
158 void _TransformAndWritePoint(
159 const PointType& pt)
const
161 IterType& iter = *
static_cast<IterType*
>(_untypedIterPtr);
162 *iter = _framePtr->Transform(pt);
167 void (_PointWriter<PointType>::*)(
const PointType &)
const;
168 _WriteFnPtr _writeFnPtr;
169 void* _untypedIterPtr;
207 const size_t numRadial,
208 const size_t numQuadStrips,
209 const _CapStyle bottomCapStyle,
210 const _CapStyle topCapStyle,
211 const bool closedSweep);
218 static size_t _ComputeNumRadialPoints(
219 const size_t numRadial,
220 const bool closedSweep);
231 template<
typename PointIterType,
233 typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
234 static void GeneratePoints(
235 PointIterType iter, ...)
237 static_assert(_IsGfVec3Iterator<PointIterType>::value,
238 "This function only supports iterators to GfVec3f or GfVec3d "
245PXR_NAMESPACE_CLOSE_SCOPE
This class provides common implementation for the different mesh generator classes in GeomUtil.
Stores a 4x4 matrix of double elements.
Topology data for meshes.