7#ifndef PXR_IMAGING_GEOM_UTIL_MESH_GENERATOR_BASE_H
8#define PXR_IMAGING_GEOM_UTIL_MESH_GENERATOR_BASE_H
10#include "pxr/imaging/geomUtil/api.h"
21PXR_NAMESPACE_OPEN_SCOPE
72 template<
typename IterType>
73 struct _IsGfVec3Iterator
75 using PointType =
typename std::iterator_traits<IterType>::value_type;
76 static constexpr bool value =
77 std::is_same<PointType, GfVec3f>::value ||
78 std::is_same<PointType, GfVec3d>::value;
81 template<
typename IterType>
82 struct _EnableIfGfVec3Iterator
83 :
public std::enable_if<_IsGfVec3Iterator<IterType>::value, void>
86 template<
typename IterType>
87 struct _EnableIfNotGfVec3Iterator
88 :
public std::enable_if<!_IsGfVec3Iterator<IterType>::value, void>
104 template<
typename Po
intType>
107 template<
class IterType>
110 : _writeFnPtr(&_PointWriter<PointType>::_WritePoint<IterType>)
111 , _untypedIterPtr(
static_cast<void*
>(&iter))
114 template<
class IterType>
119 &_PointWriter<PointType>::_TransformAndWritePoint<IterType>)
120 , _untypedIterPtr(
static_cast<void*
>(&iter))
121 , _framePtr(framePtr)
125 const PointType& pt)
const
127 (this->*_writeFnPtr)(pt);
131 template<
class IterType>
133 const PointType& pt)
const
135 IterType& iter = *
static_cast<IterType*
>(_untypedIterPtr);
140 template<
class IterType>
141 void _TransformAndWritePoint(
142 const PointType& pt)
const
144 IterType& iter = *
static_cast<IterType*
>(_untypedIterPtr);
145 *iter = _framePtr->Transform(pt);
150 void (_PointWriter<PointType>::*)(
const PointType &)
const;
151 _WriteFnPtr _writeFnPtr;
152 void* _untypedIterPtr;
190 const size_t numRadial,
191 const size_t numQuadStrips,
192 const _CapStyle bottomCapStyle,
193 const _CapStyle topCapStyle,
194 const bool closedSweep);
201 static size_t _ComputeNumRadialPoints(
202 const size_t numRadial,
203 const bool closedSweep);
214 template<
typename PointIterType,
216 typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
217 static void GeneratePoints(
218 PointIterType iter, ...)
220 static_assert(_IsGfVec3Iterator<PointIterType>::value,
221 "This function only supports iterators to GfVec3f or GfVec3d "
228PXR_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.