Loading...
Searching...
No Matches
cuboidMeshGenerator.h
1//
2// Copyright 2022 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_GEOM_UTIL_CUBOID_MESH_GENERATOR_H
8#define PXR_IMAGING_GEOM_UTIL_CUBOID_MESH_GENERATOR_H
9
10#include "pxr/imaging/geomUtil/api.h"
11#include "pxr/imaging/geomUtil/meshGeneratorBase.h"
12
13#include "pxr/pxr.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
17class GfMatrix4d;
19
43{
44public:
45 GEOMUTIL_API
46 static size_t ComputeNumPoints();
47
48 GEOMUTIL_API
49 static PxOsdMeshTopology GenerateTopology();
50
51 template<typename PointIterType,
52 typename ScalarType,
53 typename Enabled =
54 typename _EnableIfGfVec3Iterator<PointIterType>::type>
55 static void GeneratePoints(
56 PointIterType iter,
57 const ScalarType xLength,
58 const ScalarType yLength,
59 const ScalarType zLength,
60 const GfMatrix4d* framePtr = nullptr)
61 {
62 using PointType =
63 typename std::iterator_traits<PointIterType>::value_type;
64
65 _GeneratePointsImpl(xLength, yLength, zLength,
66 framePtr ? _PointWriter<PointType>(iter, framePtr)
67 : _PointWriter<PointType>(iter));
68 }
69
70 using GeomUtilMeshGeneratorBase::GeneratePoints;
71
72private:
73
74 template<typename PointType>
75 static void _GeneratePointsImpl(
76 const typename PointType::ScalarType xLength,
77 const typename PointType::ScalarType yLength,
78 const typename PointType::ScalarType zLength,
79 const _PointWriter<PointType>& ptWriter);
80};
81
82PXR_NAMESPACE_CLOSE_SCOPE
83
84#endif // PXR_IMAGING_GEOM_UTIL_CUBOID_MESH_GENERATOR_H
This class provides an implementation for generating topology and point positions on a rectangular cu...
This class provides common implementation for the different mesh generator classes in GeomUtil.
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Topology data for meshes.
Definition: meshTopology.h:52