Loading...
Searching...
No Matches
GeomUtilMeshGeneratorBase Class Reference

This class provides common implementation for the different mesh generator classes in GeomUtil. More...

#include <meshGeneratorBase.h>

+ Inheritance diagram for GeomUtilMeshGeneratorBase:

Static Public Member Functions

template<typename PointIterType , typename Enabled = typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
static void GeneratePoints (PointIterType iter,...)
 

Protected Types

enum  _CapStyle { CapStyleNone , CapStyleSharedEdge , CapStyleSeparateEdge }
 

Static Protected Member Functions

static PxOsdMeshTopology _GenerateCappedQuadTopology (const size_t numRadial, const size_t numQuadStrips, const _CapStyle bottomCapStyle, const _CapStyle topCapStyle, const bool closedSweep)
 
static size_t _ComputeNumRadialPoints (const size_t numRadial, const bool closedSweep)
 

Detailed Description

This class provides common implementation for the different mesh generator classes in GeomUtil.

As the mesh generators are entirely implemented as static functions, this "base class" is more of a grouping and access control mechanism than a base class in the polymorphic sense.

The mesh generator subclasses all follow a common pattern, providing static methods for generating topology and point positions for their specific geometric primitive. The data produced by these classes is only guaranteed to be suitable for imaging the described surface; it is only one of many possible interpretations of the surface, and should not be relied upon for any other use. The generators may e.g. change the topology or ordering of the produced data at any time. In short: these utilities are meant only to be used to produce a blob of semi-blind data, for feeding to an imager that supports PxOsdMeshTopology.

The generators make use of templates and SFINAE to allow clients to pass any output iterator that dereferences to either a GfVec3f or GfVec3d to their GeneratePoints(...) method, and internally perform compile-time type erasure in order to allow the implementations of their algorithms to be private implementation detail, not defined in the headers. Although it's expected that clients will typically want their point data in VtVec3fArray, the described implementation was chosen to minimize the chance that any prospective client with unusual data management requirements would be unable to make use of the generators, or would be forced to resort to a container copy in order to do so.

The only public API on this class is a static GeneratePoints(...) template method, intended to be added by subclasses to their GeneratePoints(...) overload sets. It serves as the "error case" for callers that attempt to pass iterators of unsupported types to the GeneratePoints(...) methods each subclass declares. As all generator subclasses have this possibility and the implementation requires SFINAE, it's implemented here and shared between all subclasses. However, it's important that subclasses explicitly include a "using" statement for the fallback to be included in overload resolution.

Definition at line 77 of file meshGeneratorBase.h.

Member Enumeration Documentation

◆ _CapStyle

enum _CapStyle
protected

Definition at line 200 of file meshGeneratorBase.h.

Member Function Documentation

◆ GeneratePoints()

static void GeneratePoints ( PointIterType  iter,
  ... 
)
inlinestatic

Definition at line 234 of file meshGeneratorBase.h.


The documentation for this class was generated from the following file: